Author: liem_nguyen
Date: 2009-11-30 03:52:51 -0500 (Mon, 30 Nov 2009)
New Revision: 858
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-215 TemplateRuntimeException (Not render gadget which not map to application)
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2009-11-30
08:45:26 UTC (rev 857)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2009-11-30
08:52:51 UTC (rev 858)
@@ -25,9 +25,11 @@
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.Properties;
+import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.WebAppController;
import org.exoplatform.web.application.gadget.GadgetApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIComponent;
@@ -133,7 +135,7 @@
{
try
{
- DataStorage ds= getApplicationComponent(DataStorage.class);
+ DataStorage ds = getApplicationComponent(DataStorage.class);
String gadgetId = ds.getId(state);
//
@@ -211,6 +213,17 @@
}
}
+ @Override
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+ if (getApplication() == null)
+ {
+ this.setRendered(false);
+ return;
+ }
+ super.processRender(context);
+ }
+
/**
* Gets GadgetApplication by GadgedRegistryService
*
@@ -233,8 +246,11 @@
{
return null;
}
- application = GadgetUtil.toGadgetApplication(model);
- webController.addApplication(application);
+ if (model != null)
+ {
+ application = GadgetUtil.toGadgetApplication(model);
+ webController.addApplication(application);
+ }
}
return application;
}
Show replies by date