converted to osgi based deployment. remove application server config that's no longer used.

This commit is contained in:
Heng Sin Low 2010-07-13 16:07:13 +08:00
parent 5b8efcd223
commit 7ddc6c4d1f
10 changed files with 161 additions and 1142 deletions

View File

@ -2,16 +2,6 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/tools"/>
<classpathentry kind="src" path="/base"/>
<classpathentry kind="src" path="/client"/>
<classpathentry kind="src" path="/serverApps"/>
<classpathentry kind="src" path="/serverRoot"/>
<classpathentry kind="lib" path="/tools/lib/ant.jar"/>
<classpathentry kind="lib" path="/tools/lib/ant-commons-net.jar"/>
<classpathentry kind="lib" path="/tools/lib/ant-launcher.jar"/>
<classpathentry kind="lib" path="/tools/lib/commons-net-1.4.0.jar"/>
<classpathentry kind="lib" path="/tools/lib/ojdbc6.jar"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="build"/> <classpathentry kind="output" path="build"/>
</classpath> </classpath>

View File

@ -18,24 +18,11 @@ fi
echo =================================== echo ===================================
echo Setup Dialog echo Setup Dialog
echo =================================== echo ===================================
CP=lib/CInstall.jar:lib/Adempiere.jar:lib/CCTools.jar:lib/oracle.jar:lib/jboss.jar:lib/postgresql.jar:
# Trace Level Parameter, e.g. ARGS=ALL
ARGS=CONFIG
# To test the OCI driver, add -DTestOCI=Y to the command - example:
# $JAVA -classpath $CP -DADEMPIERE_HOME=$ADEMPIERE_HOME -DTestOCI=Y org.compiere.install.Setup $ARGS
# $JAVA -classpath $CP -DADEMPIERE_HOME=$ADEMPIERE_HOME org.compiere.install.Setup $ARGS
# OSGi: # OSGi:
$JAVA -jar osgi/org.eclipse.osgi_3.5.0.v20090520.jar -clean -console -application org.adempiere.Install $JAVA -jar osgi/org.eclipse.osgi_3.6.0.v20100517.jar -clean -console -install osgi -configuration osgi/client -application org.adempiere.Install
#echo ===================================
#echo Setup Adempiere Server Environment
#echo ===================================
#$JAVA -classpath $CP -DADEMPIERE_HOME=$ADEMPIERE_HOME -Dant.home="." org.apache.tools.ant.launch.Launcher setup
echo =================================== echo ===================================
echo Make .sh executable & set Env echo Make .sh executable & set Env
echo =================================== echo ===================================
@ -43,15 +30,10 @@ chmod -R a+x *.sh
find . -name '*.sh' -exec chmod a+x '{}' \; find . -name '*.sh' -exec chmod a+x '{}' \;
# Sign database build # Sign database build
cd utils # cd utils
#. ./RUN_SignDatabaseBuild.sh #. ./RUN_SignDatabaseBuild.sh
. ./RUN_UnixEnv.sh . ./RUN_UnixEnv.sh
#echo ================================
#echo Test local Connection
#echo ================================
#%JAVA% -classpath lib/Adempiere.jar:lib/AdempiereCLib.jar org.compiere.install.ConnectTest localhost
echo . echo .
echo For problems, check log file in base directory echo For problems, check log file in base directory

View File

