Author: julien_viet
Date: 2010-10-22 16:03:48 -0400 (Fri, 22 Oct 2010)
New Revision: 4787
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
Log:
GTNPORTAL-1586 : Remove organization nodetypes
GTNPORTAL-1580 : Revert the change of GTNPORTAL-1477 when we switch to use JCR 1.12.5
GTNPORTAL-1585 : Update JCR related dependencies
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2010-10-22
19:21:38 UTC (rev 4786)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2010-10-22
20:03:48 UTC (rev 4787)
@@ -19,8 +19,9 @@
package org.exoplatform.portal.resource;
-import org.exoplatform.commons.utils.Safe;
import org.exoplatform.commons.xml.DocumentSource;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
import org.exoplatform.portal.resource.config.xml.SkinConfigParser;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
@@ -52,9 +53,15 @@
/** . */
private static final String GATEIN_CONFIG_RESOURCE =
"/WEB-INF/gatein-resources.xml";
- public GateInSkinConfigDeployer(SkinService _skinService)
+ /**
+ * The name of the portal container
+ */
+ private final String portalContainerName;
+
+ public GateInSkinConfigDeployer(String portalContainerName, SkinService _skinService)
{
this.skinService = _skinService;
+ this.portalContainerName = portalContainerName;
}
@Override
@@ -65,29 +72,42 @@
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
if (waEvent.getType() == WebAppLifeCycleEvent.ADDED)
{
- ServletContext scontext = event.getWebApp().getServletContext();
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- if (is != null)
+ ServletContext scontext = null;
+ try
{
+ scontext = event.getWebApp().getServletContext();
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ if (is == null)
+ return;
try
{
- register(scontext);
+ is.close();
}
catch (Exception ex)
{
- log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
- + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
+ // ignore me
}
- finally
+ final PortalContainerPostInitTask task = new
PortalContainerPostInitTask()
{
- Safe.close(is);
- }
+
+ public void execute(ServletContext scontext, PortalContainer
portalContainer)
+ {
+ register(scontext, portalContainer);
+ skinService.registerContext(scontext);
+ }
+ };
+ PortalContainer.addInitTask(scontext, task, portalContainerName);
}
+ catch (Exception ex)
+ {
+ log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
+ + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
+ }
}
}
}
- private void register(ServletContext scontext)
+ private void register(ServletContext scontext, PortalContainer container)
{
URL url;
try
@@ -107,8 +127,5 @@
log.error("An error occurs while registering '" +
GATEIN_CONFIG_RESOURCE + "' from the context '"
+ (scontext == null ? "unknown" : scontext.getServletContextName())
+ "'", ex);
}
-
- //
- skinService.registerContext(scontext);
}
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-10-22
19:21:38 UTC (rev 4786)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-10-22
20:03:48 UTC (rev 4787)
@@ -151,7 +151,7 @@
portletThemes_ = new HashMap<String, Set<String>>();
portalContainerName = context.getPortalContainerName();
mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
- deployer = new GateInSkinConfigDeployer(this);
+ deployer = new GateInSkinConfigDeployer(portalContainerName, this);
removal = new GateInSkinConfigRemoval(this);
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-10-22
19:21:38 UTC (rev 4786)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-10-22
20:03:48 UTC (rev 4787)
@@ -82,7 +82,7 @@
availableScriptsPaths_ = new ArrayList<String>();
availableScriptsKey_ = new ArrayList<Javascript>();
extendedJavascripts = new HashMap<String, String>();
- deployer = new JavascriptDeployer(this);
+ deployer = new JavascriptDeployer(context.getPortalContainerName(), this);
removal = new JavascriptRemoval(this);
object_view_of_merged_JS = new HashMap<String, List<String>>();
}
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
===================================================================
---
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2010-10-22
19:21:38 UTC (rev 4786)
+++
portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2010-10-22
20:03:48 UTC (rev 4787)
@@ -19,7 +19,8 @@
package org.exoplatform.web.application.javascript;
-import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.gatein.wci.WebAppEvent;
@@ -28,6 +29,7 @@
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.picocontainer.Startable;
+import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletContext;
@@ -50,9 +52,15 @@
/** . */
private final JavascriptConfigService javascriptService;
- public JavascriptDeployer(JavascriptConfigService javascriptService)
+ /**
+ * The name of the portal container
+ */
+ private final String portalContainerName;
+
+ public JavascriptDeployer(String portalContainerName, JavascriptConfigService
javascriptService)
{
this.javascriptService = javascriptService;
+ this.portalContainerName = portalContainerName;
}
public void start()
@@ -72,33 +80,47 @@
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
if (waEvent.getType() == WebAppLifeCycleEvent.ADDED)
{
- ServletContext scontext = event.getWebApp().getServletContext();
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- if (is != null)
+ ServletContext scontext = null;
+ try
{
+ scontext = event.getWebApp().getServletContext();
+
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ if (is == null)
+ return;
try
{
- register(scontext);
+ is.close();
}
catch (Exception ex)
{
- LOG.error("An error occurs while registering 'Javascript in
gatein-resources.xml' from the context '"
- + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
+ // ignore me
}
- finally
+ final PortalContainerPostInitTask task = new
PortalContainerPostInitTask()
{
- Safe.close(is);
- }
+
+ public void execute(ServletContext scontext, PortalContainer
portalContainer)
+ {
+ register(scontext, portalContainer);
+ }
+ };
+ PortalContainer.addInitTask(scontext, task, portalContainerName);
}
+ catch (Exception ex)
+ {
+ LOG.error("An error occurs while registering 'Javascript in
gatein-resources.xml' from the context '"
+ + (scontext == null ? "unknown" :
scontext.getServletContextName()) + "'", ex);
+ }
}
}
}
- private void register(ServletContext scontext)
+ private void register(ServletContext scontext, PortalContainer container)
{
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ InputStream is = null;
try
{
+ is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
JavascriptConfigParser.processConfigResource(is, javascriptService, scontext);
}
catch (Exception ex)
@@ -108,7 +130,17 @@
}
finally
{
- Safe.close(is);
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ }
+ catch (IOException e)
+ {
+ // ignore me
+ }
+ }
}
}
}
\ No newline at end of file
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-10-22 19:21:38 UTC (rev 4786)
+++ portal/trunk/pom.xml 2010-10-22 20:03:48 UTC (rev 4787)
@@ -37,10 +37,10 @@
<name>GateIn - Portal</name>
<properties>
-
<org.exoplatform.kernel.version>2.2.2-GA</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.2-GA</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.2-GA</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.12.2-GA</org.exoplatform.jcr.version>
+
<org.exoplatform.kernel.version>2.2.5-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.5-GA</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.5-GA</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.12.5-GA</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>1.0-r790473-Patch04</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
@@ -54,7 +54,7 @@
<rhino.version>1.6R5</rhino.version>
<org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
- <version.chromattic>1.0.3</version.chromattic>
+ <version.chromattic>1.0.4</version.chromattic>
<version.reflect>1.0.0</version.reflect>
<jcip.version>1.0</jcip.version>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-10-22
19:21:38 UTC (rev 4786)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-10-22
20:03:48 UTC (rev 4787)
@@ -113,7 +113,6 @@
<name>autoCreatedInNewRepository</name>
<description>Node types configuration file</description>
<value>jar:/conf/ext-nodetypes-config.xml</value>
- <value>jar:/conf/organization-nodetypes.xml</value>
<value>jar:/conf/gatein-nodetypes.xml</value>
<value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/application-nodetypes.xml</value>