Author: chris.laprun(a)jboss.com
Date: 2011-07-29 12:44:27 -0400 (Fri, 29 Jul 2011)
New Revision: 6950
Modified:
portal/branches/api/component/pc/pom.xml
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoPortletApplicationDeployer.java
Log:
- Inject API automatically in PortletContexts accessible via GateIn.GATEIN_API attribute.
Modified: portal/branches/api/component/pc/pom.xml
===================================================================
--- portal/branches/api/component/pc/pom.xml 2011-07-29 16:17:05 UTC (rev 6949)
+++ portal/branches/api/component/pc/pom.xml 2011-07-29 16:44:27 UTC (rev 6950)
@@ -19,59 +19,66 @@
-->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component</artifactId>
- <version>3.2.0-M02-SNAPSHOT</version>
- </parent>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component</artifactId>
+ <version>3.2.0-M02-SNAPSHOT</version>
+ </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>exo.portal.component.pc</artifactId>
- <packaging>jar</packaging>
- <name>GateIn Portal Component PC integration</name>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.component.pc</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn Portal Component PC integration</name>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.resources</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.common</groupId>
- <artifactId>common-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-portlet</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-federation</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-bridge</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-wci</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.resources</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-portlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-mc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-federation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-bridge</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
- </dependencies>
-
- <build>
- </build>
+ <!-- GateIn API support -->
+ <dependency>
+ <groupId>org.gatein.api</groupId>
+ <artifactId>gatein-java-api</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ </build>
</project>
Modified:
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
---
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2011-07-29
16:17:05 UTC (rev 6949)
+++
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2011-07-29
16:44:27 UTC (rev 6950)
@@ -22,6 +22,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.services.resources.ResourceBundleService;
+import org.gatein.api.GateIn;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.bridge.BridgeInterceptor;
import org.gatein.pc.federation.FederatingPortletInvoker;
@@ -66,7 +67,7 @@
* We enforce the dependency with the ResourceBundleService since it must be stared
before the
* <code>portletApplicationRegistry</code>
*
- * @param context the exo container context
+ * @param context the exo container context
* @param resourceBundleService the resource bundle service that is here for the sake
of creating a dependency
*/
public ExoKernelIntegration(ExoContainerContext context, ResourceBundleService
resourceBundleService)
@@ -83,13 +84,15 @@
// The portlet application deployer
portletApplicationRegistry = new ExoPortletApplicationDeployer();
portletApplicationRegistry.setContainerPortletInvoker(containerPortletInvoker);
+ GateIn gateIn = (GateIn)container.getComponentInstanceOfType(GateIn.class);
+
((ExoPortletApplicationDeployer)portletApplicationRegistry).setAPIInstance(gateIn);
//Container Stack
ContainerPortletDispatcher portletContainerDispatcher = new
ContainerPortletDispatcher();
-
+
// Federating portlet invoker
FederatingPortletInvoker federatingPortletInvoker = new
FederatingPortletInvokerService();
-
+
EventPayloadInterceptor eventPayloadInterceptor = new EventPayloadInterceptor();
eventPayloadInterceptor.setNext(portletContainerDispatcher);
RequestAttributeConversationInterceptor requestAttributeConversationInterceptor =
Modified:
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoPortletApplicationDeployer.java
===================================================================
---
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoPortletApplicationDeployer.java 2011-07-29
16:17:05 UTC (rev 6949)
+++
portal/branches/api/component/pc/src/main/java/org/exoplatform/portal/pc/ExoPortletApplicationDeployer.java 2011-07-29
16:44:27 UTC (rev 6950)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -21,6 +21,7 @@
import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.commons.utils.Safe;
+import org.gatein.api.GateIn;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.gatein.pc.mc.PortletApplicationDeployer;
@@ -44,6 +45,7 @@
public class ExoPortletApplicationDeployer extends PortletApplicationDeployer
{
private final Logger log =
LoggerFactory.getLogger(ExoPortletApplicationDeployer.class);
+ private GateIn gateIn;
@Override
protected PortletApplication10MetaData buildPortletApplicationMetaData(WebApp webApp)
@@ -80,6 +82,7 @@
log.warn("The global portlet metadata is not configured");
}
+ webApp.getServletContext().setAttribute(GateIn.GATEIN_API, gateIn);
}
return md;
}
@@ -89,8 +92,8 @@
* to ensure independence between portlet applications
*
* @return
- * @throws FileNotFoundException
- * @throws JBossXBException
+ * @throws FileNotFoundException
+ * @throws JBossXBException
*/
private GlobalPortletMetaData loadGlobalMetadata(String globalPortletLocation) throws
FileNotFoundException,
JBossXBException
@@ -106,4 +109,9 @@
Safe.close(in);
}
}
+
+ public void setAPIInstance(GateIn gateIn)
+ {
+ this.gateIn = gateIn;
+ }
}