@ -33,8 +33,6 @@
<!-- create the time stamp and environment --> <!-- create the time stamp and environment -->
<tstamp /> <tstamp />
<available file="${envFile}" property="envFileExists" /> <available file="${envFile}" property="envFileExists" />
<available file="lib/AdempiereOriginal.jar" type="file" property="adempiereOriginal.exists"/>
<available file="lib/webuiOriginal.war" type="file" property="webuiOriginal.exists"/>
<fail message="**** RUN_setup was not successful - please re-run ****" unless="envFileExists" /> <fail message="**** RUN_setup was not successful - please re-run ****" unless="envFileExists" />
<property file="${envFile}"/> <property file="${envFile}"/>
<filter filtersfile="${envFile}" /> <filter filtersfile="${envFile}" />
@ -42,20 +40,12 @@
<echo message="Environment = ${envFile}" /> <echo message="Environment = ${envFile}" />
<echo message="Java VM = ${ADEMPIERE_JAVA_TYPE}" /> <echo message="Java VM = ${ADEMPIERE_JAVA_TYPE}" />
<echo message="Database = ${ADEMPIERE_DB_TYPE}" /> <echo message="Database = ${ADEMPIERE_DB_TYPE}" />
<echo message="Apps Server = ${ADEMPIERE_APPS_TYPE}" />
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
<!-- Environment variables --> <!-- Environment variables -->
<condition property="isWindows"> <condition property="isWindows">
<os family="windows" /> <os family="windows" />
</condition> </condition>
<condition property="isAppsJBoss">
<equals arg1="jboss" arg2="${ADEMPIERE_APPS_TYPE}" />
</condition>
<condition property="isAppsGlassfish">
<equals arg1="glassfish" arg2="${ADEMPIERE_APPS_TYPE}" />
</condition>
<echo message="Windows=${isWindows} JBoss=${isAppsJBoss} Glassfish=${isAppsGlassfish}" /> <echo message="Windows=${isWindows} JBoss=${isAppsJBoss} Glassfish=${isAppsGlassfish}" />
</target> </target>
@ -120,449 +110,13 @@
</target> </target>
<target name="backupAdempiereOriginal" unless="adempiereOriginal.exists">
<copy file="lib/Adempiere.jar" tofile="lib/AdempiereOriginal.jar" overwrite="yes" />
</target>
<target name="backupWebuiOriginal" unless="webuiOriginal.exists">
<copy file="lib/webui.war" tofile="lib/webuiOriginal.war" overwrite="yes" />
</target>
<!-- rebuild Adempiere.jar and webui.war to include possible customization and patches -->
<target name="setupALib" depends="setupInit, backupAdempiereOriginal">
<delete file="lib/packages.jar" failonerror="false"/>
<jar jarfile="lib/packages.jar" duplicate="preserve">
<!-- 2pack packages -->
<zipgroupfileset dir="packages" includes="**/lib/*.jar" casesensitive="no">
<patternset refid="manifest.exclude"/>
</zipgroupfileset>
</jar>
<jar jarfile="lib/Adempiere1.jar" index="yes" duplicate="preserve">
<!-- pack patches.jar and customization.jar into Adempiere.jar -->
<zipfileset src="lib/customization.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<!-- 2pack packages -->
<zipfileset src="lib/packages.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/patches.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<!-- posterita packages -->
<zipfileset src="lib/posterita.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/AdempiereOriginal.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<indexjars>
<pathelement path="lib/AdempiereCLib.jar"/>
<pathelement path="lib/CompiereJasperReqs.jar"/>
</indexjars>
<manifest>
<attribute name="Specification-Title" value="Adempiere"/>
<attribute name="Specification-Version" value="${ADEMPIERE_VERSION}"/>
<attribute name="Specification-Vendor" value="ADempiere"/>
<attribute name="Implementation-Title" value="Adempiere ${ADEMPIERE_VERSION}"/>
<attribute name="Implementation-Version" value="${ADEMPIERE_VERSION} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${ADEMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.adempiere.com"/>
<attribute name="Main-Class" value="org.compiere.Adempiere"/>
<attribute name="Class-Path" value="AdempiereSLib.jar"/>
</manifest>
</jar>
<!-- Sign Adempiere Jar -->
<signjar jar="lib/Adempiere1.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<copy file="lib/Adempiere1.jar" tofile="lib/Adempiere.jar" overwrite="yes" />
<!-- Sign patches Jar -->
<copy file="lib/patches.jar" tofile="lib/patches1.jar" overwrite="yes" />
<signjar jar="lib/patches1.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<copy file="lib/patches1.jar" tofile="lib/patches.jar" overwrite="yes" />
<!-- Sign customization Jar -->
<copy file="lib/customization.jar" tofile="lib/customization1.jar" overwrite="yes" />
<signjar jar="lib/customization1.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<copy file="lib/customization1.jar" tofile="lib/customization.jar" overwrite="yes" />
<!-- clean up -->
<delete file="lib/Adempiere1.jar"/>
<delete file="lib/patches1.jar"/>
<delete file="lib/customization1.jar"/>
</target>
<!-- rebuild Adempiere.jar and webui.war to include possible customization and patches -->
<target name="setupWLib" depends="setupInit, backupWebuiOriginal">
<delete file="lib/zkpackages.jar" failonerror="false"/>
<jar jarfile="lib/zkpackages.jar" duplicate="preserve">
<!-- 2pack zkpackages -->
<zipgroupfileset dir="zkpackages" includes="**/lib/*.jar" casesensitive="no">
<patternset refid="manifest.exclude"/>
</zipgroupfileset>
</jar>
<zip destfile="lib/webui1.war" duplicate="preserve">
<!-- pack zkpatches.jar and zkcustomization.jar into webui.war -->
<zipfileset src="lib/zkcustomization.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<!-- 2pack zkpackages -->
<zipfileset src="lib/zkpackages.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/zkpatches.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/webuiOriginal.war" >
<patternset refid="manifest.exclude"/>
</zipfileset>
</zip>
<copy file="lib/webui1.war" tofile="lib/webui.war" overwrite="yes" />
<!-- clean up -->
<delete file="lib/webui1.war"/>
</target>
<!-- ==================================================== -->
<!-- Adempiere Client Lib -->
<!-- ==================================================== -->
<target name="setupCLib" depends="setupInit"
description="Setup Adempiere Client Lib">
<!-- Delete Old -->
<delete file="lib/AdempiereCLib.jar" failonerror="no" />
<delete file="lib/CClient.jar" failonerror="no" />
<delete file="lib/CTools.jar" failonerror="no" />
<!-- Create AdempiereCLib.jar file -->
<jar jarfile="lib/AdempiereCLib.jar" index="yes" duplicate="preserve">
<zipfileset src="lib/${ADEMPIERE_APPS_TYPE}.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/CCTools.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/oracle.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/postgresql.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<manifest>
<attribute name="Specification-Title" value="Adempiere Client Library" />
<attribute name="Specification-Version" value="${ADEMPIERE_MAIN_VERSION}" />
<attribute name="Specification-Vendor" value="Adempiere" />
<attribute name="Implementation-Title" value="AdempiereCLib ${ADEMPIERE_MAIN_VERSION}" />
<attribute name="Implementation-Version" value="${ADEMPIERE_MAIN_VERSION} ${DSTAMP}-${TSTAMP}" />
<attribute name="Implementation-Vendor" value="Adempiere, Inc." />
<attribute name="Implementation-URL" value="http://www.adempiere.com" />
</manifest>
</jar>
<echo message="KeyStore=${ADEMPIERE_KEYSTORE} - Alias=${ADEMPIERE_KEYSTORECODEALIAS}" />
<!-- Sign AdempiereCLib Jar -->
<signjar jar="lib/AdempiereCLib.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
</target>
<!-- ==================================================== -->
<!-- Adempiere Server Lib -->
<!-- ==================================================== -->
<target name="setupSLib" depends="setupInit"
description="Setup Adempiere Server Lib">
<!-- Delete Old -->
<delete file="lib/AdempiereSLib.jar" failonerror="no" />
<delete file="lib/CServer.jar" failonerror="no" />
<!-- Create AdempiereSLib.jar file -->
<jar jarfile="lib/AdempiereSLib.jar" index="yes" duplicate="preserve">
<zipfileset src="lib/CSTools.jar">
<patternset refid="manifest.exclude"/>
<exclude name="**/*.bsh"/>
</zipfileset>
<zipfileset src="lib/oracle.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/postgresql.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/CompiereJasperReqs.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<manifest>
<attribute name="Specification-Title" value="Adempiere Server Library" />
<attribute name="Specification-Version" value="${ADEMPIERE_MAIN_VERSION}" />
<attribute name="Specification-Vendor" value="Adempiere" />
<attribute name="Implementation-Title" value="AdempiereSLib ${ADEMPIERE_MAIN_VERSION}" />
<attribute name="Implementation-Version" value="${ADEMPIERE_MAIN_VERSION} ${DSTAMP}-${TSTAMP}" />
<attribute name="Implementation-Vendor" value="Adempiere, Inc." />
<attribute name="Implementation-URL" value="http://www.adempiere.com" />
</manifest>
</jar>
<!-- Sign AdempiereSLib Jar -->
<signjar jar="lib/AdempiereSLib.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<delete dir="buildSLib" />
<!-- Sign CompiereJasperReqs.jar for Java Web Start -->
<signjar jar="lib/CompiereJasperReqs.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
</target>
<!-- Sign other application jars -->
<target name="signOtherJars" depends="setupInit" >
<!-- Sign AdempiereRoot Jar -->
<copy file="lib/adempiereRoot.jar" tofile="lib/adempiereRoot1.jar" overwrite="yes" />
<signjar jar="lib/adempiereRoot1.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<copy file="lib/adempiereRoot1.jar" tofile="lib/adempiereRoot.jar" overwrite="yes" />
<delete file="lib/adempiereRoot1.jar"/>
<!-- Sign AdempiereApps Jar -->
<copy file="lib/adempiereApps.jar" tofile="lib/adempiereApps1.jar" overwrite="yes" />
<signjar jar="lib/adempiereApps1.jar" alias="${ADEMPIERE_KEYSTORECODEALIAS}"
storepass="${ADEMPIERE_KEYSTOREPASS}" keystore="${ADEMPIERE_KEYSTORE}" />
<copy file="lib/adempiereApps1.jar" tofile="lib/adempiereApps.jar" overwrite="yes" />
<delete file="lib/adempiereApps1.jar"/>
</target>
<!-- ==================================================== -->
<!-- Setup Lib -->
<!-- ==================================================== -->
<target name="setupLib" depends="setupInit, setupWin, setupNonWin"
description="Setup Adempiere Lib directory">
<!-- Filter files Overwrite -->
<copy file="${basedir}/utils/ftpPutExportTemplate.txt"
tofile="${basedir}/utils/ftpPutExport.txt" filtering="yes" overwrite="yes" />
<copy file="${basedir}/utils/ftpGetAdempiereTemplate.txt"
tofile="${basedir}/utils/ftpGetAdempiere.txt" filtering="yes" overwrite="yes" />
<copy file="${basedir}/utils/adempiereDirectTemplate.jnlp"
tofile="${basedir}/lib/adempiereDirect.jnlp" filtering="yes" overwrite="yes" />
<!-- Create Client Zip
<zip zipfile="${basedir}/lib/AdempiereClient.zip">
<zipfileset dir="." prefix="Adempiere"
includes="*.html" />
<zipfileset dir="." prefix="Adempiere"
includes="RUN_Adempiere.*" />
<zipfileset dir="utils" prefix="Adempiere"
includes="WinEnv.js" />
<zipfileset dir="lib" prefix="Adempiere/lib"
includes="Adempiere.exe,*.ico,customization.jar,patches.jar,CompiereJasperReqs.jar,Adempiere.jar,AdempiereCLib.jar,adempiereDirect.jnlp,index.html,*.0" />
</zip>
-->
<!-- Save properties -->
<copy file="AdempiereEnv.properties"
tofile="AdempiereEnv.properties.save" />
<copy file="Adempiere.properties"
tofile="Adempiere.properties.save" />
</target>
<!-- Update application library -->
<target name="updateLib" depends="setupInit, setupWin, setupNonWin, setupALib, setupWLib, signOtherJars">
<!-- Create Client Zip -->
<zip zipfile="${basedir}/lib/AdempiereClient.zip">
<zipfileset dir="." prefix="Adempiere"
includes="*.html" />
<zipfileset dir="." prefix="Adempiere"
includes="RUN_Adempiere.*" />
<zipfileset dir="utils" prefix="Adempiere"
includes="WinEnv.js" />
<zipfileset dir="lib" prefix="Adempiere/lib"
includes="Adempiere.exe,*.ico,customization.jar,patches.jar,CompiereJasperReqs.jar,Adempiere.jar,AdempiereCLib.jar,adempiereDirect.jnlp,index.html,*.0" />
</zip>
</target>
<target name="createEAR">
<!-- Create adempiereRoot war -->
<zip destfile="${basedir}/lib/adempiereRoot.war">
<!-- copy Base -->
<zipfileset src="${basedir}/lib/adempiereRootBase.war" />
<!-- copy to adempiereHome -->
<zipfileset dir="${basedir}/lib"
includes="AdempiereClient.zip,Adempiere.jar,AdempiereCLib.jar,*.jnlp,*.0,*.html,CompiereJasperReqs.jar,CompiereJasper.jar"
prefix="adempiereHome" />
</zip>
<!-- Create adempiereWebCM war -->
<zip destfile="${basedir}/lib/adempiereWebCM.war">
<!-- copy Base -->
<zipfileset src="${basedir}/lib/adempiereWebCMbase.war" />
</zip>
<antcall target="jbossEAR" inheritall="true"/>
<antcall target="glassfishEAR" inheritall="true"/>
</target>
<target name="jbossEAR" if="isAppsJBoss">
<!-- bundle everything in one ear file for simpler deployment -->
<ear destfile="${basedir}/lib/adempiere.ear" appxml="${basedir}/lib/adempiereAll.xml" >
<fileset dir="${basedir}/lib"
includes="Adempiere.jar,AdempiereSLib.jar,adempiereRoot.jar,adempiereApps.jar,adempiereApps.war,adempiereRoot.war,adempiereWebStore.war,adempiereWebCM.war,posterita.war,posterita.jar,webui.war" />
</ear>
</target>
<target name="glassfishEAR" if="isAppsGlassfish">
<unzip src="${basedir}/lib/webui.war" dest="${basedir}/lib/webui"/>
<copy file="${basedir}/lib/webui/WEB-INF/web-2.5.xml" tofile="${basedir}/lib/webui/WEB-INF/web.xml" overwrite="true" />
<delete file="${basedir}/lib/webui.war"/>
<zip destfile="${basedir}/lib/webui.war" basedir="${basedir}/lib/webui" />
<delete dir="${basedir}/lib/webui"/>
<!-- bundle everything in one ear file for simpler deployment -->
<ear destfile="${basedir}/lib/adempiere.ear" appxml="${basedir}/lib/adempiereAll.xml" >
<fileset dir="${basedir}/lib"
includes="adempiereRoot.jar,adempiereApps.jar,adempiereApps.war,adempiereRoot.war,adempiereWebStore.war,adempiereWebCM.war,posterita.war,posterita.jar,webui.war" />
<metainf dir="${basedir}/glassfish" includes="sun-application.xml"/>
</ear>
</target>
<!-- ==================================================== -->
<!-- Setup EAR Libraries -->
<!-- ==================================================== -->
<target name="setupEAR" depends="setupLib"
description="Setup Adempiere EAR Libraries">
<antcall target="createEAR" inheritall="true"/>
</target>
<target name="updateEAR" depends="updateLib">
<antcall target="createEAR" inheritall="true"/>
</target>
<!-- Update JBoss Server -->
<target name="updateJBoss" depends="updateEAR" if="isAppsJBoss"
description="Update JBoss Application Server">
<!-- Copy -->
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
<!-- Deploy in exploded format for faster startup time -->
<unjar dest="${ADEMPIERE_APPS_DEPLOY}/adempiere.ear" src="${basedir}/lib/adempiere.ear" overwrite="true">
</unjar>
</target>
<!-- ==================================================== -->
<!-- Setup Glassfish (Sun Application Server) -->
<!-- ==================================================== -->
<target name="setupGlassfish" depends="setupLib, setupEAR" if="isAppsGlassfish"
description="Setup Glassfish Application Server">
<copy file="${basedir}/lib/adempiere.ear" tofile="${basedir}/glassfish/adempiere.ear"/>
<copy file="${basedir}/lib/Adempiere.jar" tofile="${basedir}/glassfish/Adempiere.jar"/>
<copy file="${basedir}/lib/AdempiereSLib.jar" tofile="${basedir}/glassfish/AdempiereSLib.jar"/>
</target>
<!-- ==================================================== -->
<!-- Setup JBoss Server -->
<!-- ==================================================== -->
<target name="setupJBoss" depends="setupEAR" if="isAppsJBoss"
description="Setup JBoss Application Server">
<!-- Filter JBoss Templates Conf -->
<copy file="${basedir}/jboss/server/adempiere/conf/jboss-serviceTemplate.xml" tofile="${basedir}/jboss/server/adempiere/conf/jboss-service.xml" filtering="yes" overwrite="yes" />
<copy file="${basedir}/jboss/server/adempiere/conf/login-configTemplate.xml" tofile="${basedir}/jboss/server/adempiere/conf/login-config.xml" filtering="yes" overwrite="yes" />
<!-- Filter Tomcat 6.0 -->
<copy file="${basedir}/jboss/server/adempiere/deploy/jboss-web.deployer/serverTemplate.xml" tofile="${basedir}/jboss/server/adempiere/deploy/jboss-web.deployer/server.xml" filtering="yes" overwrite="yes" />
<!-- Delete Old -->
<delete file="${basedir}/jboss/server/adempiere/lib/CClient.jar" failonerror="no" />
<delete file="${basedir}/jboss/server/adempiere/lib/CSTools.jar" failonerror="no" />
<delete file="${basedir}/jboss/server/adempiere/lib/CServer.jar" failonerror="no" />
<delete file="${basedir}/jboss/server/adempiere/lib/oracle.jar" failonerror="no" />
<!-- Copy -->
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
<!-- Deploy in exploded format for faster startup time -->
<unjar dest="${ADEMPIERE_APPS_DEPLOY}/adempiere.ear" src="${basedir}/lib/adempiere.ear" overwrite="true">
</unjar>
</target>
<!-- ==================================================== -->
<!-- Update J2EE Server -->
<!-- ==================================================== -->
<target name="updateDeploy" depends="updateJBoss"
description="Update Adempiere Application Server">
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
</target>
<!-- ==================================================== -->
<!-- Deploy J2EE Server -->
<!-- ==================================================== -->
<target name="setupDeploy" depends="setupJBoss, setupGlassfish"
description="Deploy Adempiere Application Server">
<echo message="AppsDeployment= ${ADEMPIERE_APPS_DEPLOY}" />
</target>
<!-- ==================================================== -->
<!-- Update (Main) -->
<!-- ==================================================== -->
<target name="update" depends="updateDeploy"
description="Update Adempiere Deployment">
</target>
<!-- ==================================================== --> <!-- ==================================================== -->
<!-- Setup (Main) --> <!-- Setup (Main) -->
<!-- ==================================================== --> <!-- ==================================================== -->
<target name="setup" depends="setupInit, setupWin, setupNonWin, setupWar" <target name="setup" depends="setupInit, setupWin, setupNonWin"
description="Setup Adempiere"> description="Setup Adempiere">
</target> </target>
<!-- ==================================================== -->
<!-- Setup (War) -->
<!-- ==================================================== -->
<target name="setupWar"
description="Setup Adempiere ZK Webui">
<unzip src="webapp/bridge.war" dest="webapp/bridge" />
<copy todir="webapp/bridge/WEB-INF/eclipse/plugins">
<fileset dir="osgi/plugins">
<include name="**/*"/>
</fileset>
</copy>
</target>
<!-- ==================================================== -->
<!-- Test - Copy -->
<!-- ==================================================== -->
<target name="testsystemCopy"
description="Copy Adempiere to Test System">
<delete dir="lib" />
<delete dir="jboss" />
<delete dir="log" />
<unzip src="\\\\Dev1\\Adempiere\\Install\\Adempiere_253d.zip"
overwrite="true" />
</target>
<!-- ==================================================== -->
<!-- Test - Import DB -->
<!-- ==================================================== -->
<target name="testsystemImport" depends="setup"
description="Import Adempiere DB">
<exec command="${basedir}/lib/RUN_AdempiereImport" />
</target>
<!-- ==================================================== -->
<!-- Test - Setup -->
<!-- ==================================================== -->
<target name="testsystemSetup" depends="testsystemCopy, testsystemImport"
description="Set up Test System">
</target>
<!-- ==================================================== --> <!-- ==================================================== -->
<!-- Shutting down server, setting up adempiere and importing database --> <!-- Shutting down server, setting up adempiere and importing database -->
<!-- ==================================================== --> <!-- ==================================================== -->

