Author: julien_viet
Date: 2009-12-18 14:42:17 -0500 (Fri, 18 Dec 2009)
New Revision: 1074
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
Log:
now correct behavior
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
===================================================================
---
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2009-12-18
17:16:25 UTC (rev 1073)
+++
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2009-12-18
19:42:17 UTC (rev 1074)
@@ -21,6 +21,9 @@
import org.exoplatform.application.gadget.impl.GadgetRegistryServiceImpl;
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.gatein.common.xml.XMLTools;
@@ -54,8 +57,12 @@
/** . */
private GadgetRegistryServiceImpl gadgetRegistryService;
- public GadgetDeployer(GadgetRegistryService gadgetRegistryService)
+ /** . */
+ private ExoContainerContext context;
+
+ public GadgetDeployer(ExoContainerContext context, GadgetRegistryService
gadgetRegistryService)
{
+ this.context = context;
this.gadgetRegistryService = (GadgetRegistryServiceImpl)gadgetRegistryService;
}
@@ -73,7 +80,14 @@
final URL url = scontext.getResource("/WEB-INF/gadget.xml");
if (url != null)
{
- handle(scontext, url);
+ final RootContainer.PortalContainerPostInitTask task = new
RootContainer.PortalContainerPostInitTask()
+ {
+ public void execute(ServletContext context, PortalContainer
portalContainer)
+ {
+ handle(context, url);
+ }
+ };
+ PortalContainer.addInitTask(scontext, task,
context.getPortalContainerName());
}
}
catch (MalformedURLException e)
@@ -97,7 +111,7 @@
private void handle(ServletContext scontext, URL gadgetsURL)
{
ChromatticLifeCycle lifeCycle = gadgetRegistryService.getChromatticLifeCycle();
- SessionContext context = lifeCycle.openContext();
+ lifeCycle.openContext();
InputStream in;
try
{
Show replies by date