Fixed issue in load-bundle where web installation context was hard coded as ROOT. Now uses project.xml to determine installation context.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2633 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2014-05-03 08:20:38 +00:00
parent b3d55b32b1
commit 0f42cbcd60
5 changed files with 57 additions and 44 deletions

View File

@ -12,6 +12,13 @@
indent="yes" indent="yes"
xalan:indent-amount="4"/> xalan:indent-amount="4"/>
<!-- Set of templates to create a single build script out of a project's
project.xml description file and the individual application.xml for
each included module.
The generated file is stored into the development base directory.
Using ECDC the stylesheet is invoked by ~ecdc/scriptlib/build-configure
which in turn is included by ~/ecdc/build.xml. -->
<!-- Evaluate project.xml, ccm:project tag --> <!-- Evaluate project.xml, ccm:project tag -->
<xsl:template match="ccm:project"> <xsl:template match="ccm:project">
<xsl:call-template name="CheckDependencies"/> <xsl:call-template name="CheckDependencies"/>
@ -99,7 +106,8 @@
unless="app.server.lib.dir" /> unless="app.server.lib.dir" />
<!-- XXX deprecated --> <!-- XXX deprecated -->
<!-- Used to be the same as CATALINA_HOME and a requirred base for PackageMastertool --> <!-- Used to be the same as CATALINA_HOME and a required base for
CCM installation tool PackageMastertool -->
<property value="${{env.CCM_HOME}}" name="ccm.home"/> <property value="${{env.CCM_HOME}}" name="ccm.home"/>
<property value="${{env.CCM_WEBAPP_DIST_DIR}}" name="webapp.dist.dir"/> <property value="${{env.CCM_WEBAPP_DIST_DIR}}" name="webapp.dist.dir"/>
@ -172,7 +180,8 @@
<property value="xml" name="pmd.format"/> <property value="xml" name="pmd.format"/>
<property value="${{build.dir}}/pmd" name="pmd.report.dir"/> <property value="${{build.dir}}/pmd" name="pmd.report.dir"/>
<property value="pmd.${{pmd.format}}" name="pmd.report.file"/> <property value="pmd.${{pmd.format}}" name="pmd.report.file"/>
<!-- Presumably no longer used does not exist in devel environment, Red Hat made their own <!-- Presumably no longer used does not exist in devel environment,
Red Hat made their own
<property value="${{shared.lib.dist.dir}}/jdo" name="jdo.lib.dir"/> --> <property value="${{shared.lib.dist.dir}}/jdo" name="jdo.lib.dir"/> -->
<property value="com.arsdigita.persistence.pdl.PDL" name="ddl.generator.classname"/> <property value="com.arsdigita.persistence.pdl.PDL" name="ddl.generator.classname"/>

View File