View File

@ -3,18 +3,10 @@ Bundle-ManifestVersion: 2
Bundle-Name: install Bundle-Name: install
Bundle-SymbolicName: org.adempiere.install;singleton:=true Bundle-SymbolicName: org.adempiere.install;singleton:=true
Bundle-Version: 0.0.0.1 Bundle-Version: 0.0.0.1
Bundle-ClassPath: install.jar, Bundle-ClassPath: install.jar
lib/ant.jar, Export-Package: org.compiere.install
lib/ant-commons-net.jar,
lib/ant-launcher.jar,
lib/commons-net-1.4.0.jar,
lib/ocrs12.jar,
lib/ojdbc14.jar
Export-Package: images,
org.compiere.install
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0", Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.adempiere.base;bundle-version="0.0.0", org.adempiere.base;bundle-version="0.0.0",
org.adempiere.client;bundle-version="0.0.0", org.adempiere.client;bundle-version="0.0.0",
org.adempiere.tools;bundle-version="0.0.0" org.adempiere.tools;bundle-version="0.0.0"
Bundle-Activator: org.compiere.install.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View File

@ -1,4 +1,5 @@
source.install.jar = src/ source.install.jar = src/
output.install.jar = build/
bin.includes = META-INF/,\ bin.includes = META-INF/,\
install.jar,\ install.jar,\
plugin.xml plugin.xml

View File

@ -21,7 +21,6 @@
<property name="launch.dir" value="../launch"/> <property name="launch.dir" value="../launch"/>
<property name="keystore.dir" value="../keystore"/> <property name="keystore.dir" value="../keystore"/>
<property name="data.dir" value="../data"/> <property name="data.dir" value="../data"/>
<property name="jboss.dir" value="../jboss"/>
<property name="src" value="src"/> <property name="src" value="src"/>
<property name="compile.dir" value="lib"/> <property name="compile.dir" value="lib"/>
@ -54,71 +53,12 @@
<!-- create the time stamp --> <!-- create the time stamp -->
<tstamp/> <tstamp/>
<mkdir dir="${build.dir}"/> <mkdir dir="${build.dir}"/>
<mkdir dir="${compile.dir}"/>
</target> </target>
<!-- ======================================================= -->
<!-- Compile & Jar -->
<!-- ======================================================= -->
<target name="installCompile" depends="installInit">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="1.6" srcdir="${src}" destdir="${compile.dir}" deprecation="on" debug="on">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
<copy todir="${compile.dir}">
<fileset dir="${src}">
<include name="**/images/*"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.wav"/>
<include name="**/*.htm"/>
<include name="**/*.html"/>
<include name="**/*.properties"/>
<exclude name="**/package.html"/>
</fileset>
</copy>
<!-- put everything into the $CInstall.jar file -->
<jar
jarfile="CInstall.jar"
index="yes"
duplicate="preserve">
<fileset dir="${compile.dir}"/>
<!-- Ant (with ftp) files -->
<zipfileset src="../tools/lib/ant.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="../tools/lib/ant-launcher.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="../tools/lib/ant-commons-net.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="../tools/lib/commons-net-1.4.0.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<manifest>
<attribute name="Specification-Title" value="CInstall"/>
<attribute name="Specification-Version" value="${env.ADEMPIERE_VERSION}"/>
<attribute name="Specification-Vendor" value="Adempiere.org"/>
<attribute name="Implementation-Title" value="CInstall ${env.ADEMPIERE_VERSION}"/>
<attribute name="Implementation-Version" value="${env.ADEMPIERE_VERSION} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${env.ADEMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.adempiere.org"/>
<attribute name="Main-Class" value="org.compiere.install.Setup"/>
<attribute name="Class-Path" value="CTools.jar CClient.jar oracle.jar"/>
</manifest>
</jar>
</target>
<!-- ======================================================= --> <!-- ======================================================= -->
<!-- Update from Web Site + Clean .sh --> <!-- Update from Web Site + Clean .sh -->
<!-- ======================================================= --> <!-- ======================================================= -->
<target name="installUpdate" depends="" <target name="installUpdate" depends="plugin"
description="Update install directory with copies of web site"> description="Update install directory with copies of web site">
<fixcrlf srcdir="${src.dir}" <fixcrlf srcdir="${src.dir}"
@ -143,20 +83,6 @@
<mkdir dir="${build.dir}"/> <mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/Adempiere"/> <mkdir dir="${build.dir}/Adempiere"/>
<mkdir dir="${build.dir}/Adempiere/images"/> <mkdir dir="${build.dir}/Adempiere/images"/>
<mkdir dir="${build.dir}/Adempiere/packages"/>
<mkdir dir="${build.dir}/Adempiere/zkpackages"/>
<mkdir dir="${build.dir}/Adempiere/packages/liberoMFG"/>
<mkdir dir="${build.dir}/Adempiere/packages/liberoMFG/lib"/>
<copy file="../packages/liberoMFG.jar" tofile="${build.dir}/Adempiere/packages/liberoMFG/lib/liberoMFG.jar"/>
<mkdir dir="${build.dir}/Adempiere/zkpackages/liberoMFG"/>
<mkdir dir="${build.dir}/Adempiere/zkpackages/liberoMFG/lib"/>
<copy file="../zkpackages/liberozkMFG.jar" tofile="${build.dir}/Adempiere/zkpackages/liberoMFG/lib/liberozkMFG.jar"/>
<mkdir dir="${build.dir}/Adempiere/packages/liberoHR"/>
<mkdir dir="${build.dir}/Adempiere/packages/liberoHR/lib"/>
<copy file="../packages/liberoHR.jar" tofile="${build.dir}/Adempiere/packages/liberoHR/lib/liberoHR.jar"/>
<copy file="../lib/CheckConflicts.sh" tofile="${build.dir}/Adempiere/lib/CheckConflicts.sh"/> <copy file="../lib/CheckConflicts.sh" tofile="${build.dir}/Adempiere/lib/CheckConflicts.sh"/>
@ -182,33 +108,34 @@
<include name="**/*0"/> <include name="**/*0"/>
</fileset> </fileset>
</copy> </copy>
<copy file="${launch.dir}/Release/Adempiere.exe" todir="${build.dir}/Adempiere/lib"/>
<!-- <copy file="CInstall.jar" todir="${build.dir}/Adempiere/lib"/>
<copy file="../sqlj/sqlj.jar" todir="${build.dir}/Adempiere/lib"/>
<copy file="../JasperReports/CompiereJasperReqs.jar" todir="${build.dir}/Adempiere/lib"/> -->
<concat destfile="${build.dir}/Adempiere/lib/index.html">AdempiereHome</concat> <concat destfile="${build.dir}/Adempiere/lib/index.html">AdempiereHome</concat>
<!-- OSGi Container --> <!-- OSGi Container -->
<mkdir dir="${build.dir}/Adempiere/osgi"/> <mkdir dir="${build.dir}/Adempiere/osgi"/>
<copy overwrite="true" todir="${build.dir}/Adempiere/osgi" > <copy overwrite="true" todir="${build.dir}/Adempiere/osgi" >
<fileset dir="../equinox-target"> <fileset dir="../equinox-target">
<include name="configuration/**/*"/>
<include name="plugins/**/*"/> <include name="plugins/**/*"/>
<include name="org.eclipse.*.jar"/> <include name="org.eclipse.*.jar"/>
</fileset> </fileset>
<fileset dir="../equinox-target/spring">
<include name="plugins/**/*"/>
</fileset>
<fileset dir="../lib"> <fileset dir="../lib">
<include name="plugins/**/*"/> <include name="plugins/**/*"/>
</fileset> </fileset>
</copy> </copy>
<copy overwrite="true" todir="${build.dir}/Adempiere/osgi/client" >
<!-- Bridge webapp --> <fileset dir="../equinox-target/configuration">
<mkdir dir="${build.dir}/Adempiere/webapp"/> <include name="*.ini"/>
<copy overwrite="true" todir="${build.dir}/Adempiere/webapp" >
<fileset dir="../lib">
<include name="bridge.war"/>
</fileset> </fileset>
</copy> </copy>
<copy overwrite="true" todir="${build.dir}/Adempiere/osgi/server" >
<fileset dir="../equinox-target/webapp/configuration">
<include name="*.ini"/>
</fileset>
</copy>
<delete dir="${build.dir}/Adempiere/lib/plugins"/>
<!-- Utils Directory --> <!-- Utils Directory -->
<mkdir dir="${build.dir}/Adempiere/utils"/> <mkdir dir="${build.dir}/Adempiere/utils"/>
<copy todir="${build.dir}/Adempiere/utils"> <copy todir="${build.dir}/Adempiere/utils">
@ -237,37 +164,13 @@
<include name="**/Accounting*.*"/> <include name="**/Accounting*.*"/>
<include name="Example*.csv"/> <include name="Example*.csv"/>
</fileset> </fileset>
</copy> </copy>
<copy todir="${build.dir}/Adempiere/data/"> <copy todir="${build.dir}/Adempiere/data/">
<fileset dir="${data.dir}/seed/"> <fileset dir="${data.dir}/seed/">
<include name="**/*.jar"/> <include name="**/*.jar"/>
</fileset> </fileset>
</copy> </copy>
<!-- JBoss Directory -->
<mkdir dir="${build.dir}/Adempiere/jboss"/>
<mkdir dir="${build.dir}/Adempiere/jboss/bin"/>
<copy todir="${build.dir}/Adempiere/jboss/bin">
<fileset dir="${jboss.dir}/bin" excludes="**/CVS/**"/>
</copy>
<mkdir dir="${build.dir}/Adempiere/jboss/lib"/>
<copy todir="${build.dir}/Adempiere/jboss/lib">
<fileset dir="${jboss.dir}/lib" excludes="**/CVS/**"/>
</copy>
<mkdir dir="${build.dir}/Adempiere/jboss/server"/>
<copy todir="${build.dir}/Adempiere/jboss/server">
<fileset dir="${jboss.dir}/server"
excludes="**/CVS/**"/>
</copy>
<!-- GlassFish -->
<mkdir dir="${build.dir}/Adempiere/glassfish"/>
<copy todir="${build.dir}/Adempiere/glassfish">
<fileset dir="../glassfishfacet/config"/>
</copy>
<!-- Create Install ZIP --> <!-- Create Install ZIP -->
<zip zipfile="${build.dir}/Adempiere_${env.ADEMPIERE_VERSION_FILE}.zip" <zip zipfile="${build.dir}/Adempiere_${env.ADEMPIERE_VERSION_FILE}.zip"
basedir="${build.dir}" basedir="${build.dir}"
@ -289,17 +192,20 @@
</target> </target>
<target name="plugin"> <target name="plugin" depends="installInit">
<buildPlugin workspaceDirectory=".." <buildPlugin workspaceDirectory="${workspace}"
projectName="install" projectName="install"
targetPlatformId="target.platform" targetPlatformId="target.platform"
destination="${dist.dir}" destination="../lib"
buildSourceJar="false" /> buildSourceJar="false" />
</target> </target>
<target name="clean" description="deletes build"> <target name="clean" description="deletes build">
<delete dir="${build.dir}"/> <delete>
<delete dir="${compile.dir}"/> <fileset dir="../lib/plugins">
<include name="org.adempiere.install*.jar"/>
</fileset>
</delete>
</target> </target>
</project> </project>

View File

