[gatein-commits] gatein SVN: r476 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 3 03:49:53 EST 2009


Author: truong.le
Date: 2009-11-03 03:49:53 -0500 (Tue, 03 Nov 2009)
New Revision: 476

Modified:
   portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
Log:
GTNPORTAL-106: NPE when change template of portlet

Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java	2009-11-03 08:36:54 UTC (rev 475)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java	2009-11-03 08:49:53 UTC (rev 476)
@@ -30,8 +30,7 @@
 import org.exoplatform.webui.event.Event;
 
 /**
- * Created by The eXo Platform SAS
- * May 7, 2006
+ * Created by The eXo Platform SAS May 7, 2006
  */
 public class Lifecycle<E extends UIComponent>
 {
@@ -40,7 +39,8 @@
 
    private Decorator decorator_ = new Decorator();
 
-   //  public void init(UIComponent uicomponent, WebuiRequestContext context) throws Exception {}
+   // public void init(UIComponent uicomponent, WebuiRequestContext context)
+   // throws Exception {}
 
    public void processDecode(E uicomponent, WebuiRequestContext context) throws Exception
    {
@@ -57,14 +57,16 @@
    }
 
    /**
-    * That method is the most generic one for every UICOmponent that is bound to this Lifecycle object
-    * and the class that extends it withouyt overiding the method.
+    * That method is the most generic one for every UICOmponent that is bound to
+    * this Lifecycle object and the class that extends it withouyt overiding the
+    * method.
     * 
-    * According to the template type associated with the UI component (groovy or javascript one); the 
-    * template is rendered using either the method renderJSTemplate() or renderTemplate(). In the case
-    * of the use of a groovy template, a context object of type WebuiBindingContext is used to then 
-    * provide to the template all the necessary objects to render (WebuiBindingContext extends the Map
-    * class) 
+    * According to the template type associated with the UI component (groovy or
+    * javascript one); the template is rendered using either the method
+    * renderJSTemplate() or renderTemplate(). In the case of the use of a groovy
+    * template, a context object of type WebuiBindingContext is used to then
+    * provide to the template all the necessary objects to render
+    * (WebuiBindingContext extends the Map class)
     * 
     */
    public void processRender(E uicomponent, WebuiRequestContext context) throws Exception
@@ -77,18 +79,19 @@
       renderTemplate(template, bcontext);
    }
 
-   //  public void destroy(UIComponent uicomponent) throws Exception {}
+   // public void destroy(UIComponent uicomponent) throws Exception {}
 
    /**
     * The method allows to use Groovy templates to render the portal components.
     * 
-    * 1) Add a decorator object into the context
-    * 2) Get a reference of the TemplateService
-    * 3) If the system property "exo.product.developing" is set to true, the templates are not cached
-    * 4) If the writer used to render the output is of type HtmlValidator, which is the case in the
-    *    Portal environement, then it is also possible to validate the generated HTML (for debug purposes)
-    * 6) The template and the context are then merged using the method service.merge(groovyTemplate, bcontext)
-    *    to generate the HTML fragment  
+    * 1) Add a decorator object into the context 2) Get a reference of the
+    * TemplateService 3) If the system property "exo.product.developing" is set
+    * to true, the templates are not cached 4) If the writer used to render the
+    * output is of type HtmlValidator, which is the case in the Portal
+    * environement, then it is also possible to validate the generated HTML (for
+    * debug purposes) 6) The template and the context are then merged using the
+    * method service.merge(groovyTemplate, bcontext) to generate the HTML
+    * fragment
     * 
     */
    protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
@@ -127,9 +130,9 @@
             validator.endComponent();
          }
       }
-      catch (Exception e)
+      catch (NullPointerException e)
       {
-         log.error("template : " + template, e);
+         log.error("Template: " + template + " not found");
       }
    }
 }
\ No newline at end of file



More information about the gatein-commits mailing list