	These notes explain how to manually create a JBoss distribution of Platform.
    http://wiki-int.exoplatform.org/display/PLF/Manual+JBoss+Packaging

Prerequisites

Download JBoss EAP 5.1.1 from intranet
    * http://intranet.exoplatform.org/rest/jcr/repository/collaboration/Groups/platform/users/Documents/ReferenceBinaries/JBoss-EAP/jboss-eap-5.1.1.zip

Download / Checkout all the extensions
    * GateIn
          o https://github.com/exoportal/exogtn/tree/master (source)
            (you have to build and package the whole product to get the gatein.ear folder)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/portal/exo.portal.packaging.assembly/ (gatein.ear zip)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/portal/starter-gatein/ (starter.ear)
          o https://github.com/exoportal/exogtn/tree/master/server/tomcat/patch/src/main/tomcat/bin/exokey.pem
          o https://github.com/exoportal/exogtn/tree/master/server/tomcat/patch/src/main/tomcat/bin/oauthkey.pem
    * Collaboration
          o http://svn.exoplatform.org/projects/cs/branches/2.1.x/extension/ear/ (source)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/cs/exo.cs.extension.ear/ (extension ear)
    * WCM + Workflow
          o http://svn.exoplatform.org/projects/ecms/branches/2.1.x/packaging/wcm/ear/ (source)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/ecms/exo-ecms-packaging-wcm-ear-plf/ (wcm extension ear)
          o http://svn.exoplatform.org/projects/ecms/branches/2.1.x/packaging/workflow/ear/ (source)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/ecms/exo-ecms-packaging-workflow-ear-plf/ (workflow extension ear)
          o http://svn.exoplatform.org/projects/ecms/branches/2.0.x/gatein-ds.xml (datasource)
    * Knowledge
          o http://svn.exoplatform.org/projects/ks/branches/2.1.x/extension/ear/ (source)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/ks/exo.ks.extension.ear/ (extension ear)
    * Platform
          o http://svn.exoplatform.org/projects/platform/branches/3.0.x/extension/ear/ (extension source)
          o http://repository.exoplatform.org/content/groups/private/org/exoplatform/platform/exo.platform.extension.ear/ (extension ear)
          o http://svn.exoplatform.org/projects/platform/branches/3.0.x/samples/acme-website/ear/ (acme source)
          o http://repository.exoplatform.org/content/groups/private/org/exoplatform/platform/exo.platform.sample.acme-website.ear/ (acme ear)
          o http://svn.exoplatform.org/projects/platform/branches/3.0.x/office/ear/ (social intranet source)
          o http://repository.exoplatform.org/content/groups/private/org/exoplatform/platform/exo.platform.office.ear/ (social intranet ear)
          o http://svn.exoplatform.org/projects/platform/branches/3.0.x/server/tomcat/patch/src/main/resources/gatein/conf/configuration.xml (configuration)
          o http://svn.exoplatform.org/projects/platform/branches/3.0.x/server/tomcat/patch/src/main/resources/gatein/conf/configuration.properties (configuration)
    * Social
          o http://svn.exoplatform.org/projects/social/branches/1.1.x/extension/ear/ (source)
          o http://repository.exoplatform.org/content/groups/public/org/exoplatform/social/exo.social.extension.ear/ (extension ear)

Prepare JBoss
    * extract the JBoss EAP package
    * copy gatein.ear, starter.ear and gatein-ds.xml in /server/default/deploy
    * copy exokey.pem and oauthkey.pem in /bin
    * copy the EAR extensions in /server/default/deploy
    * copy the Platform configuration files in /server/default/conf/gatein
    * open the file platform-extension.ear\platform-extension.war\WEB-INF\conf\platform\ide-configuration.xml and use this configuration for the gadget key.txt location (workaround for IDE-373):
		<component>
			<type>org.exoplatform.ide.shindig.oauth.RestSecurityTokenGenerator</type>
			<init-params>
			   <value-param>
				 <name>keyFile</name>
				 <description>shindig key file location</description>
				 <value>../server/default/conf/gatein/gadgets/key.txt</value>
			   </value-param>
			</init-params>
		  </component>



Configuration

Configure Log4j
    * open /server/default/conf/jboss-log4j.xml and add
         <!-- Limit the JSR170 categories -->
         <category name="exo.jcr">
            <priority value="INFO"/>
         </category>
         <!-- Limit the JSR-168 and JSR-286 categories -->
         <category name="org.exoplatform.services">
            <priority value="INFO"/>
         </category>

Configure JVM parameters
    * add some parameters in /bin/run.conf (on linux/cygwin environment)
      # Platform environment variables
      EXO_PROFILES="-Dexo.profiles=default"
      EXO_OPTS="-Dexo.product.developing=false -Dexo.conf.dir.name=gatein -Dgatein.data.dir=../gatein"
      REMOTE_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dcom.sun.management.jmxremote -Dorg.exoplatform.container.configuration.debug"
      EXO_XML="-Djavax.xml.stream.XMLOutputFactory=com.sun.xml.stream.ZephyrWriterFactory -Djavax.xml.stream.XMLInputFactory=com.sun.xml.stream.ZephyrParserFactory -Djavax.xml.stream.XMLEventFactory=com.sun.xml.stream.events.ZephyrEventFactory"
      JAVA_OPTS="$JAVA_OPTS $EXO_OPTS $EXO_PROFILES $EXO_XML"

    * or add these parameters in /bin/run.conf.bat (on windows environment)
      rem # Platform environment variables
      set "EXO_PROFILES=-Dexo.profiles=default"
      set "EXO_OPTS=-Dexo.product.developing=false -Dexo.conf.dir.name=gatein -Dgatein.data.dir=../gatein"
      set "REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dcom.sun.management.jmxremote -Dorg.exoplatform.container.configuration.debug"
      set "EXO_XML=-Djavax.xml.stream.XMLOutputFactory=com.sun.xml.stream.ZephyrWriterFactory -Djavax.xml.stream.XMLInputFactory=com.sun.xml.stream.ZephyrParserFactory -Djavax.xml.stream.XMLEventFactory=com.sun.xml.stream.events.ZephyrEventFactory"
      set "JAVA_OPTS=%JAVA_OPTS% %EXO_OPTS% %EXO_PROFILES% %EXO_XML%"

      (activate REMOTE_DEBUG only for debugging needs)
      (you can specify a different stax implementation in the EXO_XML variable, e.g. com.sun.xml.internal.stream.XMLOutputFactoryImpl...)

Configure the datasources

In gatein-ds.xml:
    * rename the ds from gatein-... to exo-...
    * change the connection URLs like jdbc:hsqldb:${gatein.data.dir}/hsql/exo-idm_portal

Configure Platform properties

In configuration.properties:
    * comment out the variable gatein.data.dir
    * change the value of jcr and idm datasource name to java:exo-jcr and java:exo-idm respectively

Configure SSO (needed for IDE gadget)
    * in $jboss.server.home.dir/deploy/jbossweb.sar/server.xml uncomment line:
      <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> 
