[gatein-commits] gatein SVN: r7651 - in portal/trunk/packaging: jboss-as7 and 95 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Oct 4 09:31:35 EDT 2011


Author: mstruk
Date: 2011-10-04 09:31:34 -0400 (Tue, 04 Oct 2011)
New Revision: 7651

Added:
   portal/trunk/packaging/jboss-as7/
   portal/trunk/packaging/jboss-as7/README.txt
   portal/trunk/packaging/jboss-as7/extension/
   portal/trunk/packaging/jboss-as7/extension/pom.xml
   portal/trunk/packaging/jboss-as7/extension/src/
   portal/trunk/packaging/jboss-as7/extension/src/main/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInEarKey.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInExtKey.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java
   portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/StartupService.java
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/services/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/
   portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd
   portal/trunk/packaging/jboss-as7/extension/src/test/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AbstractParsingTest.java
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalInitialization.java
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalParsers.java
   portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/KernelServices.java
   portal/trunk/packaging/jboss-as7/modules/
   portal/trunk/packaging/jboss-as7/modules/build.xml
   portal/trunk/packaging/jboss-as7/modules/lib.xml
   portal/trunk/packaging/jboss-as7/modules/pom.xml
   portal/trunk/packaging/jboss-as7/modules/src/
   portal/trunk/packaging/jboss-as7/modules/src/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/java/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/gatein/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/gatein/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/gatein/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/gatein/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/main/module.xml
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/main/
   portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/main/module.xml
   portal/trunk/packaging/jboss-as7/pkg/
   portal/trunk/packaging/jboss-as7/pkg/download-jboss.xml
   portal/trunk/packaging/jboss-as7/pkg/package.xml
   portal/trunk/packaging/jboss-as7/pkg/pom.xml
   portal/trunk/packaging/jboss-as7/pkg/src/
   portal/trunk/packaging/jboss-as7/pkg/src/main/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/exokey.pem
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/oauthkey.pem
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.bat
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf.bat
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.sh
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/test.policy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.properties
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/controller.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/gadgets/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/gadgets/oauthkey.pem
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/portlet.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear.dodeploy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/MANIFEST.MF
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/application.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear.dodeploy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/MANIFEST.MF
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/application.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-skin.war.dodeploy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-wsrp-integration.ear.dodeploy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear.dodeploy
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/MANIFEST.MF
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/application.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/WEB-INF/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/WEB-INF/web.xml
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/WEB-INF/
   portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/WEB-INF/web.xml
   portal/trunk/packaging/jboss-as7/pom.xml
Modified:
   portal/trunk/packaging/pom.xml
Log:
JBoss AS7 support

Added: portal/trunk/packaging/jboss-as7/README.txt
===================================================================
--- portal/trunk/packaging/jboss-as7/README.txt	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/README.txt	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,103 @@
+
+JBoss AS7 Support
+=================
+
+
+This module provides JBoss AS7 support for GateIn.
+
+There is a new packaging module called 'jboss-as7'. It contains three sub-modules: 
+
+- extension
+-----------
+
+Provides JBoss AS7 'gatein' subsystem implementation in the form of 'extension'. Extensions are the mechanism to extend JBoss AS7 functionality. GateIn extension plugs interceptors into JBoss AS7 deployment, management, services engine to provide proper startup order of GateIn deployment archives, and proper class visibility.
+
+
+- modules
+---------
+
+Provides GateIn libraries as JBoss AS7 modules - a format for modular packaging of classes and resources in order to provide fine grained classloader isolation.
+
+
+- pkg
+------
+
+Provides packaging for the build, with automated JBoss AS7 download support.
+
+
+
+
+Known Issues
+============
+
+- JBoss AS 7.0.2.Final and higher are supported. It does not work with JBoss AS 7.0.0.Final.
+- WSRP is not yet supported
+- <distributable/> is not yet supported
+- Sample ears have been repackaged as their current default packaging is not supported
+
+
+
+
+Building
+========
+
+Currently some patched up gatein dependencies are required to build JBoss AS7 support for GateIn. As soon as the patches are included and patched versions released this step will not be required any more. Until then, we have to build the patched versions ourselves.
+
+Checkout the dependencies sources from sandbox:
+
+svn co http://anonsvn.jboss.org/repos/gatein/sandbox/as7_support/tags/AS7-Beta01
+cd AS7-Beta01
+
+This will checkout specific versions of wci and exo.kernel.container, and a new gatein-naming component.
+
+Build them:
+
+cd wci
+mvn clean install -Dmaven.test.skip
+
+cd ../exo.kernel.container
+mvn clean install -Dmaven.test.skip
+
+cd ../gatein-naming
+mvn clean install -Dmaven.test.skip
+
+
+Now that we have built the new dependencies let’s checkout GateIn Portal trunk:
+cd ../..
+
+svn co http://anonsvn.jboss.org/repos/gatein/portal/trunk gatein-portal
+cd gatein-portal
+
+If you have built gatein portal before, you can skip the tests by adding '-Dmaven.test.skip' to the next command:
+
+mvn clean install
+
+
+Set CONTAINERS_DIR env variable to point to a directory containing your application servers (i.e. export CONTAINERS_DIR=$HOME/devel/containers). If you already have ‘jboss-as-7.0.2.Final’ in your CONTAINERS_DIR, then remove ‘,download’ from the next command:
+
+cd packaging/jboss-as7
+mvn clean install -Ppkg-jbossas7,download -Dexo.projects.directory.dependencies=$CONTAINERS_DIR
+
+
+
+Now that we successfully built GateIn including JBoss AS7 support, let’s run it:
+
+cd pkg/target/jboss-as-7.0.2.Final/bin
+./standalone.sh
+
+
+
+
+Help
+====
+
+File JIRA issues in JBoss JIRA: https://issues.jboss.org/browse/GTNPORTAL
+
+Ask questions, and provide suggestions and feedback on forums: http://community.jboss.org/en/gatein?view=discussions
+
+
+
+
+Have a nice day :)
+
+