@ -16,57 +16,38 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.install; package org.compiere.install;
import java.io.File;
import java.net.InetAddress; import java.net.InetAddress;
/** /**
* JBoss 4.0.2 Apps Server Configuration * Apps Server Configuration
* *
* @author Jorg Janke * @author hengsin
* @version $Id: ConfigJBoss.java,v 1.3 2006/07/30 00:57:42 jjanke Exp $ * @version $Id: ConfigJBoss.java,v 1.3 2006/07/30 00:57:42 jjanke Exp $
*/ */
public class ConfigJBoss extends Config public class ConfigAppServer extends Config
{ {
/** /**
* ConfigJBoss * ConfigJBoss
* @param data configuration * @param data configuration
*/ */
public ConfigJBoss (ConfigurationData data) public ConfigAppServer(ConfigurationData data)
{ {
super (data); super (data);
} // ConfigJBoss } // ConfigJBoss
/** /**
* Initialize * Initialize
*/ */
public void init() public void init()
{ {
p_data.setAppsServerDeployDir(getDeployDir());
p_data.setAppsServerDeployDir(false);
//
p_data.setAppsServerJNPPort("1099");
p_data.setAppsServerJNPPort(true);
p_data.setAppsServerWebPort("80"); p_data.setAppsServerWebPort("80");
p_data.setAppsServerWebPort(true); p_data.setAppsServerWebPort(true);
p_data.setAppsServerSSLPort("443"); p_data.setAppsServerSSLPort("443");
p_data.setAppsServerSSLPort(true); p_data.setAppsServerSSLPort(true);
} // init } // init
/**
* Get Deployment Dir
* @return deployment dir
*/
private String getDeployDir()
{
return p_data.getAdempiereHome()
+ File.separator + "jboss"
+ File.separator + "server"
+ File.separator + "adempiere"
+ File.separator + "deploy";
} // getDeployDir
/** /**
* Test * Test
* @return error message or null if OK * @return error message or null if OK
@ -79,7 +60,7 @@ public class ConfigJBoss extends Config
&& server.toLowerCase().indexOf("localhost") == -1 && server.toLowerCase().indexOf("localhost") == -1
&& !server.equals("127.0.0.1"); && !server.equals("127.0.0.1");
InetAddress appsServer = null; InetAddress appsServer = null;
String error = "Not correct: AppsServer = " + server; String error = "Not correct: AppsServer = " + server;
try try
{ {
if (pass) if (pass)
@ -92,60 +73,33 @@ public class ConfigJBoss extends Config
} }
if (getPanel() != null) if (getPanel() != null)
signalOK(getPanel().okAppsServer, "ErrorAppsServer", signalOK(getPanel().okAppsServer, "ErrorAppsServer",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
log.info("OK: AppsServer = " + appsServer); log.info("OK: AppsServer = " + appsServer);
setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName()); setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName());
setProperty(ConfigurationData.ADEMPIERE_APPS_TYPE, p_data.getAppsServerType());
// Deployment Dir
p_data.setAppsServerDeployDir(getDeployDir());
File deploy = new File (p_data.getAppsServerDeployDir());
pass = deploy.exists();
error = "Not found: " + deploy;
if (getPanel() != null)
signalOK(getPanel().okDeployDir, "ErrorDeployDir",
pass, true, error);
if (!pass)
return error;
setProperty(ConfigurationData.ADEMPIERE_APPS_DEPLOY, p_data.getAppsServerDeployDir());
log.info("OK: Deploy Directory = " + deploy);
// JNP Port
int JNPPort = p_data.getAppsServerJNPPort();
pass = !p_data.testPort (appsServer, JNPPort, false)
&& p_data.testServerPort(JNPPort);
error = "Not correct: JNP Port = " + JNPPort;
if (getPanel() != null)
signalOK(getPanel().okJNPPort, "ErrorJNPPort",
pass, true, error);
if (!pass)
return error;
log.info("OK: JNPPort = " + JNPPort);
setProperty(ConfigurationData.ADEMPIERE_JNP_PORT, String.valueOf(JNPPort));
// Web Port // Web Port
int WebPort = p_data.getAppsServerWebPort(); int WebPort = p_data.getAppsServerWebPort();
pass = !p_data.testPort ("http", appsServer.getHostName(), WebPort, "/") pass = !p_data.testPort ("http", appsServer.getHostName(), WebPort, "/")
&& p_data.testServerPort(WebPort); && p_data.testServerPort(WebPort);
error = "Not correct: Web Port = " + WebPort; error = "Not correct: Web Port = " + WebPort;
if (getPanel() != null) if (getPanel() != null)
signalOK(getPanel().okWebPort, "ErrorWebPort", signalOK(getPanel().okWebPort, "ErrorWebPort",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
log.info("OK: Web Port = " + WebPort); log.info("OK: Web Port = " + WebPort);
setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort)); setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort));
// SSL Port // SSL Port
int sslPort = p_data.getAppsServerSSLPort(); int sslPort = p_data.getAppsServerSSLPort();
pass = !p_data.testPort ("https", appsServer.getHostName(), sslPort, "/") pass = !p_data.testPort ("https", appsServer.getHostName(), sslPort, "/")
&& p_data.testServerPort(sslPort); && p_data.testServerPort(sslPort);
error = "Not correct: SSL Port = " + sslPort; error = "Not correct: SSL Port = " + sslPort;
if (getPanel() != null) if (getPanel() != null)
signalOK(getPanel().okSSLPort, "ErrorWebPort", signalOK(getPanel().okSSLPort, "ErrorWebPort",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
log.info("OK: SSL Port = " + sslPort); log.info("OK: SSL Port = " + sslPort);
@ -153,5 +107,5 @@ public class ConfigJBoss extends Config
// //
return null; return null;
} // test } // test
} // ConfigJBoss } // ConfigJBoss

View File

@ -1,153 +0,0 @@
/**********************************************************************
* This file is part of Adempiere ERP Bazaar *
* http://www.adempiere.org *
* *
* Copyright (C) Praneet Tiwari. *
* Copyright (C) Contributors *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - Trifon Trifonov (trifonnt@users.sourceforge.net) *
* *
* Sponsors: *
* - D3 Soft (http://www.d3-soft.com) *
***********************************************************************/
package org.compiere.install;
import java.io.File;
import java.net.InetAddress;
/**
* GlassFish v2UR1 Apps Server Configuration
*
* @author Praneet Tiwari
* @author Trifon Trifonov
* @version $Id: $
*/
public class ConfigGlassfish extends Config {
/**
* ConfigGlassfish
* @param data configuration
*/
public ConfigGlassfish (ConfigurationData data)
{
super (data);
} // ConfigGlassfish
/**
* Initialize
*/
public void init()
{
p_data.setAppsServerDeployDir(getDeployDir());
p_data.setAppsServerDeployDir(false);
//
p_data.setAppsServerJNPPort("3700");
p_data.setAppsServerJNPPort(true);
p_data.setAppsServerWebPort("8080");
p_data.setAppsServerWebPort(true);
p_data.setAppsServerSSLPort("443");
p_data.setAppsServerSSLPort(true);
} // init
/**
* Get Deployment Dir
* @return deployment dir
*/
private String getDeployDir()
{
// TODO - check deployment directory
return p_data.getAdempiereHome() + File.separator + "glassfish";
/*Commented for now
+ File.separator + "glassfish"
+ File.separator + "domains"
+ File.separator + "domain1" ;
* */
} // getDeployDir
/**
* Test
* @return error message or null if OK
*/
public String test()
{
// AppsServer
String server = p_data.getAppsServer();
boolean pass = server != null && server.length() > 0
&& server.toLowerCase().indexOf("localhost") == -1
&& !server.equals("127.0.0.1");
InetAddress appsServer = null;
String error = "Not correct: AppsServer = " + server;
try
{
if (pass)
appsServer = InetAddress.getByName(server);
}
catch (Exception e)
{
error += " - " + e.getMessage();
pass = false;
}
if (getPanel() != null)
signalOK(getPanel().okAppsServer, "ErrorAppsServer",
pass, true, error);
if (!pass)
return error;
log.info("OK: AppsServer = " + appsServer);
setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName());
setProperty(ConfigurationData.ADEMPIERE_APPS_TYPE, p_data.getAppsServerType());
setProperty(ConfigurationData.ADEMPIERE_APPS_DEPLOY, p_data.getAppsServerDeployDir());
// JNP Port
int JNPPort = p_data.getAppsServerJNPPort();
setProperty(ConfigurationData.ADEMPIERE_JNP_PORT, String.valueOf(JNPPort));
// Web Port
int WebPort = p_data.getAppsServerWebPort();
pass = !p_data.testPort ("http", appsServer.getHostName(), WebPort, "/")
&& p_data.testServerPort(WebPort);
error = "Not correct: Web Port = " + WebPort;
if (getPanel() != null)
signalOK(getPanel().okWebPort, "ErrorWebPort",
pass, true, error);
if (!pass)
return error;
log.info("OK: Web Port = " + WebPort);
setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort));
// SSL Port
int sslPort = p_data.getAppsServerSSLPort();
pass = !p_data.testPort ("https", appsServer.getHostName(), sslPort, "/")
&& p_data.testServerPort(sslPort);
error = "Not correct: SSL Port = " + sslPort;
if (getPanel() != null)
signalOK(getPanel().okSSLPort, "ErrorWebPort",
pass, true, error);
if (!pass)
return error;
log.info("OK: SSL Port = " + sslPort);
setProperty(ConfigurationData.ADEMPIERE_SSL_PORT, String.valueOf(sslPort));
//
return null;
} // test
} // ConfigGlassfish

View File

@ -52,7 +52,7 @@ import org.compiere.util.Ini;
/** /**
* Configuration Data * Configuration Data
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: ConfigurationData.java,v 1.4 2006/07/30 00:57:42 jjanke Exp $ * @version $Id: ConfigurationData.java,v 1.4 2006/07/30 00:57:42 jjanke Exp $
*/ */
@ -75,14 +75,14 @@ public class ConfigurationData
/** Adempiere Home */ /** Adempiere Home */
private File m_adempiereHome; private File m_adempiereHome;
/** Static Logger */ /** Static Logger */
static CLogger log = CLogger.getCLogger (ConfigurationData.class); static CLogger log = CLogger.getCLogger (ConfigurationData.class);
/** Properties File name */ /** Properties File name */
public static final String ADEMPIERE_ENV_FILE = "AdempiereEnv.properties"; public static final String ADEMPIERE_ENV_FILE = "AdempiereEnv.properties";
/** Adempiere Home */ /** Adempiere Home */
public static final String ADEMPIERE_HOME = "ADEMPIERE_HOME"; public static final String ADEMPIERE_HOME = "ADEMPIERE_HOME";
/** */ /** */
@ -108,7 +108,7 @@ public class ConfigurationData
public static final String ADEMPIERE_SSL_PORT = "ADEMPIERE_SSL_PORT"; public static final String ADEMPIERE_SSL_PORT = "ADEMPIERE_SSL_PORT";
/** */ /** */
public static final String ADEMPIERE_WEB_ALIAS = "ADEMPIERE_WEB_ALIAS"; public static final String ADEMPIERE_WEB_ALIAS = "ADEMPIERE_WEB_ALIAS";
/** */ /** */
public static final String ADEMPIERE_KEYSTORE = "ADEMPIERE_KEYSTORE"; public static final String ADEMPIERE_KEYSTORE = "ADEMPIERE_KEYSTORE";
/** */ /** */
@ -117,17 +117,17 @@ public class ConfigurationData
public static final String ADEMPIERE_KEYSTORECODEALIAS = "ADEMPIERE_KEYSTORECODEALIAS"; public static final String ADEMPIERE_KEYSTORECODEALIAS = "ADEMPIERE_KEYSTORECODEALIAS";
/** */ /** */
public static final String ADEMPIERE_KEYSTOREWEBALIAS = "ADEMPIERE_KEYSTOREWEBALIAS"; public static final String ADEMPIERE_KEYSTOREWEBALIAS = "ADEMPIERE_KEYSTOREWEBALIAS";
public static final String ADEMPIERE_CERT_CN = "ADEMPIERE_CERT_CN"; public static final String ADEMPIERE_CERT_CN = "ADEMPIERE_CERT_CN";
public static final String ADEMPIERE_CERT_ORG = "ADEMPIERE_CERT_ORG"; public static final String ADEMPIERE_CERT_ORG = "ADEMPIERE_CERT_ORG";
public static final String ADEMPIERE_CERT_ORG_UNIT = "ADEMPIERE_CERT_ORG_UNIT"; public static final String ADEMPIERE_CERT_ORG_UNIT = "ADEMPIERE_CERT_ORG_UNIT";
public static final String ADEMPIERE_CERT_LOCATION = "ADEMPIERE_CERT_LOCATION"; public static final String ADEMPIERE_CERT_LOCATION = "ADEMPIERE_CERT_LOCATION";
public static final String ADEMPIERE_CERT_STATE = "ADEMPIERE_CERT_STATE"; public static final String ADEMPIERE_CERT_STATE = "ADEMPIERE_CERT_STATE";
public static final String ADEMPIERE_CERT_COUNTRY = "ADEMPIERE_CERT_COUNTRY"; public static final String ADEMPIERE_CERT_COUNTRY = "ADEMPIERE_CERT_COUNTRY";
/** DB Type */ /** DB Type */
@ -173,8 +173,8 @@ public class ConfigurationData
/** */ /** */
public static final String ADEMPIERE_WEBSTORES = "ADEMPIERE_WEBSTORES"; public static final String ADEMPIERE_WEBSTORES = "ADEMPIERE_WEBSTORES";
private void updateProperty(String property, String value) { private void updateProperty(String property, String value) {
if (value == null) value = ""; if (value == null) value = "";
String currentValue = (String)p_properties.get(property); String currentValue = (String)p_properties.get(property);
@ -183,7 +183,7 @@ public class ConfigurationData
else if (!currentValue.equals(value)) else if (!currentValue.equals(value))
p_properties.put(property, value); p_properties.put(property, value);
} }
/** /**
* Load Configuration Data * Load Configuration Data
* @return true if loaded * @return true if loaded
@ -194,7 +194,7 @@ public class ConfigurationData
String adempiereHome = System.getProperty(ADEMPIERE_HOME); String adempiereHome = System.getProperty(ADEMPIERE_HOME);
if (adempiereHome == null || adempiereHome.length() == 0) if (adempiereHome == null || adempiereHome.length() == 0)
adempiereHome = System.getProperty("user.dir"); adempiereHome = System.getProperty("user.dir");
boolean envLoaded = false; boolean envLoaded = false;
String fileName = adempiereHome + File.separator + ADEMPIERE_ENV_FILE; String fileName = adempiereHome + File.separator + ADEMPIERE_ENV_FILE;
File env = new File (fileName); File env = new File (fileName);
@ -213,7 +213,7 @@ public class ConfigurationData
log.info(env.toString()); log.info(env.toString());
if (p_properties.size() > 5) if (p_properties.size() > 5)
envLoaded = true; envLoaded = true;
Properties loaded = new Properties(); Properties loaded = new Properties();
loaded.putAll(p_properties); loaded.putAll(p_properties);
// //
@ -231,14 +231,8 @@ public class ConfigurationData
} }
setKeyStore(s); setKeyStore(s);
// //
int appServerIndex = setAppsServerType((String)p_properties.get(ADEMPIERE_APPS_TYPE));
initAppsServer(appServerIndex);
if (loaded.containsKey(ADEMPIERE_APPS_SERVER)) if (loaded.containsKey(ADEMPIERE_APPS_SERVER))
setAppsServer((String)loaded.get(ADEMPIERE_APPS_SERVER)); setAppsServer((String)loaded.get(ADEMPIERE_APPS_SERVER));
if (loaded.containsKey(ADEMPIERE_APPS_DEPLOY))
setAppsServerDeployDir((String)loaded.get(ADEMPIERE_APPS_DEPLOY));
if (loaded.containsKey(ADEMPIERE_JNP_PORT))
setAppsServerJNPPort((String)loaded.get(ADEMPIERE_JNP_PORT));
if (loaded.containsKey(ADEMPIERE_WEB_PORT)) if (loaded.containsKey(ADEMPIERE_WEB_PORT))
setAppsServerWebPort((String)loaded.get(ADEMPIERE_WEB_PORT)); setAppsServerWebPort((String)loaded.get(ADEMPIERE_WEB_PORT));
if (loaded.containsKey(ADEMPIERE_SSL_PORT)) if (loaded.containsKey(ADEMPIERE_SSL_PORT))
@ -281,7 +275,7 @@ public class ConfigurationData
{ {
log.severe("Cannot get local host name"); log.severe("Cannot get local host name");
} }
// No environment file found - defaults // No environment file found - defaults
// envLoaded = false; // envLoaded = false;
if (!envLoaded) if (!envLoaded)
@ -329,9 +323,9 @@ public class ConfigurationData
// Web Alias // Web Alias
if (!p_properties.containsKey(ADEMPIERE_WEB_ALIAS) && localhost != null) if (!p_properties.containsKey(ADEMPIERE_WEB_ALIAS) && localhost != null)
p_properties.setProperty(ADEMPIERE_WEB_ALIAS, localhost.getCanonicalHostName()); p_properties.setProperty(ADEMPIERE_WEB_ALIAS, localhost.getCanonicalHostName());
// (String)p_properties.get(ADEMPIERE_DB_URL) // derived // (String)p_properties.get(ADEMPIERE_DB_URL) // derived
// Keystore Alias // Keystore Alias
if (!p_properties.containsKey(ADEMPIERE_KEYSTORECODEALIAS)) if (!p_properties.containsKey(ADEMPIERE_KEYSTORECODEALIAS))
p_properties.setProperty(ADEMPIERE_KEYSTORECODEALIAS, "adempiere"); p_properties.setProperty(ADEMPIERE_KEYSTORECODEALIAS, "adempiere");
@ -340,8 +334,8 @@ public class ConfigurationData
return true; return true;
} // load } // load
public String resolveDatabaseName(String connectionName) { public String resolveDatabaseName(String connectionName) {
int index = p_panel.fDatabaseType.getSelectedIndex(); int index = p_panel.fDatabaseType.getSelectedIndex();
if (index < 0 || index >= DBTYPE.length) if (index < 0 || index >= DBTYPE.length)
@ -365,7 +359,7 @@ public class ConfigurationData
log.severe(error); log.severe(error);
return false; return false;
} }
error = testAdempiere(); error = testAdempiere();
if (error != null) if (error != null)
{ {
@ -381,7 +375,7 @@ public class ConfigurationData
log.warning(error); log.warning(error);
return false; return false;
} }
if (p_panel != null) if (p_panel != null)
p_panel.setStatusBar(p_panel.lDatabaseServer.getText()); p_panel.setStatusBar(p_panel.lDatabaseServer.getText());
error = testDatabase(); error = testDatabase();
@ -399,10 +393,10 @@ public class ConfigurationData
log.warning(error); log.warning(error);
return false; return false;
} }
return true; return true;
} // test } // test
/** /**
* Test Adempiere and set AdempiereHome * Test Adempiere and set AdempiereHome
@ -415,27 +409,27 @@ public class ConfigurationData
boolean pass =m_adempiereHome.exists(); boolean pass =m_adempiereHome.exists();
String error = "Not found: AdempiereHome = " + m_adempiereHome; String error = "Not found: AdempiereHome = " + m_adempiereHome;
if (p_panel != null) if (p_panel != null)
p_panel.signalOK(p_panel.okAdempiereHome, "ErrorAdempiereHome", p_panel.signalOK(p_panel.okAdempiereHome, "ErrorAdempiereHome",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
log.info("OK: AdempiereHome = " + m_adempiereHome); log.info("OK: AdempiereHome = " + m_adempiereHome);
p_properties.setProperty(ADEMPIERE_HOME, m_adempiereHome.getAbsolutePath()); p_properties.setProperty(ADEMPIERE_HOME, m_adempiereHome.getAbsolutePath());
System.setProperty(ADEMPIERE_HOME, m_adempiereHome.getAbsolutePath()); System.setProperty(ADEMPIERE_HOME, m_adempiereHome.getAbsolutePath());
// KeyStore // KeyStore
String fileName = KeyStoreMgt.getKeystoreFileName(m_adempiereHome.getAbsolutePath()); String fileName = KeyStoreMgt.getKeystoreFileName(m_adempiereHome.getAbsolutePath());
p_properties.setProperty(ADEMPIERE_KEYSTORE, fileName); p_properties.setProperty(ADEMPIERE_KEYSTORE, fileName);
// KeyStore Password // KeyStore Password
String pw = p_panel != null String pw = p_panel != null
? new String(p_panel.fKeyStore.getPassword()) ? new String(p_panel.fKeyStore.getPassword())
: (String)p_properties.get(ADEMPIERE_KEYSTOREPASS); : (String)p_properties.get(ADEMPIERE_KEYSTOREPASS);
pass = pw != null && pw.length() > 0; pass = pw != null && pw.length() > 0;
error = "Invalid Key Store Password = " + pw; error = "Invalid Key Store Password = " + pw;
if (p_panel != null) if (p_panel != null)
p_panel.signalOK(p_panel.okKeyStore, "KeyStorePassword", p_panel.signalOK(p_panel.okKeyStore, "KeyStorePassword",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
p_properties.setProperty(ADEMPIERE_KEYSTOREPASS, pw); p_properties.setProperty(ADEMPIERE_KEYSTOREPASS, pw);
@ -448,20 +442,20 @@ public class ConfigurationData
ks.setLocation((String)p_properties.getProperty(ADEMPIERE_CERT_LOCATION)); ks.setLocation((String)p_properties.getProperty(ADEMPIERE_CERT_LOCATION));
ks.setState((String)p_properties.getProperty(ADEMPIERE_CERT_STATE)); ks.setState((String)p_properties.getProperty(ADEMPIERE_CERT_STATE));
ks.setCountry((String)p_properties.getProperty(ADEMPIERE_CERT_COUNTRY)); ks.setCountry((String)p_properties.getProperty(ADEMPIERE_CERT_COUNTRY));
error = p_panel != null error = p_panel != null
? ks.verify((JFrame)SwingUtilities.getWindowAncestor(p_panel)) ? ks.verify((JFrame)SwingUtilities.getWindowAncestor(p_panel))
: ks.verify(null); : ks.verify(null);
pass = error == null; pass = error == null;
if (p_panel != null) if (p_panel != null)
p_panel.signalOK(p_panel.okKeyStore, "KeyStorePassword", p_panel.signalOK(p_panel.okKeyStore, "KeyStorePassword",
pass, true, error); pass, true, error);
if (!pass) if (!pass)
return error; return error;
log.info("OK: KeyStore = " + fileName); log.info("OK: KeyStore = " + fileName);
return null; return null;
} // testAdempiere } // testAdempiere
/************************************************************************** /**************************************************************************
* Test (optional) Mail * Test (optional) Mail
* @return error message or null, if OK * @return error message or null, if OK
@ -473,7 +467,7 @@ public class ConfigurationData
? p_panel.fMailServer.getText() ? p_panel.fMailServer.getText()
: (String)p_properties.get(ADEMPIERE_MAIL_SERVER); : (String)p_properties.get(ADEMPIERE_MAIL_SERVER);
boolean pass = server != null && server.length() > 0 boolean pass = server != null && server.length() > 0
&& server.toLowerCase().indexOf("localhost") == -1 && server.toLowerCase().indexOf("localhost") == -1
&& !server.equals("127.0.0.1"); && !server.equals("127.0.0.1");
String error = "Error Mail Server = " + server; String error = "Error Mail Server = " + server;
InetAddress mailServer = null; InetAddress mailServer = null;
@ -498,7 +492,7 @@ public class ConfigurationData
p_properties.setProperty(ADEMPIERE_MAIL_SERVER, mailServer.getHostName()); p_properties.setProperty(ADEMPIERE_MAIL_SERVER, mailServer.getHostName());
// Mail User // Mail User
String mailUser = p_panel != null String mailUser = p_panel != null
? p_panel.fMailUser.getText() ? p_panel.fMailUser.getText()
: (String)p_properties.get(ADEMPIERE_MAIL_USER); : (String)p_properties.get(ADEMPIERE_MAIL_USER);
String mailPassword = p_panel != null String mailPassword = p_panel != null
@ -508,7 +502,7 @@ public class ConfigurationData
// log.config("Mail User = " + mailUser + "/" + mailPassword); // log.config("Mail User = " + mailUser + "/" + mailPassword);
// Mail Address // Mail Address
String adminEMailString = p_panel != null String adminEMailString = p_panel != null
? p_panel.fAdminEMail.getText() ? p_panel.fAdminEMail.getText()
: (String)p_properties.get(ADEMPIERE_ADMIN_EMAIL); : (String)p_properties.get(ADEMPIERE_ADMIN_EMAIL);
InternetAddress adminEMail = null; InternetAddress adminEMail = null;
@ -528,7 +522,7 @@ public class ConfigurationData
pass = testMailServer(mailServer, adminEMail, mailUser, mailPassword); pass = testMailServer(mailServer, adminEMail, mailUser, mailPassword);
} }
if (p_panel != null) if (p_panel != null)
p_panel.signalOK(p_panel.okMailUser, "ErrorMail", p_panel.signalOK(p_panel.okMailUser, "ErrorMail",
pass, false, error); pass, false, error);
if (pass) if (pass)
{ {
@ -548,7 +542,7 @@ public class ConfigurationData
} }
return null; return null;
} // testMail } // testMail
/** /**
* Test Mail * Test Mail
* @param mailServer mail server * @param mailServer mail server
@ -598,7 +592,7 @@ public class ConfigurationData
EMail email = new EMail (new Properties(), EMail email = new EMail (new Properties(),
mailServer.getHostName (), mailServer.getHostName (),
adminEMail.toString (), adminEMail.toString(), adminEMail.toString (), adminEMail.toString(),
"Adempiere Server Setup Test", "Adempiere Server Setup Test",
"Test: " + getProperties()); "Test: " + getProperties());
email.createAuthenticator (mailUser, mailPassword); email.createAuthenticator (mailUser, mailPassword);
if (EMail.SENT_OK.equals (email.send ())) if (EMail.SENT_OK.equals (email.send ()))
@ -673,8 +667,8 @@ public class ConfigurationData
} }
return true; return true;
} // testMailServer } // testMailServer
/************************************************************************** /**************************************************************************
* Test Apps Server Port (client perspective) * Test Apps Server Port (client perspective)
* @param protocol protocol (http, ..) * @param protocol protocol (http, ..)
@ -693,7 +687,7 @@ public class ConfigurationData
} }
catch (MalformedURLException ex) catch (MalformedURLException ex)
{ {
log.severe("No URL for Protocol=" + protocol log.severe("No URL for Protocol=" + protocol
+ ", Server=" + server + ", Server=" + server
+ ": " + ex.getMessage()); + ": " + ex.getMessage());
return false; return false;
@ -763,7 +757,7 @@ public class ConfigurationData
} }
if (!shouldBeUsed) if (!shouldBeUsed)
log.warning("Open Socket " + host + ":" + port + " - " + pingSocket); log.warning("Open Socket " + host + ":" + port + " - " + pingSocket);
log.fine(host + ":" + port + " - " + pingSocket); log.fine(host + ":" + port + " - " + pingSocket);
if (pingSocket == null) if (pingSocket == null)
return false; return false;
@ -779,7 +773,7 @@ public class ConfigurationData
return true; return true;
} // testPort } // testPort
/************************************************************************** /**************************************************************************
* Save Settings * Save Settings
* @return true if saved * @return true if saved
@ -792,7 +786,7 @@ public class ConfigurationData
p_properties.setProperty("ADEMPIERE_DB_VERSION", Adempiere.DB_VERSION); p_properties.setProperty("ADEMPIERE_DB_VERSION", Adempiere.DB_VERSION);
log.finest(p_properties.toString()); log.finest(p_properties.toString());
// Before we save, load Ini // Before we save, load Ini
Ini.setClient(false); Ini.setClient(false);
String fileName = m_adempiereHome.getAbsolutePath() + File.separator + Ini.ADEMPIERE_PROPERTY_FILE; String fileName = m_adempiereHome.getAbsolutePath() + File.separator + Ini.ADEMPIERE_PROPERTY_FILE;
@ -811,8 +805,8 @@ public class ConfigurationData
{ {
log.severe("Cannot save Properties to " + fileName + " - " + e.toString()); log.severe("Cannot save Properties to " + fileName + " - " + e.toString());
if (p_panel != null) if (p_panel != null)
JOptionPane.showConfirmDialog(p_panel, JOptionPane.showConfirmDialog(p_panel,
ConfigurationPanel.res.getString("ErrorSave"), ConfigurationPanel.res.getString("ErrorSave"),
ConfigurationPanel.res.getString("AdempiereServerSetup"), ConfigurationPanel.res.getString("AdempiereServerSetup"),
JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
else else
@ -823,8 +817,8 @@ public class ConfigurationData
{ {
log.severe("Cannot save Properties to " + fileName + " - " + t.toString()); log.severe("Cannot save Properties to " + fileName + " - " + t.toString());
if (p_panel != null) if (p_panel != null)
JOptionPane.showConfirmDialog(p_panel, JOptionPane.showConfirmDialog(p_panel,
ConfigurationPanel.res.getString("ErrorSave"), ConfigurationPanel.res.getString("ErrorSave"),
ConfigurationPanel.res.getString("AdempiereServerSetup"), ConfigurationPanel.res.getString("AdempiereServerSetup"),
JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
else else
@ -834,10 +828,10 @@ public class ConfigurationData
log.info(fileName); log.info(fileName);
return saveIni(); return saveIni();
} // save } // save
/** /**
* Synchronize and save Connection Info in Ini * Synchronize and save Connection Info in Ini
* @return true * @return true
*/ */
private boolean saveIni() private boolean saveIni()
{ {
@ -854,7 +848,6 @@ public class ConfigurationData
getDatabaseServer(), getDatabasePort(), getDatabaseName(), getDatabaseServer(), getDatabasePort(), getDatabaseName(),
getDatabaseUser(), getDatabasePassword()); getDatabaseUser(), getDatabasePassword());
cc.setAppsHost(getAppsServer()); cc.setAppsHost(getAppsServer());
cc.setAppsPort(getAppsServerJNPPort());
cc.setConnectionProfile(CConnection.PROFILE_LAN); cc.setConnectionProfile(CConnection.PROFILE_LAN);
} }
catch(Exception e) catch(Exception e)
@ -871,8 +864,8 @@ public class ConfigurationData
Ini.saveProperties(false); Ini.saveProperties(false);
return true; return true;
} // saveIni } // saveIni
/** /**
* Get Properties * Get Properties
* @return properties * @return properties
@ -881,14 +874,14 @@ public class ConfigurationData
{ {
return p_properties; return p_properties;
} // getProperties } // getProperties
/** /**
* Get Adempiere Home * Get Adempiere Home
* @return adempiere home * @return adempiere home
*/ */
public String getAdempiereHome() public String getAdempiereHome()
{ {
return p_panel != null return p_panel != null
? p_panel.fAdempiereHome.getText() ? p_panel.fAdempiereHome.getText()
: (String)p_properties.get(ADEMPIERE_HOME); : (String)p_properties.get(ADEMPIERE_HOME);
} // getAdempiereHome } // getAdempiereHome
@ -904,7 +897,7 @@ public class ConfigurationData
else else
updateProperty(ADEMPIERE_HOME, adempiereHome); updateProperty(ADEMPIERE_HOME, adempiereHome);
} // setAdempiereHome } // setAdempiereHome
/** /**
* Get Key Store * Get Key Store
* @return password * @return password
@ -928,8 +921,8 @@ public class ConfigurationData
else else
updateProperty(ADEMPIERE_KEYSTOREPASS, password); updateProperty(ADEMPIERE_KEYSTOREPASS, password);
} // setKeyStore } // setKeyStore
/************************************************************************** /**************************************************************************
* Java Settings * Java Settings
*************************************************************************/ *************************************************************************/
@ -945,10 +938,11 @@ public class ConfigurationData
/** Java VM Types */ /** Java VM Types */
static String[] JAVATYPE = new String[] static String[] JAVATYPE = new String[]
{JAVATYPE_SUN, JAVATYPE_OPENJDK, JAVATYPE_MAC, JAVATYPE_IBM}; {JAVATYPE_SUN, JAVATYPE_OPENJDK, JAVATYPE_MAC, JAVATYPE_IBM};
/** Virtual machine Configurations */ /** Virtual machine Configurations */
private Config[] m_javaConfig = new Config[] private Config[] m_javaConfig = new Config[]
{new ConfigVMSun(this), new ConfigVMOpenJDK(this), new ConfigVMMac(this), null}; {new ConfigVMSun(this), new ConfigVMOpenJDK(this), new ConfigVMMac(this), null};
private ConfigAppServer m_appsConfig = new ConfigAppServer(this);
/** /**
* Init Database * Init Database
@ -958,7 +952,7 @@ public class ConfigurationData
int index = (p_panel != null ? p_panel.fJavaType.getSelectedIndex() : 0); int index = (p_panel != null ? p_panel.fJavaType.getSelectedIndex() : 0);
initJava(index); initJava(index);
} // initDatabase } // initDatabase
private void initJava(int index) private void initJava(int index)
{ {
if (index < 0 || index >= JAVATYPE.length) if (index < 0 || index >= JAVATYPE.length)
@ -972,14 +966,14 @@ public class ConfigurationData
else else
m_javaConfig[index].init(); m_javaConfig[index].init();
} }
/** /**
* Test Java * Test Java
* @return error message or null of OK * @return error message or null of OK
*/ */
public String testJava() public String testJava()
{ {
int index = p_panel != null int index = p_panel != null
? p_panel.fJavaType.getSelectedIndex() ? p_panel.fJavaType.getSelectedIndex()
: setJavaType((String)p_properties.get(JAVA_TYPE)); : setJavaType((String)p_properties.get(JAVA_TYPE));
if (index < 0 || index >= JAVATYPE.length) if (index < 0 || index >= JAVATYPE.length)
@ -988,7 +982,7 @@ public class ConfigurationData
return "JavaType Config class missing: " + index; return "JavaType Config class missing: " + index;
return m_javaConfig[index].test(); return m_javaConfig[index].test();
} // testJava } // testJava
/** /**
* Set Java Type * Set Java Type
* @param javaType The javaType to set. * @param javaType The javaType to set.
@ -1013,7 +1007,7 @@ public class ConfigurationData
p_panel.fJavaType.setSelectedIndex(index); p_panel.fJavaType.setSelectedIndex(index);
else else
updateProperty(JAVA_TYPE, javaType); updateProperty(JAVA_TYPE, javaType);
return index; return index;
} // setJavaType } // setJavaType
@ -1048,110 +1042,30 @@ public class ConfigurationData
else else
updateProperty(JAVA_HOME, javaHome); updateProperty(JAVA_HOME, javaHome);
} }
/**************************************************************************
* Apps Server Settings
*************************************************************************/
/** JBoss (default) */
protected static String APPSTYPE_JBOSS = "jboss";
/** GlassFish */
protected static String APPSTYPE_GLASSFISH = "glassfish";
/** Application Server Type */
static String[] APPSTYPE = new String[]
{ APPSTYPE_JBOSS
, APPSTYPE_GLASSFISH
};
/** Database Configs */
private Config[] m_appsConfig = new Config[]
{ new ConfigJBoss(this)
, new ConfigGlassfish( this )
};
/** /**
* Init Apps Server * Init Apps Server
*/ */
public void initAppsServer() public void initAppsServer()
{ {
int index = (p_panel != null ? p_panel.fAppsType.getSelectedIndex() : 0); m_appsConfig.init();
initAppsServer(index);
} // initAppsServer } // initAppsServer
private void initAppsServer(int index)
{
if (index < 0 || index >= APPSTYPE.length)
log.warning("AppsServerType Index invalid: " + index);
else if (m_appsConfig[index] == null)
{
log.warning("AppsServerType Config missing: " + APPSTYPE[index]);
p_panel.fAppsType.setSelectedIndex(0);
}
else
m_appsConfig[index].init();
}
/** /**
* Test Apps Server * Test Apps Server
* @return error message or null of OK * @return error message or null of OK
*/ */
public String testAppsServer() public String testAppsServer()
{ {
int index = p_panel != null return m_appsConfig.test();
? p_panel.fAppsType.getSelectedIndex()
: setAppsServerType((String)p_properties.get(ADEMPIERE_APPS_TYPE));
if (index < 0 || index >= APPSTYPE.length)
return "AppsServerType Index invalid: " + index;
else if (m_appsConfig[index] == null)
return "AppsServerType Config class missing: " + index;
return m_appsConfig[index].test();
} // testAppsServer } // testAppsServer
/**
* Set Apps Server Type
* @param appsType The appsType to set.
*/
public int setAppsServerType (String appsType)
{
int index = -1;
for (int i = 0; i < APPSTYPE.length; i++)
{
if (APPSTYPE[i].equals(appsType))
{
index = i;
break;
}
}
if (index == -1)
{
index = 0;
log.warning("Invalid AppsType=" + appsType);
}
if (p_panel != null)
p_panel.fAppsType.setSelectedIndex(index);
else
updateProperty(ADEMPIERE_APPS_TYPE, appsType);
return index;
} // setAppsServerType
/**
* Get Apps Server Type
* @return Apps Server Type
*/
public String getAppsServerType ()
{
return p_panel != null
? (String)p_panel.fAppsType.getSelectedItem()
: (String)p_properties.get(ADEMPIERE_APPS_TYPE);
} // setDatabaseType
/** /**
* @return Returns the appsServer. * @return Returns the appsServer.
*/ */
public String getAppsServer () public String getAppsServer ()
{ {
return p_panel != null return p_panel != null
? p_panel.fAppsServer.getText() ? p_panel.fAppsServer.getText()
: (String)p_properties.get(ADEMPIERE_APPS_SERVER); : (String)p_properties.get(ADEMPIERE_APPS_SERVER);
} }
@ -1165,74 +1079,7 @@ public class ConfigurationData
else else
updateProperty(ADEMPIERE_APPS_SERVER, appsServer); updateProperty(ADEMPIERE_APPS_SERVER, appsServer);
} }
/**
* @return Returns the appsServerDeployDir.
*/
public String getAppsServerDeployDir ()
{
return p_panel != null
? p_panel.fDeployDir.getText()
: (String)p_properties.get(ADEMPIERE_APPS_DEPLOY);
}
/**
* @param appsServerDeployDir The appsServerDeployDir to set.
*/
public void setAppsServerDeployDir (String appsServerDeployDir)
{
if (p_panel != null)
p_panel.fDeployDir.setText(appsServerDeployDir);
else
updateProperty(ADEMPIERE_APPS_DEPLOY, appsServerDeployDir);
}
/**
* @param enable if true enable entry
*/
public void setAppsServerDeployDir (boolean enable)
{
if (p_panel != null)
{
p_panel.fDeployDir.setEnabled(enable);
p_panel.bDeployDir.setEnabled(enable);
}
}
/**
* @return Returns the appsServerJNPPort.
*/
public int getAppsServerJNPPort ()
{
String port = p_panel != null
? p_panel.fJNPPort.getText()
: (String)p_properties.get(ADEMPIERE_JNP_PORT);
try
{
return Integer.parseInt(port);
}
catch (Exception e)
{
setAppsServerJNPPort("0");
}
return 0;
}
/**
* @param appsServerJNPPort The appsServerJNPPort to set.
*/
public void setAppsServerJNPPort (String appsServerJNPPort)
{
if (p_panel != null)
p_panel.fJNPPort.setText(appsServerJNPPort);
else
updateProperty(ADEMPIERE_JNP_PORT, appsServerJNPPort);
}
/**
* @param enable if enable JNP entry
*/
public void setAppsServerJNPPort (boolean enable)
{
if (p_panel != null)
p_panel.fJNPPort.setEnabled(enable);
}
/** /**
* @return Returns the appsServerSSLPort. * @return Returns the appsServerSSLPort.
*/ */
@ -1305,36 +1152,36 @@ public class ConfigurationData
if (p_panel != null) if (p_panel != null)
p_panel.fWebPort.setEnabled(enable); p_panel.fWebPort.setEnabled(enable);
} }
/************************************************************************** /**************************************************************************
* Database Settings * Database Settings
*************************************************************************/ *************************************************************************/
/** Oracle directory */ /** Oracle directory */
private static String DBTYPE_ORACLE = "oracle"; private static String DBTYPE_ORACLE = "oracle";
/** Oracle XP */ /** Oracle XP */
private static String DBTYPE_ORACLEXE = "oracleXE"; private static String DBTYPE_ORACLEXE = "oracleXE";
/** PostgreSQL */ /** PostgreSQL */
private static String DBTYPE_POSTGRESQL = "postgresql"; private static String DBTYPE_POSTGRESQL = "postgresql";
/** Database Types */ /** Database Types */
static String[] DBTYPE = new String[] static String[] DBTYPE = new String[]
{ DBTYPE_ORACLEXE, { DBTYPE_ORACLEXE,
DBTYPE_ORACLE, DBTYPE_ORACLE,
//begin e-evolution vpj-cd 02/07/2005 PostgreSQL //begin e-evolution vpj-cd 02/07/2005 PostgreSQL
DBTYPE_POSTGRESQL DBTYPE_POSTGRESQL
}; };
//end e-evolution vpj-cd 02/07/2005 PostgreSQL //end e-evolution vpj-cd 02/07/2005 PostgreSQL
/** Database Configs */ /** Database Configs */
private Config[] m_databaseConfig = new Config[] private Config[] m_databaseConfig = new Config[]
{ {
new ConfigOracle(this,true), new ConfigOracle(this,true),
new ConfigOracle(this,false), new ConfigOracle(this,false),
//begin e-evolution vpj-cd 02/07/2005 PostgreSQL //begin e-evolution vpj-cd 02/07/2005 PostgreSQL
new ConfigPostgreSQL(this) new ConfigPostgreSQL(this)
// end e-evolution vpj-cd 02/07/2005 PostgreSQL // end e-evolution vpj-cd 02/07/2005 PostgreSQL
}; };
@ -1347,7 +1194,7 @@ public class ConfigurationData
int index = (p_panel != null ? p_panel.fDatabaseType.getSelectedIndex() : 0); int index = (p_panel != null ? p_panel.fDatabaseType.getSelectedIndex() : 0);
initDatabase(selected, index); initDatabase(selected, index);
} // initDatabase } // initDatabase
private void initDatabase(String selected, int index) private void initDatabase(String selected, int index)
{ {
if (index < 0 || index >= DBTYPE.length) if (index < 0 || index >= DBTYPE.length)
@ -1361,26 +1208,26 @@ public class ConfigurationData
else else
{ {
m_databaseConfig[index].init(); m_databaseConfig[index].init();
if (p_panel != null) if (p_panel != null)
{ {
String[] databases = m_databaseConfig[index].discoverDatabases(selected); String[] databases = m_databaseConfig[index].discoverDatabases(selected);
DefaultComboBoxModel model = new DefaultComboBoxModel(databases); DefaultComboBoxModel model = new DefaultComboBoxModel(databases);
p_panel.fDatabaseDiscovered.setModel(model); p_panel.fDatabaseDiscovered.setModel(model);
p_panel.fDatabaseDiscovered.setEnabled(databases.length != 0); p_panel.fDatabaseDiscovered.setEnabled(databases.length != 0);
if (databases.length > 0) if (databases.length > 0)
p_panel.fDatabaseName.setText(databases[0]); p_panel.fDatabaseName.setText(databases[0]);
} }
} }
} }
/** /**
* Test Database * Test Database
* @return error message or null of OK * @return error message or null of OK
*/ */
public String testDatabase() public String testDatabase()
{ {
int index = p_panel != null int index = p_panel != null
? p_panel.fDatabaseType.getSelectedIndex() ? p_panel.fDatabaseType.getSelectedIndex()
: setDatabaseType((String)p_properties.get(ADEMPIERE_DB_TYPE)); : setDatabaseType((String)p_properties.get(ADEMPIERE_DB_TYPE));
if (index < 0 || index >= DBTYPE.length) if (index < 0 || index >= DBTYPE.length)
@ -1389,8 +1236,8 @@ public class ConfigurationData
return "DatabaseType Config class missing: " + index; return "DatabaseType Config class missing: " + index;
return m_databaseConfig[index].test(); return m_databaseConfig[index].test();
} // testDatabase } // testDatabase
/** /**
* Set Database Type * Set Database Type
* @param databaseType The databaseType to set. * @param databaseType The databaseType to set.
@ -1415,10 +1262,10 @@ public class ConfigurationData
p_panel.fDatabaseType.setSelectedIndex(index); p_panel.fDatabaseType.setSelectedIndex(index);
else else
updateProperty(ADEMPIERE_DB_TYPE, databaseType); updateProperty(ADEMPIERE_DB_TYPE, databaseType);
return index; return index;
} // setDatabaseType } // setDatabaseType
/** /**
* @return Returns the databaseType. * @return Returns the databaseType.
*/ */
@ -1443,7 +1290,7 @@ public class ConfigurationData
if (p_panel != null) if (p_panel != null)
p_panel.fDatabaseDiscovered.setSelectedItem(databaseDiscovered); p_panel.fDatabaseDiscovered.setSelectedItem(databaseDiscovered);
} }
/** /**
* @return Returns the databaseName. * @return Returns the databaseName.
*/ */
@ -1463,7 +1310,7 @@ public class ConfigurationData
else else
updateProperty(ADEMPIERE_DB_NAME, databaseName); updateProperty(ADEMPIERE_DB_NAME, databaseName);
} }
/** /**
* @return Returns the database User Password. * @return Returns the database User Password.
*/ */
@ -1594,5 +1441,5 @@ public class ConfigurationData
else else
updateProperty(ADEMPIERE_DB_USER, databaseUser); updateProperty(ADEMPIERE_DB_USER, databaseUser);
} }
} // ConfigurationData } // ConfigurationData

