diff --git a/org.adempiere.install/META-INF/MANIFEST.MF b/org.adempiere.install/META-INF/MANIFEST.MF
index 24b78d5e81..bfea4e3452 100644
--- a/org.adempiere.install/META-INF/MANIFEST.MF
+++ b/org.adempiere.install/META-INF/MANIFEST.MF
@@ -12,4 +12,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: javax.mail;version="1.4.0",
javax.mail.internet;version="1.4.0",
org.apache.tools.ant,
- org.eclipse.equinox.app
+ org.eclipse.ant.core,
+ org.eclipse.core.runtime;version="3.4.0",
+ org.eclipse.equinox.app,
+ org.osgi.framework
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.adempiere.install.InstallBundleActivator
diff --git a/org.adempiere.install/install.app.launch b/org.adempiere.install/install.app.launch
index b9d923a622..54d86821eb 100644
--- a/org.adempiere.install/install.app.launch
+++ b/org.adempiere.install/install.app.launch
@@ -14,13 +14,13 @@
-
+
-
-
+
+
diff --git a/org.adempiere.install/install.console.app.launch b/org.adempiere.install/install.console.app.launch
index 625668ba29..eeef1dc5c0 100644
--- a/org.adempiere.install/install.console.app.launch
+++ b/org.adempiere.install/install.console.app.launch
@@ -19,8 +19,8 @@
-
-
+
+
diff --git a/org.adempiere.install/plugin.xml b/org.adempiere.install/plugin.xml
index 2cc89a0dda..94de0adb17 100644
--- a/org.adempiere.install/plugin.xml
+++ b/org.adempiere.install/plugin.xml
@@ -6,7 +6,7 @@
id="org.adempiere.install.application"
point="org.eclipse.core.runtime.applications">
-
+
+ class="org.compiere.install.console.ConsoleInstallApplication">
diff --git a/org.adempiere.install/src/org/adempiere/install/IDatabaseConfig.java b/org.adempiere.install/src/org/adempiere/install/IDatabaseConfig.java
index 106bb56ded..3419968bfd 100644
--- a/org.adempiere.install/src/org/adempiere/install/IDatabaseConfig.java
+++ b/org.adempiere.install/src/org/adempiere/install/IDatabaseConfig.java
@@ -51,4 +51,10 @@ public interface IDatabaseConfig {
* @return error message or null if OK
*/
public String test(IDBConfigMonitor monitor, ConfigurationData data);
+
+ /**
+ * Get Database Name
+ * @return database short name
+ */
+ public String getName();
}
diff --git a/org.adempiere.install/src/org/compiere/install/Application.java b/org.adempiere.install/src/org/adempiere/install/InstallBundleActivator.java
similarity index 71%
rename from org.adempiere.install/src/org/compiere/install/Application.java
rename to org.adempiere.install/src/org/adempiere/install/InstallBundleActivator.java
index c29b414487..f91df646cb 100644
--- a/org.adempiere.install/src/org/compiere/install/Application.java
+++ b/org.adempiere.install/src/org/adempiere/install/InstallBundleActivator.java
@@ -11,24 +11,27 @@
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
-package org.compiere.install;
+package org.adempiere.install;
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
/**
*
* @author hengsin
*
*/
-public class Application implements IApplication {
+public class InstallBundleActivator implements BundleActivator {
+ public static BundleContext bundleContext = null;
- public Object start(IApplicationContext arg0) throws Exception {
- Setup.main(new String[]{});
- return null;
+ @Override
+ public void start(BundleContext context) throws Exception {
+ bundleContext = context;
}
- public void stop() {
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ bundleContext = null;
}
}
diff --git a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java
index f25f437bc8..e528aaec7b 100644
--- a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java
+++ b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java
@@ -81,9 +81,11 @@ public class ConfigurationData
{
List configList = Service.list(IDatabaseConfig.class);
m_databaseConfig = new IDatabaseConfig[configList.size()];
+ DBTYPE = new String[m_databaseConfig.length];
for(int i = 0; i < configList.size(); i++)
{
m_databaseConfig[i] = configList.get(i);
+ DBTYPE[i] = m_databaseConfig[i].getName();
}
}
@@ -1117,17 +1119,13 @@ public class ConfigurationData
*************************************************************************/
/** Oracle directory */
- private static String DBTYPE_ORACLE = "oracle";
+ private static String DBTYPE_ORACLE = "Oracle";
/** PostgreSQL */
- private static String DBTYPE_POSTGRESQL = "postgresql";
+ private static String DBTYPE_POSTGRESQL = "PostgreSQL";
/** Database Types */
- public static String[] DBTYPE = new String[]
- { DBTYPE_ORACLE,
- //begin e-evolution vpj-cd 02/07/2005 PostgreSQL
- DBTYPE_POSTGRESQL
- };
+ public static String[] DBTYPE = null;
//end e-evolution vpj-cd 02/07/2005 PostgreSQL
/** Database Configs */
diff --git a/org.adempiere.install/src/org/compiere/install/ConfigurationPanel.java b/org.adempiere.install/src/org/compiere/install/ConfigurationPanel.java
index 9454b456c5..1bfeb68593 100644
--- a/org.adempiere.install/src/org/compiere/install/ConfigurationPanel.java
+++ b/org.adempiere.install/src/org/compiere/install/ConfigurationPanel.java
@@ -612,7 +612,7 @@ public class ConfigurationPanel extends JPanel implements ActionListener, IDBCon
// To be sure
((Frame)SwingUtilities.getWindowAncestor(this)).dispose();
- System.exit(0); // remains active when License Dialog called
+// System.exit(0); // remains active when License Dialog called
/** **/
} // save
diff --git a/org.adempiere.install/src/org/compiere/install/InstallApplication.java b/org.adempiere.install/src/org/compiere/install/InstallApplication.java
new file mode 100644
index 0000000000..1b01c24c85
--- /dev/null
+++ b/org.adempiere.install/src/org/compiere/install/InstallApplication.java
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * Product: Adempiere ERP & CRM Smart Business Solution *
+ * Copyright (C) 2010 Heng Sin Low *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms version 2 of the GNU General Public License as published *
+ * by the Free Software Foundation. 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., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
+ *****************************************************************************/
+package org.compiere.install;
+
+import java.io.File;
+
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.eclipse.ant.core.AntRunner;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+
+/**
+ *
+ * @author hengsin
+ *
+ */
+public class InstallApplication implements IApplication {
+
+ public Object start(IApplicationContext context) throws Exception {
+ Setup.main(new String[]{});
+ Thread.sleep(10000);
+ while (Setup.instance.isDisplayable()) {
+ Thread.sleep(2000);
+ }
+ String path = System.getProperty("user.dir") + "/org.adempiere.install/build.xml";
+ File file = new File(path);
+ System.out.println("file="+path+" exists="+file.exists());
+ //only exists if it is running from development environment
+ if (file.exists()) {
+ AntRunner runner = new AntRunner();
+ runner.setBuildFileLocation(path);
+ runner.setMessageOutputLevel(Project.MSG_VERBOSE);
+ runner.addBuildLogger(DefaultLogger.class.getName());
+ runner.run();
+ runner.stop();
+ }
+ return null;
+ }
+
+ public void stop() {
+ }
+
+}
diff --git a/org.adempiere.install/src/org/compiere/install/Setup.java b/org.adempiere.install/src/org/compiere/install/Setup.java
index 3b95fbb1b2..ad7be0f121 100644
--- a/org.adempiere.install/src/org/compiere/install/Setup.java
+++ b/org.adempiere.install/src/org/compiere/install/Setup.java
@@ -48,7 +48,7 @@ import org.compiere.util.CLogger;
public class Setup extends JFrame implements ActionListener
{
/**
- *
+ *
*/
private static final long serialVersionUID = 1916571473738628986L;
@@ -100,6 +100,8 @@ public class Setup extends JFrame implements ActionListener
private BorderLayout borderLayout = new BorderLayout();
private ConfigurationPanel configurationPanel = new ConfigurationPanel (statusBar);
+ public static Setup instance;
+
/**
* Static Init
* @throws Exception
@@ -141,7 +143,7 @@ public class Setup extends JFrame implements ActionListener
else if (e.getSource() == menuHelpInfo)
new Setup_Help(this);
} // actionPerformed
-
+
/**
* Start
@@ -160,8 +162,8 @@ public class Setup extends JFrame implements ActionListener
// File Logger at least FINE
if (fileHandler.getLevel().intValue() > Level.FINE.intValue())
fileHandler.setLevel(Level.FINE);
-
- new Setup();
+
+ instance = new Setup();
} // main
} // Setup
diff --git a/org.adempiere.install/src/org/compiere/install/console/Application.java b/org.adempiere.install/src/org/compiere/install/console/ConsoleInstallApplication.java
similarity index 68%
rename from org.adempiere.install/src/org/compiere/install/console/Application.java
rename to org.adempiere.install/src/org/compiere/install/console/ConsoleInstallApplication.java
index e67380e404..a05d9ef91d 100644
--- a/org.adempiere.install/src/org/compiere/install/console/Application.java
+++ b/org.adempiere.install/src/org/compiere/install/console/ConsoleInstallApplication.java
@@ -13,6 +13,11 @@
*****************************************************************************/
package org.compiere.install.console;
+import java.io.File;
+
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.eclipse.ant.core.AntRunner;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
@@ -20,7 +25,7 @@ import org.eclipse.equinox.app.IApplicationContext;
* @author hengsin
*
*/
-public class Application implements IApplication {
+public class ConsoleInstallApplication implements IApplication {
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
@@ -29,7 +34,19 @@ public class Application implements IApplication {
public Object start(IApplicationContext context) throws Exception {
ConfigurationConsole console = new ConfigurationConsole();
console.doSetup();
- return Application.EXIT_OK;
+ String path = System.getProperty("user.dir") + "/org.adempiere.install/build.xml";
+ File file = new File(path);
+ System.out.println("file="+path+" exists="+file.exists());
+ //only exists if it is running from development environment
+ if (file.exists()) {
+ AntRunner runner = new AntRunner();
+ runner.setBuildFileLocation(path);
+ runner.setMessageOutputLevel(Project.MSG_VERBOSE);
+ runner.addBuildLogger(DefaultLogger.class.getName());
+ runner.run();
+ runner.stop();
+ }
+ return ConsoleInstallApplication.EXIT_OK;
}
/* (non-Javadoc)
diff --git a/org.adempiere.server-feature/server.product.launch b/org.adempiere.server-feature/server.product.launch
index 7ae02cb9a6..e946c1e202 100644
--- a/org.adempiere.server-feature/server.product.launch
+++ b/org.adempiere.server-feature/server.product.launch
@@ -21,8 +21,8 @@
-
-
+
+
diff --git a/org.adempiere.server-feature/setup-alt.bat b/org.adempiere.server-feature/setup-alt.bat
index 1f8229bb94..11aa2b75ef 100644
--- a/org.adempiere.server-feature/setup-alt.bat
+++ b/org.adempiere.server-feature/setup-alt.bat
@@ -18,7 +18,7 @@ goto START
:START
@REM Setup Adempiere.properties and AdempiereEnv.properties
-@"%JAVA%" -Dosgi.noShutdown=true -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -application org.adempiere.install.application -consoleLog
+@"%JAVA%" -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -application org.adempiere.install.application -consoleLog
@Echo ErrorLevel = %ERRORLEVEL%
@IF NOT ERRORLEVEL = 1 GOTO NEXT
diff --git a/org.adempiere.server-feature/setup-alt.sh b/org.adempiere.server-feature/setup-alt.sh
index 9f30330eb5..0fa32b2040 100644
--- a/org.adempiere.server-feature/setup-alt.sh
+++ b/org.adempiere.server-feature/setup-alt.sh
@@ -15,7 +15,7 @@ else
fi
#setup Adempiere.properties and AdempiereEnv.propertiess
-$JAVA -Dosgi.noShutdown=true -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -application org.adempiere.install.application -consoleLog
+$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -application org.adempiere.install.application -consoleLog
#setup tomcat
$JAVA -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=setup -jar plugins/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -application org.eclipse.ant.core.antRunner -buildfile build.xml
diff --git a/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java b/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java
index 4b8e7dfeb7..540319c22b 100644
--- a/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java
+++ b/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java
@@ -491,4 +491,9 @@ public class ConfigOracle implements IDatabaseConfig
return result == 0;
} // testSQL
+ @Override
+ public String getName() {
+ return Database.DB_ORACLE;
+ }
+
} // ConfigOracle
diff --git a/org.compiere.db.postgresql.provider/src/org/adempiere/db/postgresql/config/ConfigPostgreSQL.java b/org.compiere.db.postgresql.provider/src/org/adempiere/db/postgresql/config/ConfigPostgreSQL.java
index 845a15cb33..81e74bf34b 100755
--- a/org.compiere.db.postgresql.provider/src/org/adempiere/db/postgresql/config/ConfigPostgreSQL.java
+++ b/org.compiere.db.postgresql.provider/src/org/adempiere/db/postgresql/config/ConfigPostgreSQL.java
@@ -196,4 +196,9 @@ public class ConfigPostgreSQL implements IDatabaseConfig
return nativeConnectioName;
}
+ @Override
+ public String getName() {
+ return Database.DB_POSTGRESQL;
+ }
+
} // ConfigPostgreSQL