@ -21,22 +21,22 @@
<project name="load"> <project name="load">
<target name="load-bundle" depends="prepare-load"> <target name="load-bundle" depends="prepare-load">
<echo>Loading bundle from ${this.bundle.folder} into ${ccm.home}</echo> <echo>Loading bundle from ${this.bundle.folder} into ${ccmhome}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="true"> <java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" /> <classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --parameter-file ${this.bundle.folder}/cfg/integration.properties" /> <arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
</target> </target>
<target name="load-bundle-interactive" depends="prepare-load"> <target name="load-bundle-interactive" depends="prepare-load">
<echo>Loading bundle ${this.bundle.folder} interactively into ${ccm.home}</echo> <echo>Loading bundle ${this.bundle.folder} interactively into ${ccmhome}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="true"> <java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" /> <classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" /> <arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
@ -46,7 +46,7 @@
<echo>Registers configuration from ${this.bundle.folder} for ${applications} into registry</echo> <echo>Registers configuration from ${this.bundle.folder} for ${applications} into registry</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true"> classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load ${applications} --config --parameter-file ${this.bundle.folder}/cfg/integration.properties" /> <arg line="load ${applications} --config --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
@ -56,7 +56,7 @@
<echo>Registers configuration from ${this.bundle.folder} for ${applications} into registry, aksing interactivly for values.</echo> <echo>Registers configuration from ${this.bundle.folder} for ${applications} into registry, aksing interactivly for values.</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true" > classpathref="ccm.classpath" fork="true" >
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load ${applications} --config --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" /> <arg line="load ${applications} --config --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
@ -66,7 +66,7 @@
<echo>load ${applications} without further configuration specifications but using build in defaults.</echo> <echo>load ${applications} without further configuration specifications but using build in defaults.</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true"> classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<!-- <!--
<sysproperty key="log4j.configuration" <sysproperty key="log4j.configuration"
value="file:runtime/${app.server.bundles.name}/conf/log4j.xml" /> value="file:runtime/${app.server.bundles.name}/conf/log4j.xml" />
@ -83,7 +83,7 @@
<echo>load --data ${applications}</echo> <echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true"> classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load --data ${applications}" /> <arg line="load --data ${applications}" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
@ -94,7 +94,7 @@
<echo>load --data ${applications}</echo> <echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true"> classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load --data ${applications}" /> <arg line="load --data ${applications}" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
@ -104,24 +104,26 @@
<echo>load initializers for ${applications} (--init )</echo> <echo>load initializers for ${applications} (--init )</echo>
<java classname="com.arsdigita.packaging.MasterTool" <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true"> classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="load --schema ${applications}" /> <arg line="load --schema ${applications}" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
</java> </java>
</target> </target>
<target name="prepare-load"> <target name="prepare-load">
<property value="${app.server.webapp.dir}/ROOT/WEB-INF/bin/bundle" <!-- The application context has been determined during configure step
and is available via included build-projects.xml -->
<echo>Application Context: ${this.appContext}</echo>
<property value="${app.server.webapp.dir}/${this.appContext}/WEB-INF/bin/bundle"
name="this.bundle.folder" /> name="this.bundle.folder" />
<echo>prepare bundle ${this.bundle.folder}</echo> <echo>prepare bundle ${this.bundle.folder}</echo>
<!-- bundle file applications.cfg replaced by project.xml, now part of bundle
<copy file="${this.bundle.folder}/cfg/applications.cfg"
tofile=".tmp.applications.cfg" overwrite="yes" /> <!-- Retrieve list of applications/modules to be installed from
<replaceregexp file=".tmp.applications.cfg" match="#.*" replace="" byline="true" /> project.xml living in the deployed WEB-INF directory -->
<replaceregexp file=".tmp.applications.cfg" <java classname="org.apache.xalan.xslt.Process" fork="yes"
match="[ \t\r\n]+" replace=" " flags="gs" /> failonerror="true">
-->
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
<classpath refid="ccm.tools.classpath"/> <classpath refid="ccm.tools.classpath"/>
<arg value="-IN"/> <arg value="-IN"/>
<arg value="${this.bundle.folder}/cfg/project.xml"/> <arg value="${this.bundle.folder}/cfg/project.xml"/>
@ -132,7 +134,12 @@
<arg value="-TEXT"/> <arg value="-TEXT"/>
</java> </java>
<loadfile property="applications" srcFile=".tmp.applications.list" /> <loadfile property="applications" srcFile=".tmp.applications.list" />
<delete file=".tmp.applications.list"/> <delete file=".tmp.applications.list"/>
<property name="ccmhome"
value="${app.server.webapp.dir}/${this.appContext}"/>
<echo>Installation directory: ${ccmhome}</echo>
<tstamp> <tstamp>
<format pattern="yyyymmddhhmmss" property="timestamp" /> <format pattern="yyyymmddhhmmss" property="timestamp" />
</tstamp> </tstamp>
@ -141,12 +148,12 @@
<!-- classpath used by command line tools load-bundle, update, ... --> <!-- classpath used by command line tools load-bundle, update, ... -->
<path id="ccm.classpath"> <path id="ccm.classpath">
<path refid="ccm.tools.classpath"/> <path refid="ccm.tools.classpath"/>
<!-- <pathelement location="runtime/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/classes"/> --> <!-- <pathelement location="runtime/apache-tomcat-6.0.18/webapps/${this.appContext}/WEB-INF/classes"/> -->
<pathelement location="${app.server.webapp.dir}/ROOT/WEB-INF/classes"/> <pathelement location="${app.server.webapp.dir}/${this.appContext}/WEB-INF/classes"/>
<!-- <pathelement location="runtime/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/classes"/> --> <!-- <pathelement location="runtime/apache-tomcat-6.0.18/webapps/${this.appContext}/WEB-INF/classes"/> -->
<pathelement location="${this.bundle.folder}/res"/> <pathelement location="${this.bundle.folder}/res"/>
<!-- <fileset dir="runtime/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/lib" includes="**/*.jar" /> --> <!-- <fileset dir="runtime/apache-tomcat-6.0.18/webapps/${this.appContext}/WEB-INF/lib" includes="**/*.jar" /> -->
<fileset dir="${app.server.webapp.dir}/ROOT/WEB-INF/lib" includes="**/*.jar" /> <fileset dir="${app.server.webapp.dir}/${this.appContext}/WEB-INF/lib" includes="**/*.jar" />
</path> </path>
<!-- Check configuration of debug option and set property appropriately --> <!-- Check configuration of debug option and set property appropriately -->
@ -208,7 +215,7 @@
<java classname="com.arsdigita.packaging.MasterTool" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool" fork="yes">
<classpath refid="ccm.classpath" /> <classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="upgrade ${ccm.upgrade.package} --from-version=${ccm.upgrade.from.version} --to-version=${ccm.upgrade.to.version}" /> <arg line="upgrade ${ccm.upgrade.package} --from-version=${ccm.upgrade.from.version} --to-version=${ccm.upgrade.to.version}" />
</java> </java>
</target> </target>
@ -259,10 +266,10 @@
<java classname="com.arsdigita.packaging.MasterTool" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool" fork="yes">
<classpath> <classpath>
<path refid="ccm.tools.classpath" /> <path refid="ccm.tools.classpath" />
<pathelement location="${app.server.webapp.dir}/ROOT/WEB-INF/classes" /> <pathelement location="${app.server.webapp.dir}/${this.appContext}/WEB-INF/classes" />
<fileset dir="${app.server.webapp.dir}/ROOT/WEB-INF/lib" includes="**/*.jar" /> <fileset dir="${app.server.webapp.dir}/${this.appContext}/WEB-INF/lib" includes="**/*.jar" />
</classpath> </classpath>
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<arg line="${ccm.parameters}" /> <arg line="${ccm.parameters}" />
</java> </java>
</target> </target>
@ -286,10 +293,10 @@
<java classname="${ccm.classname}" fork="yes"> <java classname="${ccm.classname}" fork="yes">
<classpath> <classpath>
<path refid="ccm.tools.classpath" /> <path refid="ccm.tools.classpath" />
<pathelement location="${app.server.webapp.dir}/ROOT/WEB-INF/classes" /> <pathelement location="${app.server.webapp.dir}/${this.appContext}/WEB-INF/classes" />
<fileset dir="${app.server.webapp.dir}/ROOT/WEB-INF/lib" includes="**/*.jar" /> <fileset dir="${app.server.webapp.dir}/${this.appContext}/WEB-INF/lib" includes="**/*.jar" />
</classpath> </classpath>
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccmhome}" />
<jvmarg value="${app.server.debugger}" /> <jvmarg value="${app.server.debugger}" />
<arg line="${ccm.parameters}" /> <arg line="${ccm.parameters}" />
</java> </java>