View File

@ -38,7 +38,6 @@ import javax.swing.border.TitledBorder;
import org.adempiere.base.Core; import org.adempiere.base.Core;
import org.apache.tools.ant.Main; import org.apache.tools.ant.Main;
import org.compiere.Adempiere;
import org.compiere.swing.CButton; import org.compiere.swing.CButton;
import org.compiere.swing.CCheckBox; import org.compiere.swing.CCheckBox;
import org.compiere.swing.CComboBox; import org.compiere.swing.CComboBox;
@ -48,9 +47,6 @@ import org.compiere.swing.CPassword;
import org.compiere.swing.CTextField; import org.compiere.swing.CTextField;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import com.sfcommerce.jpaymentcomponent.ssl.Client;
/** /**
* Configuration Panel * Configuration Panel
* *
@ -60,7 +56,7 @@ import com.sfcommerce.jpaymentcomponent.ssl.Client;
public class ConfigurationPanel extends CPanel implements ActionListener public class ConfigurationPanel extends CPanel implements ActionListener
{ {
/** /**
* *
*/ */
private static final long serialVersionUID = -5113669370606054608L; private static final long serialVersionUID = -5113669370606054608L;
@ -93,8 +89,6 @@ public class ConfigurationPanel extends CPanel implements ActionListener
/** Translation */ /** Translation */
static ResourceBundle res = ResourceBundle.getBundle("org.compiere.install.SetupRes"); static ResourceBundle res = ResourceBundle.getBundle("org.compiere.install.SetupRes");
/** Setup Frame */
private Setup m_setup = null;
/** Status Bar */ /** Status Bar */
private JLabel m_statusBar; private JLabel m_statusBar;
/** Configuration Data */ /** Configuration Data */
@ -123,20 +117,10 @@ public class ConfigurationPanel extends CPanel implements ActionListener
private CLabel lKeyStore = new CLabel(); private CLabel lKeyStore = new CLabel();
CPassword fKeyStore = new CPassword(); CPassword fKeyStore = new CPassword();
CCheckBox okKeyStore = new CCheckBox(); CCheckBox okKeyStore = new CCheckBox();
// Apps Server - Type // Apps Server - Type
CLabel lAppsServer = new CLabel(); CLabel lAppsServer = new CLabel();
CTextField fAppsServer = new CTextField(FIELDLENGTH); CTextField fAppsServer = new CTextField(FIELDLENGTH);
CCheckBox okAppsServer = new CCheckBox(); CCheckBox okAppsServer = new CCheckBox();
private CLabel lAppsType = new CLabel();
CComboBox fAppsType = new CComboBox(ConfigurationData.APPSTYPE);
// Deployment Directory - JNP
private CLabel lDeployDir = new CLabel();
CTextField fDeployDir = new CTextField(FIELDLENGTH);
CCheckBox okDeployDir = new CCheckBox();
CButton bDeployDir = new CButton(iOpen);
private CLabel lJNPPort = new CLabel();
CTextField fJNPPort = new CTextField(FIELDLENGTH);
CCheckBox okJNPPort = new CCheckBox();
// Web Ports // Web Ports
private CLabel lWebPort = new CLabel(); private CLabel lWebPort = new CLabel();
CTextField fWebPort = new CTextField(FIELDLENGTH); CTextField fWebPort = new CTextField(FIELDLENGTH);
@ -181,7 +165,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
private CButton bHelp = new CButton(iHelp); private CButton bHelp = new CButton(iHelp);
private CButton bTest = new CButton(); private CButton bTest = new CButton();
private CButton bSave = new CButton(iSave); private CButton bSave = new CButton(iSave);
/** /**
* Static Layout Init * Static Layout Init
@ -192,7 +176,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
this.setLayout(gridBagLayout); this.setLayout(gridBagLayout);
Insets bInsets = new Insets(0, 5, 0, 5); Insets bInsets = new Insets(0, 5, 0, 5);
TitledBorder titledBorder = new TitledBorder("dummy"); TitledBorder titledBorder = new TitledBorder("dummy");
// Java // Java
lJavaHome.setToolTipText(res.getString("JavaHomeInfo")); lJavaHome.setToolTipText(res.getString("JavaHomeInfo"));
lJavaHome.setText(res.getString("JavaHome")); lJavaHome.setText(res.getString("JavaHome"));
@ -203,7 +187,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
lJavaType.setToolTipText(res.getString("JavaTypeInfo")); lJavaType.setToolTipText(res.getString("JavaTypeInfo"));
lJavaType.setText(res.getString("JavaType")); lJavaType.setText(res.getString("JavaType"));
fJavaType.setPreferredSize(fJavaHome.getPreferredSize()); fJavaType.setPreferredSize(fJavaHome.getPreferredSize());
JLabel sectionLabel = new JLabel("Java"); JLabel sectionLabel = new JLabel("Java");
sectionLabel.setForeground(titledBorder.getTitleColor()); sectionLabel.setForeground(titledBorder.getTitleColor());
JSeparator separator = new JSeparator(); JSeparator separator = new JSeparator();
@ -211,7 +195,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 10), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 10), 0, 0));
this.add(separator, new GridBagConstraints(0, 1, 7, 1, 1.0, 0.0 this.add(separator, new GridBagConstraints(0, 1, 7, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
this.add(lJavaHome, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 this.add(lJavaHome, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0)); ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
this.add(fJavaHome, new GridBagConstraints(1, 2, 1, 1, 0.5, 0.0 this.add(fJavaHome, new GridBagConstraints(1, 2, 1, 1, 0.5, 0.0
@ -235,7 +219,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
lKeyStore.setToolTipText(res.getString("KeyStorePasswordInfo")); lKeyStore.setToolTipText(res.getString("KeyStorePasswordInfo"));
fKeyStore.setText(""); fKeyStore.setText("");
okKeyStore.setEnabled(false); okKeyStore.setEnabled(false);
sectionLabel = new JLabel("Adempiere"); sectionLabel = new JLabel("Adempiere");
sectionLabel.setForeground(titledBorder.getTitleColor()); sectionLabel.setForeground(titledBorder.getTitleColor());
separator = new JSeparator(); separator = new JSeparator();
@ -263,9 +247,6 @@ public class ConfigurationPanel extends CPanel implements ActionListener
lAppsServer.setFont(lAppsServer.getFont().deriveFont(Font.BOLD)); lAppsServer.setFont(lAppsServer.getFont().deriveFont(Font.BOLD));
fAppsServer.setText("."); fAppsServer.setText(".");
okAppsServer.setEnabled(false); okAppsServer.setEnabled(false);
lAppsType.setToolTipText(res.getString("AppsTypeInfo"));
lAppsType.setText(res.getString("AppsType"));
fAppsType.setPreferredSize(fAppsServer.getPreferredSize());
sectionLabel = new JLabel(res.getString("AppsServer")); sectionLabel = new JLabel(res.getString("AppsServer"));
sectionLabel.setForeground(titledBorder.getTitleColor()); sectionLabel.setForeground(titledBorder.getTitleColor());
separator = new JSeparator(); separator = new JSeparator();
@ -279,35 +260,6 @@ public class ConfigurationPanel extends CPanel implements ActionListener
,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0));
this.add(okAppsServer, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0 this.add(okAppsServer, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
this.add(lAppsType, new GridBagConstraints(4, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
this.add(fAppsType, new GridBagConstraints(5, 8, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
// Deployment - JNP
lDeployDir.setToolTipText(res.getString("DeployDirInfo"));
lDeployDir.setText(res.getString("DeployDir"));
fDeployDir.setText(".");
okDeployDir.setEnabled(false);
bDeployDir.setMargin(bInsets);
bDeployDir.setToolTipText(res.getString("DeployDirInfo"));
lJNPPort.setToolTipText(res.getString("JNPPortInfo"));
lJNPPort.setText(res.getString("JNPPort"));
fJNPPort.setText(".");
okJNPPort.setEnabled(false);
this.add(lDeployDir, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
this.add(fDeployDir, new GridBagConstraints(1, 9, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
this.add(okDeployDir, new GridBagConstraints(2, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
this.add(bDeployDir, new GridBagConstraints(3, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.add(lJNPPort, new GridBagConstraints(4, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
this.add(fJNPPort, new GridBagConstraints(5, 9, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
this.add(okJNPPort, new GridBagConstraints(6, 9, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
// Web Ports // Web Ports
lWebPort.setToolTipText(res.getString("WebPortInfo")); lWebPort.setToolTipText(res.getString("WebPortInfo"));
lWebPort.setText(res.getString("WebPort")); lWebPort.setText(res.getString("WebPort"));
@ -357,7 +309,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
lDatabaseName.setToolTipText(res.getString("DatabaseNameInfo")); lDatabaseName.setToolTipText(res.getString("DatabaseNameInfo"));
lDatabaseName.setText(res.getString("DatabaseName")); lDatabaseName.setText(res.getString("DatabaseName"));
fDatabaseName.setText("."); fDatabaseName.setText(".");
//TNS/Native connection //TNS/Native connection
lDatabaseDiscovered.setToolTipText(res.getString("TNSNameInfo")); lDatabaseDiscovered.setToolTipText(res.getString("TNSNameInfo"));
lDatabaseDiscovered.setText(res.getString("TNSName")); lDatabaseDiscovered.setText(res.getString("TNSName"));
@ -438,7 +390,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0)); ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
this.add(fAdminEMail, new GridBagConstraints(5, 19, 1, 1, 0.5, 0.0 this.add(fAdminEMail, new GridBagConstraints(5, 19, 1, 1, 0.5, 0.0
,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0));
// Mail User = Password // Mail User = Password
lMailUser.setToolTipText(res.getString("MailUserInfo")); lMailUser.setToolTipText(res.getString("MailUserInfo"));
lMailUser.setText(res.getString("MailUser")); lMailUser.setText(res.getString("MailUser"));
@ -464,7 +416,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
filler.setBorder(null); filler.setBorder(null);
this.add(filler, new GridBagConstraints(0, 21, 1, 1, 0.0, 1.0 this.add(filler, new GridBagConstraints(0, 21, 1, 1, 0.0, 1.0
,GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
// End // End
bTest.setToolTipText(res.getString("TestInfo")); bTest.setToolTipText(res.getString("TestInfo"));
bTest.setText(res.getString("Test")); bTest.setText(res.getString("Test"));
@ -480,9 +432,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
// //
bAdempiereHome.addActionListener(this); bAdempiereHome.addActionListener(this);
bJavaHome.addActionListener(this); bJavaHome.addActionListener(this);
bDeployDir.addActionListener(this);
fJavaType.addActionListener(this); fJavaType.addActionListener(this);
fAppsType.addActionListener(this);
fDatabaseType.addActionListener(this); fDatabaseType.addActionListener(this);
fDatabaseDiscovered.addActionListener(this); fDatabaseDiscovered.addActionListener(this);
bHelp.addActionListener(this); bHelp.addActionListener(this);
@ -508,8 +458,8 @@ public class ConfigurationPanel extends CPanel implements ActionListener
{ {
m_statusBar.setText(text); m_statusBar.setText(text);
} // setStatusBar } // setStatusBar
/************************************************************************** /**************************************************************************
* ActionListener * ActionListener
* @param e event * @param e event
@ -528,8 +478,6 @@ public class ConfigurationPanel extends CPanel implements ActionListener
// //
else if (e.getSource() == fJavaType) else if (e.getSource() == fJavaType)
m_data.initJava(); m_data.initJava();
else if (e.getSource() == fAppsType)
m_data.initAppsServer();
else if (e.getSource() == fDatabaseType) else if (e.getSource() == fDatabaseType)
m_data.initDatabase(""); m_data.initDatabase("");
// //
@ -537,8 +485,6 @@ public class ConfigurationPanel extends CPanel implements ActionListener
setPath (fJavaHome); setPath (fJavaHome);
else if (e.getSource() == bAdempiereHome) else if (e.getSource() == bAdempiereHome)
setPath (fAdempiereHome); setPath (fAdempiereHome);
else if (e.getSource() == bDeployDir)
setPath (fDeployDir);
else if (e.getSource() == bHelp) else if (e.getSource() == bHelp)
new Setup_Help((Frame)SwingUtilities.getWindowAncestor(this)); new Setup_Help((Frame)SwingUtilities.getWindowAncestor(this));
else if (e.getSource() == bTest) else if (e.getSource() == bTest)
@ -547,8 +493,8 @@ public class ConfigurationPanel extends CPanel implements ActionListener
startTest(true); startTest(true);
} // actionPerformed } // actionPerformed
/** /**
* Set Path in Field * Set Path in Field
* @param field field to set Path * @param field field to set Path
@ -564,7 +510,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
field.setText(fc.getSelectedFile().getAbsolutePath()); field.setText(fc.getSelectedFile().getAbsolutePath());
} // setPath } // setPath
/************************************************************************** /**************************************************************************
* Start Test Async. * Start Test Async.
* @param saveIt save * @param saveIt save
@ -605,8 +551,8 @@ public class ConfigurationPanel extends CPanel implements ActionListener
if (m_errorString != null) if (m_errorString != null)
{ {
CLogger.get().severe(m_errorString); CLogger.get().severe(m_errorString);
JOptionPane.showConfirmDialog (m_statusBar.getParent(), JOptionPane.showConfirmDialog (m_statusBar.getParent(),
m_errorString, m_errorString,
res.getString("ServerError"), res.getString("ServerError"),
JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
} }
@ -641,7 +587,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
* @param critical true if critical * @param critical true if critical
* @param errorMsg error Message * @param errorMsg error Message
*/ */
void signalOK (CCheckBox cb, String resString, void signalOK (CCheckBox cb, String resString,
boolean pass, boolean critical, String errorMsg) boolean pass, boolean critical, String errorMsg)
{ {
m_errorString = res.getString(resString); m_errorString = res.getString(resString);
@ -672,10 +618,10 @@ public class ConfigurationPanel extends CPanel implements ActionListener
bSave.setEnabled(false); bSave.setEnabled(false);
bTest.setEnabled(false); bTest.setEnabled(false);
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if (!m_data.save()) if (!m_data.save())
return; return;
// Final Info // Final Info
JOptionPane.showConfirmDialog(this, res.getString("EnvironmentSaved"), JOptionPane.showConfirmDialog(this, res.getString("EnvironmentSaved"),
res.getString("AdempiereServerSetup"), res.getString("AdempiereServerSetup"),
@ -695,7 +641,7 @@ public class ConfigurationPanel extends CPanel implements ActionListener
{ {
CLogger.get().log(Level.SEVERE, "ant", e); CLogger.get().log(Level.SEVERE, "ant", e);
} }
// To be sure // To be sure
((Frame)SwingUtilities.getWindowAncestor(this)).dispose(); ((Frame)SwingUtilities.getWindowAncestor(this)).dispose();
System.exit(0); // remains active when License Dialog called System.exit(0); // remains active when License Dialog called