Added: portal/trunk/packaging/jboss-as7/extension/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/pom.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/pom.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<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/xsd/maven-4.0.0.xsd">
+
+   <parent>
+      <groupId>org.exoplatform.portal</groupId>
+      <artifactId>exo.portal.packaging.jboss7</artifactId>
+      <version>3.2.0-M02-SNAPSHOT</version>
+   </parent>
+
+   <modelVersion>4.0.0</modelVersion>
+   <artifactId>jboss-as7-integration-extension</artifactId>
+   <name>GateIn - Portlet Container (JBoss AS7 Extension)</name>
+
+   <properties>
+      <version.junit>4.8.2</version.junit>
+   </properties>
+
+   <dependencies>
+
+      <dependency>
+         <groupId>org.jboss.as</groupId>
+         <artifactId>jboss-as-controller</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.as</groupId>
+         <artifactId>jboss-as-server</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.as</groupId>
+         <artifactId>jboss-as-ee</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.as</groupId>
+         <artifactId>jboss-as-web</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss</groupId>
+         <artifactId>jboss-vfs</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.container</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+         <version>${version.junit}</version>
+      </dependency>
+
+   </dependencies>
+
+</project>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public enum Attribute
+{
+   UNKNOWN(null),
+   NAME("name"),
+   MAIN("main"),
+   IMPORT_SERVICES("import-services");
+
+   private final String name;
+
+   Attribute(final String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    * Get the local name of this attribute.
+    *
+    * @return the local name
+    */
+   public String getLocalName()
+   {
+      return name;
+   }
+
+   private static final Map<String, Attribute> MAP;
+
+   static
+   {
+      final Map<String, Attribute> map = new HashMap<String, Attribute>();
+      for (Attribute element : values())
+      {
+         final String name = element.getLocalName();
+         if (name != null)
+         {
+            map.put(name, element);
+         }
+      }
+      MAP = map;
+   }
+
+   public static Attribute forName(String localName)
+   {
+      final Attribute element = MAP.get(localName);
+      return element == null ? UNKNOWN : element;
+   }
+
+   @Override
+   public String toString()
+   {
+      return getLocalName();
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+interface Constants
+{
+
+   String DEPLOYMENT_ARCHIVES = "deployment-archives";
+   String PORTLET_WAR_DEPENDENCIES = "portlet-war-dependencies";
+   String ARCHIVE = "archive";
+   String DEPENDENCY = "dependency";
+   String MAIN = "main";
+   String IMPORT_SERVICES = "import-services";
+   String TRUE = "true";
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Element.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public enum Element
+{
+   // must be first
+   UNKNOWN(null),
+   DEPLOYMENT_ARCHIVES(Constants.DEPLOYMENT_ARCHIVES),
+   PORTLET_WAR_DEPENDENCIES(Constants.PORTLET_WAR_DEPENDENCIES),
+   ARCHIVE(Constants.ARCHIVE),
+   DEPENDENCY(Constants.DEPENDENCY);
+
+   private final String name;
+
+   Element(final String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    * Get the local name of this element.
+    *
+    * @return the local name
+    */
+   public String getLocalName()
+   {
+      return name;
+   }
+
+   private static final Map<String, Element> MAP;
+
+   static
+   {
+      final Map<String, Element> map = new HashMap<String, Element>();
+      for (Element element : values())
+      {
+         final String name = element.getLocalName();
+         if (name != null)
+         {
+            map.put(name, element);
+         }
+      }
+      MAP = map;
+   }
+
+   public static Element forName(String localName)
+   {
+      final Element element = MAP.get(localName);
+      return element == null ? UNKNOWN : element;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.Extension;
+import org.jboss.as.controller.ExtensionContext;
+import org.jboss.as.controller.SubsystemRegistration;
+import org.jboss.as.controller.parsing.ExtensionParsingContext;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.as.controller.registry.OperationEntry;
+import org.jboss.as.server.deployment.Phase;
+import org.jboss.as.server.deployment.Services;
+import org.jboss.as.server.moduleservice.ServiceModuleLoader;
+import org.jboss.logging.Logger;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.ServiceName;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInExtension implements Extension
+{
+   private static final Logger log = Logger.getLogger("org.gatein");
+
+   /**
+    * The name space used for the {@code substystem} element
+    */
+   public static final String NAMESPACE = "urn:jboss:domain:gatein:1.0";
+
+   public static final String SUBSYSTEM_NAME = "gatein";
+
+   private GateInExtensionConfiguration config = new GateInExtensionConfiguration();
+
+   public GateInExtensionConfiguration getConfiguration()
+   {
+      return config;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void initialize(ExtensionContext context)
+   {
+      log.debug("Activating GateIn Extension");
+      final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
+      final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(GateInSubsystemDescriptionProviders.SUBSYSTEM);
+      registration.registerOperationHandler(ADD, new GateInSubsystemAdd(this), GateInSubsystemAdd.DESCRIPTION, false);
+      registration.registerOperationHandler(DESCRIBE, GateInSubsystemDescribe.INSTANCE, GateInSubsystemDescribe.INSTANCE, false, OperationEntry.EntryType.PRIVATE);
+      subsystem.registerXMLElementWriter(GateInSubsystemParser.getInstance());
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void initializeParsers(ExtensionParsingContext context)
+   {
+      context.setSubsystemXmlMapping(NAMESPACE, GateInSubsystemParser.getInstance());
+   }
+
+   public static String skipModuleLoaderPrefix(String name)
+   {
+      if (name.startsWith(ServiceModuleLoader.MODULE_PREFIX))
+      {
+         return name.substring(ServiceModuleLoader.MODULE_PREFIX.length());
+      }
+
+      return name;
+   }
+
+   public static ServiceName deploymentUnitName(ModuleIdentifier moduleId, Phase phase)
+   {
+      return ServiceName.of(Services.deploymentUnitName(
+            GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), phase.name());
+   }
+
+   public static ServiceName deploymentUnitName(ModuleIdentifier moduleId, String... postfix)
+   {
+      return ServiceName.of(Services.deploymentUnitName(
+            GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), postfix);
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.ServiceName;
+
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInExtensionConfiguration
+{
+   private Set<ModuleIdentifier> extModules;
+
+   private ModuleIdentifier earModule = ModuleIdentifier.create("deployment.gatein.ear");
+
+   private final List<ServiceName> childWars = new LinkedList<ServiceName>();
+
+   private final List<ServiceName> childSubUnits = new LinkedList<ServiceName>();
+
+   public GateInExtensionConfiguration()
+   {
+      Set<ModuleIdentifier> set = new LinkedHashSet<ModuleIdentifier>();
+      set.add(ModuleIdentifier.create("deployment.gatein-sample-extension.ear"));
+      set.add(ModuleIdentifier.create("deployment.gatein-sample-portal.ear"));
+      set.add(ModuleIdentifier.create("deployment.gatein-sample-skin.war"));
+      //set.add(ModuleIdentifier.create("deployment.gatein-wsrp-integration.ear"));
+      setGateInExtModules(Collections.unmodifiableSet(set));
+   }
+
+   public Set<ModuleIdentifier> getGateInExtModules()
+   {
+      return extModules;
+   }
+
+   public void setGateInExtModules(Set<ModuleIdentifier> modules)
+   {
+      this.extModules = modules;
+   }
+
+   public ModuleIdentifier getGateInEarModule()
+   {
+      return earModule;
+   }
+
+   public void setGateInEarModule(ModuleIdentifier modules)
+   {
+      this.earModule = modules;
+   }
+
+   public List<ServiceName> getChildWars()
+   {
+      return childWars;
+   }
+
+   public List<ServiceName> getChildSubUnits()
+   {
+      return childSubUnits;
+   }
+
+   public List<String> getChildSubUnitComponentPrefixes()
+   {
+      LinkedList<String> ret = new LinkedList<String>();
+      for (ServiceName name : childSubUnits)
+      {
+         ret.add(name.getCanonicalName() + ".component.");
+      }
+      return ret;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.gatein.integration.jboss.as7.deployment.GateInDependenciesDeploymentProcessor;
+import org.gatein.integration.jboss.as7.deployment.GateInInitDeploymentProcessor;
+import org.gatein.integration.jboss.as7.deployment.GateInStarterDeploymentProcessor;
+import org.gatein.integration.jboss.as7.deployment.GateInStructureDeploymentProcessor;
+import org.gatein.integration.jboss.as7.deployment.PortletWarDeploymentInitializingProcessor;
+import org.gatein.integration.jboss.as7.deployment.WarDependenciesDeploymentProcessor;
+import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.server.AbstractDeploymentChainStep;
+import org.jboss.as.server.DeploymentProcessorTarget;
+import org.jboss.as.server.deployment.Phase;
+import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceController;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemAdd extends AbstractBoottimeAddStepHandler
+{
+   static final DescriptionProvider DESCRIPTION = new DescriptionProvider()
+   {
+      public ModelNode getModelDescription(Locale locale)
+      {
+         return GateInSubsystemDescriptions.getSubsystemAddDescription(locale);
+      }
+   };
+
+
+   static final int STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT = 0x0B80;
+   static final int DEPENDENCIES_PORTLET_MODULE = 0x1100;
+   static final int STRUCTURE_GATEIN = 0x2000;
+   static final int POST_MODULE_GATEIN_INIT = 0x2000;
+   static final int INSTALL_GATEIN_CHILD_WARS = 0x4000;
+   static final int INSTALL_GATEIN_START = 0x4000;
+   static final int MANIFEST_DEPENDENCIES_GATEIN = 0x4000;
+
+   private GateInExtension extension;
+
+   public GateInSubsystemAdd(GateInExtension extension)
+   {
+      this.extension = extension;
+   }
+
+   protected void populateModel(ModelNode operation, ModelNode model)
+   {
+      //Initialize the 'type' child node
+      if (operation.hasDefined(Constants.DEPLOYMENT_ARCHIVES))
+      {
+         model.get(Constants.DEPLOYMENT_ARCHIVES).set(operation.get(Constants.DEPLOYMENT_ARCHIVES));
+      }
+      if (operation.hasDefined(Constants.PORTLET_WAR_DEPENDENCIES))
+      {
+         model.get(Constants.PORTLET_WAR_DEPENDENCIES).set(operation.get(Constants.PORTLET_WAR_DEPENDENCIES));
+      }
+      // Can we read extension configuration here?
+   }
+
+   protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model,
+                                  ServiceVerificationHandler verificationHandler,
+                                  List<ServiceController<?>> newControllers) throws OperationFailedException
+   {
+      context.addStep(new AbstractDeploymentChainStep()
+      {
+         protected void execute(DeploymentProcessorTarget processorTarget)
+         {
+            final SharedPortletTldsMetaDataBuilder tldsBuilder = new SharedPortletTldsMetaDataBuilder();
+
+            processorTarget.addDeploymentProcessor(Phase.STRUCTURE, STRUCTURE_GATEIN, new GateInStructureDeploymentProcessor(extension));
+            processorTarget.addDeploymentProcessor(Phase.PARSE, STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT, new PortletWarDeploymentInitializingProcessor(extension));
+            processorTarget.addDeploymentProcessor(Phase.PARSE, MANIFEST_DEPENDENCIES_GATEIN, new GateInDependenciesDeploymentProcessor(extension));
+            processorTarget.addDeploymentProcessor(Phase.PARSE, INSTALL_GATEIN_CHILD_WARS, new WarDependenciesDeploymentProcessor(extension));
+
+            //processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES, DEPENDENCIES_PORTLET_MODULE,
+            //      new PortletWarClassloadingDependencyProcessor(tldsBuilder.create()));
+            processorTarget.addDeploymentProcessor(Phase.POST_MODULE, POST_MODULE_GATEIN_INIT, new GateInInitDeploymentProcessor(extension));
+            processorTarget.addDeploymentProcessor(Phase.INSTALL, INSTALL_GATEIN_START, new GateInStarterDeploymentProcessor(extension));
+         }
+      }, OperationContext.Stage.RUNTIME);
+   }
+
+   protected boolean requiresRuntimeVerification()
+   {
+      return false;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.OperationStepHandler;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescribe implements OperationStepHandler, DescriptionProvider
+{
+
+   static final GateInSubsystemDescribe INSTANCE = new GateInSubsystemDescribe();
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void execute(OperationContext context, ModelNode operation) throws OperationFailedException
+   {
+      final PathAddress rootAddress = PathAddress.pathAddress(PathAddress.pathAddress(operation.require(OP_ADDR)).getLastElement());
+      final ModelNode subModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
+
+      final ModelNode subsystemAdd = new ModelNode();
+      subsystemAdd.get(OP).set(ADD);
+      subsystemAdd.get(OP_ADDR).set(rootAddress.toModelNode());
+      if (subModel.hasDefined(Constants.DEPLOYMENT_ARCHIVES))
+      {
+         subsystemAdd.get(Constants.DEPLOYMENT_ARCHIVES).set(subModel.get(Constants.DEPLOYMENT_ARCHIVES));
+      }
+      if (subModel.hasDefined(Constants.PORTLET_WAR_DEPENDENCIES))
+      {
+         subsystemAdd.get(Constants.PORTLET_WAR_DEPENDENCIES).set(subModel.get(Constants.PORTLET_WAR_DEPENDENCIES));
+      }
+      context.getResult().add(subsystemAdd);
+
+      context.completeStep();
+   }
+
+   @Override
+   public ModelNode getModelDescription(Locale locale)
+   {
+      return new ModelNode();
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+
+/**
+ * Common web description providers.
+ *
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescriptionProviders
+{
+   public static final DescriptionProvider SUBSYSTEM = new DescriptionProvider()
+   {
+      @Override
+      public ModelNode getModelDescription(Locale locale)
+      {
+         return GateInSubsystemDescriptions.getSubsystemDescription(locale);
+      }
+   };
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.dmr.ModelNode;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemDescriptions
+{
+   static final String RESOURCE_NAME = GateInSubsystemDescriptions.class.getPackage().getName() + ".LocalDescriptions";
+
+   public static ModelNode getSubsystemDescription(final Locale locale)
+   {
+      final ResourceBundle bundle = getResourceBundle(locale);
+
+      final ModelNode node = new ModelNode();
+
+      node.get(DESCRIPTION).set(bundle.getString("gatein.description"));
+      node.get(HEAD_COMMENT_ALLOWED).set(true);
+      node.get(TAIL_COMMENT_ALLOWED).set(true);
+      node.get(NAMESPACE).set(GateInExtension.NAMESPACE);
+
+      node.get(CHILDREN, "deployment-archives", DESCRIPTION).set(bundle.getString("gatein.deployment-archives.description"));
+      node.get(CHILDREN, "deployment-archives", MIN_OCCURS).set(0);
+      node.get(CHILDREN, "deployment-archives", MAX_OCCURS).set(1);
+      node.get(CHILDREN, "deployment-archives", MODEL_DESCRIPTION);
+
+      node.get(CHILDREN, "portlet-war-dependencies", DESCRIPTION).set(bundle.getString("gatein.portlet-war-dependencies.description"));
+      node.get(CHILDREN, "portlet-war-dependencies", MIN_OCCURS).set(0);
+      node.get(CHILDREN, "portlet-war-dependencies", MAX_OCCURS).set(1);
+      node.get(CHILDREN, "portlet-war-dependencies", MODEL_DESCRIPTION);
+
+      return node;
+   }
+
+   static ResourceBundle getResourceBundle(Locale locale)
+   {
+      if (locale == null)
+      {
+         locale = Locale.getDefault();
+      }
+      return ResourceBundle.getBundle(RESOURCE_NAME, locale);
+   }
+
+   public static ModelNode getSubsystemAddDescription(Locale locale)
+   {
+      final ResourceBundle bundle = getResourceBundle(locale);
+      final ModelNode subsystem = new ModelNode();
+      subsystem.get(DESCRIPTION).set(bundle.getString("gatein.add.description"));
+      return subsystem;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,358 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.Property;
+import org.jboss.staxmapper.XMLElementReader;
+import org.jboss.staxmapper.XMLElementWriter;
+import org.jboss.staxmapper.XMLExtendedStreamReader;
+import org.jboss.staxmapper.XMLExtendedStreamWriter;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import java.util.List;
+
+import static org.gatein.integration.jboss.as7.Constants.*;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.jboss.as.controller.parsing.ParseUtils.*;
+
+/**
+ * GateIn subsystem parser.
+ *
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInSubsystemParser implements XMLStreamConstants, XMLElementReader<List<ModelNode>>, XMLElementWriter<SubsystemMarshallingContext>
+{
+
+   private static final GateInSubsystemParser INSTANCE = new GateInSubsystemParser();
+
+   static GateInSubsystemParser getInstance()
+   {
+      return INSTANCE;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException
+   {
+      context.startSubsystemElement(GateInExtension.NAMESPACE, false);
+
+      ModelNode node = context.getModelNode();
+      if (node.hasDefined(DEPLOYMENT_ARCHIVES))
+      {
+         writeDeploymentArchives(writer, node.get(DEPLOYMENT_ARCHIVES));
+      }
+      if (node.hasDefined(PORTLET_WAR_DEPENDENCIES))
+      {
+         writePortletWarDependencies(writer, node.get(PORTLET_WAR_DEPENDENCIES));
+      }
+      writer.writeEndElement();
+   }
+
+   private void writeDeploymentArchives(XMLExtendedStreamWriter writer, ModelNode deployArchives) throws XMLStreamException
+   {
+      if (deployArchives.isDefined() && deployArchives.asInt() > 0)
+      {
+         writer.writeStartElement(Element.DEPLOYMENT_ARCHIVES.getLocalName());
+         for (Property archive : deployArchives.asPropertyList())
+         {
+            writer.writeStartElement(Element.ARCHIVE.getLocalName());
+            writer.writeAttribute(Attribute.NAME.getLocalName(), archive.getName());
+            if (archive.getValue().isDefined() && archive.getValue().asInt() > 0)
+            {
+               for (Property property : archive.getValue().asPropertyList())
+               {
+                  if (MAIN.equals(property.getName()))
+                  {
+                     writer.writeAttribute(Attribute.MAIN.getLocalName(), TRUE);
+                  }
+                  else
+                  {
+                     throw new RuntimeException("Unexpected model property: " + property + " on " + archive);
+                  }
+               }
+            }
+            writer.writeEndElement();
+         }
+         writer.writeEndElement();
+      }
+   }
+
+
+   private void writePortletWarDependencies(XMLExtendedStreamWriter writer, ModelNode warDependencies) throws XMLStreamException
+   {
+      if (warDependencies.isDefined() && warDependencies.asInt() > 0)
+      {
+         writer.writeStartElement(Element.PORTLET_WAR_DEPENDENCIES.getLocalName());
+         for (Property dependency : warDependencies.asPropertyList())
+         {
+            writer.writeStartElement(Element.DEPENDENCY.getLocalName());
+            writer.writeAttribute(Attribute.NAME.getLocalName(), dependency.getName());
+            if (dependency.getValue().isDefined() && dependency.getValue().asInt() > 0)
+            {
+               for (Property property : dependency.getValue().asPropertyList())
+               {
+                  if (IMPORT_SERVICES.equals(property.getName()))
+                  {
+                     writer.writeAttribute(Attribute.IMPORT_SERVICES.getLocalName(), TRUE);
+                  }
+                  else
+                  {
+                     throw new RuntimeException("Unexpected model property: " + property + " on " + dependency);
+                  }
+               }
+            }
+            writer.writeEndElement();
+         }
+         writer.writeEndElement();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException
+   {
+      // no attributes
+      if (reader.getAttributeCount() > 0)
+      {
+         throw unexpectedAttribute(reader, 0);
+      }
+
+      final ModelNode address = new ModelNode();
+      address.add(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME);
+      address.protect();
+
+      final ModelNode subsystem = new ModelNode();
+      subsystem.get(OP).set(ADD);
+      subsystem.get(OP_ADDR).set(address);
+      final int count = reader.getAttributeCount();
+      for (int i = 0; i < count; i++)
+      {
+         requireNoNamespaceAttribute(reader, i);
+         requireNoAttributes(reader);
+      }
+      list.add(subsystem);
+
+      // elements
+      while (reader.hasNext() && reader.nextTag() != END_ELEMENT)
+      {
+         if (GateInExtension.NAMESPACE.equals(reader.getNamespaceURI()))
+         {
+            final Element element = Element.forName(reader.getLocalName());
+            switch (element)
+            {
+               case DEPLOYMENT_ARCHIVES:
+               {
+                  final ModelNode deploymentArchives = parseDeploymentArchives(reader);
+                  subsystem.get(DEPLOYMENT_ARCHIVES).set(deploymentArchives);
+                  break;
+               }
+               case PORTLET_WAR_DEPENDENCIES:
+               {
+                  final ModelNode portletWarDeps = parsePortletWarDependencies(reader);
+                  subsystem.get(PORTLET_WAR_DEPENDENCIES).set(portletWarDeps);
+                  break;
+               }
+               default:
+               {
+                  throw unexpectedElement(reader);
+               }
+            }
+         }
+         else
+         {
+            throw unexpectedElement(reader);
+         }
+      }
+   }
+
+   static ModelNode parseDeploymentArchives(XMLExtendedStreamReader reader) throws XMLStreamException
+   {
+      final ModelNode model = new ModelNode();
+      // no attributes
+      requireNoAttributes(reader);
+      // elements
+      while (reader.hasNext() && reader.nextTag() != END_ELEMENT)
+      {
+         final Element element = Element.forName(reader.getLocalName());
+         switch (element)
+         {
+            case ARCHIVE:
+            {
+               parseArchive(reader, model);
+               break;
+            }
+            default:
+               throw unexpectedElement(reader);
+         }
+      }
+
+      // validate archives
+      int mainCount = 0;
+      for (Property p : model.asPropertyList())
+      {
+         if (p.getValue().isDefined())
+         {
+            List<Property> props = p.getValue().asPropertyList();
+            if (props.size() > 0 && MAIN.equals(props.get(0).getName()))
+            {
+               mainCount++;
+            }
+         }
+      }
+
+      if (mainCount != 1)
+      {
+         throw new RuntimeException("Exactly one archive has to be marked as a main archive (found: " + mainCount + ")");
+      }
+
+      return model;
+   }
+
+   static void parseArchive(XMLExtendedStreamReader reader, ModelNode model) throws XMLStreamException
+   {
+      // attributes
+      final int count = reader.getAttributeCount();
+      boolean main = false;
+      String name = null;
+      for (int i = 0; i < count; i++)
+      {
+         requireNoNamespaceAttribute(reader, i);
+         final String value = reader.getAttributeValue(i);
+         final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
+         switch (attribute)
+         {
+            case NAME:
+            {
+               name = value;
+               break;
+            }
+            case MAIN:
+            {
+               requireTrueOrFalse(value);
+               main = Boolean.parseBoolean(value);
+               break;
+            }
+            default:
+               throw unexpectedAttribute(reader, i);
+         }
+      }
+
+      if (name == null)
+      {
+         throw new RuntimeException("Attribute '" + Attribute.NAME.getLocalName()
+               + "' of '" + Element.ARCHIVE.getLocalName() + "' element can not be null!");
+      }
+
+      ModelNode attrList = new ModelNode();
+      if (main)
+      {
+         attrList.add(MAIN, new ModelNode());
+      }
+      model.add(name, attrList);
+
+      requireNoContent(reader);
+   }
+
+   static ModelNode parsePortletWarDependencies(XMLExtendedStreamReader reader) throws XMLStreamException
+   {
+      final ModelNode model = new ModelNode();
+      // no attributes
+      requireNoAttributes(reader);
+      // elements
+      while (reader.hasNext() && reader.nextTag() != END_ELEMENT)
+      {
+         final Element element = Element.forName(reader.getLocalName());
+         switch (element)
+         {
+            case DEPENDENCY:
+            {
+               parseDependency(reader, model);
+               break;
+            }
+            default:
+               throw unexpectedElement(reader);
+         }
+      }
+
+      return model;
+   }
+
+   static void parseDependency(XMLExtendedStreamReader reader, ModelNode model) throws XMLStreamException
+   {
+      // attributes
+      final int count = reader.getAttributeCount();
+      boolean importSvcs = false;
+      String name = null;
+      for (int i = 0; i < count; i++)
+      {
+         requireNoNamespaceAttribute(reader, i);
+         final String value = reader.getAttributeValue(i);
+         final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
+         switch (attribute)
+         {
+            case NAME:
+            {
+               name = value;
+               break;
+            }
+            case IMPORT_SERVICES:
+            {
+               requireTrueOrFalse(value);
+               importSvcs = Boolean.parseBoolean(value);
+               break;
+            }
+            default:
+               throw unexpectedAttribute(reader, i);
+         }
+      }
+
+      if (name == null)
+      {
+         throw new RuntimeException("Attribute '" + Attribute.NAME.getLocalName()
+               + "' of '" + Element.ARCHIVE.getLocalName() + "' element can not be null!");
+      }
+
+      ModelNode attrList = new ModelNode();
+      if (importSvcs)
+      {
+         attrList.add(IMPORT_SERVICES, new ModelNode());
+      }
+      model.add(name, attrList);
+
+      requireNoContent(reader);
+   }
+
+   private static void requireTrueOrFalse(String value)
+   {
+      if (!"true".equals(value) && !"false".equals(value))
+      {
+         throw new RuntimeException("Invalid value for boolean attribute: " + value);
+      }
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.AbstractAddStepHandler;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class SetGateInArchivesHandler extends AbstractAddStepHandler implements DescriptionProvider
+{
+   public static final SetGateInArchivesHandler INSTANCE = new SetGateInArchivesHandler();
+
+   private SetGateInArchivesHandler()
+   {
+   }
+
+   @Override
+   protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException
+   {
+
+   }
+
+   public ModelNode getModelDescription(Locale locale)
+   {
+      final ResourceBundle bundle = GateInSubsystemDescriptions.getResourceBundle(locale);
+      ModelNode node = new ModelNode();
+      node.get(DESCRIPTION).set(bundle.getString("gatein.set-deployment-archives.description"));
+      node.get(REQUEST_PROPERTIES, "services", DESCRIPTION).set(bundle.getString("gatein.deployment-archives.archive.services.description"));
+      node.get(REQUEST_PROPERTIES, "services", TYPE).set(ModelType.UNDEFINED);
+      node.get(REQUEST_PROPERTIES, "services", REQUIRED).set(false);
+      return node;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SharedPortletTldsMetaDataBuilder.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import org.jboss.metadata.parser.jsp.TldMetaDataParser;
+import org.jboss.metadata.parser.util.NoopXmlResolver;
+import org.jboss.metadata.web.spec.TldMetaData;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoadException;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+class SharedPortletTldsMetaDataBuilder
+{
+   private static final String[] PORTLET_TLDS = {"portlet.tld", "portlet_2_0.tld"};
+
+   private final List<TldMetaData> tlds = new ArrayList<TldMetaData>();
+
+   SharedPortletTldsMetaDataBuilder()
+   {
+      init();
+   }
+
+   private void init()
+   {
+      try
+      {
+         ModuleClassLoader jstl = Module.getModuleFromCallerModuleLoader(ModuleIdentifier.create("org.gatein.pc")).getClassLoader();
+         for (String tld : PORTLET_TLDS)
+         {
+            InputStream is = jstl.getResourceAsStream("META-INF/" + tld);
+            if (is != null)
+            {
+               TldMetaData tldMetaData = parseTLD(tld, is);
+               tlds.add(tldMetaData);
+            }
+         }
+      }
+      catch (ModuleLoadException e)
+      {
+         // Ignore
+      }
+      catch (Exception e)
+      {
+         // Ignore
+      }
+   }
+
+   List<TldMetaData> create()
+   {
+      final List<TldMetaData> metadata = new ArrayList<TldMetaData>();
+      metadata.addAll(tlds);
+      return metadata;
+   }
+
+   private TldMetaData parseTLD(String tld, InputStream is) throws Exception
+   {
+      try
+      {
+         final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+         inputFactory.setXMLResolver(NoopXmlResolver.create());
+         XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is);
+         return TldMetaDataParser.parse(xmlReader);
+      }
+      finally
+      {
+         try
+         {
+            if (is != null)
+            {
+               is.close();
+            }
+         }
+         catch (IOException e)
+         {
+            // Ignore
+         }
+      }
+   }
+
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.module.ModuleDependency;
+import org.jboss.as.server.moduleservice.ServiceModuleLoader;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleIdentifier;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInDependenciesDeploymentProcessor implements DeploymentUnitProcessor
+{
+
+   final ModuleIdentifier gateInLibId = ModuleIdentifier.fromString("org.gatein.lib");
+
+   private GateInExtension extension;
+   private GateInExtensionConfiguration config;
+
+   public GateInDependenciesDeploymentProcessor(GateInExtension extension)
+   {
+      this.extension = extension;
+      this.config = extension.getConfiguration();
+   }
+
+   public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      final DeploymentUnit du = phaseContext.getDeploymentUnit();
+
+      if (du.getAttachment(GateInEarKey.KEY) != null
+            || du.getAttachment(GateInExtKey.KEY) != null
+            || du.getAttachment(PortletWarKey.INSTANCE) != null)
+      {
+         // add dependency on org.gatein.lib
+         List<ModuleDependency> dependencies = du.getAttachmentList(Attachments.MANIFEST_DEPENDENCIES);
+
+         if (!containsDependency(dependencies, gateInLibId))
+         {
+            du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
+                  new ModuleDependency(Module.getBootModuleLoader(), gateInLibId, false, false, true));
+         }
+
+         // add gatein deployment modules cross-dependencies
+         ModuleIdentifier moduleId = du.getAttachment(Attachments.MODULE_IDENTIFIER);
+
+         if (du.getAttachment(GateInEarKey.KEY) != null
+               || du.getAttachment(GateInExtKey.KEY) != null)
+         {
+            final ServiceModuleLoader deploymentModuleLoader = du.getAttachment(Attachments.SERVICE_MODULE_LOADER);
+
+            if (!moduleId.equals(config.getGateInEarModule()))
+            {
+               if (!containsDependency(dependencies, config.getGateInEarModule()))
+               {
+                  du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
+                        new ModuleDependency(deploymentModuleLoader, config.getGateInEarModule(), false, false, false));
+               }
+            }
+
+            for (ModuleIdentifier id : config.getGateInExtModules())
+            {
+               if (!moduleId.equals(id))
+               {
+                  if (!containsDependency(dependencies, id))
+                  {
+                     du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
+                           new ModuleDependency(deploymentModuleLoader, id, false, false, false));
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   private boolean containsDependency(List<ModuleDependency> dependencies, ModuleIdentifier moduleId)
+   {
+      boolean exists = false;
+      for (ModuleDependency dep : dependencies)
+      {
+         if (dep.getIdentifier().equals(moduleId))
+         {
+            exists = true;
+            break;
+         }
+      }
+      return exists;
+   }
+
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInEarKey.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInEarKey.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInEarKey.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInEarKey
+{
+   public static final AttachmentKey<GateInEarKey> KEY = AttachmentKey.create(GateInEarKey.class);
+   public static final GateInEarKey INSTANCE = new GateInEarKey();
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInExtKey.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInExtKey.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInExtKey.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInExtKey
+{
+   public static AttachmentKey<GateInExtKey> KEY = AttachmentKey.create(GateInExtKey.class);
+   public static GateInExtKey INSTANCE = new GateInExtKey();
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
+import org.gatein.integration.jboss.as7.web.InitService;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.Phase;
+import org.jboss.logging.Logger;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInInitDeploymentProcessor implements DeploymentUnitProcessor
+{
+   private final Logger log = Logger.getLogger(GateInInitDeploymentProcessor.class);
+
+   private GateInExtension extension;
+
+   public GateInInitDeploymentProcessor(GateInExtension extension)
+   {
+      this.extension = extension;
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      final DeploymentUnit du = phaseContext.getDeploymentUnit();
+
+      if (du.getAttachment(GateInEarKey.KEY) != null
+            || du.getAttachment(GateInExtKey.KEY) != null)
+      {
+         log.info("Module is on GateIn Extension modules list");
+         GateInExtensionConfiguration conf = extension.getConfiguration();
+         ServiceName initSvcName = GateInExtension.deploymentUnitName(conf.getGateInEarModule(), "gatein", "init");
+         ServiceTarget target = phaseContext.getServiceTarget();
+
+         if (du.getAttachment(GateInEarKey.KEY) != null)
+         {
+            // install InitService with dependency on all the deployment modules reaching POST_MODULE
+            // TODO: we are starting up InitService before child modules (jboss.deployment.subunit.*) have gone through POST_MODULE
+            ServiceBuilder<InitService> builder = target.addService(initSvcName, new InitService(extension))
+                  .addDependency(GateInExtension.deploymentUnitName(conf.getGateInEarModule(), Phase.POST_MODULE));
+
+            for (ModuleIdentifier module : conf.getGateInExtModules())
+            {
+               builder.addDependency(GateInExtension.deploymentUnitName(module, Phase.POST_MODULE));
+            }
+            builder.install();
+            log.info("Installed " + initSvcName);
+         }
+         // all gatein deployment modules use InitService as barrier on POST_MODULE to ensure
+         // they are all available on the classpath when init time resource loading takes place
+         phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, initSvcName);
+         log.info("Added NEXT_PHASE_DEP on " + initSvcName);
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
+import org.gatein.integration.jboss.as7.web.StartupService;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.Phase;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceName;
+
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInStarterDeploymentProcessor implements DeploymentUnitProcessor
+{
+   private ConcurrentHashMap<ModuleIdentifier, ModuleIdentifier> deploymentModules;
+
+   private GateInExtension extension;
+   private GateInExtensionConfiguration config;
+
+   public GateInStarterDeploymentProcessor(GateInExtension extension)
+   {
+      this.extension = extension;
+      this.config = extension.getConfiguration();
+   }
+
+   private synchronized ConcurrentHashMap<ModuleIdentifier, ModuleIdentifier> getDeploymentModules()
+   {
+      if (deploymentModules == null)
+      {
+         deploymentModules = new ConcurrentHashMap<ModuleIdentifier, ModuleIdentifier>();
+         deploymentModules.put(config.getGateInEarModule(), config.getGateInEarModule());
+         for (ModuleIdentifier id : config.getGateInExtModules())
+         {
+            deploymentModules.put(id, id);
+         }
+      }
+      return deploymentModules;
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      DeploymentUnit du = phaseContext.getDeploymentUnit();
+
+      // Wait to the last GateIn archive deployment unit install
+      // Then enumerate all the child components which should all be scheduled for startup at that point
+      // to get the dependencies for StartupService
+
+      if (du.getAttachment(GateInEarKey.KEY) != null || du.getAttachment(GateInExtKey.KEY) != null)
+      {
+         ModuleIdentifier moduleId = du.getAttachment(Attachments.MODULE_IDENTIFIER);
+         getDeploymentModules().remove(moduleId);
+
+         if (deploymentModules.size() == 0)
+         {
+            StartupService startup = new StartupService();
+            startup.setGateInModule(du.getAttachment(Attachments.MODULE));
+
+            ServiceBuilder<StartupService> builder = phaseContext.getServiceTarget()
+                  .addService(StartupService.SERVICE_NAME, startup);
+
+            builder.addDependency(GateInExtension.deploymentUnitName(config.getGateInEarModule(), Phase.CLEANUP));
+            for (ModuleIdentifier id : config.getGateInExtModules())
+            {
+               builder.addDependency(GateInExtension.deploymentUnitName(id, Phase.CLEANUP));
+            }
+
+            // Looks like web archives are completely covered by jboss.web services
+            for (ServiceName svcName : config.getChildWars())
+            {
+               builder.addDependency(svcName);
+            }
+
+            // Subunit not necessary for web archives - but might be necessary for non-web
+            for (ServiceName svcName : config.getChildSubUnits())
+            {
+               builder.addDependency(svcName.append(Phase.CLEANUP.name()));
+            }
+
+            // Subcomponents not necessary for web archives - but might necessary for non-web
+            List<String> prefixes = config.getChildSubUnitComponentPrefixes();
+            for (ServiceName name : du.getServiceRegistry().getServiceNames())
+            {
+               for (String prefix : prefixes)
+               {
+                  if (name.getCanonicalName().startsWith(prefix))
+                  {
+                     builder.addDependency(name);
+                  }
+               }
+            }
+
+            builder.install();
+         }
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.Services;
+import org.jboss.as.web.WebSubsystemServices;
+import org.jboss.logging.Logger;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.AbstractServiceListener;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceListener;
+import org.jboss.msc.service.ServiceName;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class GateInStructureDeploymentProcessor implements DeploymentUnitProcessor
+{
+   private static Logger log = Logger.getLogger(GateInStructureDeploymentProcessor.class);
+
+   private static final ServiceListener listener = new AbstractServiceListener()
+   {
+
+      @Override
+      public void transition(ServiceController serviceController, ServiceController.Transition transition)
+      {
+         switch (transition)
+         {
+            case STARTING_to_UP:
+            case STOP_REQUESTED_to_UP:
+               log.trace("Service started: " + serviceController.getName() + " [" + transition + "]");
+               break;
+            case REMOVING_to_DOWN:
+            case START_FAILED_to_DOWN:
+            case START_REQUESTED_to_DOWN:
+            case STOPPING_to_DOWN:
+            case WAITING_to_DOWN:
+            case WONT_START_to_DOWN:
+               log.trace("Service stopped: " + serviceController.getName() + " [" + transition + "]");
+               break;
+         }
+      }
+   };
+
+
+   private GateInExtension extension;
+   private GateInExtensionConfiguration config;
+
+   public GateInStructureDeploymentProcessor(GateInExtension extension)
+   {
+      this.extension = extension;
+      this.config = extension.getConfiguration();
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      DeploymentUnit du = phaseContext.getDeploymentUnit();
+      log.debug("Deploy: " + du.getName() + " [" + phaseContext.getPhase() + "]");
+      if (du.getParent() != null)
+      {
+         processChildDeployment(phaseContext);
+      }
+      else
+      {
+         ModuleIdentifier moduleId = du.getAttachment(Attachments.MODULE_IDENTIFIER);
+         if (config.getGateInEarModule().equals(moduleId))
+         {
+            log.debugf("Recognized %s as main GateIn deployment archive", moduleId);
+            du.putAttachment(GateInEarKey.KEY, GateInEarKey.INSTANCE);
+            if (log.isTraceEnabled())
+            {
+               installListener(phaseContext, moduleId);
+            }
+         }
+         else if (config.getGateInExtModules().contains(moduleId))
+         {
+            log.debugf("Recognized %s as part of GateIn deployment", moduleId);
+            du.putAttachment(GateInExtKey.KEY, GateInExtKey.INSTANCE);
+            if (log.isTraceEnabled())
+            {
+               installListener(phaseContext, moduleId);
+            }
+         }
+      }
+   }
+
+   private void processChildDeployment(DeploymentPhaseContext phaseContext)
+   {
+      DeploymentUnit du = phaseContext.getDeploymentUnit();
+      DeploymentUnit parent = du.getParent();
+      if (parent.getAttachment(GateInEarKey.KEY) != null
+            || parent.getAttachment(GateInExtKey.KEY) != null)
+      {
+         //if (DeploymentTypeMarker.isType(DeploymentType.WAR, du))
+         //{
+         //   config.getChildWars().add(WebSubsystemServices.JBOSS_WEB.append(du.getName()));
+         //}
+         config.getChildSubUnits().add(Services.deploymentUnitName(parent.getName(), du.getName()));
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+
+   void installListener(DeploymentPhaseContext phaseContext, ModuleIdentifier moduleId)
+   {
+      ServiceName serviceName = Services.deploymentUnitName(
+            GateInExtension.skipModuleLoaderPrefix(moduleId.getName()));
+
+      ServiceController<?> svcc = phaseContext.getServiceRegistry().getService(serviceName);
+      svcc.addListener(ServiceListener.Inheritance.ALL, listener);
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.module.ModuleDependency;
+import org.jboss.as.server.deployment.module.ModuleSpecification;
+import org.jboss.as.web.deployment.TldsMetaData;
+import org.jboss.metadata.web.spec.TldMetaData;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoader;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarClassloadingDependencyProcessor implements DeploymentUnitProcessor
+{
+
+   private static final ModuleIdentifier GATEIN_WCI = ModuleIdentifier.create("org.gatein.wci");
+   private static final ModuleIdentifier GATEIN_PC = ModuleIdentifier.create("org.gatein.pc");
+   private static final ModuleIdentifier JAVAX_PORTLET = ModuleIdentifier.create("javax.portlet.api");
+
+   private List<TldMetaData> tldMetas;
+
+   public PortletWarClassloadingDependencyProcessor(List<TldMetaData> tldMetaData)
+   {
+      this.tldMetas = tldMetaData;
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+      if (deploymentUnit.getAttachment(PortletWarKey.INSTANCE) == null)
+      {
+         return; // Skip non portlet deployments
+      }
+
+      final ModuleLoader moduleLoader = Module.getBootModuleLoader();
+      final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
+
+      // Add module dependencies
+      moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, GATEIN_WCI, false, false, false));
+      moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, GATEIN_PC, false, false, false));
+      moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAVAX_PORTLET, false, false, false));
+
+      // Provide tlds for portlet taglibs
+      provideTlds(deploymentUnit);
+   }
+
+   private void provideTlds(DeploymentUnit deploymentUnit)
+   {
+      TldsMetaData tsmd = deploymentUnit.getAttachment(TldsMetaData.ATTACHMENT_KEY);
+      if (tsmd == null)
+      {
+         throw new IllegalStateException("Attachment not present: TldsMetaData");
+      }
+
+      Map<String, TldMetaData> tlds = tsmd.getTlds();
+      if (tlds == null)
+      {
+         throw new IllegalStateException("TldsMetaData.tlds == null");
+      }
+
+      for (TldMetaData tld : tldMetas)
+      {
+         tlds.put(tld.getUri(), tld);
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.Attachments;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarDeploymentInitializingProcessor implements DeploymentUnitProcessor
+{
+   private static final String PORTLET_XML = "WEB-INF/portlet.xml";
+
+   private GateInExtension extension;
+
+   public PortletWarDeploymentInitializingProcessor(GateInExtension extension)
+   {
+      this.extension = extension;
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+      if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit))
+      {
+         return; // Skip non web deployments
+      }
+      final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
+      final VirtualFile portletXml = deploymentRoot.getRoot().getChild(PORTLET_XML);
+      if (portletXml.exists())
+      {
+         // we don't care about the contents, its existence is enough to mark it as a portlet app
+         deploymentUnit.putAttachment(PortletWarKey.INSTANCE, Boolean.TRUE);
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarKey.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarKey
+{
+
+   public static final AttachmentKey<Boolean> INSTANCE = AttachmentKey.create(Boolean.class);
+
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.deployment;
+
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.web.WebSubsystemServices;
+import org.jboss.as.web.deployment.WarMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.msc.service.ServiceName;
+
+import java.lang.Override;import java.lang.String;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class WarDependenciesDeploymentProcessor implements DeploymentUnitProcessor
+{
+   private GateInExtensionConfiguration config;
+
+   public WarDependenciesDeploymentProcessor(GateInExtension extension)
+   {
+      this.config = extension.getConfiguration();
+   }
+
+   private void processWarDeployment(DeploymentUnit du)
+   {
+      WarMetaData warMetaData = du.getAttachment(WarMetaData.ATTACHMENT_KEY);
+      if (warMetaData == null)
+         return;
+      final JBossWebMetaData metaData = warMetaData.getMergedJBossWebMetaData();
+
+      String pathName;
+      if (metaData.getContextRoot() == null) {
+         pathName = "/" + du.getName().substring(0, du.getName().length() - 4);
+      } else {
+         pathName = metaData.getContextRoot();
+         if ("/".equals(pathName)) {
+             pathName = "";
+         } else if (pathName.length() > 0 && pathName.charAt(0) != '/') {
+             pathName = "/" + pathName;
+         }
+      }
+
+      final ServiceName deploymentServiceName = WebSubsystemServices.deploymentServiceName("default-host", pathName);
+      config.getChildWars().add(deploymentServiceName);
+   }
+
+   @Override
+   public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
+   {
+      DeploymentUnit du = phaseContext.getDeploymentUnit();
+      DeploymentUnit parent = du.getParent();
+
+      if (du.getParent() != null) {
+         if (parent.getAttachment(GateInEarKey.KEY) != null
+               || parent.getAttachment(GateInExtKey.KEY) != null)
+         {
+            processWarDeployment(du);
+         }
+      }
+      else if (du.getAttachment(GateInEarKey.KEY) != null
+               || du.getAttachment(GateInExtKey.KEY) != null)
+      {
+         processWarDeployment(du);
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit context)
+   {
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.web;
+
+import org.exoplatform.container.RootContainer;
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.jboss.as.server.moduleservice.ModuleLoadService;
+import org.jboss.as.server.moduleservice.ServiceModuleLoader;
+import org.jboss.modules.Module;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class InitService implements Service<InitService>
+{
+
+   private GateInExtension extension;
+
+   public InitService(GateInExtension extension)
+   {
+      this.extension = extension;
+   }
+
+   @Override
+   public void start(StartContext context) throws StartException
+   {
+      System.out.println("InitService START");
+      ServiceController<?> svc = context.getController().getServiceContainer()
+            .getRequiredService(ServiceModuleLoader.moduleServiceName(extension.getConfiguration().getGateInEarModule()));
+
+      ModuleLoadService modService = (ModuleLoadService) svc.getService();
+      Module module = modService.getValue();
+
+      ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         // set TCCL to this module's CL
+         Thread.currentThread().setContextClassLoader(module.getClassLoader());
+         RootContainer.getInstance();
+      }
+      finally
+      {
+         if (Thread.currentThread().getContextClassLoader() != oldCl)
+         {
+            Thread.currentThread().setContextClassLoader(oldCl);
+         }
+      }
+   }
+
+   @Override
+   public void stop(StopContext context)
+   {
+   }
+
+   @Override
+   public InitService getValue() throws IllegalStateException, IllegalArgumentException
+   {
+      return null;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/StartupService.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/StartupService.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/StartupService.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.web;
+
+import org.exoplatform.container.RootContainer;
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.jboss.as.server.moduleservice.ServiceModuleLoader;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class StartupService implements Service<StartupService>
+{
+   private Module module;
+
+   public static final ServiceName SERVICE_NAME = ServiceName.of((ServiceName) null, "org", "gatein", "startup");
+
+   @Override
+   public void start(StartContext context) throws StartException
+   {
+      ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         // set TCCL to this module's CL
+         Thread.currentThread().setContextClassLoader(module.getClassLoader());
+
+         // Trigger startup
+         RootContainer rootContainer = RootContainer.getInstance();
+         rootContainer.createPortalContainers();
+      }
+      finally
+      {
+         if (Thread.currentThread().getContextClassLoader() != oldCl)
+         {
+            Thread.currentThread().setContextClassLoader(oldCl);
+         }
+      }
+   }
+
+   @Override
+   public void stop(StopContext context)
+   {
+      RootContainer.getInstance().stop();
+   }
+
+   @Override
+   public StartupService getValue() throws IllegalStateException, IllegalArgumentException
+   {
+      return this;
+   }
+
+   public void setGateInModule(Module module)
+   {
+      this.module = module;
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/resources/META-INF/services/org.jboss.as.controller.Extension	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,23 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2011, Red Hat, Inc., and individual contributors
+# as indicated by the @author tags. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# 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
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+org.gatein.integration.jboss.as7.GateInExtension
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,29 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2011, Red Hat, Inc., and individual contributors
+# as indicated by the @author tags. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# 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
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+
+gatein.description=GateIn subsystem configuration.
+gatein.add.description=Adds the GateIn subsystem.
+gatein.deployment-archives.description=Set of deployment archives forming a GateIn portal installation.
+gatein.set-deployment-archives.description=Sets the deployment archives that are part of GateIn portal installation.
+gatein.portlet-war-dependencies.description=Set of dependencies to make available to portlet wars.
+gatein.deployment-archives.archive.services.description=Should META-INF/services configuration be imported for ServiceLoader to find it?

Added: portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="urn:jboss:domain:gatein:1.0"
+           xmlns="urn:jboss:domain:gatein:1.0"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified"
+           version="1.0">
+
+   <!-- The gatein subsystem root element -->
+   <xs:element name="subsystem" type="gatein-rootType"/>
+
+   <!-- The gatein subsystem configuration -->
+   <xs:complexType name="gatein-rootType">
+      <xs:annotation>
+         <xs:documentation>
+            <![CDATA[
+                    The gatein subsystem, used to configure gatein support
+                ]]>
+         </xs:documentation>
+      </xs:annotation>
+
+      <xs:sequence>
+         <xs:element minOccurs="0" maxOccurs="1" name="deployment-archives" type="deploymentArchivesType"/>
+         <xs:element minOccurs="0" maxOccurs="1" name="portlet-war-dependencies" type="portletWarDependenciesType"/>
+      </xs:sequence>
+   </xs:complexType>
+
+
+   <xs:complexType name="deploymentArchivesType">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+         <xs:element name="archive" type="archiveType">
+            <xs:annotation>
+               <xs:documentation>
+                  <![CDATA[
+                  TODO: Description ...
+               ]]>
+               </xs:documentation>
+            </xs:annotation>
+         </xs:element>
+      </xs:choice>
+   </xs:complexType>
+
+   <xs:complexType name="archiveType">
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="main" type="xs:boolean" use="optional" default="false"/>
+   </xs:complexType>
+
+   <xs:complexType name="portletWarDependenciesType">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+         <xs:element name="dependency" type="dependencyType">
+            <xs:annotation>
+               <xs:documentation>
+                  <![CDATA[
+                  TODO: Description ...
+               ]]>
+               </xs:documentation>
+            </xs:annotation>
+         </xs:element>
+      </xs:choice>
+   </xs:complexType>
+
+   <xs:complexType name="dependencyType">
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="import-services" type="xs:boolean" use="optional" default="false"/>
+   </xs:complexType>
+
+</xs:schema>

Added: portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,275 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7;
+
+import junit.framework.Assert;
+import org.gatein.integration.jboss.as7.support.AbstractParsingTest;
+import org.gatein.integration.jboss.as7.support.KernelServices;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.PathElement;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.Property;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * @author <a href="mailto:mstrukel at redhat.com">Marko Strukelj</a>
+ */
+public class SubsystemParsingTestCase extends AbstractParsingTest
+{
+   static enum Archive
+   {
+      GATEIN("gatein.ear"),
+      GATEIN_SAMPLE_EXTENSION("gatein-sample-extension.ear"),
+      GATEIN_SAMPLE_PORTAL("gatein-sample-portal.ear"),
+      GATEIN_SAMPLE_SKIN("gatein-sample-skin.war");
+
+      private String archive;
+
+      public String getLocalName()
+      {
+         return archive;
+      }
+
+      private Archive(String name)
+      {
+         archive = name;
+      }
+   }
+
+   static enum Module
+   {
+      ORG_GATEIN_LIB("org.gatein.lib"),
+      ORG_GATEIN_WCI("org.gatein.wci"),
+      JAVAX_PORTLET_API("javax.portlet.api");
+
+      private String module;
+
+      public String getLocalName()
+      {
+         return module;
+      }
+
+      private Module(String name)
+      {
+         module = name;
+      }
+   }
+
+   /**
+    * Tests that the xml is parsed into the correct operations
+    */
+   @Test
+   public void testParseSubsystem() throws Exception
+   {
+      //Parse the subsystem xml
+      String subsystemXml =
+            "<subsystem xmlns=\"" + GateInExtension.NAMESPACE + "\">\n" +
+                  "   <deployment-archives>\n" +
+                  "      <archive name=\"" + Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
+                  "   </deployment-archives>\n" +
+                  "   <portlet-war-dependencies>\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\" />\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
+                  "      <dependency name=\"" + Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
+                  "   </portlet-war-dependencies>\n" +
+                  "</subsystem>";
+
+      List<ModelNode> operations = super.parse(subsystemXml);
+
+      ///Check that we have the expected number of operations
+      Assert.assertEquals(1, operations.size());
+
+      //Check that the operation has correct content
+      //Add subsystem operation is what we expect
+      ModelNode addSubsystem = operations.get(0);
+      Assert.assertEquals(ADD, addSubsystem.get(OP).asString());
+      PathAddress addr = PathAddress.pathAddress(addSubsystem.get(OP_ADDR));
+      Assert.assertEquals(1, addr.size());
+      PathElement element = addr.getElement(0);
+      Assert.assertEquals(SUBSYSTEM, element.getKey());
+      Assert.assertEquals(GateInExtension.SUBSYSTEM_NAME, element.getValue());
+
+      //We expect to have deployment-archives node set
+      ModelNode deploymentArchives = addSubsystem.get(Constants.DEPLOYMENT_ARCHIVES);
+      Assert.assertNotNull(Constants.DEPLOYMENT_ARCHIVES, deploymentArchives);
+
+      List<Property> archives = deploymentArchives.asPropertyList();
+      Assert.assertEquals(Archive.GATEIN.getLocalName(), archives.get(0).getName());
+      Assert.assertEquals(Constants.MAIN, archives.get(0).getValue().asPropertyList().get(0).getName());
+      Assert.assertEquals(1, archives.get(0).getValue().asPropertyList().size());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_EXTENSION.getLocalName(), archives.get(1).getName());
+      Assert.assertFalse(archives.get(1).getValue().isDefined());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_PORTAL.getLocalName(), archives.get(2).getName());
+      Assert.assertFalse(archives.get(2).getValue().isDefined());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_SKIN.getLocalName(), archives.get(3).getName());
+      Assert.assertFalse(archives.get(3).getValue().isDefined());
+
+
+      ModelNode portletWarDependencies = addSubsystem.get(Constants.PORTLET_WAR_DEPENDENCIES);
+      Assert.assertNotNull(Constants.PORTLET_WAR_DEPENDENCIES, portletWarDependencies);
+
+      List<Property> modules = portletWarDependencies.asPropertyList();
+      Assert.assertEquals(Module.ORG_GATEIN_LIB.getLocalName(), modules.get(0).getName());
+      Assert.assertEquals(Module.ORG_GATEIN_WCI.getLocalName(), modules.get(1).getName());
+      Assert.assertEquals(Module.JAVAX_PORTLET_API.getLocalName(), modules.get(2).getName());
+   }
+
+   /**
+    * Test that the model created from the xml looks as expected
+    */
+
+   @Test
+   public void testInstallIntoController() throws Exception
+   {
+      //Parse the subsystem xml and install into the controller
+      String subsystemXml =
+            "<subsystem xmlns=\"" + GateInExtension.NAMESPACE + "\">\n" +
+                  "   <deployment-archives>\n" +
+                  "      <archive name=\"" + Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
+                  "   </deployment-archives>\n" +
+                  "   <portlet-war-dependencies>\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\" />\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
+                  "      <dependency name=\"" + Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
+                  "   </portlet-war-dependencies>\n" +
+                  "</subsystem>";
+      KernelServices services = super.installInController(subsystemXml);
+
+      //Read the whole model and make sure it looks as expected
+      ModelNode model = services.readWholeModel();
+      //Useful for debugging :-)
+      //System.out.println(model);
+
+      Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(GateInExtension.SUBSYSTEM_NAME));
+      model = model.get(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME);
+
+      //We expect to have deployment-archives node set
+      ModelNode deploymentArchives = model.get(Constants.DEPLOYMENT_ARCHIVES);
+      Assert.assertNotNull(Constants.DEPLOYMENT_ARCHIVES, deploymentArchives);
+
+      List<Property> archives = deploymentArchives.asPropertyList();
+      Assert.assertEquals(Archive.GATEIN.getLocalName(), archives.get(0).getName());
+      Assert.assertEquals(Constants.MAIN, archives.get(0).getValue().asPropertyList().get(0).getName());
+      Assert.assertEquals(1, archives.get(0).getValue().asPropertyList().size());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_EXTENSION.getLocalName(), archives.get(1).getName());
+      Assert.assertFalse(archives.get(1).getValue().isDefined());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_PORTAL.getLocalName(), archives.get(2).getName());
+      Assert.assertFalse(archives.get(2).getValue().isDefined());
+
+      Assert.assertEquals(Archive.GATEIN_SAMPLE_SKIN.getLocalName(), archives.get(3).getName());
+      Assert.assertFalse(archives.get(3).getValue().isDefined());
+
+
+      ModelNode portletWarDependencies = model.get(Constants.PORTLET_WAR_DEPENDENCIES);
+      Assert.assertNotNull(Constants.PORTLET_WAR_DEPENDENCIES, portletWarDependencies);
+
+      List<Property> modules = portletWarDependencies.asPropertyList();
+      Assert.assertEquals(Module.ORG_GATEIN_LIB.getLocalName(), modules.get(0).getName());
+      Assert.assertEquals(Module.ORG_GATEIN_WCI.getLocalName(), modules.get(1).getName());
+      Assert.assertEquals(Module.JAVAX_PORTLET_API.getLocalName(), modules.get(2).getName());
+   }
+
+   /**
+    * Starts a controller with a given subsystem xml and then checks that a second
+    * controller started with the xml marshalled from the first one results in the same model
+    */
+
+   @Test
+   public void testParseAndMarshalModel() throws Exception
+   {
+      //Parse the subsystem xml and install into the first controller
+      String subsystemXml =
+            "<subsystem xmlns=\"" + GateInExtension.NAMESPACE + "\">\n" +
+                  "   <deployment-archives>\n" +
+                  "      <archive name=\"" + Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
+                  "      <archive name=\"" + Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
+                  "   </deployment-archives>\n" +
+                  "   <portlet-war-dependencies>\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\" />\n" +
+                  "      <dependency name=\"" + Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
+                  "      <dependency name=\"" + Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
+                  "   </portlet-war-dependencies>\n" +
+                  "</subsystem>";
+
+      KernelServices servicesA = super.installInController(subsystemXml);
+      //Get the model and the persisted xml from the first controller
+      ModelNode modelA = servicesA.readWholeModel();
+      String marshalled = servicesA.getPersistedSubsystemXml();
+
+      //Install the persisted xml from the first controller into a second controller
+      KernelServices servicesB = super.installInController(marshalled);
+      ModelNode modelB = servicesB.readWholeModel();
+
+      //Make sure the models from the two controllers are identical
+      super.compare(modelA, modelB);
+   }
+
+   /**
+    * Starts a controller with the given subsystem xml and then checks that a second
+    * controller started with the operations from its describe action results in the same model
+    */
+
+   @Test
+   public void testDescribeHandler() throws Exception
+   {
+      //Parse the subsystem xml and install into the first controller
+      String subsystemXml =
+            "<subsystem xmlns=\"" + GateInExtension.NAMESPACE + "\">" +
+                  "</subsystem>";
+      KernelServices servicesA = super.installInController(subsystemXml);
+      //Get the model and the describe operations from the first controller
+      ModelNode modelA = servicesA.readWholeModel();
+      ModelNode describeOp = new ModelNode();
+      describeOp.get(OP).set(DESCRIBE);
+      describeOp.get(OP_ADDR).set(
+            PathAddress.pathAddress(
+                  PathElement.pathElement(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME)).toModelNode());
+      List<ModelNode> operations = super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
+
+
+      //Install the describe options from the first controller into a second controller
+      KernelServices servicesB = super.installInController(operations);
+      ModelNode modelB = servicesB.readWholeModel();
+
+      //Make sure the models from the two controllers are identical
+      super.compare(modelA, modelB);
+   }
+
+   /* TODO: test invalid configuration detection */
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AbstractParsingTest.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AbstractParsingTest.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AbstractParsingTest.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,523 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.support;
+
+import junit.framework.Assert;
+import junit.framework.AssertionFailedError;
+import org.gatein.integration.jboss.as7.GateInExtension;
+import org.jboss.as.controller.AbstractControllerService;
+import org.jboss.as.controller.ControlledProcessState;
+import org.jboss.as.controller.ExtensionContext;
+import org.jboss.as.controller.ExtensionContextImpl;
+import org.jboss.as.controller.ModelController;
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.common.CommonProviders;
+import org.jboss.as.controller.operations.common.Util;
+import org.jboss.as.controller.operations.global.GlobalOperationHandlers;
+import org.jboss.as.controller.parsing.Element;
+import org.jboss.as.controller.parsing.ExtensionParsingContext;
+import org.jboss.as.controller.parsing.Namespace;
+import org.jboss.as.controller.parsing.ParseUtils;
+import org.jboss.as.controller.persistence.AbstractConfigurationPersister;
+import org.jboss.as.controller.persistence.ConfigurationPersistenceException;
+import org.jboss.as.controller.persistence.ModelMarshallingContext;
+import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.as.controller.registry.Resource;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.jboss.dmr.Property;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceContainer;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.staxmapper.XMLElementReader;
+import org.jboss.staxmapper.XMLElementWriter;
+import org.jboss.staxmapper.XMLExtendedStreamReader;
+import org.jboss.staxmapper.XMLExtendedStreamWriter;
+import org.jboss.staxmapper.XMLMapper;
+import org.junit.After;
+import org.junit.Before;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.ByteArrayOutputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.jboss.as.controller.parsing.ParseUtils.unexpectedElement;
+
+/**
+ * The base class for parsing tests which does the work of setting up the environment for parsing
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public class AbstractParsingTest
+{
+
+   private final String TEST_NAMESPACE = "urn.org.jboss.test:1.0";
+
+   private ExtensionParsingContextImpl parsingContext;
+
+   private List<KernelServices> kernelServices = new ArrayList<KernelServices>();
+
+   private final AtomicInteger counter = new AtomicInteger();
+
+   @Before
+   public void initializeParser() throws Exception
+   {
+      //Initialize the parser
+      XMLMapper mapper = XMLMapper.Factory.create();
+      mapper.registerRootElement(new QName(TEST_NAMESPACE, "test"), TestParser.INSTANCE);
+      GateInExtension extension = new GateInExtension();
+      parsingContext = new ExtensionParsingContextImpl(mapper);
+      extension.initializeParsers(parsingContext);
+   }
+
+   @After
+   public void cleanup() throws Exception
+   {
+      for (KernelServices kernelServices : this.kernelServices)
+      {
+         try
+         {
+            kernelServices.shutdown();
+         }
+         catch (Exception e)
+         {
+         }
+      }
+      kernelServices.clear();
+      parsingContext = null;
+   }
+
+   /**
+    * Parse the subsystem xml and create the operations that will be passed into the controller
+    *
+    * @param subsystemXml the subsystem xml to be parsed
+    * @return the created operations
+    */
+   protected List<ModelNode> parse(String subsystemXml) throws XMLStreamException
+   {
+      return parse(null, subsystemXml);
+   }
+
+   /**
+    * Parse the subsystem xml and create the operations that will be passed into the controller
+    *
+    * @param allows       Additional steps that should be done to the controller before initializing our extension
+    * @param subsystemXml the subsystem xml to be parsed
+    * @return the created operations
+    */
+   protected List<ModelNode> parse(AdditionalParsers additionalParsers, String subsystemXml) throws XMLStreamException
+   {
+      if (additionalParsers != null)
+      {
+         additionalParsers.addParsers(parsingContext);
+      }
+
+      String xml = "<test xmlns=\"" + TEST_NAMESPACE + "\">" +
+            subsystemXml +
+            "</test>";
+      final XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xml));
+      final List<ModelNode> operationList = new ArrayList<ModelNode>();
+      parsingContext.getMapper().parseDocument(operationList, reader);
+      return operationList;
+   }
+
+   /**
+    * Initializes the controller and populates the subsystem model from the passed in xml
+    *
+    * @param subsystemXml the subsystem xml to be parsed
+    * @return the kernel services allowing access to the controller and service container
+    */
+   protected KernelServices installInController(String subsystemXml) throws Exception
+   {
+      return installInController(null, subsystemXml);
+   }
+
+   /**
+    * Initializes the controller and populates the subsystem model from the passed in xml
+    *
+    * @param additionalInit Additional initialization that should be done to the parsers, controller and service container before initializing our extension
+    * @param subsystemXml   the subsystem xml to be parsed
+    * @return the kernel services allowing access to the controller and service container
+    */
+   protected KernelServices installInController(AdditionalInitialization additionalInit, String subsystemXml) throws Exception
+   {
+      List<ModelNode> operations = parse(additionalInit, subsystemXml);
+      KernelServices services = installInController(additionalInit, operations);
+      return services;
+   }
+
+   /**
+    * Create a new controller with the passed in operations
+    *
+    * @param bootOperations the operations
+    */
+   protected KernelServices installInController(List<ModelNode> bootOperations) throws Exception
+   {
+      return installInController(null, bootOperations);
+   }
+
+   /**
+    * Create a new controller with the passed in operations
+    *
+    * @param bootOperations the operations
+    */
+   protected KernelServices installInController(AdditionalInitialization additionalInit, List<ModelNode> bootOperations) throws Exception
+   {
+      //Initialize the controller
+      ServiceContainer container = ServiceContainer.Factory.create("test" + counter.incrementAndGet());
+      ServiceTarget target = container.subTarget();
+      ControlledProcessState processState = new ControlledProcessState(true);
+      StringConfigurationPersister persister = new StringConfigurationPersister(bootOperations, TestParser.INSTANCE);
+      ModelControllerService svc = new ModelControllerService(additionalInit, processState, persister);
+      ServiceBuilder<ModelController> builder = target.addService(ServiceName.of("ModelController"), svc);
+      builder.install();
+
+      if (additionalInit != null)
+      {
+         additionalInit.addExtraServices(target);
+      }
+
+      //sharedState = svc.state;
+      svc.latch.await();
+      ModelController controller = svc.getValue();
+      ModelNode setup = Util.getEmptyOperation("setup", new ModelNode());
+      controller.execute(setup, null, null, null);
+      processState.setRunning();
+
+      KernelServices kernelServices = new KernelServices(container, controller, persister);
+      this.kernelServices.add(kernelServices);
+      return kernelServices;
+   }
+
+
+   /**
+    * Checks that the result was successful and gets the real result contents
+    *
+    * @param result the result to check
+    * @return the result contents
+    */
+   protected static ModelNode checkResultAndGetContents(ModelNode result)
+   {
+      Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString());
+      Assert.assertTrue(result.hasDefined(RESULT));
+      return result.get(RESULT);
+   }
+
+   /**
+    * Compares two models to make sure that they are the same
+    *
+    * @param node1 the first model
+    * @param node2 the second model
+    * @throws junit.framework.AssertionFailedError
+    *          if the models were not the same
+    */
+   protected void compare(ModelNode node1, ModelNode node2)
+   {
+      Assert.assertEquals(node1.getType(), node2.getType());
+      if (node1.getType() == ModelType.OBJECT)
+      {
+         final Set<String> keys1 = node1.keys();
+         final Set<String> keys2 = node2.keys();
+         Assert.assertEquals(node1 + "\n" + node2, keys1.size(), keys2.size());
+
+         for (String key : keys1)
+         {
+            final ModelNode child1 = node1.get(key);
+            Assert.assertTrue("Missing: " + key + "\n" + node1 + "\n" + node2, node2.has(key));
+            final ModelNode child2 = node2.get(key);
+            if (child1.isDefined())
+            {
+               Assert.assertTrue(child1.toString(), child2.isDefined());
+               compare(child1, child2);
+            }
+            else
+            {
+               Assert.assertFalse(child2.asString(), child2.isDefined());
+            }
+         }
+      }
+      else if (node1.getType() == ModelType.LIST)
+      {
+         List<ModelNode> list1 = node1.asList();
+         List<ModelNode> list2 = node2.asList();
+         Assert.assertEquals(list1 + "\n" + list2, list1.size(), list2.size());
+
+         for (int i = 0; i < list1.size(); i++)
+         {
+            compare(list1.get(i), list2.get(i));
+         }
+
+      }
+      else if (node1.getType() == ModelType.PROPERTY)
+      {
+         Property prop1 = node1.asProperty();
+         Property prop2 = node2.asProperty();
+         Assert.assertEquals(prop1 + "\n" + prop2, prop1.getName(), prop2.getName());
+         compare(prop1.getValue(), prop2.getValue());
+
+      }
+      else
+      {
+         try
+         {
+            Assert.assertEquals("\n\"" + node1.asString() + "\"\n\"" + node2.asString() + "\"\n-----", node2.asString().trim(), node1.asString().trim());
+         }
+         catch (AssertionFailedError error)
+         {
+            throw error;
+         }
+      }
+   }
+
+
+   private final class ExtensionParsingContextImpl implements ExtensionParsingContext
+   {
+      private final XMLMapper mapper;
+
+      public ExtensionParsingContextImpl(XMLMapper mapper)
+      {
+         this.mapper = mapper;
+      }
+
+      @Override
+      public void setSubsystemXmlMapping(final String namespaceUri, final XMLElementReader<List<ModelNode>> reader)
+      {
+         mapper.registerRootElement(new QName(namespaceUri, SUBSYSTEM), reader);
+      }
+
+      @Override
+      public void setDeploymentXmlMapping(final String namespaceUri, final XMLElementReader<ModelNode> reader)
+      {
+      }
+
+      private XMLMapper getMapper()
+      {
+         return mapper;
+      }
+   }
+
+
+   private static final class TestParser implements XMLStreamConstants, XMLElementReader<List<ModelNode>>, XMLElementWriter<ModelMarshallingContext>
+   {
+
+      private static final TestParser INSTANCE = new TestParser();
+
+      private TestParser()
+      {
+
+      }
+
+      @Override
+      public void writeContent(XMLExtendedStreamWriter writer, ModelMarshallingContext context) throws XMLStreamException
+      {
+         String defaultNamespace = writer.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
+         try
+         {
+            ModelNode subsystem = context.getModelNode().get(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME);
+            XMLElementWriter<SubsystemMarshallingContext> subsystemWriter = context.getSubsystemWriter(GateInExtension.SUBSYSTEM_NAME);
+            if (subsystemWriter != null)
+            {
+               subsystemWriter.writeContent(writer, new SubsystemMarshallingContext(subsystem, writer));
+            }
+         }
+         finally
+         {
+            writer.setDefaultNamespace(defaultNamespace);
+         }
+         writer.writeEndDocument();
+      }
+
+      @Override
+      public void readElement(XMLExtendedStreamReader reader, List<ModelNode> operations) throws XMLStreamException
+      {
+
+         ParseUtils.requireNoAttributes(reader);
+         while (reader.hasNext() && reader.nextTag() != END_ELEMENT)
+         {
+            if (Namespace.forUri(reader.getNamespaceURI()) != Namespace.UNKNOWN)
+            {
+               throw unexpectedElement(reader);
+            }
+            if (Element.forName(reader.getLocalName()) != Element.SUBSYSTEM)
+            {
+               throw unexpectedElement(reader);
+            }
+            reader.handleAny(operations);
+         }
+      }
+   }
+
+   private static class ModelControllerService extends AbstractControllerService
+   {
+
+      final AtomicBoolean state = new AtomicBoolean(true);
+      final CountDownLatch latch = new CountDownLatch(1);
+      final StringConfigurationPersister persister;
+      final AdditionalInitialization additionalInit;
+
+      ModelControllerService(final AdditionalInitialization additionalPreStep, final ControlledProcessState processState, final StringConfigurationPersister persister)
+      {
+         super(OperationContext.Type.SERVER, persister, processState, DESC_PROVIDER, null);
+         this.persister = persister;
+         this.additionalInit = additionalPreStep;
+      }
+
+      @Override
+      protected void initModel(Resource rootResource, ManagementResourceRegistration rootRegistration)
+      {
+         rootResource.getModel().get(SUBSYSTEM);
+         rootRegistration.registerOperationHandler(READ_RESOURCE_OPERATION, GlobalOperationHandlers.READ_RESOURCE, CommonProviders.READ_RESOURCE_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_ATTRIBUTE_OPERATION, GlobalOperationHandlers.READ_ATTRIBUTE, CommonProviders.READ_ATTRIBUTE_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_RESOURCE_DESCRIPTION_OPERATION, GlobalOperationHandlers.READ_RESOURCE_DESCRIPTION, CommonProviders.READ_RESOURCE_DESCRIPTION_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_CHILDREN_NAMES_OPERATION, GlobalOperationHandlers.READ_CHILDREN_NAMES, CommonProviders.READ_CHILDREN_NAMES_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_CHILDREN_TYPES_OPERATION, GlobalOperationHandlers.READ_CHILDREN_TYPES, CommonProviders.READ_CHILDREN_TYPES_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_CHILDREN_RESOURCES_OPERATION, GlobalOperationHandlers.READ_CHILDREN_RESOURCES, CommonProviders.READ_CHILDREN_RESOURCES_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_OPERATION_NAMES_OPERATION, GlobalOperationHandlers.READ_OPERATION_NAMES, CommonProviders.READ_OPERATION_NAMES_PROVIDER, true);
+         rootRegistration.registerOperationHandler(READ_OPERATION_DESCRIPTION_OPERATION, GlobalOperationHandlers.READ_OPERATION_DESCRIPTION, CommonProviders.READ_OPERATION_PROVIDER, true);
+         rootRegistration.registerOperationHandler(WRITE_ATTRIBUTE_OPERATION, GlobalOperationHandlers.WRITE_ATTRIBUTE, CommonProviders.WRITE_ATTRIBUTE_PROVIDER, true);
+
+         ExtensionContext context = new ExtensionContextImpl(rootRegistration, null, persister);
+         if (additionalInit != null)
+         {
+            additionalInit.initializeExtraSubystemsAndModel(context, rootResource, rootRegistration);
+         }
+         GateInExtension extension = new GateInExtension();
+         extension.initialize(context);
+      }
+
+      @Override
+      protected void boot(List<ModelNode> bootOperations) throws ConfigurationPersistenceException
+      {
+         super.boot(persister.bootOperations);
+         latch.countDown();
+      }
+
+      @Override
+      public void start(StartContext context) throws StartException
+      {
+         super.start(context);
+      }
+   }
+
+   private static final DescriptionProvider DESC_PROVIDER = new DescriptionProvider()
+   {
+      @Override
+      public ModelNode getModelDescription(Locale locale)
+      {
+         ModelNode model = new ModelNode();
+         model.get(DESCRIPTION).set("The test model controller");
+         return model;
+      }
+   };
+
+   static class StringConfigurationPersister extends AbstractConfigurationPersister
+   {
+
+      private final List<ModelNode> bootOperations;
+      volatile String marshalled;
+
+      public StringConfigurationPersister(List<ModelNode> bootOperations, XMLElementWriter<ModelMarshallingContext> rootDeparser)
+      {
+         super(rootDeparser);
+         this.bootOperations = bootOperations;
+      }
+
+      @Override
+      public PersistenceResource store(ModelNode model, Set<PathAddress> affectedAddresses)
+            throws ConfigurationPersistenceException
+      {
+         return new StringPersistenceResource(model, this);
+      }
+
+      @Override
+      public List<ModelNode> load() throws ConfigurationPersistenceException
+      {
+         return bootOperations;
+      }
+
+      private class StringPersistenceResource implements PersistenceResource
+      {
+
+         private byte[] bytes;
+         private final AbstractConfigurationPersister persister;
+
+         StringPersistenceResource(final ModelNode model, final AbstractConfigurationPersister persister) throws ConfigurationPersistenceException
+         {
+            this.persister = persister;
+            ByteArrayOutputStream output = new ByteArrayOutputStream(1024 * 8);
+            try
+            {
+               try
+               {
+                  persister.marshallAsXml(model, output);
+               }
+               finally
+               {
+                  try
+                  {
+                     output.close();
+                  }
+                  catch (Exception ignore)
+                  {
+                  }
+                  bytes = output.toByteArray();
+               }
+            }
+            catch (Exception e)
+            {
+               throw new ConfigurationPersistenceException("Failed to marshal configuration", e);
+            }
+         }
+
+         @Override
+         public void commit()
+         {
+            StringConfigurationPersister.this.marshalled = new String(bytes);
+         }
+
+         @Override
+         public void rollback()
+         {
+            marshalled = null;
+         }
+      }
+   }
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalInitialization.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalInitialization.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalInitialization.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.support;
+
+import org.jboss.as.controller.ExtensionContext;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.as.controller.registry.Resource;
+import org.jboss.msc.service.ServiceTarget;
+
+/**
+ * Allows you to additionally initialize the service container and the model controller
+ * <p/>
+ * beyond the subsystem being tested
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public interface AdditionalInitialization extends AdditionalParsers
+{
+
+   /**
+    * Adds extra services to the service controller
+    *
+    * @param target the service controller target
+    */
+   void addExtraServices(ServiceTarget target);
+
+
+   /**
+    * Allows extra initialization of the model and addition of extra subsystems
+    *
+    * @param context          allows installation of extra subsystem extensions, call {@code extension.initialize(context)} for each extra extension you have
+    * @param rootResource     the root model resource which allows you to for example add child elements to the model
+    * @param rootRegistration the root resource registration which allows you to for example add additional operations to the model
+    */
+   void initializeExtraSubystemsAndModel(ExtensionContext context, Resource rootResource, ManagementResourceRegistration rootRegistration);
+
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalParsers.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalParsers.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/AdditionalParsers.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.support;
+
+import org.jboss.as.controller.parsing.ExtensionParsingContext;
+
+/**
+ * Allows you to additionally initialize the parsers
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public interface AdditionalParsers
+{
+   /**
+    * Allows you to add subsystems parsers
+    *
+    * @param context the extension parsing context to add your subsystem parser to
+    */
+   void addParsers(ExtensionParsingContext context);
+}

Added: portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/KernelServices.java
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/KernelServices.java	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/KernelServices.java	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.integration.jboss.as7.support;
+
+import org.gatein.integration.jboss.as7.support.AbstractParsingTest.StringConfigurationPersister;
+import org.jboss.as.controller.ModelController;
+import org.jboss.as.controller.ModelController.OperationTransactionControl;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceContainer;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+
+/**
+ * Allows access to the service container and the model controller
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public class KernelServices
+{
+
+   private final ServiceContainer container;
+   private final ModelController controller;
+   private final StringConfigurationPersister persister;
+
+   KernelServices(ServiceContainer container, ModelController controller, StringConfigurationPersister persister)
+   {
+      this.container = container;
+      this.controller = controller;
+      this.persister = persister;
+   }
+
+   /**
+    * Gets the service container
+    *
+    * @return the service container
+    */
+   public ServiceContainer getContainer()
+   {
+      return container;
+   }
+
+   /**
+    * Execute an operation in the model controller
+    *
+    * @param operation the operation to execute
+    * @return the result of the operation
+    */
+   public ModelNode executeOperation(ModelNode operation)
+   {
+      return controller.execute(operation, null, OperationTransactionControl.COMMIT, null);
+   }
+
+   /**
+    * Reads the persisted subsystem xml
+    *
+    * @return the xml
+    */
+   public String getPersistedSubsystemXml()
+   {
+      return persister.marshalled;
+   }
+
+   /**
+    * Reads the whole model from the model controller
+    *
+    * @return the whole model
+    */
+   public ModelNode readWholeModel()
+   {
+      ModelNode op = new ModelNode();
+      op.get(OP).set(READ_RESOURCE_OPERATION);
+      op.get(OP_ADDR).set(PathAddress.EMPTY_ADDRESS.toModelNode());
+      op.get(RECURSIVE).set(true);
+      ModelNode result = executeOperation(op);
+      return AbstractParsingTest.checkResultAndGetContents(result);
+   }
+
+   void shutdown()
+   {
+      if (container != null)
+      {
+         container.shutdown();
+         try
+         {
+            container.awaitTermination(5, TimeUnit.SECONDS);
+         }
+         catch (InterruptedException e)
+         {
+            e.printStackTrace();
+         }
+      }
+   }
+}

Added: portal/trunk/packaging/jboss-as7/modules/build.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/build.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/build.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,287 @@
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2010, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<project name="module-repository" basedir="." default="modules">
+
+    <property name="output.dir" value="target/jboss-as-${version.jboss.as.release}"/>
+
+    <import file="lib.xml"/>
+
+    <target name="copy-files">
+        <copy todir="${output.dir}">
+            <fileset dir="src/main/resources">
+                <include name="bin/**"/>
+            </fileset>
+            <fileset dir="src/main/resources">
+                <include name="domain/**"/>
+            </fileset>
+            <fileset dir="src/main/resources">
+                <include name="standalone/**"/>
+            </fileset>
+        </copy>
+        <!--chmod perm="+x">
+            <fileset dir="${output.dir}/bin">
+                <include name="**/*.sh"/>
+            </fileset>
+        </chmod-->
+    </target>
+
+    <target name="make-dirs">
+        <mkdir dir="${output.dir}/domain/content"/>
+        <mkdir dir="${output.dir}/standalone/lib/ext"/>
+        <mkdir dir="${output.dir}/domain/lib/ext"/>
+    </target>
+
+    <target name="modules">
+
+        <!--copy file="${org.jboss.modules:jboss-modules:jar}" tofile="${output.dir}/jboss-modules.jar"/-->
+
+        <!--
+          ~ Complete list of modules to assemble.
+          ~
+          ~ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+          ~ +++++++   KEEP THIS LIST ALPHABETICAL BY MODULE NAME!   +++++++
+          ~ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+          -->
+        <module-def name="org.gatein">
+            <maven-resource group="org.exoplatform.portal" artifact="jboss-as7-integration-extension" />
+        </module-def>
+
+        <module-def name="org.gatein.lib">
+           <!-- maven-resource group="javax.activation" artifact="activation" / -->
+           <maven-resource group="aopalliance" artifact="aopalliance" />
+           <maven-resource group="asm" artifact="asm" />
+           <maven-resource group="bouncycastle" artifact="bcmail-jdk14" />
+           <maven-resource group="bouncycastle" artifact="bcprov-jdk14" />
+           <maven-resource group="caja" artifact="caja" />
+           <maven-resource group="org.chromattic" artifact="chromattic.api" />
+           <maven-resource group="org.chromattic" artifact="chromattic.apt" />
+           <maven-resource group="org.chromattic" artifact="chromattic.common" />
+           <maven-resource group="org.chromattic" artifact="chromattic.core" />
+           <maven-resource group="org.chromattic" artifact="chromattic.ext" />
+           <maven-resource group="org.chromattic" artifact="chromattic.metamodel" />
+           <maven-resource group="org.chromattic" artifact="chromattic.spi" />
+           <maven-resource group="com.google.javascript" artifact="closure-compiler" />
+           <!--maven-resource group="org.gatein.common" artifact="common-common" /-->
+           <!--maven-resource group="org.gatein.common" artifact="common-logging" /-->
+           <maven-resource group="commons-beanutils" artifact="commons-beanutils" />
+           <maven-resource group="commons-chain" artifact="commons-chain" />
+           <maven-resource group="commons-codec" artifact="commons-codec" />
+           <maven-resource group="commons-dbcp" artifact="commons-dbcp" />
+           <maven-resource group="commons-digester" artifact="commons-digester" />
+           <maven-resource group="commons-fileupload" artifact="commons-fileupload" />
+           <maven-resource group="commons-httpclient" artifact="commons-httpclient" />
+           <maven-resource group="commons-io" artifact="commons-io" />
+           <maven-resource group="commons-lang" artifact="commons-lang" />
+           <maven-resource group="commons-pool" artifact="commons-pool" />
+           <maven-resource group="oswego-concurrent" artifact="concurrent" />
+           <maven-resource group="net.sf.ehcache" artifact="ehcache" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.database" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.document" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.ldap" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.organization.api" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.organization.jdbc" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.organization.ldap" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.security.core" />
+           <maven-resource group="org.exoplatform.core" artifact="exo.core.component.xml-processing" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.component.core" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.component.ext" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.component.ftp" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.component.webdav" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.framework.command" />
+           <maven-resource group="org.exoplatform.jcr" artifact="exo.jcr.framework.web" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.commons" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.component.cache" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.component.command" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.component.common" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.component.ext.cache.impl.jboss.v3" />
+           <maven-resource group="org.exoplatform.kernel" artifact="exo.kernel.container" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.application-registry" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.common" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.identity" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.management" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.pc" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.portal" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.resources" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.scripting" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.web.api" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.web.controller" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.web.resources" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.web.security" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.component.web.server" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.gadgets-core" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.core" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.dashboard" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.eXo" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.framework" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.portal" />
+           <maven-resource group="org.exoplatform.portal" artifact="exo.portal.webui.portlet" />
+           <maven-resource group="org.exoplatform.ws" artifact="exo.ws.commons" />
+           <maven-resource group="org.exoplatform.ws" artifact="exo.ws.frameworks.json" />
+           <maven-resource group="org.exoplatform.ws" artifact="exo.ws.frameworks.servlet" />
+           <maven-resource group="org.exoplatform.ws" artifact="exo.ws.rest.core" />
+           <maven-resource group="org.exoplatform.ws" artifact="exo.ws.rest.ext" />
+           <maven-resource group="com.jhlabs" artifact="filters" />
+           <maven-resource group="org.gatein.management" artifact="gatein-management-api" />
+           <maven-resource group="org.gatein.management" artifact="gatein-management-spi" />
+           <maven-resource group="org.gatein.management" artifact="gatein-management-core" />
+           <maven-resource group="org.gatein.management" artifact="gatein-management-rest" />
+           <maven-resource group="org.codehaus.groovy" artifact="groovy-all" />
+           <maven-resource group="com.google.guava" artifact="guava" />
+           <maven-resource group="com.google.inject" artifact="guice" />
+           <maven-resource group="com.google.inject.extensions" artifact="guice-jmx" />
+           <maven-resource group="com.google.inject.extensions" artifact="guice-multibindings" />
+           <maven-resource group="howl" artifact="howl-logger" />
+           <maven-resource group="org.htmlparser" artifact="htmlparser" />
+           <maven-resource group="com.ibm.icu" artifact="icu4j" />
+           <maven-resource group="org.jboss.cache" artifact="jbosscache-core" />
+           <!--maven-resource group="org.jboss.jbossts" artifact="jbossjts" /-->
+           <maven-resource group="jdom" artifact="jdom" />
+           <maven-resource group="org.jgroups" artifact="jgroups" />
+           <maven-resource group="org.jibx" artifact="jibx-bind" />
+           <maven-resource group="org.jibx" artifact="jibx-run" />
+           <maven-resource group="joda-time" artifact="joda-time" />
+           <maven-resource group="rhino" artifact="js" />
+           <maven-resource group="org.jsecurity" artifact="jsecurity" />
+           <maven-resource group="caja" artifact="json_simple" />
+           <maven-resource group="org.json" artifact="json" />
+           <maven-resource group="de.odysseus.juel" artifact="juel-impl" />
+           <maven-resource group="org.apache.lucene" artifact="lucene-core" />
+           <maven-resource group="org.apache.lucene" artifact="lucene-memory" />
+           <maven-resource group="org.apache.lucene" artifact="lucene-spellchecker" />
+           <maven-resource group="eu.medsea.mimeutil" artifact="mime-util" />
+           <maven-resource group="org.gatein.mop" artifact="mop-api" />
+           <maven-resource group="org.gatein.mop" artifact="mop-core" />
+           <maven-resource group="org.gatein.mop" artifact="mop-spi" />
+           <maven-resource group="net.sourceforge.nekohtml" artifact="nekohtml" />
+           <maven-resource group="net.oauth.core" artifact="oauth" />
+           <!--maven-resource group="org.gatein.pc" artifact="pc-api" /-->
+           <maven-resource group="org.gatein.pc" artifact="pc-bridge" />
+           <maven-resource group="org.gatein.pc" artifact="pc-controller" />
+           <maven-resource group="org.gatein.pc" artifact="pc-federation" />
+           <!--maven-resource group="org.gatein.pc" artifact="pc-portlet" /-->
+           <maven-resource group="org.apache.pdfbox" artifact="pdfbox" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-api" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-cache" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-common" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-core" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-hibernate" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-ldap" />
+           <maven-resource group="org.picketlink.idm" artifact="picketlink-idm-spi" />
+           <maven-resource group="picocontainer" artifact="picocontainer" />
+           <maven-resource group="org.apache.poi" artifact="poi" />
+           <maven-resource group="org.apache.poi" artifact="poi-ooxml" />
+           <maven-resource group="org.apache.poi" artifact="poi-scratchpad" />
+           <maven-resource group="org.apache.portals.bridges" artifact="portals-bridges-common" />
+           <maven-resource group="org.reflext" artifact="reflext.api" />
+           <maven-resource group="org.reflext" artifact="reflext.core" />
+           <maven-resource group="org.reflext" artifact="reflext.jlr" />
+           <maven-resource group="org.reflext" artifact="reflext.spi" />
+           <maven-resource group="rome" artifact="rome" />
+           <maven-resource group="org.apache.sanselan" artifact="sanselan" />
+           <maven-resource group="org.gatein.shindig" artifact="shindig-common" />
+           <maven-resource group="org.gatein.shindig" artifact="shindig-features" />
+           <maven-resource group="org.gatein.shindig" artifact="shindig-gadgets" />
+           <maven-resource group="org.gatein.shindig" artifact="shindig-social-api" />
+           <maven-resource group="org.gatein.captcha" artifact="simplecaptcha" />
+           <maven-resource group="org.apache.tika" artifact="tika-core" />
+           <maven-resource group="org.apache.tika" artifact="tika-parsers" />
+           <!--maven-resource group="org.gatein.wci" artifact="wci-exo" />
+           <maven-resource group="org.gatein.wci" artifact="wci-jboss7" />
+           <maven-resource group="org.gatein.wci" artifact="wci-wci" /-->
+           <maven-resource group="org.apache.ws.commons" artifact="ws-commons-util" />
+           <maven-resource group="com.experlog" artifact="xapool" />
+           <maven-resource group="org.apache.xmlbeans" artifact="xmlbeans" />
+           <maven-resource group="xpp3" artifact="xpp3" />
+           <maven-resource group="com.thoughtworks.xstream" artifact="xstream" />
+        </module-def>
+
+       <module-def name="org.gatein.wci">
+           <maven-resource group="org.gatein.wci" artifact="wci-jboss7" />
+           <maven-resource group="org.gatein.wci" artifact="wci-wci" />
+           <maven-resource group="org.gatein.wci" artifact="wci-exo" />
+       </module-def>
+
+       <module-def name="org.gatein.common">
+           <maven-resource group="org.gatein.common" artifact="common-common" />
+           <maven-resource group="org.gatein.common" artifact="common-logging" />
+       </module-def>
+
+       <module-def name="org.gatein.pc">
+           <maven-resource group="org.gatein.pc" artifact="pc-api" />
+           <maven-resource group="org.gatein.pc" artifact="pc-portlet" />
+       </module-def>
+
+       <module-def name="org.gatein.naming">
+           <maven-resource group="org.gatein.naming" artifact="gatein-naming" />
+       </module-def>
+
+       <module-def name="org.hibernate" slot="gatein">
+           <maven-resource group="org.hibernate" artifact="hibernate-commons-annotations" />
+           <maven-resource group="org.hibernate" artifact="hibernate-core" />
+           <maven-resource group="org.hibernate" artifact="hibernate-annotations" />
+           <maven-resource group="org.hibernate" artifact="ejb3-persistence" />
+           <!--maven-resource group="org.hibernate" artifact="hibernate-entitymanager" /-->
+           <!--maven-resource group="org.hibernate.javax.persistence" artifact="hibernate-jpa-2.0-api" /-->
+           <!--maven-resource group="org.hibernate" artifact="hibernate-validator" /-->
+           <!--maven-resource group="org.hibernate" artifact="hibernate-validator-legacy" /-->
+       </module-def>
+
+       <module-def name="org.staxnav">
+           <maven-resource group="org.staxnav" artifact="staxnav.core" />
+       </module-def>
+
+       <module-def name="javax.portlet.api">
+           <maven-resource group="javax.portlet" artifact="portlet-api" />
+       </module-def>
+
+       <module-def name="javax.ccpp.api">
+           <maven-resource group="javax.ccpp" artifact="ccpp" />
+       </module-def>
+
+       <module-def name="javax.jcr.api">
+           <maven-resource group="javax.jcr" artifact="jcr" />
+       </module-def>
+
+       <module-def name="org.slf4j" slot="gatein">
+           <maven-resource group="org.slf4j" artifact="slf4j-api" />
+           <maven-resource group="org.jboss.slf4j" artifact="slf4j-jboss-logmanager" />
+       </module-def>
+
+       <module-def name="sun.jdk.xml">
+       </module-def>
+
+       <module-def name="org.hsqldb">
+           <maven-resource group="hsqldb" artifact="hsqldb" />
+       </module-def>
+    </target>
+
+    <target name="clean-target">
+        <delete dir="${output.dir}"/>
+    </target>
+
+    <target name="clean" depends="clean-target">
+        <delete file="maven-ant-tasks.jar"/>
+    </target>
+
+    <target name="all" depends="clean-target, modules, copy-files, make-dirs"/>
+</project>

Added: portal/trunk/packaging/jboss-as7/modules/lib.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/lib.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/lib.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,144 @@
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2010, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<project name="module-repository-lib" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+    
+    <property name="src.dir" value="src"/>
+    <property name="module.repo.src.dir" value="${src.dir}/main/resources/modules"/>
+    <!--property name="output.dir" value="target/jboss-as-${version.jboss.as.release}"/-->
+    <property name="module.repo.output.dir" value="${output.dir}/gatein/modules"/>
+    <property name="module.xml" value="module.xml"/>
+
+
+    <taskdef name="jandex" classname="org.jboss.jandex.JandexAntTask" />
+
+    <macrodef name="module-def">
+        <attribute name="name"/>
+        <attribute name="slot" default="main"/>
+        <element name="resources" implicit="yes" optional="yes"/>
+                
+        <sequential>
+            <echo message="Initializing module -> @{name}"/>
+            <!-- Figure out the correct module path -->
+            <define-module-dir name="@{name}" slot="@{slot}"/>
+            
+            <!-- Make the module output director -->
+            <mkdir dir="${module.repo.output.dir}/${current.module.path}"/>
+            
+            <!-- Copy the module.xml and other stuff to the output director -->
+            <copy todir="${module.repo.output.dir}/${current.module.path}">
+                <fileset dir="${module.repo.src.dir}/${current.module.path}">
+                    <include name="**"/>
+                </fileset>
+            </copy>
+            
+            <!-- Process the resource -->
+            <resources/>
+
+            <!-- Some final cleanup -->
+            <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+              <replacetoken><![CDATA[
+        <!-- Insert resources here -->]]></replacetoken>
+              <replacevalue></replacevalue>
+            </replace>
+
+        </sequential>
+    </macrodef>
+    
+    <scriptdef name="define-module-dir" language="javascript">
+        <attribute name="name"/>
+        <attribute name="slot"/>
+        <![CDATA[
+            name = attributes.get("name");
+            name = name.replace(".", "/");
+            project.setProperty("current.module.path", name + "/" + attributes.get("slot"));
+        ]]>
+    </scriptdef>
+    
+    <macrodef name="maven-resource" >
+        <attribute name="group"/>
+        <attribute name="artifact"/>
+        <attribute name="jandex" default="false" />
+
+        <sequential>
+            <!-- Copy the jar to the module dir -->
+            <copy todir="${module.repo.output.dir}/${current.module.path}" failonerror="true">
+                <fileset file="${@{group}:@{artifact}:jar}"/>
+                <mapper type="flatten" />
+            </copy>
+
+            <basename file="${@{group}:@{artifact}:jar}" property="resourcename.@{group}.@{artifact}"/>
+            <!-- Generate the Jandex Index -->
+            <jandex run="@{jandex}" newJar="true" >
+                <fileset dir="${module.repo.output.dir}/${current.module.path}" />
+            </jandex>
+            <!-- Update the resource entry in module.xml -->
+            <define-resource-root path="${resourcename.@{group}.@{artifact}}" jandex="@{jandex}"/>
+            <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+                <replacefilter token="&lt;!-- Insert resources here --&gt;" value="${current.resource.root}&#10;        &lt;!-- Insert resources here --&gt;"/>
+            </replace>
+        </sequential>
+        
+    </macrodef>
+
+    <macrodef name="maven-resource-with-classifier" >
+        <attribute name="group"/>
+        <attribute name="artifact"/>
+        <attribute name="classifier"/>
+        <attribute name="jandex" default="false" />
+        
+        <sequential>
+            <!-- Copy the jar to the module dir -->
+            <copy todir="${module.repo.output.dir}/${current.module.path}" failonerror="true">
+                <fileset file="${@{group}:@{artifact}:jar:@{classifier}}"/> <!-- http://jira.codehaus.org/browse/MANTRUN-159 -->
+                <mapper type="flatten" />
+            </copy>
+
+            <basename file="${@{group}:@{artifact}:jar:@{classifier}}" property="resourcename.@{group}.@{artifact}.@{classifier}"/>
+
+            <!-- Update the resource entry in module.xml -->
+            <define-resource-root path="${resourcename.@{group}.@{artifact}.@{classifier}}"/>
+            <replace file="${module.repo.output.dir}/${current.module.path}/${module.xml}">
+                <replacefilter token="&lt;!-- Insert resources here --&gt;" value="${current.resource.root}&#10;        &lt;!-- Insert resources here --&gt;"/>
+            </replace>
+        </sequential>
+        
+    </macrodef>
+
+
+    <scriptdef name="define-resource-root" language="javascript">
+        <attribute name="path"/>
+        <attribute name="jandex"/>
+        <![CDATA[
+            path = attributes.get("path");
+            root = "<resource-root path=\"" + path + "\"/>";
+            if(path.indexOf('${') != -1) {
+                throw "Module resource root not found, make sure it is listed in build/pom.xml" + path;
+            }
+            if(attributes.get("jandex") == "true" ) {
+                root = root + "\n\t<resource-root path=\"" + path.replace(".jar","-jandex.jar") + "\"/>";
+            }
+            project.setProperty("current.resource.root", root);
+        ]]>
+    </scriptdef>
+
+</project>

Added: portal/trunk/packaging/jboss-as7/modules/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/pom.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/pom.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,1429 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+   <parent>
+      <groupId>org.exoplatform.portal</groupId>
+      <artifactId>exo.portal.packaging.jboss7</artifactId>
+      <version>3.2.0-M02-SNAPSHOT</version>
+   </parent>
+
+   <modelVersion>4.0.0</modelVersion>
+   <artifactId>jboss-as7-integration-modules</artifactId>
+   <name>GateIn - Portlet Container (JBoss AS7 Extension Modules)</name>
+
+   <properties>
+      <version.org.jboss.jandex>1.0.0.Beta6</version.org.jboss.jandex>
+   </properties>
+
+   <dependencies>
+
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>jboss-as7-integration-extension</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.naming</groupId>
+         <artifactId>gatein-naming</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-jboss7</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.wci</groupId>
+               <artifactId>wci-wci</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.jboss.web</groupId>
+               <artifactId>jbossweb</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.jboss.spec.javax.servlet</groupId>
+               <artifactId>jboss.servlet.api_3.0_spec</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-jboss6</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.wci</groupId>
+               <artifactId>wci-wci</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.jboss.web</groupId>
+               <artifactId>jbossweb</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-wci</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.common</groupId>
+               <artifactId>common-common</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>org.gatein.common</groupId>
+         <artifactId>common-common</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.common</groupId>
+               <artifactId>common-logging</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.activation</groupId>
+               <artifactId>activation</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.jboss</groupId>
+               <artifactId>jboss-vfs</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>commons-httpclient</groupId>
+               <artifactId>commons-httpclient</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>org.gatein.common</groupId>
+         <artifactId>common-logging</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.slf4j</groupId>
+               <artifactId>slf4j-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-api</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.common</groupId>
+               <artifactId>common-common</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.servlet</groupId>
+               <artifactId>servlet-api</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>junit</groupId>
+               <artifactId>junit</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-portlet</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.gatein.pc</groupId>
+               <artifactId>pc-api</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.gatein.wci</groupId>
+               <artifactId>wci-wci</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.portlet</groupId>
+               <artifactId>portlet-api</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.ccpp</groupId>
+               <artifactId>ccpp</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.servlet.jsp</groupId>
+               <artifactId>jsp-api</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>sun.jaxb</groupId>
+               <artifactId>jaxb-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.portlet</groupId>
+         <artifactId>portlet-api</artifactId>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.ccpp</groupId>
+         <artifactId>ccpp</artifactId>
+      </dependency>
+
+
+      <!-- Apache commons -->
+      <dependency>
+         <groupId>commons-beanutils</groupId>
+         <artifactId>commons-beanutils</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>commons-logging</groupId>
+               <artifactId>commons-logging</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>commons-chain</groupId>
+         <artifactId>commons-chain</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>commons-codec</groupId>
+         <artifactId>commons-codec</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>commons-dbcp</groupId>
+         <artifactId>commons-dbcp</artifactId>
+         <version>1.4</version>
+      </dependency>
+      <dependency>
+         <groupId>commons-digester</groupId>
+         <artifactId>commons-digester</artifactId>
+         <version>1.8.1</version>
+      </dependency>
+      <dependency>
+         <groupId>commons-fileupload</groupId>
+         <artifactId>commons-fileupload</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>commons-httpclient</groupId>
+         <artifactId>commons-httpclient</artifactId>
+         <version>3.1</version>
+      </dependency>
+      <dependency>
+         <groupId>commons-io</groupId>
+         <artifactId>commons-io</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>commons-lang</groupId>
+         <artifactId>commons-lang</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>commons-pool</groupId>
+         <artifactId>commons-pool</artifactId>
+      </dependency>
+
+      <!-- Hibernate -->
+      <!--dependency>
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-commons-annotations</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.hibernate.javax.persistence</groupId>
+         <artifactId>hibernate-jpa-2.0-api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-validator</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-validator-legacy</artifactId>
+      </dependency-->
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>ejb3-persistence</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-commons-annotations</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-core</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-annotations</artifactId>
+      </dependency>
+
+
+
+      <!-- JBoss -->
+      <dependency>
+         <groupId>org.jboss.cache</groupId>
+         <artifactId>jbosscache-core</artifactId>
+         <version>3.2.6.GA</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>jgroups</groupId>
+                  <artifactId>jgroups</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.javaee</groupId>
+                  <artifactId>jboss-transaction-api</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss</groupId>
+                  <artifactId>jboss-common-core</artifactId>
+               </exclusion>
+            </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.jgroups</groupId>
+         <artifactId>jgroups</artifactId>
+         <version>2.11.1.Final</version>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.slf4j</groupId>
+         <artifactId>slf4j-jboss-logmanager</artifactId>
+         <version>1.0.0.GA</version>
+      </dependency>
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+      </dependency>
+
+      <!--dependency>
+         <groupId>org.jboss.mc-int</groupId>
+         <artifactId>jboss-mc-int-common</artifactId>
+         <version>2.2.0.Alpha2</version>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.mc-int</groupId>
+         <artifactId>jboss-mc-int-servlet</artifactId>
+         <version>2.2.0.Alpha2</version>
+      </dependency-->
+
+
+      <!-- JCR stack -->
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.commons</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.slf4j</groupId>
+               <artifactId>slf4j-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.component.cache</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.exoplatform.tool</groupId>
+               <artifactId>exo.tool.framework.junit</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.faces</groupId>
+               <artifactId>jsf-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.component.command</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>xml-apis</groupId>
+               <artifactId>xml-apis</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.component.common</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.ow2.jotm</groupId>
+               <artifactId>jotm-core</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.quartz-scheduler</groupId>
+               <artifactId>quartz</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.mail</groupId>
+               <artifactId>mail</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>javax.transaction</groupId>
+               <artifactId>jta</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.container</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.jibx</groupId>
+               <artifactId>jibx-extras</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <!--dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.mc-int</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>trove</groupId>
+               <artifactId>trove</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.mc-kernel-extras</artifactId>
+      </dependency-->
+      <dependency>
+         <groupId>org.exoplatform.kernel</groupId>
+         <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.ldap</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.organization.api</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>xstream</groupId>
+               <artifactId>xstream</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.database</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.hibernate</groupId>
+               <artifactId>hibernate-core</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.hibernate</groupId>
+               <artifactId>hibernate-annotations</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.hibernate</groupId>
+               <artifactId>ejb3-persistence</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.hibernate</groupId>
+               <artifactId>hibernate-commons-annotations</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.organization.jdbc</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.organization.ldap</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.security.core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.document</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.core</groupId>
+         <artifactId>exo.core.component.xml-processing</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>net.sf.jtidy</groupId>
+               <artifactId>jtidy</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.component.core</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>concurrent</groupId>
+               <artifactId>concurrent</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>commons-collections</groupId>
+               <artifactId>commons-collections</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>jboss.jbossts</groupId>
+               <artifactId>jbossjts</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>jboss.jbossts</groupId>
+               <artifactId>jbossts-common</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.infinispan</groupId>
+               <artifactId>infinispan-core</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.infinispan</groupId>
+               <artifactId>infinispan-cachestore-jdbc</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>c3p0</groupId>
+               <artifactId>c3p0</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.component.ext</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.exoplatform.core</groupId>
+               <artifactId>exo.core.component.script.groovy</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.component.webdav</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.component.ftp</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.framework.web</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.jcr</groupId>
+         <artifactId>exo.jcr.framework.command</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.ws</groupId>
+         <artifactId>exo.ws.commons</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.ws</groupId>
+         <artifactId>exo.ws.frameworks.json</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.ws</groupId>
+         <artifactId>exo.ws.frameworks.servlet</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.ws</groupId>
+         <artifactId>exo.ws.rest.core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.ws</groupId>
+         <artifactId>exo.ws.rest.ext</artifactId>
+      </dependency>
+
+
+
+      <!-- Reflext -->
+      <dependency>
+         <groupId>org.reflext</groupId>
+         <artifactId>reflext.api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.reflext</groupId>
+         <artifactId>reflext.core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.reflext</groupId>
+         <artifactId>reflext.jlr</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.reflext</groupId>
+         <artifactId>reflext.spi</artifactId>
+      </dependency>
+
+      <!-- Chromattic -->
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.apt</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.reflext</groupId>
+               <artifactId>reflext.apt</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.spi</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.common</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.metamodel</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.chromattic</groupId>
+         <artifactId>chromattic.ext</artifactId>
+      </dependency>
+
+
+
+      <!-- Picket link -->
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-spi</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-cache</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-common</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>log4j</groupId>
+               <artifactId>log4j</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-core</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.staxnav</groupId>
+               <artifactId>staxnav.core</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-hibernate</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javassist</groupId>
+               <artifactId>javassist</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.hibernate</groupId>
+               <artifactId>hibernate-cglib-repack</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.picketlink.idm</groupId>
+         <artifactId>picketlink-idm-ldap</artifactId>
+      </dependency>
+
+      <dependency>
+         <groupId>eu.medsea.mimeutil</groupId>
+         <artifactId>mime-util</artifactId>
+         <version>2.1.3</version>
+      </dependency>
+
+      <!-- Staxnav -->
+      <dependency>
+         <groupId>org.staxnav</groupId>
+         <artifactId>staxnav.core</artifactId>
+      </dependency>
+
+      <!-- Gatein common -->
+      <dependency>
+         <groupId>org.gatein.common</groupId>
+         <artifactId>common-common</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.common</groupId>
+         <artifactId>common-logging</artifactId>
+      </dependency>
+
+      <!-- Gatein wci -->
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-wci</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-jboss7</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.wci</groupId>
+         <artifactId>wci-exo</artifactId>
+      </dependency>
+
+
+
+
+      <!-- Gatein PC -->
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-api</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>junit</groupId>
+               <artifactId>junit</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-portlet</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>javax.servlet.jsp</groupId>
+               <artifactId>jsp-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-controller</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>apache-xerces</groupId>
+               <artifactId>resolver</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>apache-xerces</groupId>
+               <artifactId>xercesImpl</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-federation</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.pc</groupId>
+         <artifactId>pc-bridge</artifactId>
+      </dependency>
+
+      <!-- GateIn MOP -->
+      <dependency>
+         <groupId>org.gatein.mop</groupId>
+         <artifactId>mop-api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.mop</groupId>
+         <artifactId>mop-core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.mop</groupId>
+         <artifactId>mop-spi</artifactId>
+      </dependency>
+
+
+      <!-- Gatein Mgmt -->
+      <dependency>
+         <groupId>org.gatein.management</groupId>
+         <artifactId>gatein-management-api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.management</groupId>
+         <artifactId>gatein-management-spi</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.management</groupId>
+         <artifactId>gatein-management-core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.management</groupId>
+         <artifactId>gatein-management-rest</artifactId>
+      </dependency>
+
+
+      <!-- GateIn Captcha -->
+      <dependency>
+         <groupId>org.gatein.captcha</groupId>
+         <artifactId>simplecaptcha</artifactId>
+      </dependency>
+
+      <!-- GateIn Shinding -->
+      <dependency>
+         <groupId>org.gatein.shindig</groupId>
+         <artifactId>shindig-gadgets</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>net.oauth.core</groupId>
+               <artifactId>oauth-consumer</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>net.oauth.core</groupId>
+               <artifactId>oauth-httpclient3</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>xerces</groupId>
+               <artifactId>xercesImpl</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.shindig</groupId>
+         <artifactId>shindig-features</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.shindig</groupId>
+         <artifactId>shindig-common</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>net.oauth.core</groupId>
+               <artifactId>oauth</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>net.sf.json-lib</groupId>
+               <artifactId>json-lib</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>commons-betwixt</groupId>
+               <artifactId>commons-betwixt</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>net.sf.ezmorph</groupId>
+               <artifactId>ezmorph</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.gatein.shindig</groupId>
+         <artifactId>shindig-social-api</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.geronimo.specs</groupId>
+               <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>net.oauth.core</groupId>
+         <artifactId>oauth</artifactId>
+      </dependency>
+
+
+
+      <!-- GateIn -->
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.application-registry</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.common</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.identity</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.management</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.pc</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.portal</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.resources</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.scripting</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.web.api</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.web.controller</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.web.resources</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.web.security</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.component.web.server</artifactId>
+      </dependency>
+      <!--dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.server.jboss.plugin</artifactId>
+      </dependency-->
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.core</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.dashboard</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.eXo</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.framework</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.portal</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.webui.portlet</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.gadgets-core</artifactId>
+      </dependency>
+
+
+
+      <!-- Provided -->
+      <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.activation</groupId>
+         <artifactId>activation</artifactId>
+         <version>1.1.1</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.jcr</groupId>
+         <artifactId>jcr</artifactId>
+         <version>1.0</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.annotation</groupId>
+         <artifactId>jsr250-api</artifactId>
+         <version>1.0</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.ws.rs</groupId>
+         <artifactId>jsr311-api</artifactId>
+         <version>1.0</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.resource</groupId>
+         <artifactId>connector-api</artifactId>
+         <version>1.5</version>
+      </dependency>
+
+      <dependency>
+         <groupId>javax.xml.bind</groupId>
+         <artifactId>jaxb-api</artifactId>
+         <version>2.1</version>
+      </dependency>
+      <dependency>
+         <groupId>com.sun.xml.bind</groupId>
+         <artifactId>jaxb-impl</artifactId>
+         <version>2.1.7</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.xml.stream</groupId>
+         <artifactId>stax-api</artifactId>
+         <version>1.0-2</version>
+      </dependency>
+      <dependency>
+         <groupId>com.sun.xml.stream</groupId>
+         <artifactId>sjsxp</artifactId>
+         <version>1.0.1</version>
+      </dependency>
+
+
+
+      <!-- Various -->
+      <dependency>
+         <groupId>com.google.inject</groupId>
+         <artifactId>guice</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>com.google.inject.extensions</groupId>
+         <artifactId>guice-multibindings</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>com.google.inject.extensions</groupId>
+         <artifactId>guice-jmx</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>aopalliance</groupId>
+         <artifactId>aopalliance</artifactId>
+         <version>1.0</version>
+      </dependency>
+      <dependency>
+         <groupId>asm</groupId>
+         <artifactId>asm</artifactId>
+         <version>1.5.3</version>
+      </dependency>
+      <dependency>
+         <groupId>bouncycastle</groupId>
+         <artifactId>bcmail-jdk14</artifactId>
+         <version>136</version>
+      </dependency>
+      <dependency>
+         <groupId>bouncycastle</groupId>
+         <artifactId>bcprov-jdk14</artifactId>
+         <version>136</version>
+      </dependency>
+      <dependency>
+         <groupId>caja</groupId>
+         <artifactId>caja</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>nu.validator.htmlparser</groupId>
+               <artifactId>htmlparser</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>caja</groupId>
+         <artifactId>json_simple</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>oswego-concurrent</groupId>
+         <artifactId>concurrent</artifactId>
+         <version>1.3.4</version>
+      </dependency>
+      <dependency>
+         <groupId>dom4j</groupId>
+         <artifactId>dom4j</artifactId>
+         <version>1.6.1</version>
+      </dependency>
+      <dependency>
+         <groupId>howl</groupId>
+         <artifactId>howl-logger</artifactId>
+         <version>0.1.11</version>
+      </dependency>
+      <dependency>
+         <groupId>net.sf.ehcache</groupId>
+         <artifactId>ehcache</artifactId>
+         <version>1.6.0</version>
+      </dependency>
+      <dependency>
+         <groupId>com.jhlabs</groupId>
+         <artifactId>filters</artifactId>
+         <version>2.0.235</version>
+      </dependency>
+      <dependency>
+        <groupId>com.google.guava</groupId>
+        <artifactId>guava</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.codehaus.groovy</groupId>
+         <artifactId>groovy-all</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.htmlparser</groupId>
+         <artifactId>htmlparser</artifactId>
+         <version>1.6</version>
+         <exclusions>
+            <exclusion>
+               <groupId>com.sun</groupId>
+               <artifactId>tools</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>com.ibm.icu</groupId>
+         <artifactId>icu4j</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>jdom</groupId>
+         <artifactId>jdom</artifactId>
+         <version>1.0</version>
+      </dependency>
+      <dependency>
+         <groupId>org.jibx</groupId>
+         <artifactId>jibx-bind</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>bcel</groupId>
+               <artifactId>bcel</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.jibx</groupId>
+         <artifactId>jibx-run</artifactId>
+         <exclusions>
+            <exclusion>
+               <groupId>org.codehaus.woodstox</groupId>
+               <artifactId>wstx-asl</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>joda-time</groupId>
+         <artifactId>joda-time</artifactId>
+         <version>1.6</version>
+      </dependency>
+      <dependency>
+         <groupId>rhino</groupId>
+         <artifactId>js</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jsecurity</groupId>
+         <artifactId>jsecurity</artifactId>
+         <version>0.9.0</version>
+      </dependency>
+      <dependency>
+         <groupId>org.json</groupId>
+         <artifactId>json</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>de.odysseus.juel</groupId>
+         <artifactId>juel-impl</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.lucene</groupId>
+         <artifactId>lucene-core</artifactId>
+         <version>2.9.4</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.lucene</groupId>
+         <artifactId>lucene-memory</artifactId>
+         <version>2.9.4</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.lucene</groupId>
+         <artifactId>lucene-spellchecker</artifactId>
+         <version>2.9.4</version>
+      </dependency>
+      <dependency>
+         <groupId>net.sourceforge.nekohtml</groupId>
+         <artifactId>nekohtml</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.pdfbox</groupId>
+         <artifactId>pdfbox</artifactId>
+         <version>1.4.0</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.pdfbox</groupId>
+               <artifactId>fontbox</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.apache.pdfbox</groupId>
+               <artifactId>jempbox</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>picocontainer</groupId>
+         <artifactId>picocontainer</artifactId>
+         <version>1.1</version>
+         <exclusions>
+            <exclusion>
+               <groupId>jmock</groupId>
+               <artifactId>jmock</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.poi</groupId>
+         <artifactId>poi</artifactId>
+         <version>3.6</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.poi</groupId>
+         <artifactId>poi-ooxml</artifactId>
+         <version>3.6</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.poi</groupId>
+               <artifactId>poi-ooxml-schemas</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.poi</groupId>
+         <artifactId>poi-scratchpad</artifactId>
+         <version>3.6</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.portals.bridges</groupId>
+         <artifactId>portals-bridges-common</artifactId>
+         <version>1.0.4</version>
+      </dependency>
+      <dependency>
+         <groupId>rome</groupId>
+         <artifactId>rome</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.sanselan</groupId>
+         <artifactId>sanselan</artifactId>
+         <version>0.97-incubator</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.ws.commons</groupId>
+         <artifactId>ws-commons-util</artifactId>
+         <version>1.0.1</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.xmlbeans</groupId>
+         <artifactId>xmlbeans</artifactId>
+         <version>2.3.0</version>
+         <exclusions>
+            <exclusion>
+               <groupId>stax</groupId>
+               <artifactId>stax-api</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>xpp3</groupId>
+         <artifactId>xpp3</artifactId>
+         <version>1.1.4c</version>
+      </dependency>
+      <dependency>
+         <groupId>com.thoughtworks.xstream</groupId>
+         <artifactId>xstream</artifactId>
+         <version>1.3.1</version>
+         <exclusions>
+            <exclusion>
+               <groupId>xpp3</groupId>
+               <artifactId>xpp3_min</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.jvnet.jaxb2.maven2</groupId>
+         <artifactId>maven-jaxb2-plugin</artifactId>
+         <version>0.7.4</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.jvnet.jaxb2.maven2</groupId>
+               <artifactId>maven-jaxb2-plugin-raw</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.jvnet.jaxb2_commons</groupId>
+               <artifactId>jaxb2-basics-jaxb-xjc</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.sun.codemodel</groupId>
+               <artifactId>codemodel</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.sun.xml.dtd-parser</groupId>
+               <artifactId>dtd-parser</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.sun.istack</groupId>
+               <artifactId>istack-commons-tools</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>relaxngDatatype</groupId>
+               <artifactId>relaxngDatatype</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.sun.org.apache.xml.internal</groupId>
+               <artifactId>resolver</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.kohsuke.rngom</groupId>
+               <artifactId>rngom</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.sun.xsom</groupId>
+               <artifactId>xsom</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>sun.jdk</groupId>
+               <artifactId>tools</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>com.experlog</groupId>
+         <artifactId>xapool</artifactId>
+         <version>1.5.0</version>
+      </dependency>
+      <dependency>
+         <groupId>xdoclet</groupId>
+         <artifactId>xdoclet</artifactId>
+         <version>1.2.3</version>
+      </dependency>
+      <dependency>
+         <groupId>xdoclet</groupId>
+         <artifactId>xdoclet-hibernate-module</artifactId>
+         <version>1.2.3</version>
+      </dependency>
+      <dependency>
+         <groupId>xdoclet</groupId>
+         <artifactId>xdoclet-xdoclet-module</artifactId>
+         <version>1.2.3</version>
+      </dependency>
+      <dependency>
+         <groupId>xdoclet</groupId>
+         <artifactId>xjavadoc</artifactId>
+         <version>1.2.3</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.tika</groupId>
+        <artifactId>tika-core</artifactId>
+        <version>0.7</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.tika</groupId>
+        <artifactId>tika-parsers</artifactId>
+        <version>0.7</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.commons</groupId>
+               <artifactId>commons-compress</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.bouncycastle</groupId>
+               <artifactId>bcmail-jdk15</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.bouncycastle</groupId>
+               <artifactId>bcprov-jdk15</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.ccil.cowan.tagsoup</groupId>
+               <artifactId>tagsoup</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.drewnoakes</groupId>
+               <artifactId>metadata-extractor</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.tika</groupId>
+        <artifactId>tika-core</artifactId>
+        <version>0.7</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.tika</groupId>
+        <artifactId>tika-parsers</artifactId>
+        <version>0.7</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.commons</groupId>
+               <artifactId>commons-compress</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.bouncycastle</groupId>
+               <artifactId>bcmail-jdk15</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.bouncycastle</groupId>
+               <artifactId>bcprov-jdk15</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.ccil.cowan.tagsoup</groupId>
+               <artifactId>tagsoup</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.drewnoakes</groupId>
+               <artifactId>metadata-extractor</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>com.google.javascript</groupId>
+        <artifactId>closure-compiler</artifactId>
+        <version>r706</version>
+         <exclusions>
+            <exclusion>
+               <groupId>args4j</groupId>
+               <artifactId>args4j</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.google.protobuf</groupId>
+               <artifactId>protobuf-java</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.apache.ant</groupId>
+               <artifactId>ant</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>com.google.code.findbugs</groupId>
+               <artifactId>jsr305</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>hsqldb</groupId>
+         <artifactId>hsqldb</artifactId>
+         <version>1.8.0.10</version>
+      </dependency>
+
+   </dependencies>
+
+   <build>
+       <plugins>
+           <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-antrun-plugin</artifactId>
+               <version>1.4</version>
+               <inherited>false</inherited>
+               <executions>
+                   <execution>
+                       <id>build-dist</id>
+                       <goals>
+                           <goal>run</goal>
+                       </goals>
+                       <phase>package</phase>
+                       <configuration>
+                           <tasks>
+                               <ant antfile="build.xml"  inheritRefs="true">
+                                   <target name="all"/>
+                               </ant>
+                           </tasks>
+                       </configuration>
+                   </execution>
+               </executions>
+               <dependencies>
+                   <dependency>
+                       <groupId>org.jboss</groupId>
+                       <artifactId>jandex</artifactId>
+                       <version>${version.org.jboss.jandex}</version>
+                   </dependency>
+               </dependencies>
+           </plugin>
+       </plugins>
+   </build>
+
+
+</project>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/ccpp/api/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="javax.ccpp.api">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/jcr/api/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="javax.jcr.api">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/javax/portlet/api/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="javax.portlet.api">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="javax.servlet.api" />
+       <module name="javax.api"/>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/common/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.common">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="javax.api"/>
+       <module name="org.slf4j" slot="gatein" />
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/lib/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.lib">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+    <dependencies>
+
+        <module name="system" export="true">
+          <imports>
+              <exclude-set>
+                  <path name="javax/xml/bind"/>
+                  <path name="javax/xml/bind/annotation"/>
+              </exclude-set>
+          </imports>
+        </module>
+
+       <!-- picketlink idm dependencies -->
+       <module name="com.sun.xml.bind" services="export" export="true" />
+       <module name="javax.xml.bind.api" />
+       <module name="org.dom4j" />
+
+       <!--module name="sun.jdk" /-->
+       <!-- TODO try maybe: module name="javax.xml.jaxp-provider" /-->
+       <module name="sun.jdk.xml" />
+       <module name="javax.api"/>
+       <module name="javax.jcr.api" />
+       <module name="javax.portlet.api" export="true"/>
+       <module name="javax.servlet.api" />
+       <module name="javax.servlet.jsp.api" />
+       <module name="javax.ws.rs.api" />
+       <module name="org.gatein.common" />
+       <module name="org.apache.commons.logging" />
+       <module name="org.apache.commons.collections" />
+       <module name="org.apache.httpcomponents" />
+       <module name="org.apache.xerces" />
+       <module name="org.gatein.naming" export="true"/>
+       <module name="org.gatein.pc" />
+       <module name="org.gatein.wci" export="true"/>
+       <module name="org.hibernate" slot="gatein" />
+       <module name="org.javassist"/>
+       <module name="org.slf4j" slot="gatein" />
+       <module name="org.staxnav" />
+
+       <!-- gatein-naming.jar dependencies -->
+       <module name="org.jboss.threads"/>
+       <module name="org.jboss.logging"/>
+
+       <!-- oeg.exoplatform.services dependencies -->
+       <module name="org.hsqldb" />
+       <module name="org.jboss.common-core" />
+
+       <!-- oeg.exoplatform.services.rest dependencies -->
+       <module name="javax.inject.api" />
+
+       <!-- jbosscache dependencies -->
+       <module name="javax.resource.api" />
+       <module name="javax.transaction.api" />
+       <module name="org.jboss.jts" />
+
+       <module name="javax.annotation.api" />
+
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+        <module name="org.jboss.as.controller"/>
+        <module name="org.jboss.as.ee"/>
+        <module name="org.jboss.as.server"/>
+        <module name="org.jboss.as.web"/>
+        <module name="org.jboss.logging"/>
+        <module name="org.jboss.metadata"/>
+        <module name="org.jboss.modules"/>
+        <module name="org.jboss.staxmapper"/>
+        <module name="org.jboss.vfs"/>
+        <module name="org.gatein.lib"/>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/naming/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.naming">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+        <module name="javax.api"/>
+        <module name="org.jboss.threads"/>
+        <module name="org.jboss.logging"/>
+    </dependencies>
+</module>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/pc/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.pc">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="javax.api" />
+       <module name="javax.xml.bind.api" />
+       <module name="org.gatein.wci" />
+       <module name="org.gatein.common" />
+       <module name="org.staxnav" />
+       <module name="javax.servlet.api" />
+       <module name="javax.servlet.jsp.api" />
+       <module name="javax.portlet.api" />
+       <module name="javax.ccpp.api" />
+    </dependencies>
+</module>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/gatein/wci/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.gatein.wci">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="javax.api" />
+       <module name="javax.servlet.api" />
+       <module name="org.jboss.as.web" />
+       <module name="org.gatein.common" />
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/gatein/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/gatein/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hibernate/gatein/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.hibernate" slot="gatein">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+        <module name="asm.asm"/>
+        <module name="javax.api"/>
+        <module name="javax.persistence.api"/>
+        <module name="javax.transaction.api"/>
+        <module name="javax.validation.api"/>
+        <module name="org.antlr"/>
+        <module name="org.apache.commons.collections"/>
+        <module name="org.dom4j"/>
+        <module name="org.javassist"/>
+        <module name="org.jboss.logging"/>
+        <module name="org.slf4j"/>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/hsqldb/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2010, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.hsqldb">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/gatein/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/gatein/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/slf4j/gatein/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.slf4j" slot="gatein">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+        <module name="org.jboss.logmanager"/>
+    </dependencies>
+</module>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/org/staxnav/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.staxnav">
+    <resources>
+        <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="javax.api" />
+    </dependencies>
+</module>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/modules/src/main/resources/modules/sun/jdk/xml/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="sun.jdk.xml">
+    <resources>
+    </resources>
+    <dependencies>
+        <module name="system" export="true">
+          <exports>
+              <include-set>
+                  <path name="com/sun/org/apache"/>
+                  <path name="com/sun/xml/internal"/>
+              </include-set>
+          </exports>
+        </module>
+    </dependencies>
+</module>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/pkg/download-jboss.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/download-jboss.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/download-jboss.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="download-jboss" xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+   <target name="download-jboss">
+
+      <!-- Fetch jbossas .zip -->
+      <get dest="${dest}" skipexisting="true">
+         <url url="${url}"/>
+      </get>
+
+      <!-- Fetch .sha1 file -->
+      <!--
+      <get dest="${dest}.sha1" skipexisting="true">
+         <url url="${url}.sha1"/>
+      </get>
+      -->
+
+      <!-- Validate checksum -->
+      <!--
+      <local name="checksum.matches"/>
+      <local name="checksum.matches.fail"/>
+      <checksum file="${dest}" algorithm="sha" fileext=".sha1"
+                verifyproperty="checksum.matches"/>
+      <condition property="checksum.matches.fail">
+         <equals arg1="${checksum.matches}" arg2="false"/>
+      </condition>
+      <fail if="checksum.matches.fail">Checksum validation failed! (for: ${dest})</fail>
+      -->
+   </target>
+</project>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/pkg/package.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/package.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/package.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="package" xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+   <target name="package">
+
+      <echo>Using JBoss AS at: ${jbossas.dir}</echo>
+
+      <!-- Copy jboss -->
+      <copy todir="${jbossas.target.dir}" preservelastmodified="true">
+         <fileset dir="${jbossas.dir}"/>
+      </copy>
+
+      <!-- Copy configuration non-xml first -->
+      <!--copy todir="${jbossas.target.dir}" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/src/main/resources/jboss">
+            <exclude name="**/*.xml" />
+         </fileset>
+      </copy-->
+
+      <!-- Copy simple-portal -->
+      <!--copy todir="${jbossas.target.dir}/standalone/deployments/simple-portal.ear" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/../../portal/target/simple-portal-jboss7-ear/simple-portal.ear" />
+      </copy-->
+
+      <!-- maven-ant integration - calling pom.xml dependencies as filesets -->
+      <dependencyfilesets/>
+
+      <!-- Copy deployment archives -->
+
+      <unzip dest="${jbossas.target.dir}/standalone/deployments/gatein.ear/eXoResources.war">
+         <fileset refid="org.exoplatform.portal:exo.portal.web.eXoResources:war"/>
+      </unzip>
+      <unzip dest="${jbossas.target.dir}/standalone/deployments/gatein.ear/portal.war">
+         <fileset refid="org.exoplatform.portal:exo.portal.web.portal:war"/>
+      </unzip>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/dashboard.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.portlet.dashboard:war"/>
+      </copy>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/exoadmin.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.portlet.exoadmin:war"/>
+      </copy>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/eXoGadgets.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.eXoGadgets:war"/>
+      </copy>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/eXoGadgetServer.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.gadgets-server:war"/>
+      </copy>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/rest.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.web.rest:war"/>
+      </copy>
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein.ear/web.war" >
+         <fileset refid="org.exoplatform.portal:exo.portal.portlet.web:war"/>
+      </copy>
+
+
+      <!--copy tofile="${jbossas.target.dir}/standalone/deployments/gatein-sample-portal.ear" >
+         <fileset refid="org.exoplatform.portal:gatein-sample-portal:ear"/>
+      </copy-->
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-portal.ear/lib" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.portal.config:jar"/>
+      </copy>
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-portal.ear/lib" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.portal.jar:jar"/>
+      </copy>
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-portal.ear" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.portal.war:war"/>
+      </copy>
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-portal.ear" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.portal.rest-war:war"/>
+      </copy>
+
+
+      <!--copy tofile="${jbossas.target.dir}/standalone/deployments/gatein-sample-extension.ear">
+         <fileset refid="org.exoplatform.portal:gatein-sample-extension:ear"/>
+      </copy-->
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-extension.ear/lib" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.extension.config:jar"/>
+      </copy>
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-extension.ear/lib" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.extension.jar:jar"/>
+      </copy>
+      <copy todir="${jbossas.target.dir}/standalone/deployments/gatein-sample-extension.ear" >
+         <fileset refid="org.exoplatform.portal:exo.portal.sample.extension.war:war"/>
+      </copy>
+
+
+      <copy tofile="${jbossas.target.dir}/standalone/deployments/gatein-sample-skin.war">
+         <fileset refid="org.gatein.portal.examples.skins:gatein-sample-skin:war"/>
+      </copy>
+
+
+      <!-- Deployment archives overrides -->
+      <!-- Copy configuration files -->
+      <copy todir="${jbossas.target.dir}/standalone" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/src/main/resources/jboss/standalone" />
+      </copy>
+
+      <!--copy file="${maven.project.basedir}/../../../component/common/src/main/java/conf/configuration-jboss.properties"
+            tofile="${jbossas.target.dir}/standalone/configuration/gatein/configuration-jboss.properties"
+            preservelastmodified="true" overwrite="true"/-->
+
+      <!-- Copy bin files -->
+      <copy todir="${jbossas.target.dir}/bin" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/src/main/resources/jboss/bin" />
+      </copy>
+
+      <!-- Copy modules overrides -->
+      <copy todir="${jbossas.target.dir}/modules" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/src/main/resources/jboss/modules" />
+      </copy>
+
+      <!-- Copy modules -->
+      <copy todir="${jbossas.target.dir}/gatein" preservelastmodified="true" overwrite="true">
+         <fileset dir="${maven.project.basedir}/../modules/target/${jbossas.name}/gatein" />
+      </copy>
+
+      <!-- File permissions -->
+      <!-- Excluded due to ARG_MAX limitation on Mac OS X -->
+      <!--chmod perm="0644" type="file" dir="${jbossas.target.dir}" excludes="**/*.sh"/-->
+      <chmod perm="0755" type="file" dir="${jbossas.target.dir}" includes="**/*.sh"/>
+
+   </target>
+</project>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/pom.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/pom.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,415 @@
+<?xml version="1.0"?>
+<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">
+
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.exoplatform.portal</groupId>
+      <artifactId>exo.portal.packaging.jboss7</artifactId>
+      <version>3.2.0-M02-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>exo.portal.packaging.jboss7.pkg</artifactId>
+   <packaging>pom</packaging>
+
+   <name>GateIn for JBoss AS 7.x.x packaging</name>
+
+   <properties>
+      <version.jboss.as>7.0.2.Final</version.jboss.as>
+      <jbossas.dist.version>${version.jboss.as}</jbossas.dist.version>
+      <servers.dir>${project.basedir}/servers</servers.dir>
+      <jbossas.path>${servers.dir}</jbossas.path>
+      <jbossas.name>jboss-${version.jboss.as}</jbossas.name>
+      <jbossas.dir>${jbossas.path}/${jbossas.name}</jbossas.dir>
+      <gatein.working.dir>${project.build.directory}/${jbossas.name}</gatein.working.dir>
+      <jbossas.target.dir>${gatein.working.dir}</jbossas.target.dir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>jboss-as7-integration-extension</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>jboss-as7-integration-modules</artifactId>
+      </dependency>
+
+      <!--                    -->
+      <!-- Deployment Modules -->
+      <!--                    -->
+
+      <!-- Default Portal -->
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.web.eXoResources</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.web.portal</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.gadgets-server</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.eXoGadgets</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.portlet.web</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.web.rest</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.portlet.exoadmin</artifactId>
+         <type>war</type>
+      </dependency>
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.portlet.dashboard</artifactId>
+         <type>war</type>
+      </dependency>
+
+
+      <!--         -->
+      <!-- Samples -->
+      <!--         -->
+
+      <!-- Sample Portal -->
+      <!--dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>gatein-sample-portal</artifactId>
+         <type>ear</type>
+         <version>${project.version}</version>
+      </dependency-->
+      <dependency>
+        <groupId>org.exoplatform.portal</groupId>
+        <artifactId>exo.portal.sample.portal.config</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.exoplatform.portal</groupId>
+        <artifactId>exo.portal.sample.portal.jar</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.exoplatform.portal</groupId>
+        <artifactId>exo.portal.sample.portal.war</artifactId>
+         <version>${project.version}</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.exoplatform.portal</groupId>
+        <artifactId>exo.portal.sample.portal.rest-war</artifactId>
+         <version>${project.version}</version>
+        <type>war</type>
+      </dependency>
+
+
+      <!-- Sample Extension -->
+      <!--dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>gatein-sample-extension</artifactId>
+         <type>ear</type>
+         <version>${project.version}</version>
+      </dependency-->
+      <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.sample.extension.config</artifactId>
+         <version>${project.version}</version>
+       </dependency>
+       <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.sample.extension.jar</artifactId>
+          <version>${project.version}</version>
+       </dependency>
+       <dependency>
+         <groupId>org.exoplatform.portal</groupId>
+         <artifactId>exo.portal.sample.extension.war</artifactId>
+          <version>${project.version}</version>
+         <type>war</type>
+       </dependency>
+
+      <!-- Sample Skin -->
+      <dependency>
+         <groupId>org.gatein.portal.examples.skins</groupId>
+         <artifactId>gatein-sample-skin</artifactId>
+         <type>war</type>
+      </dependency>
+
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-enforcer-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>check-jboss-environment-ready</id>
+                  <goals>
+                     <goal>enforce</goal>
+                  </goals>
+                  <configuration>
+                     <rules>
+                        <requireProperty>
+                           <property>jbossas.path</property>
+                           <message>"
+You must define the property 'jbossas.path'
+to give the path to the directory where you store your applications servers.
+"
+                           </message>
+                        </requireProperty>
+                        <requireProperty>
+                           <property>jbossas.name</property>
+                           <message>"
+You must define the property 'jbossas.name'
+to give the name of the directory where JBoss AS is stored.
+"
+                           </message>
+                        </requireProperty>
+                        <requireFilesExist>
+                           <files>
+                              <file>${jbossas.path}/${jbossas.name}/</file>
+                           </files>
+                           <message>"
+The following JBoss AS directory doesn't exist :
+                              ${jbossas.path}/${jbossas.name}
+
+Make JBoss AS instance available at that location, or use -Dservers.dir=PATH to point to the correct location of servers directory
+and/or -Djbossas.name=NAME to point to the correct directory under the servers directory.
+You can also use -Pdownload to automatically provide JBoss AS instance.
+"
+                           </message>
+                        </requireFilesExist>
+                     </rules>
+                     <fail>true</fail>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <artifactId>maven-clean-plugin</artifactId>
+            <version>2.4.1</version>
+            <executions>
+               <execution>
+                  <id>auto-clean</id>
+                  <phase>initialize</phase>
+                  <goals>
+                     <goal>clean</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.6</version>
+            <executions>
+               <execution>
+                  <id>prepare-package</id>
+                  <phase>prepare-package</phase>
+                  <goals>
+                     <goal>run</goal>
+                  </goals>
+                  <configuration>
+                     <target>
+                        <ant antfile="${project.basedir}/package.xml" inheritRefs="true">
+                           <target name="package"/>
+                           <property name="maven.project.basedir" value="${project.basedir}"/>
+                           <property name="maven.project.build.directory" value="${project.build.directory}"/>
+                        </ant>
+                     </target>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+   </build>
+
+
+   <profiles>
+      <profile>
+         <id>pkg-jbossas7</id>
+         <activation>
+            <activeByDefault>true</activeByDefault>
+         </activation>
+
+         <properties>
+            <exo.projects.app.jboss7.version>jboss-as-7.0.2.Final</exo.projects.app.jboss7.version>
+            <servers.dir>${exo.projects.directory.dependencies}</servers.dir>
+            <jbossas.name>${exo.projects.app.jboss7.version}</jbossas.name>
+         </properties>
+
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-enforcer-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>check-jboss-legacy-environment-dependencies-dir</id>
+                        <goals>
+                           <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                           <rules>
+                              <requireProperty>
+                                 <property>exo.projects.directory.dependencies</property>
+                                 <message>"
+You must define the property 'exo.projects.directory.dependencies'
+to specify the path to the directory where you store your application servers.
+"
+                                 </message>
+                              </requireProperty>
+                           </rules>
+                           <fail>true</fail>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>check-jboss-legacy-environment-jboss-name</id>
+                        <goals>
+                           <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                           <rules>
+                              <requireProperty>
+                                 <property>exo.projects.app.jboss7.version</property>
+                                 <message>"
+You must define the property 'exo.projects.app.jboss7.version'
+to specify the name of the directory where JBoss AS is stored.
+"
+                                 </message>
+                              </requireProperty>
+                           </rules>
+                           <fail>true</fail>
+                        </configuration>
+                     </execution>
+
+                     <execution>
+                        <id>check-jboss-dir-exists</id>
+                        <goals>
+                           <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                           <rules>
+                              <requireFilesExist>
+                                 <files>
+                                    <file>${exo.projects.directory.dependencies}/${exo.projects.app.jboss7.version}/
+                                    </file>
+                                 </files>
+                                 <message>"
+The following JBoss AS directory doesn't exist :
+                                    ${exo.projects.directory.dependencies}/${exo.projects.app.jboss7.version}
+
+Make JBoss AS instance available at that location, or use -Dexo.projects.directory.dependencies=PATH to point to the correct location
+of servers directory and/or -Dexo.projects.app.jboss7.version=NAME to point to the correct directory under the servers directory.
+You can also use -Pdownload to automatically provide JBoss AS instance.
+"
+                                 </message>
+                              </requireFilesExist>
+                           </rules>
+                           <fail>true</fail>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>check-jboss-environment-ready</id>
+                        <phase>none</phase>
+                     </execution>
+                  </executions>
+               </plugin>
+
+            </plugins>
+         </build>
+      </profile>
+
+      <profile>
+         <id>download</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-enforcer-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>check-jboss-environment-ready</id>
+                        <phase>none</phase>
+                     </execution>
+                     <execution>
+                        <id>check-jboss-legacy-environment-jboss-name</id>
+                        <phase>none</phase>
+                     </execution>
+                     <execution>
+                        <id>check-jboss-dir-exists</id>
+                        <phase>none</phase>
+                     </execution>
+                  </executions>
+               </plugin>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-antrun-plugin</artifactId>
+                  <version>1.6</version>
+                  <executions>
+                     <execution>
+                        <id>prepare-package</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                        <configuration>
+                           <target>
+                              <available property="jbossas.dir.exists" type="dir" file="${jbossas.dir}"/>
+
+                              <fail if="jbossas.dir.exists">"
+Destination JBossAS directory exists already:
+                                 ${jbossas.dir}
+
+Either rename it, delete it, or deactivate -Pdownload profile.
+"
+                              </fail>
+
+                              <property name="jbossas.zip"
+                                        value="${jbossas.path}/jboss-as-${jbossas.dist.version}.zip"/>
+
+                              <!-- Autocreate servers.dir if necessary -->
+                              <mkdir dir="${jbossas.path}"/>
+
+                              <!-- Download JBossAS unless already downloaded -->
+                              <ant antfile="${project.basedir}/download-jboss.xml">
+                                 <target name="download-jboss"/>
+                                 <property name="url"
+                                           value="http://download.jboss.org/jbossas/7.0/jboss-as-${jbossas.dist.version}/jboss-as-${jbossas.dist.version}.zip"/>
+                                 <property name="dest" value="${jbossas.zip}"/>
+                              </ant>
+
+                              <!-- Extract downloaded JBossAS to servers dir -->
+                              <unzip src="${jbossas.zip}" dest="${jbossas.path}" overwrite="false"/>
+
+                              <ant antfile="${project.basedir}/package.xml" inheritRefs="true">
+                                 <target name="package"/>
+                                 <property name="maven.project.basedir" value="${project.basedir}"/>
+                                 <property name="maven.project.build.directory" value="${project.build.directory}"/>
+                              </ant>
+                           </target>
+                        </configuration>
+                     </execution>
+                  </executions>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+</project>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/exokey.pem
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/exokey.pem	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/exokey.pem	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,29 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDMYzu2ZJb6Mt89RxjYcPb01clMna7PJTm+UneDYELKjG6EZ4Nu
++v8Di7e2PxpNlW4cCwUiEkiWBrZH8S1caz4CYIAG+VmKXZXBgmNCINgRVzNtj0/E
+4xi5Yz+G1uGCkaB+1mheJWke1rO6SgL6tJ5LmEYCGGu0mj+vxD8W2i4nBwIDAQAB
+AoGAJS1zwiSf9djlFI9nLI+3zCdLG32fO5zI2R7FEIek/pT20WzG0pwjYPC8NRFb
+Zntk8QLsJxtuSqPj6kgreSEkwRR/YGVIo/xIr46vwl/WydMLKJljvu+E7Y4yjYHb
+X4+FDRSL+huOMNNrHgnMy8WnplvtuW5LNV4kD3izU37jxQECQQD15re+8J3C8O6m
+wt8+5Ed6a+1+BIdFggFFpV4oC2AKE11+dnwxD5ZyB77sg6sCbcWbLTXOyp/CCAY8
+bkp9ZbOBAkEA1MgP7ZKUUrtrIIg0VYaTTH24iMWTOsPbgNWg9DlLzmIagHHmmmLC
+O6gFT05bsNPcFv5a25m+jT1yfvjuKLN+hwJBAJHD544/UjWZ3s5p3C6K4bg3PDwk
+cQ+KBjkD0zHHtHGkkxqBIBNxGwyTfOD1GC1DZw0amrfvsw4w9YljE7ML04ECQHrX
+IPLrm3uDvZ3jZCs37RPMxNsZDR1w8ukW67vy1APK+TfMCfB5MV8VajNVrnOQa9BO
+eY+r26lYnyAUgBG5RkMCQHW5qFDYmgJjb38+uwxd53zGy6m+Jd7kdnGms9V4pPd1
+b21WA/5ncxrpFaz5OFPLtv2zrKYVBAj0tros5hs8Fwk=
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICGzCCAYSgAwIBAgIJAJ/PJcjrAB25MA0GCSqGSIb3DQEBBAUAMBQxEjAQBgNV
+BAMTCW15dGVzdGtleTAeFw0wOTAxMDgwNzUwMjlaFw0xMDAxMDgwNzUwMjlaMBQx
+EjAQBgNVBAMTCW15dGVzdGtleTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+zGM7tmSW+jLfPUcY2HD29NXJTJ2uzyU5vlJ3g2BCyoxuhGeDbvr/A4u3tj8aTZVu
+HAsFIhJIlga2R/EtXGs+AmCABvlZil2VwYJjQiDYEVczbY9PxOMYuWM/htbhgpGg
+ftZoXiVpHtazukoC+rSeS5hGAhhrtJo/r8Q/FtouJwcCAwEAAaN1MHMwHQYDVR0O
+BBYEFB6QdOIZawuedUjT4F+bK9RG8+sMMEQGA1UdIwQ9MDuAFB6QdOIZawuedUjT
+4F+bK9RG8+sMoRikFjAUMRIwEAYDVQQDEwlteXRlc3RrZXmCCQCfzyXI6wAduTAM
+BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBAAE/6mmd8/mMyzzFozblp04e
+TonwNrUB7TldXj+0WnYP04u0hNJuFJ/KD29gHdMnYDdOiVdmK/WS6a7Mn+7HVDT7
+wytizzu/Jfvlrr3yMQYCZssvNIbXPTmr+MjLErjkRxYi4quAnkankTNCDxa4mxN3
+WNlNt2SavfSi3d60wd5o
+-----END CERTIFICATE-----

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/oauthkey.pem
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/oauthkey.pem	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/oauthkey.pem	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMxjO7Zklvoy3z1H
+GNhw9vTVyUydrs8lOb5Sd4NgQsqMboRng276/wOLt7Y/Gk2VbhwLBSISSJYGtkfx
+LVxrPgJggAb5WYpdlcGCY0Ig2BFXM22PT8TjGLljP4bW4YKRoH7WaF4laR7Ws7pK
+Avq0nkuYRgIYa7SaP6/EPxbaLicHAgMBAAECgYAlLXPCJJ/12OUUj2csj7fMJ0sb
+fZ87nMjZHsUQh6T+lPbRbMbSnCNg8Lw1EVtme2TxAuwnG25Ko+PqSCt5ISTBFH9g
+ZUij/Eivjq/CX9bJ0wsomWO+74TtjjKNgdtfj4UNFIv6G44w02seCczLxaemW+25
+bks1XiQPeLNTfuPFAQJBAPXmt77wncLw7qbC3z7kR3pr7X4Eh0WCAUWlXigLYAoT
+XX52fDEPlnIHvuyDqwJtxZstNc7Kn8IIBjxuSn1ls4ECQQDUyA/tkpRSu2sgiDRV
+hpNMfbiIxZM6w9uA1aD0OUvOYhqAceaaYsI7qAVPTluw09wW/lrbmb6NPXJ++O4o
+s36HAkEAkcPnjj9SNZnezmncLorhuDc8PCRxD4oGOQPTMce0caSTGoEgE3EbDJN8
+4PUYLUNnDRqat++zDjD1iWMTswvTgQJAetcg8uube4O9neNkKzftE8zE2xkNHXDy
+6Rbru/LUA8r5N8wJ8HkxXxVqM1Wuc5Br0E55j6vbqVifIBSAEblGQwJAdbmoUNia
+AmNvfz67DF3nfMbLqb4l3uR2caaz1Xik93VvbVYD/mdzGukVrPk4U8u2/bOsphUE
+CPS2uizmGzwXCQ==
+-----END PRIVATE KEY-----

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.bat
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.bat	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.bat	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,108 @@
+ at echo off
+rem -------------------------------------------------------------------------
+rem JBoss Bootstrap Script for Windows
+rem -------------------------------------------------------------------------
+
+rem $Id$
+
+ at if not "%ECHO%" == ""  echo %ECHO%
+ at if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+  set "DIRNAME=%~dp0%"
+) else (
+  set DIRNAME=.\
+)
+
+rem Read an optional configuration file.
+if "x%STANDALONE_CONF%" == "x" (   
+   set "STANDALONE_CONF=%DIRNAME%standalone.conf.bat"
+)
+if exist "%STANDALONE_CONF%" (
+   echo Calling %STANDALONE_CONF%
+   call "%STANDALONE_CONF%" %*
+) else (
+   echo Config file not found %STANDALONE_CONF%
+)
+
+pushd %DIRNAME%..
+if "x%JBOSS_HOME%" == "x" (
+  set "JBOSS_HOME=%CD%"
+)
+popd
+
+set DIRNAME=
+
+if "%OS%" == "Windows_NT" (
+  set "PROGNAME=%~nx0%"
+) else (
+  set "PROGNAME=standalone.bat"
+)
+
+rem Setup JBoss specific properties
+set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
+
+if "x%JAVA_HOME%" == "x" (
+  set  JAVA=java
+  echo JAVA_HOME is not set. Unexpected results may occur.
+  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
+) else (
+  set "JAVA=%JAVA_HOME%\bin\java"
+)
+
+rem Add -server to the JVM options, if supported
+"%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
+if not errorlevel == 1 (
+  set "JAVA_OPTS=%JAVA_OPTS% -server"
+)
+
+rem Find run.jar, or we can't continue
+if exist "%JBOSS_HOME%\jboss-modules.jar" (
+    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
+) else (
+  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
+  echo Please check that you are in the bin directory when running this script.
+  goto END
+)
+
+rem Setup JBoss specific properties
+
+rem Setup the java endorsed dirs
+set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
+
+rem Set default module root paths
+if "x%MODULEPATH%" == "x" (
+  set  "MODULEPATH=%JBOSS_HOME%\modules"
+)
+
+echo ===============================================================================
+echo.
+echo   JBoss Bootstrap Environment
+echo.
+echo   JBOSS_HOME: %JBOSS_HOME%
+echo.
+echo   JAVA: %JAVA%
+echo.
+echo   JAVA_OPTS: %JAVA_OPTS%
+echo.
+echo ===============================================================================
+echo.
+
+:RESTART
+"%JAVA%" %JAVA_OPTS% ^
+ "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\standalone\log\boot.log" ^
+ "-Dlogging.configuration=file:%JBOSS_HOME%/standalone/configuration/logging.properties" ^
+    -jar "%JBOSS_HOME%\jboss-modules.jar" ^
+    -mp "%MODULEPATH%;%JBOSS_HOME%\gatein\modules" ^
+    -logmodule "org.jboss.logmanager" ^
+    -jaxpmodule "javax.xml.jaxp-provider" ^
+     org.jboss.as.standalone ^
+    -Djboss.home.dir="%JBOSS_HOME%" ^
+     %*
+
+if ERRORLEVEL 10 goto RESTART
+
+:END
+if "x%NOPAUSE%" == "x" pause
+
+:END_NO_PAUSE

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,65 @@
+## -*- shell-script -*- ######################################################
+##                                                                          ##
+##  JBoss Bootstrap Script Configuration                                    ##
+##                                                                          ##
+##############################################################################
+
+#
+# This file is optional; it may be removed if not needed.
+#
+
+#
+# Specify the maximum file descriptor limit, use "max" or "maximum" to use
+# the default, as queried by the system.
+#
+# Defaults to "maximum"
+#
+#MAX_FD="maximum"
+
+#
+# Specify the profiler configuration file to load.
+#
+# Default is to not load profiler configuration file.
+#
+#PROFILER=""
+
+#
+# Specify the location of the Java home directory.  If set then $JAVA will
+# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
+#
+#JAVA_HOME="/opt/java/jdk"
+
+#
+# Specify the exact Java VM executable to use.
+#
+#JAVA=""
+
+if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
+   JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"
+fi
+
+#
+# Specify options to pass to the Java VM.
+#
+if [ "x$JAVA_OPTS" = "x" ]; then
+   JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
+fi
+
+# Sample JPDA settings for remote socket debugging
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+# Sample JPDA settings for shared memory debugging 
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"
+
+# Allow JProfiler to find its classes
+#JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.jprofiler"
+
+# Use JBoss Modules lockless mode
+#JAVA_OPTS="$JAVA_OPTS -Djboss.modules.lockless=true"
+
+# GateIn configuration directory
+JAVA_OPTS="$JAVA_OPTS -Dexo.conf.dir=$PWD/../standalone/configuration/gatein -Dgatein.conf.dir=\\\${jboss.server.config.dir}/gatein -Dexo.conf.dir.name=gatein"
+
+# development mode
+JAVA_OPTS="$JAVA_OPTS -Dexo.product.developing=true"

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf.bat
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf.bat	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.conf.bat	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,71 @@
+rem ### -*- batch file -*- ######################################################
+rem #                                                                          ##
+rem #  JBoss Bootstrap Script Configuration                                    ##
+rem #                                                                          ##
+rem #############################################################################
+
+rem # $Id: run.conf.bat 88820 2009-05-13 15:25:44Z dimitris at jboss.org $
+
+rem #
+rem # This batch file is executed by run.bat to initialize the environment 
+rem # variables that run.bat uses. It is recommended to use this file to
+rem # configure these variables, rather than modifying run.bat itself. 
+rem #
+
+if not "x%JAVA_OPTS%" == "x" goto JAVA_OPTS_SET
+
+rem #
+rem # Specify the JBoss Profiler configuration file to load.
+rem #
+rem # Default is to not load a JBoss Profiler configuration file.
+rem #
+rem set "PROFILER=%JBOSS_HOME%\bin\jboss-profiler.properties"
+
+rem #
+rem # Specify the location of the Java home directory (it is recommended that
+rem # this always be set). If set, then "%JAVA_HOME%\bin\java" will be used as
+rem # the Java VM executable; otherwise, "%JAVA%" will be used (see below).
+rem #
+rem set "JAVA_HOME=C:\opt\jdk1.6.0_23"
+
+rem #
+rem # Specify the exact Java VM executable to use - only used if JAVA_HOME is
+rem # not set. Default is "java".
+rem #
+rem set "JAVA=C:\opt\jdk1.6.0_23\bin\java"
+
+rem #
+rem # Specify options to pass to the Java VM. Note, there are some additional
+rem # options that are always passed by run.bat.
+rem #
+
+rem # JVM memory allocation pool parameters - modify as appropriate.
+set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MaxPermSize=256M"
+
+rem # Reduce the RMI GCs to once per hour for Sun JVMs.
+set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+
+rem # Warn when resolving remote XML DTDs or schemas.
+set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true"
+
+rem # Make Byteman classes visible in all module loaders
+rem # This is necessary to inject Byteman rules into AS7 deployments
+set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman"
+
+rem # Sample JPDA settings for remote socket debugging
+rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+rem # Sample JPDA settings for shared memory debugging
+rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"
+
+rem # Use JBoss Modules lockless mode
+rem #JAVA_OPTS="$JAVA_OPTS -Djboss.modules.lockless=true"
+
+
+:JAVA_OPTS_SET
+
+rem # GateIn configuration directory
+set "JAVA_OPTS=%JAVA_OPTS% -Dexo.conf.dir=%CD%\..\standalone\configuration\gatein -Dgatein.conf.dir=${jboss.server.config.dir}/gatein -Dexo.conf.dir.name=gatein"
+
+rem # development mode
+set "JAVA_OPTS=%JAVA_OPTS% -Dexo.product.developing=true"

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.sh
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.sh	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.sh	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,199 @@
+#!/bin/sh
+
+DIRNAME=`dirname "$0"`
+PROGNAME=`basename "$0"`
+GREP="grep"
+
+# Use the maximum available, or set MAX_FD != -1 to use that
+MAX_FD="maximum"
+
+#
+# Helper to complain.
+#
+warn() {
+    echo "${PROGNAME}: $*"
+}
+
+#
+# Helper to puke.
+#
+die() {
+    warn $*
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+darwin=false;
+linux=false;
+case "`uname`" in
+    CYGWIN*)
+        cygwin=true
+        ;;
+
+    Darwin*)
+        darwin=true
+        ;;
+
+    Linux)
+        linux=true
+        ;;
+esac
+
+# Read an optional running configuration file
+if [ "x$RUN_CONF" = "x" ]; then
+    RUN_CONF="$DIRNAME/standalone.conf"
+fi
+if [ -r "$RUN_CONF" ]; then
+    . "$RUN_CONF"
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+    [ -n "$JBOSS_HOME" ] &&
+        JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
+    [ -n "$JAVA_HOME" ] &&
+        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+    [ -n "$JAVAC_JAR" ] &&
+        JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"`
+fi
+
+# Setup JBOSS_HOME
+if [ "x$JBOSS_HOME" = "x" ]; then
+    # get the full path (without any relative bits)
+    JBOSS_HOME=`cd "$DIRNAME/.."; pwd`
+fi
+export JBOSS_HOME
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+    if [ "x$JAVA_HOME" != "x" ]; then
+        JAVA="$JAVA_HOME/bin/java"
+    else
+        JAVA="java"
+    fi
+fi
+
+# Check for -d32/-d64 in JAVA_OPTS
+JVM_OPTVERSION="-version"
+JVM_D64_OPTION=`echo $JAVA_OPTS | $GREP "\-d64"`
+JVM_D32_OPTION=`echo $JAVA_OPTS | $GREP "\-d32"`
+test "x$JVM_D64_OPTION" != "x" && JVM_OPTVERSION="-d64 $JVM_OPTVERSION"
+test "x$JVM_D32_OPTION" != "x" && JVM_OPTVERSION="-d32 $JVM_OPTVERSION"
+
+# If -server not set in JAVA_OPTS, set it, if supported
+SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
+if [ "x$SERVER_SET" = "x" ]; then
+
+    # Check for SUN(tm) JVM w/ HotSpot support
+    if [ "x$HAS_HOTSPOT" = "x" ]; then
+        HAS_HOTSPOT=`"$JAVA" $JVM_OPTVERSION -version 2>&1 | $GREP -i HotSpot`
+    fi
+
+    # Check for OpenJDK JVM w/server support
+    if [ "x$HAS_OPENJDK_" = "x" ]; then
+        HAS_OPENJDK=`"$JAVA" $JVM_OPTVERSION 2>&1 | $GREP -i OpenJDK`
+    fi
+
+    # Enable -server if we have Hotspot or OpenJDK, unless we can't
+    if [ "x$HAS_HOTSPOT" != "x" -o "x$HAS_OPENJDK" != "x" ]; then
+        # MacOS does not support -server flag
+        if [ "$darwin" != "true" ]; then
+            JAVA_OPTS="-server $JAVA_OPTS"
+            JVM_OPTVERSION="-server $JVM_OPTVERSION"
+        fi
+    fi
+else
+    JVM_OPTVERSION="-server $JVM_OPTVERSION"
+fi
+
+if [ "x$MODULEPATH" = "x" ]; then
+    MODULEPATH="$JBOSS_HOME/modules"
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+    JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+    JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
+    JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"`
+    MODULEPATH=`cygpath --path --windows "$MODULEPATH"`
+fi
+
+# Display our environment
+echo "========================================================================="
+echo ""
+echo "  JBoss Bootstrap Environment"
+echo ""
+echo "  JBOSS_HOME: $JBOSS_HOME"
+echo ""
+echo "  JAVA: $JAVA"
+echo ""
+echo "  JAVA_OPTS: $JAVA_OPTS"
+echo ""
+echo "========================================================================="
+echo ""
+
+while true; do
+   if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
+      # Execute the JVM in the foreground
+      eval \"$JAVA\" $JAVA_OPTS \
+         \"-Dorg.jboss.boot.log.file=$JBOSS_HOME/standalone/log/boot.log\" \
+         \"-Dlogging.configuration=file:$JBOSS_HOME/standalone/configuration/logging.properties\" \
+         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
+         -mp \"${MODULEPATH}:$JBOSS_HOME/gatein/modules\" \
+         -logmodule "org.jboss.logmanager" \
+         -jaxpmodule javax.xml.jaxp-provider \
+         org.jboss.as.standalone \
+         -Djboss.home.dir=\"$JBOSS_HOME\" \
+         "$@"
+      JBOSS_STATUS=$?
+   else
+      # Execute the JVM in the background
+      eval \"$JAVA\" $JAVA_OPTS \
+         \"-Dorg.jboss.boot.log.file=$JBOSS_HOME/standalone/log/boot.log\" \
+         \"-Dlogging.configuration=file:$JBOSS_HOME/standalone/configuration/logging.properties\" \
+         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
+         -mp \"${MODULEPATH}:$JBOSS_HOME/gatein/modules\" \
+         -logmodule "org.jboss.logmanager" \
+         -jaxpmodule javax.xml.jaxp-provider \
+         org.jboss.as.standalone \
+         -Djboss.home.dir=\"$JBOSS_HOME\" \
+         "$@" "&"
+      JBOSS_PID=$!
+      # Trap common signals and relay them to the jboss process
+      trap "kill -HUP  $JBOSS_PID" HUP
+      trap "kill -TERM $JBOSS_PID" INT
+      trap "kill -QUIT $JBOSS_PID" QUIT
+      trap "kill -PIPE $JBOSS_PID" PIPE
+      trap "kill -TERM $JBOSS_PID" TERM
+      if [ "x$JBOSS_PIDFILE" != "x" ]; then
+        echo $JBOSS_PID > $JBOSS_PIDFILE
+      fi
+      # Wait until the background process exits
+      WAIT_STATUS=128
+      while [ "$WAIT_STATUS" -ge 128 ]; do
+         wait $JBOSS_PID 2>/dev/null
+         WAIT_STATUS=$?
+         if [ "$WAIT_STATUS" -gt 128 ]; then
+            SIGNAL=`expr $WAIT_STATUS - 128`
+            SIGNAL_NAME=`kill -l $SIGNAL`
+            echo "*** JBossAS process ($JBOSS_PID) received $SIGNAL_NAME signal ***" >&2
+         fi
+      done
+      if [ "$WAIT_STATUS" -lt 127 ]; then
+         JBOSS_STATUS=$WAIT_STATUS
+      else
+         JBOSS_STATUS=0
+      fi
+      if [ "$JBOSS_STATUS" -ne 10 ]; then
+            # Wait for a complete shudown
+            wait $JBOSS_PID 2>/dev/null
+      fi
+   fi
+   if [ "$JBOSS_STATUS" -eq 10 ]; then
+      echo "Restarting JBoss..."
+   else
+      exit $JBOSS_STATUS
+   fi
+done


Property changes on: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/standalone.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/bin/test.policy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2010, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.as.web">
+
+    <resources>
+       <resource-root path="jboss-as-web-7.0.2.Final.jar"/>
+       <resource-root path="jasper-jdt-7.0.0.Beta8.jar"/>
+       <resource-root path="jbossweb-7.0.1.Final.jar"/>
+       <!-- Insert resources here -->
+    </resources>
+
+    <dependencies>
+       <module name="sun.jdk"/>
+       <module name="com.sun.jsf-impl"/>
+       <module name="javax.annotation.api"/>
+       <module name="javax.api"/>
+       <module name="javax.faces.api"/>
+       <module name="javax.servlet.api"/>
+       <module name="javax.servlet.jsp.api"/>
+       <module name="org.jboss.jandex"/>
+       <module name="org.jboss.staxmapper"/>
+       <module name="org.jboss.as.clustering.web.spi" optional="true"/>
+       <module name="org.jboss.as.controller"/>
+       <module name="org.jboss.as.ee"/>
+       <module name="org.jboss.as.naming"/>
+       <module name="org.jboss.as.network"/>
+       <module name="org.jboss.as.security"/>
+       <module name="org.jboss.as.server"/>
+       <module name="org.jboss.as.threads"/>
+       <module name="org.jboss.invocation"/>
+       <module name="org.jboss.metadata"/>
+       <module name="org.jboss.modules"/>
+       <module name="org.jboss.msc"/>
+       <module name="org.jboss.threads"/>
+       <module name="org.jboss.vfs"/>
+       <module name="org.jboss.logging"/>
+       <module name="org.jboss.common-core"/>
+       <module name="org.picketbox"/>
+       <module name="org.gatein.wci"/>
+    </dependencies>
+</module>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.properties
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.properties	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.properties	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,72 @@
+#
+# 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
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+#
+gatein.conf.dir=${jboss.server.config.dir}/gatein
+gatein.data.dir=${jboss.server.data.dir}/gatein
+
+# DB
+gatein.db.data.dir=${gatein.data.dir}/db
+
+# JCR
+gatein.jcr.config.type=local
+gatein.jcr.datasource.name=java:jdbcjcr
+gatein.jcr.datasource.dialect=auto
+gatein.jcr.datasource.driver=org.hsqldb.jdbcDriver
+gatein.jcr.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcjcr_${name}
+gatein.jcr.datasource.username=sa
+gatein.jcr.datasource.password=
+
+gatein.jcr.data.dir=${gatein.data.dir}/jcr
+gatein.jcr.storage.data.dir=${gatein.jcr.data.dir}/values
+gatein.jcr.cache.config=classpath:/conf/jcr/jbosscache/${gatein.jcr.config.type}/config.xml
+gatein.jcr.lock.cache.config=classpath:/conf/jcr/jbosscache/${gatein.jcr.config.type}/lock-config.xml
+gatein.jcr.index.data.dir=${gatein.jcr.data.dir}/lucene
+gatein.jcr.index.changefilterclass=org.exoplatform.services.jcr.impl.core.query.DefaultChangesFilter
+gatein.jcr.index.cache.config=classpath:/conf/jcr/jbosscache/cluster/indexer-config.xml
+gatein.jcr.jgroups.config=classpath:/conf/jcr/jbosscache/cluster/udp-mux.xml
+
+# IDM
+gatein.idm.datasource.name=java:jdbcidm
+gatein.idm.datasource.driver=org.hsqldb.jdbcDriver
+gatein.idm.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcidm_${name}
+gatein.idm.datasource.username=sa
+gatein.idm.datasource.password=
+
+# EMail
+gatein.email.smtp.username=
+gatein.email.smtp.password=
+gatein.email.smtp.host=smtp.gmail.com
+gatein.email.smtp.port=465
+gatein.email.smtp.starttls.enable=true
+gatein.email.smtp.auth=true
+gatein.email.smtp.socketFactory.port=465
+gatein.email.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
+
+# Global portlet.xml
+gatein.portlet.config=${gatein.conf.dir}/portlet.xml
+
+# Portal configuration
+gatein.portal.idm.createuserportal=false
+gatein.portal.idm.destroyuserportal=true
+gatein.portal.controller.config=${gatein.conf.dir}/controller.xml
+
+# key files for gadget
+gatein.gadgets.securitytokenkeyfile=${gatein.conf.dir}/gadgets/key.txt
+gatein.gadgets.signingkeyfile=${gatein.conf.dir}/gadgets/oauthkey.pem

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/configuration.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,68 @@
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+	xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+	<component>
+		<!-- The full qualified name of the PortalContainerConfig -->
+		<type>org.exoplatform.container.definition.PortalContainerConfig</type>
+		<init-params>
+			<!-- The name of the default portal container -->
+			<value-param>
+				<name>default.portal.container</name>
+				<value>portal</value>
+			</value-param>
+			<!-- The name of the default rest ServletContext -->
+			<value-param>
+				<name>default.rest.context</name>
+				<value>rest</value>
+			</value-param>
+			<!-- The name of the default realm -->
+			<value-param>
+				<name>default.realm.name</name>
+				<value>gatein-domain</value>
+			</value-param>
+			<!-- The default portal container definition -->
+			<!-- It cans be used to avoid duplicating configuration -->
+			<object-param>
+				<name>default.portal.definition</name>
+				<object type="org.exoplatform.container.definition.PortalContainerDefinition">
+					<!-- The path to the external properties file -->
+					<field name="externalSettingsPath">
+						<string>configuration.properties</string>
+					</field>
+					<field name="dependencies">
+						<collection type="java.util.ArrayList">
+							<value>
+								<string>eXoResources</string>
+							</value>
+							<value>
+								<string>portal</string>
+							</value>
+							<value>
+								<string>dashboard</string>
+							</value>
+							<value>
+								<string>exoadmin</string>
+							</value>
+							<value>
+								<string>eXoGadgets</string>
+							</value>
+							<value>
+								<string>eXoGadgetServer</string>
+							</value>
+							<value>
+								<string>rest</string>
+							</value>
+							<value>
+								<string>wsrp-producer</string>
+							</value>
+							<value>
+								<string>web</string>
+							</value>
+						</collection>
+					</field>                    
+				</object>
+			</object-param>
+		</init-params>
+	</component>
+</configuration>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/controller.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/controller.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/controller.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,139 @@
+<!--
+  ~ Copyright (C) 2011 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<controller
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_controller_1_0 http://www.gatein.org/xml/ns/gatein_controller_1_0"
+    xmlns="http://www.gatein.org/xml/ns/gatein_controller_1_0"
+    separator-escape=":">
+
+  <route path="/upload">
+    <route-param qname="gtn:handler">
+      <value>upload</value>
+    </route-param>
+  </route>
+
+  <route path="/download">
+    <route-param qname="gtn:handler">
+      <value>download</value>
+    </route-param>
+  </route>
+
+  <!-- The legacy route -->
+  <route path="/public">
+    <route path="/">
+      <route-param qname="gtn:handler">
+        <value>default</value>
+      </route-param>
+    </route>
+    <route path="/{gtn:sitename}/{gtn:path}">
+      <route-param qname="gtn:handler">
+        <value>legacy</value>
+      </route-param>
+      <path-param qname="gtn:path" encoding="preserve-path">
+        <pattern>.*</pattern>
+      </path-param>
+    </route>
+  </route>
+  <route path="/private">
+    <route path="/">
+      <route-param qname="gtn:handler">
+        <value>default</value>
+      </route-param>
+    </route>
+    <route path="/{gtn:sitename}/{gtn:path}">
+	  <route-param qname="gtn:handler">
+	    <value>legacy</value>
+	  </route-param>
+	  <path-param qname="gtn:path" encoding="preserve-path">
+	    <pattern>.*</pattern>
+	  </path-param>
+  	</route>
+  </route>
+
+  <route path="/">
+
+    <!-- The portal handler -->
+    <route-param qname="gtn:handler">
+      <value>portal</value>
+    </route-param>
+
+    <!-- Webui parameters -->
+    <request-param qname="gtn:componentid" name="portal:componentId"/>
+    <request-param qname="gtn:action" name="portal:action"/>
+    <request-param qname="gtn:objectid" name="objectId"/>
+
+    <!-- The group access -->
+    <route path="/g/{gtn:sitename}/{gtn:path}">
+      <request-param qname="gtn:lang" name="lang" value-mapping="never-empty">
+        <pattern>([A-Za-z]{2}(-[A-Za-z]{2})?)?</pattern>
+      </request-param>
+      <route-param qname="gtn:sitetype">
+        <value>group</value>
+      </route-param>
+      <path-param qname="gtn:path" encoding="preserve-path">
+        <pattern>.*</pattern>
+      </path-param>
+    </route>
+
+    <!-- The user access -->
+    <route path="/u/{gtn:sitename}/{gtn:path}">
+      <request-param qname="gtn:lang" name="lang" value-mapping="never-empty">
+        <pattern>([A-Za-z]{2}(-[A-Za-z]{2})?)?</pattern>
+      </request-param>
+      <route-param qname="gtn:sitetype">
+        <value>user</value>
+      </route-param>
+      <path-param qname="gtn:path" encoding="preserve-path">
+        <pattern>.*</pattern>
+      </path-param>
+    </route>
+
+    <!-- The portal access -->
+    <route path="/{gtn:lang}/{gtn:sitename}/{gtn:path}">
+      <route-param qname="gtn:sitetype">
+        <value>portal</value>
+      </route-param>
+      <path-param qname="gtn:lang" encoding="preserve-path">
+        <pattern>([A-Za-z]{2}(-[A-Za-z]{2})?)?</pattern>
+      </path-param>
+      <path-param qname="gtn:path" encoding="preserve-path">
+        <pattern>.*</pattern>
+      </path-param>
+    </route>
+
+  </route>
+
+  <route path="/{gtn:path}">
+    <route-param qname="gtn:handler">
+      <value>staticResource</value>
+    </route-param>
+    <path-param qname="gtn:path" encoding="preserve-path">
+      <pattern>.*\.(jpg|png|gif|ico|css)</pattern>
+    </path-param>
+  </route>
+
+  <!-- Default handler -->
+  <route path="/">
+    <route-param qname="gtn:handler">
+      <value>default</value>
+    </route-param>
+  </route>
+
+</controller>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/gadgets/oauthkey.pem
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/gadgets/oauthkey.pem	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/gadgets/oauthkey.pem	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMxjO7Zklvoy3z1H
+GNhw9vTVyUydrs8lOb5Sd4NgQsqMboRng276/wOLt7Y/Gk2VbhwLBSISSJYGtkfx
+LVxrPgJggAb5WYpdlcGCY0Ig2BFXM22PT8TjGLljP4bW4YKRoH7WaF4laR7Ws7pK
+Avq0nkuYRgIYa7SaP6/EPxbaLicHAgMBAAECgYAlLXPCJJ/12OUUj2csj7fMJ0sb
+fZ87nMjZHsUQh6T+lPbRbMbSnCNg8Lw1EVtme2TxAuwnG25Ko+PqSCt5ISTBFH9g
+ZUij/Eivjq/CX9bJ0wsomWO+74TtjjKNgdtfj4UNFIv6G44w02seCczLxaemW+25
+bks1XiQPeLNTfuPFAQJBAPXmt77wncLw7qbC3z7kR3pr7X4Eh0WCAUWlXigLYAoT
+XX52fDEPlnIHvuyDqwJtxZstNc7Kn8IIBjxuSn1ls4ECQQDUyA/tkpRSu2sgiDRV
+hpNMfbiIxZM6w9uA1aD0OUvOYhqAceaaYsI7qAVPTluw09wW/lrbmb6NPXJ++O4o
+s36HAkEAkcPnjj9SNZnezmncLorhuDc8PCRxD4oGOQPTMce0caSTGoEgE3EbDJN8
+4PUYLUNnDRqat++zDjD1iWMTswvTgQJAetcg8uube4O9neNkKzftE8zE2xkNHXDy
+6Rbru/LUA8r5N8wJ8HkxXxVqM1Wuc5Br0E55j6vbqVifIBSAEblGQwJAdbmoUNia
+AmNvfz67DF3nfMbLqb4l3uR2caaz1Xik93VvbVYD/mdzGukVrPk4U8u2/bOsphUE
+CPS2uizmGzwXCQ==
+-----END PRIVATE KEY-----

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/portlet.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/portlet.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/gatein/portlet.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
+  <!-- This filter collects runtime request statistics -->
+  <filter>
+    <filter-name>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-name>
+    <filter-class>org.exoplatform.portal.application.ApplicationMonitoringFilter</filter-class>
+    <lifecycle>ACTION_PHASE</lifecycle>
+    <lifecycle>RENDER_PHASE</lifecycle>
+    <lifecycle>EVENT_PHASE</lifecycle>
+    <lifecycle>RESOURCE_PHASE</lifecycle>
+  </filter>
+
+</portlet-app>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,395 @@
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<server xmlns="urn:jboss:domain:1.0">
+
+    <extensions>
+        <extension module="org.jboss.as.clustering.infinispan"/>
+        <extension module="org.jboss.as.connector"/>
+        <extension module="org.jboss.as.deployment-scanner"/>
+        <extension module="org.jboss.as.ee"/>
+        <extension module="org.jboss.as.ejb3"/>
+        <extension module="org.jboss.as.jaxrs"/>
+        <extension module="org.jboss.as.jmx"/>
+        <extension module="org.jboss.as.jpa"/>
+        <extension module="org.jboss.as.logging"/>
+        <extension module="org.jboss.as.naming"/>
+        <extension module="org.jboss.as.osgi"/>
+        <extension module="org.jboss.as.pojo"/>
+        <extension module="org.jboss.as.remoting"/>
+        <extension module="org.jboss.as.sar"/>
+        <extension module="org.jboss.as.security"/>
+        <extension module="org.jboss.as.threads"/>
+        <extension module="org.jboss.as.transactions"/>
+        <extension module="org.jboss.as.web" />
+        <extension module="org.jboss.as.weld" />
+        <extension module="org.gatein"/>
+    </extensions>
+
+    <management>
+	    <security-realms>
+		    <security-realm name="PropertiesMgmtSecurityRealm">
+			    <authentication>
+				    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" />
+			    </authentication>
+		    </security-realm>
+	    </security-realms>
+        <management-interfaces>
+           <native-interface interface="management" port="9999" />
+           <http-interface interface="management" port="9990"/>
+        </management-interfaces>
+    </management>
+
+    <profile>
+        <!--subsystem xmlns="urn:jboss:domain:logging:1.1">
+            <console-handler name="CONSOLE">
+                <level name="INFO"/>
+                <formatter>
+                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+                </formatter>
+            </console-handler>
+
+            <periodic-rotating-file-handler name="FILE">
+                <level name="INFO"/>
+                <formatter>
+                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+                </formatter>
+                <file relative-to="jboss.server.log.dir" path="server.log"/>
+                <suffix value=".yyyy-MM-dd"/>
+            </periodic-rotating-file-handler>
+
+            <logger category="com.arjuna">
+                <level name="WARN"/>
+            </logger>
+            <logger category="org.apache.tomcat.util.modeler">
+                <level name="WARN"/>
+            </logger>
+            <logger category="sun.rmi">
+                <level name="WARN"/>
+            </logger>
+
+            <root-logger>
+                <level name="INFO"/>
+                <handlers>
+                    <handler name="CONSOLE"/>
+                    <handler name="FILE"/>
+                </handlers>
+            </root-logger>
+        </subsystem-->
+       <subsystem xmlns="urn:jboss:domain:logging:1.0">
+           <console-handler name="CONSOLE" autoflush="true">
+               <level name="TRACE"/>
+               <formatter>
+                   <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+               </formatter>
+           </console-handler>
+           <periodic-rotating-file-handler name="FILE" autoflush="true">
+               <level name="INFO"/>
+               <formatter>
+                   <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
+               </formatter>
+               <file relative-to="jboss.server.log.dir" path="server.log"/>
+               <suffix value=".yyyy-MM-dd"/>
+           </periodic-rotating-file-handler>
+           <logger category="org">
+               <level name="INFO"/>
+           </logger>
+           <logger category="exo">
+               <level name="INFO"/>
+           </logger>
+           <logger category="net">
+               <level name="INFO"/>
+           </logger>
+           <logger category="javax">
+               <level name="INFO"/>
+           </logger>
+           <logger category="com">
+               <level name="INFO"/>
+           </logger>
+           <logger category="com.arjuna">
+               <level name="WARN"/>
+           </logger>
+           <logger category="org.apache.tomcat.util.modeler">
+               <level name="WARN"/>
+           </logger>
+           <logger category="org.jboss.msc">
+               <level name="DEBUG"/>
+           </logger>
+           <logger category="org.jboss.as.server.deployment">
+               <level name="DEBUG"/>
+           </logger>
+           <logger category="sun.rmi">
+               <level name="WARN"/>
+           </logger>
+           <logger category="org.gatein.integration">
+               <level name="TRACE"/>
+           </logger>
+           <root-logger>
+               <level name="TRACE"/>
+               <handlers>
+                   <handler name="CONSOLE"/>
+                   <handler name="FILE"/>
+               </handlers>
+           </root-logger>
+       </subsystem>
+        <subsystem xmlns="urn:jboss:domain:datasources:1.0">
+            <datasources>
+                <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
+                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
+                    <driver>h2</driver>
+                    <pool></pool>
+                    <security>
+                        <user-name>sa</user-name>
+                        <password>sa</password>
+                    </security>
+                </datasource>
+                <drivers>
+                    <driver name="h2" module="com.h2database.h2">
+                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
+                    </driver>
+                </drivers>
+            </datasources>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
+            <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" deployment-timeout="300"/>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:ee:1.0" />
+        <subsystem xmlns="urn:jboss:domain:ejb3:1.1" lite="true">
+            <!-- EJB3 pools -->
+            <pools>
+                <bean-instance-pools>
+                    <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5"
+                                     instance-acquisition-timeout-unit="MINUTES"/>
+                </bean-instance-pools>
+            </pools>
+
+            <!-- Session bean configurations -->
+            <session-bean>
+                <stateless>
+                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
+                </stateless>
+            </session-bean>
+
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:infinispan:1.0" default-cache-container="hibernate">
+            <cache-container name="hibernate" default-cache="local-query">
+                <local-cache name="entity">
+                    <eviction strategy="LRU" max-entries="10000"/>
+                    <expiration max-idle="100000"/>
+                </local-cache>
+                <local-cache name="local-query">
+                    <eviction strategy="LRU" max-entries="10000"/>
+                    <expiration max-idle="100000"/>
+                </local-cache>
+                <local-cache name="timestamps">
+                    <eviction strategy="NONE"/>
+                </local-cache>
+            </cache-container>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
+        <subsystem xmlns="urn:jboss:domain:jca:1.0">
+            <archive-validation enabled="false" />
+            <bean-validation enabled="false" />
+            <default-workmanager>
+                <short-running-threads blocking="true">
+                        <core-threads count="10" per-cpu="20"/>
+                        <queue-length count="10" per-cpu="20"/>
+                        <max-threads count="10" per-cpu="20"/>
+                        <keepalive-time time="10" unit="seconds"/>
+                </short-running-threads>
+                <long-running-threads blocking="true">
+                        <core-threads count="10" per-cpu="20"/>
+                        <queue-length count="10" per-cpu="20"/>
+                        <max-threads count="10" per-cpu="20"/>
+                        <keepalive-time time="10" unit="seconds"/>
+                </long-running-threads>
+            </default-workmanager>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:jmx:1.0">
+            <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server" />
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:jpa:1.0">
+            <jpa default-datasource=""/>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:naming:1.0" />
+        <subsystem xmlns="urn:jboss:domain:pojo:1.0" />
+        <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
+            <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
+                <property name="manager.root">jboss-osgi</property>
+            </configuration>
+            <properties>
+                <!--
+                    A comma seperated list of module identifiers. Each system module
+                    is added as a dependency to the OSGi framework module. The packages
+                    from these system modules can be made visible as framework system packages.
+                    http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#FRAMEWORK_SYSTEMPACKAGES_EXTRA
+                -->
+                <property name="org.jboss.osgi.system.modules">
+                org.apache.commons.logging,
+                org.apache.log4j,
+                org.jboss.as.osgi,
+                org.slf4j,
+                </property>
+                <!--
+                    Framework environment property identifying extra packages which the system bundle
+                    must export from the current execution environment
+                -->
+                <property name="org.osgi.framework.system.packages.extra">
+                org.apache.commons.logging;version=1.1.1,
+                org.apache.log4j;version=1.2,
+                org.jboss.as.osgi.service;version=7.0,
+                org.jboss.osgi.deployment.interceptor;version=1.0,
+                org.jboss.osgi.spi.capability;version=1.0,
+                org.jboss.osgi.spi.util;version=1.0,
+                org.jboss.osgi.testing;version=1.0,
+                org.jboss.osgi.vfs;version=1.0,
+                org.slf4j;version=1.5.10,
+                </property>
+                <!-- Specifies the beginning start level of the framework -->
+                <property name="org.osgi.framework.startlevel.beginning">1</property>
+            </properties>
+            <modules>
+                <!-- modules registered with the OSGi layer on startup -->
+                <module identifier="javaee.api"/>
+                <module identifier="org.jboss.logging"/>
+                <!-- bundles installed on startup -->
+                <module identifier="org.apache.aries.util"/>
+                <module identifier="org.jboss.osgi.webconsole"/>
+                <module identifier="org.osgi.compendium"/>
+                <!-- bundles started in startlevel 1 -->
+                <module identifier="org.apache.felix.log" startlevel="1"/>
+                <module identifier="org.jboss.osgi.logging" startlevel="1"/>
+                <module identifier="org.apache.felix.configadmin" startlevel="1"/>
+                <module identifier="org.jboss.as.osgi.configadmin" startlevel="1"/>
+                <!-- bundles started in startlevel 2 -->
+                <module identifier="org.apache.aries.jmx" startlevel="2"/>
+                <module identifier="org.apache.felix.eventadmin" startlevel="2"/>
+                <module identifier="org.apache.felix.metatype" startlevel="2"/>
+                <module identifier="org.apache.felix.scr" startlevel="2"/>
+                <module identifier="org.apache.felix.webconsole" startlevel="2"/>
+                <module identifier="org.jboss.osgi.jmx" startlevel="2"/>
+                <module identifier="org.jboss.osgi.http" startlevel="2"/>
+                <!-- bundles started in startlevel 3 -->
+                <module identifier="org.jboss.osgi.blueprint" startlevel="3"/>
+                <module identifier="org.jboss.osgi.webapp" startlevel="3"/>
+                <module identifier="org.jboss.osgi.xerces" startlevel="3"/>
+            </modules>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:remoting:1.0"/>
+        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0" />
+        <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
+        <subsystem xmlns="urn:jboss:domain:security:1.0">
+            <security-domains>
+                <security-domain name="other" cache-type="default">
+                    <authentication>
+                        <login-module code="Disabled" flag="required"/>
+                    </authentication>
+                </security-domain>
+                <security-domain name="gatein-domain" cache-type="default">
+                    <authentication>
+                        <login-module code="org.gatein.wci.security.WCILoginModule" flag="optional">
+                            <module-option name="portalContainerName" value="portal"/>
+                            <module-option name="realmName" value="gatein-domain"/>
+                        </login-module>
+                        <login-module code="org.exoplatform.services.security.jaas.SharedStateLoginModule" flag="required">
+                            <module-option name="portalContainerName" value="portal"/>
+                            <module-option name="realmName" value="gatein-domain"/>
+                        </login-module>
+                        <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+                            <module-option name="portalContainerName" value="portal"/>
+                            <module-option name="realmName" value="gatein-domain"/>
+                        </login-module>
+                    </authentication>
+                </security-domain>
+                <security-domain name="gatein-domain-sample-portal" cache-type="default">
+                    <authentication>
+                        <login-module code="org.gatein.wci.security.WCILoginModule" flag="optional">
+                            <module-option name="portalContainerName" value="sample-portal"/>
+                            <module-option name="realmName" value="gatein-domain-sample-portal"/>
+                        </login-module>
+                        <login-module code="org.exoplatform.services.security.jaas.SharedStateLoginModule" flag="required">
+                            <module-option name="portalContainerName" value="sample-portal"/>
+                            <module-option name="realmName" value="gatein-domain-sample-portal"/>
+                        </login-module>
+                        <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+                            <module-option name="portalContainerName" value="sample-portal"/>
+                            <module-option name="realmName" value="gatein-domain-sample-portal"/>
+                        </login-module>
+                    </authentication>
+                </security-domain>
+            </security-domains>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:threads:1.0"/>
+        <subsystem xmlns="urn:jboss:domain:transactions:1.0">
+            <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
+            <core-environment>
+                <process-id>
+                    <uuid />
+                </process-id>
+            </core-environment>
+            <coordinator-environment default-timeout="300"/>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
+            <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
+            <virtual-server name="default-host" enable-welcome-root="true">
+               <alias name="localhost" />
+               <alias name="example.com" />
+            </virtual-server>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:weld:1.0" />
+        <subsystem xmlns="urn:jboss:domain:gatein:1.0">
+           <deployment-archives>
+              <archive name="gatein.ear" main="true" />
+              <archive name="gatein-sample-extension.ear" />
+              <archive name="gatein-sample-portal.ear" />
+              <archive name="gatein-sample-skin.war" />
+           </deployment-archives>
+           <portlet-war-dependencies>
+              <dependency name="org.gatein.lib" import-services="true" />
+              <dependency name="org.gatein.wci"/>
+              <dependency name="javax.portlet.api"/>
+           </portlet-war-dependencies>
+        </subsystem>        
+    </profile>
+
+    <interfaces>
+        <interface name="management">
+            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
+        </interface>
+        <interface name="public">
+           <inet-address value="${jboss.bind.address:127.0.0.1}"/>
+        </interface>
+    </interfaces>
+
+    <socket-binding-group name="standard-sockets" default-interface="public">
+        <socket-binding name="http" port="8080"/>
+        <socket-binding name="https" port="8443"/>
+        <socket-binding name="jmx-connector-registry" interface="management" port="1090"/>
+        <socket-binding name="jmx-connector-server" interface="management" port="1091"/>
+        <socket-binding name="jndi" port="1099"/>
+        <socket-binding name="osgi-http" interface="management" port="8090"/>
+        <socket-binding name="remoting" port="4447"/>
+        <socket-binding name="txn-recovery-environment" port="4712"/>
+        <socket-binding name="txn-status-manager" port="4713"/>
+    </socket-binding-group>
+
+</server>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/MANIFEST.MF	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/MANIFEST.MF	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: Marko
+Build-Jdk: 1.6.0_24
+Dependencies: org.gatein.common

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/application.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/application.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear/META-INF/application.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+	"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+	"http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+  <display-name>gatein-sample-extension</display-name>
+  <description>GateIn Sample Extension Ear</description>
+  <module>
+    <web>
+      <web-uri>exo.portal.sample.extension.war-3.2.0-M02-SNAPSHOT.war</web-uri>
+      <context-root>sample-ext</context-root>
+    </web>
+  </module>
+</application>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-extension.ear.dodeploy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/MANIFEST.MF	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/MANIFEST.MF	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: Marko
+Build-Jdk: 1.6.0_24
+Dependencies: org.gatein.pc,org.gatein.common,org.hibernate:gatein

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/application.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/application.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear/META-INF/application.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+	"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+	"http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+  <display-name>sample-portal</display-name>
+  <description>GateIn Sample Portal Ear</description>
+  <module>
+    <web>
+      <web-uri>exo.portal.sample.portal.war-3.2.0-M02-SNAPSHOT.war</web-uri>
+      <context-root>sample-portal</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>exo.portal.sample.portal.rest-war-3.2.0-M02-SNAPSHOT.war</web-uri>
+      <context-root>rest-sample-portal</context-root>
+    </web>
+  </module>
+</application>
\ No newline at end of file

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-portal.ear.dodeploy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-sample-skin.war.dodeploy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein-wsrp-integration.ear.dodeploy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/MANIFEST.MF	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/MANIFEST.MF	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: Marko
+Build-Jdk: 1.6.0_24
+Dependencies: org.gatein.common,org.gatein.pc,com.sun.xml.bind service
+ s,org.hibernate:gatein

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/application.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/application.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/META-INF/application.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+  <display-name>exoplatform</display-name>
+  <module>
+    <web>
+      <web-uri>eXoResources.war</web-uri>
+      <context-root>eXoResources</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>portal.war</web-uri>
+      <context-root>portal</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>dashboard.war</web-uri>
+      <context-root>dashboard</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>exoadmin.war</web-uri>
+      <context-root>exoadmin</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>eXoGadgets.war</web-uri>
+      <context-root>eXoGadgets</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>eXoGadgetServer.war</web-uri>
+      <context-root>eXoGadgetServer</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>integration.war</web-uri>
+      <context-root>integration</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>rest.war</web-uri>
+      <context-root>rest</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>web.war</web-uri>
+      <context-root>web</context-root>
+    </web>
+  </module>
+  <!--module>
+    <web>
+      <web-uri>wsrp-admin-gui.war</web-uri>
+      <context-root>wsrp-admin-gui</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>wsrp-producer.war</web-uri>
+      <context-root>wsrp-producer</context-root>
+    </web>
+  </module-->
+</application>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/WEB-INF/web.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/WEB-INF/web.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/integration.war/WEB-INF/web.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!--
+  ~ JBoss, Home of Professional Open Source.
+  ~ Copyright 2011, Red Hat, Inc., and individual contributors
+  ~ as indicated by the @author tags. See the copyright.txt file in the
+  ~ distribution for a full listing of individual contributors.
+  ~
+  ~ 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
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  -->
+
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+   <context-param>
+      <param-name>jboss.portal.mc.beans_resource_type</param-name>
+      <param-value>classloader</param-value>
+   </context-param>
+   <servlet>
+      <servlet-name>ContainerServlet</servlet-name>
+      <servlet-class>org.gatein.wci.jboss.JB7ContainerServlet</servlet-class>
+      <load-on-startup>1</load-on-startup>
+   </servlet>
+</web-app>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/WEB-INF/web.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/WEB-INF/web.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear/portal.war/WEB-INF/web.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+
+    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
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+            http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+        version="2.4">
+  <display-name>portal</display-name>
+
+  <!--Uncomment for clustered setup-->
+  <!--
+  <distributable/>
+  -->
+
+  <context-param>
+    <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsWorkspace</param-name>
+    <param-value>portal</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath</param-name>
+    <param-value>/</param-value>
+  </context-param>
+
+  <!-- ================================================================== -->
+  <!--   RESOURCE FILTER TO CACHE MERGED JAVASCRIPT AND CSS               -->
+  <!-- ================================================================== -->
+    <filter>
+		<filter-name>LocalizationFilter</filter-name>
+		<filter-class>org.exoplatform.portal.application.localization.LocalizationFilter</filter-class>
+	</filter>
+	<filter>
+		<filter-name>GenericFilter</filter-name>
+		<filter-class>org.exoplatform.web.filter.GenericFilter</filter-class>
+	</filter>
+	<filter>
+	  <filter-name>ResourceRequestFilter</filter-name>
+	  <filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+	</filter>
+
+	<filter>
+    <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+    <filter-class>org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter</filter-class>
+  </filter>
+
+  <filter>
+    <filter-name>SetCurrentIdentityFilter</filter-name>
+    <filter-class>org.exoplatform.services.security.web.SetCurrentIdentityFilter</filter-class>
+  </filter>
+
+  <filter>
+    <filter-name>RestEncodingFilter</filter-name>
+      <filter-class>org.exoplatform.services.rest.servlet.RestEncodingFilter</filter-class>
+      <init-param>
+        <param-name>REQUEST_ENCODING</param-name>
+        <param-value>UTF-8</param-value>
+      </init-param>
+  </filter>
+
+  <filter>
+    <filter-name>CacheUserProfileFilter</filter-name>
+ 	<filter-class>org.exoplatform.web.CacheUserProfileFilter</filter-class>
+  </filter>
+
+  <filter>
+    <filter-name>RememberMeFilter</filter-name>
+    <filter-class>org.exoplatform.web.login.RememberMeFilter</filter-class>
+  </filter>
+
+   <filter>
+		<filter-name>ClusteredSSOFilter</filter-name>
+		<filter-class>org.exoplatform.web.login.ClusteredSSOFilter</filter-class>
+	</filter>
+
+  <filter>
+	     <filter-name>PortalContainerFilter</filter-name>
+	     <filter-class>org.exoplatform.container.web.PortalContainerFilter</filter-class>
+  </filter>  
+
+  <filter-mapping>
+    <filter-name>PortalContainerFilter</filter-name>
+	  <url-pattern>/*</url-pattern>
+  </filter-mapping>
+  
+   <filter-mapping>
+     <filter-name>RememberMeFilter</filter-name>
+     <servlet-name>portal</servlet-name>
+   </filter-mapping>
+
+   <filter-mapping>
+		<filter-name>ClusteredSSOFilter</filter-name>
+		<url-pattern>/*</url-pattern>
+	</filter-mapping>
+
+   <filter-mapping>
+       <filter-name>LocalizationFilter</filter-name>
+       <url-pattern>*.jsp</url-pattern>
+       <dispatcher>INCLUDE</dispatcher>
+       <dispatcher>FORWARD</dispatcher>
+       <dispatcher>REQUEST</dispatcher>
+       <dispatcher>ERROR</dispatcher>
+    </filter-mapping>
+
+	<filter-mapping>
+    <filter-name>ResourceRequestFilter</filter-name>
+    <url-pattern>*.css</url-pattern>
+  </filter-mapping>
+
+	<filter-mapping>
+		<filter-name>ResourceRequestFilter</filter-name>
+		<url-pattern>*.gif</url-pattern>
+	</filter-mapping>
+
+	<filter-mapping>
+		<filter-name>ResourceRequestFilter</filter-name>
+		<url-pattern>*.png</url-pattern>
+	</filter-mapping>
+
+	<filter-mapping>
+		<filter-name>ResourceRequestFilter</filter-name>
+		<url-pattern>*.jpg</url-pattern>
+	</filter-mapping>
+
+	<filter-mapping>
+	  <filter-name>ResourceRequestFilter</filter-name>
+	  <url-pattern>/javascript/*</url-pattern>
+	</filter-mapping>
+
+  <filter-mapping>
+    <filter-name>SetCurrentIdentityFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>CacheUserProfileFilter</filter-name>
+ 	<url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <filter-mapping>
+    <filter-name>RestEncodingFilter</filter-name>
+    <url-pattern>/rest/*</url-pattern>
+  </filter-mapping>
+  
+  <filter-mapping>
+  	<filter-name>GenericFilter</filter-name>
+	  <url-pattern>/*</url-pattern>
+  </filter-mapping>
+  
+  <!-- ================================================================== -->
+  <!--           LISTENER                                                 -->
+  <!-- ================================================================== -->
+	<listener>
+		<listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+	</listener>
+	<listener>
+    <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+  </listener>
+  <!-- ================================================================== -->
+  <!--           SERVLET                                                  -->
+  <!-- ================================================================== -->
+	<servlet>
+	  <servlet-name>portal</servlet-name>
+	  <servlet-class>org.exoplatform.portal.application.PortalController</servlet-class>
+		<init-param>
+	  	<param-name>webui.configuration</param-name>
+	  	<param-value>app:/WEB-INF/webui-configuration.xml</param-value>
+	  </init-param>
+	  <load-on-startup>1</load-on-startup>
+	</servlet>
+
+  <servlet>
+    <servlet-name>RestServer</servlet-name>
+    <servlet-class>org.exoplatform.services.rest.servlet.RestServlet</servlet-class>
+    <load-on-startup>4</load-on-startup>
+  </servlet>
+
+	<servlet>
+	  <servlet-name>javascript</servlet-name>
+	  <servlet-class>org.exoplatform.portal.webui.javascript.JavascriptServlet</servlet-class>
+	</servlet>
+
+  <servlet>
+    <servlet-name>Controller</servlet-name>
+    <servlet-class>org.exoplatform.frameworks.jcr.web.CommandControllerServlet</servlet-class>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+
+  <servlet>
+    <servlet-name>PortalLoginController</servlet-name>
+    <servlet-class>org.exoplatform.web.security.PortalLoginController</servlet-class>
+  </servlet>
+  <servlet>
+    <servlet-name>InitiateLoginServlet</servlet-name>
+    <servlet-class>org.exoplatform.web.login.InitiateLoginServlet</servlet-class>
+  </servlet>
+  <servlet>
+    <servlet-name>DoLoginServlet</servlet-name>
+    <servlet-class>org.exoplatform.web.login.DoLoginServlet</servlet-class>
+  </servlet>
+	<servlet>
+		<servlet-name>ErrorLoginServlet</servlet-name>
+		<servlet-class>org.exoplatform.web.login.ErrorLoginServlet</servlet-class>
+	</servlet>
+
+  <servlet>
+    <servlet-name>GateInServlet</servlet-name>
+    <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+
+	<!--  =================================================================  -->
+
+	<servlet-mapping>
+	  <servlet-name>InitiateLoginServlet</servlet-name>
+	  <url-pattern>/initiatelogin</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>ErrorLoginServlet</servlet-name>
+		<url-pattern>/errorlogin</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+	  <servlet-name>PortalLoginController</servlet-name>
+	  <url-pattern>/login</url-pattern>
+	</servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>DoLoginServlet</servlet-name>
+    <url-pattern>/dologin</url-pattern>
+  </servlet-mapping>
+
+	<servlet-mapping>
+	  <servlet-name>javascript</servlet-name>
+	  <url-pattern>/javascript/*</url-pattern>
+	</servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>RestServer</servlet-name>
+    <url-pattern>/rest/*</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>Controller</servlet-name>
+    <url-pattern>/connector</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>portal</servlet-name>
+    <url-pattern>/</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>GateInServlet</servlet-name>
+    <url-pattern>/gateinservlet</url-pattern>
+  </servlet-mapping>
+
+	<security-constraint>
+		<web-resource-collection>
+	  	<web-resource-name>user authentication</web-resource-name>
+	  	<url-pattern>/dologin</url-pattern>
+	  	<url-pattern>/private/*</url-pattern>
+      	<url-pattern>/g/*</url-pattern>
+      	<url-pattern>/u/*</url-pattern>
+	  	<http-method>POST</http-method>
+	  	<http-method>GET</http-method>
+	  </web-resource-collection>
+		<auth-constraint>
+	  	<role-name>users</role-name>
+	  </auth-constraint>
+		<user-data-constraint>
+	  	<transport-guarantee>NONE</transport-guarantee>
+	  </user-data-constraint>
+	</security-constraint>
+	<security-constraint>
+		<web-resource-collection>
+		  <web-resource-name>admin authentication</web-resource-name>
+		  <url-pattern>/admin/*</url-pattern>
+		  <http-method>POST</http-method>
+		  <http-method>GET</http-method>
+	  </web-resource-collection>
+		<auth-constraint>
+	 		<role-name>admin</role-name>
+	  </auth-constraint>
+		<user-data-constraint>
+		  <transport-guarantee>NONE</transport-guarantee>
+	  </user-data-constraint>
+	</security-constraint>
+	<login-config>
+	  <auth-method>FORM</auth-method>
+	  <realm-name>gatein-domain</realm-name>
+		<form-login-config>
+		  <form-login-page>/initiatelogin</form-login-page>
+			<form-error-page>/errorlogin</form-error-page>
+	  </form-login-config>
+	</login-config>
+	<security-role>
+	  <description>a simple user role</description>
+	  <role-name>users</role-name>
+	</security-role>
+	<security-role>
+	  <description>the admin role</description> 
+	  <role-name>admin</role-name>
+	</security-role>
+</web-app>

Added: portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/deployments/gatein.ear.dodeploy
===================================================================
Added: portal/trunk/packaging/jboss-as7/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pom.xml	                        (rev 0)
+++ portal/trunk/packaging/jboss-as7/pom.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -0,0 +1,116 @@
+<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">
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
+      <groupId>org.exoplatform.portal</groupId>
+      <artifactId>exo.portal.packaging</artifactId>
+      <version>3.2.0-M02-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>exo.portal.packaging.jboss7</artifactId>
+   <packaging>pom</packaging>
+
+   <name>GateIn JBoss AS 7.x.x packaging</name>
+
+   <properties>
+      <version.jboss.as.release>7.0.2.Final</version.jboss.as.release>
+      <version.jboss.as>7.0.2.Final</version.jboss.as>
+      <version.org.jboss.vfs>3.0.0.GA</version.org.jboss.vfs>
+      <version.org.gatein.wci.as7>2.1.0-Beta07-AS7-Beta01</version.org.gatein.wci.as7>
+      <version.exo.kernel.as7>2.3.1-GA-AS7-Beta01</version.exo.kernel.as7>
+      <version.org.gatein.naming>1.0.0-Beta01</version.org.gatein.naming>
+   </properties>
+   <build>
+      <defaultGoal>package</defaultGoal>
+      <plugins>
+	<plugin>
+	    <artifactId>maven-antrun-plugin</artifactId>
+	    <executions>
+		<execution>
+		    <phase>generate-resources</phase>
+		    <goals>
+		        <goal>run</goal>
+		    </goals>
+		    <configuration>
+		        <tasks>
+		            <echo>"
+
+
+DON'T FORGET TO FIRST READ packaging/jboss-as7/README.txt
+
+
+"
+</echo>
+		        </tasks>
+		    </configuration>
+		</execution>
+	    </executions>
+	</plugin>
+      </plugins>
+   </build>
+
+   <dependencyManagement>
+      <dependencies>
+         <dependency>
+            <groupId>org.exoplatform.portal</groupId>
+            <artifactId>jboss-as7-integration-extension</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.gatein.naming</groupId>
+            <artifactId>gatein-naming</artifactId>
+            <version>${version.org.gatein.naming}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.exoplatform.portal</groupId>
+            <artifactId>jboss-as7-integration-modules</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.as</groupId>
+            <artifactId>jboss-as-controller</artifactId>
+            <version>${version.jboss.as}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.as</groupId>
+            <artifactId>jboss-as-server</artifactId>
+            <version>${version.jboss.as}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.as</groupId>
+            <artifactId>jboss-as-ee</artifactId>
+            <version>${version.jboss.as}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.as</groupId>
+            <artifactId>jboss-as-web</artifactId>
+            <version>${version.jboss.as}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss</groupId>
+            <artifactId>jboss-vfs</artifactId>
+            <version>${version.org.jboss.vfs}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.gatein.wci</groupId>
+            <artifactId>wci-jboss7</artifactId>
+            <version>${version.org.gatein.wci.as7}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.gatein.wci</groupId>
+            <artifactId>wci-wci</artifactId>
+            <version>${version.org.gatein.wci.as7}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.exoplatform.kernel</groupId>
+            <artifactId>exo.kernel.container</artifactId>
+            <version>${version.exo.kernel.as7}</version>
+         </dependency>
+      </dependencies>
+   </dependencyManagement>
+   <modules>
+      <module>extension</module>
+      <module>modules</module>
+      <module>pkg</module>
+   </modules>
+
+</project>

Modified: portal/trunk/packaging/pom.xml
===================================================================
--- portal/trunk/packaging/pom.xml	2011-10-04 11:15:15 UTC (rev 7650)
+++ portal/trunk/packaging/pom.xml	2011-10-04 13:31:34 UTC (rev 7651)
@@ -93,5 +93,11 @@
                 <module>jboss-as5</module>
             </modules>
         </profile>
+        <profile>
+            <id>pkg-jbossas7</id>
+            <modules>
+                <module>jboss-as7</module>
+            </modules>
+        </profile>
     </profiles>
 </project>



More information about the gatein-commits mailing list