View File

@ -16,8 +16,8 @@
ccm.tools.rh-jdo.dir ccm.tools.rh-jdo.dir
ccm.context.dir ccm.context.dir
ccm.home ccm.home
shared.lib.dist.dir shared.lib.dist.dir DEPRECATED prebuild modules no longer used
webapp.dist.dir webapp.dist.dir DEPRECATED prebuild modules no longer used
--> -->
<fail message="Property ccm.project.dir not set " <fail message="Property ccm.project.dir not set "
@ -71,15 +71,11 @@
<property name="ccm.tools.rh-jdo.dir" value="${ccm.project.dir}/tools-ng/common/classes"/> <property name="ccm.tools.rh-jdo.dir" value="${ccm.project.dir}/tools-ng/common/classes"/>
<echo>Project file: ${ccm.bundle.folder}/cfg/project.xml</echo> <echo>Project file: ${ccm.bundle.folder}/cfg/project.xml</echo>
<!-- preliminary, must be taken from project.xml -->
<property name="ccm.context.dir" value="/ROOT"/>
<echo>Installation context: ${ccm.context.dir}</echo>
<property name="ccm.home" value="${app.server.webapp.dir}${ccm.context.dir}"/>
<echo>CCM home: ${ccm.home}</echo>
<!-- deprecated used by prebuild modules only --> <!-- DEPRECATED used by prebuild modules only -->
<property name="shared.lib.dist.dir" value="${ccm.tools.lib.dir}"/> <property name="shared.lib.dist.dir" value="${ccm.tools.lib.dir}"/>
<!-- deprecated used by prebuild modules only --> <!-- DEPRECATED used by prebuild modules only -->
<property name="webapp.dist.dir" value="${ccm.project.dir}/distribution"/> <property name="webapp.dist.dir" value="${ccm.project.dir}/distribution"/>
<!-- http://antelope.tigris.org/ --> <!-- http://antelope.tigris.org/ -->

View File

@ -75,6 +75,7 @@
<!-- Building ccm.classpath which used to contain a list with dirs <!-- Building ccm.classpath which used to contain a list with dirs
to include into the classpath for each module included in the to include into the classpath for each module included in the
project (~/build/classes ~/build/sql ~/lib ~/pdl ) --> project (~/build/classes ~/build/sql ~/lib ~/pdl ) -->
<!-- Usage unkown, probably required for Eclipse IDE? -->
<!-- <!--
<xslt style="${ccm.tools.xsl.dir}/classpath-template.xsl" in="project.xml" <xslt style="${ccm.tools.xsl.dir}/classpath-template.xsl" in="project.xml"
out="ccm.classpath" classpathref="ccm.tools.classpath" force="yes"> out="ccm.classpath" classpathref="ccm.tools.classpath" force="yes">

View File

@ -77,10 +77,10 @@
<!-- Previously required to prevent Tomcat from using AElfred to check web.xml / taglibs --> <!-- Previously required to prevent Tomcat from using AElfred to check web.xml / taglibs -->
<!-- seems to work now without, please comment in if something goes wrong with XML processing <!-- seems to work now without, please comment in if something goes wrong with XML processing
-->
<sysproperty key="javax.xml.transform.TransformerFactory" value="com.icl.saxon.TransformerFactoryImpl" /> <sysproperty key="javax.xml.transform.TransformerFactory" value="com.icl.saxon.TransformerFactoryImpl" />
<sysproperty key="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" /> <sysproperty key="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" />
<sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl" /> <sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl" />
-->
<!-- standard parameter to Tomcat operation --> <!-- standard parameter to Tomcat operation -->
<sysproperty key="catalina.home" value="${app.server.home.dir}" /> <sysproperty key="catalina.home" value="${app.server.home.dir}" />