* [ 1636521 ] Zero Setup for Webstart Client

This commit is contained in:
Heng Sin Low 2007-01-16 08:44:02 +00:00
parent 9df795c82e
commit c335e9c7ad
2 changed files with 33 additions and 6 deletions

View File

@ -396,6 +396,14 @@ public final class Adempiere
return null;
}
} // getCodeBase
/**
* @return True if client is started using web start
*/
public static boolean isWebStartClient()
{
return getCodeBase() != null;
}
/**
* Get JNLP CodeBase Host

View File

@ -77,11 +77,29 @@ public class CConnection implements Serializable
String attributes = Ini.getProperty (Ini.P_CONNECTION);
if (attributes == null || attributes.length () == 0)
{
CConnectionDialog ccd = new CConnectionDialog (new CConnection(apps_host));
s_cc = ccd.getConnection ();
// set also in ALogin and Ctrl
Ini.setProperty (Ini.P_CONNECTION, s_cc.toStringLong ());
Ini.saveProperties (Ini.isClient ());
//hengsin, zero setup for webstart client
CConnection cc = null;
if (apps_host != null && Adempiere.isWebStartClient())
{
cc = new CConnection(apps_host);
cc.setConnectionProfile(CConnection.PROFILE_WAN);
cc.setAppsPort(80);
if (cc.testAppsServer() == null)
{
s_cc = cc;
Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong());
Ini.saveProperties(false);
}
}
if (s_cc == null)
{
if (cc == null) cc = new CConnection(apps_host);
CConnectionDialog ccd = new CConnectionDialog (cc);
s_cc = ccd.getConnection ();
// set also in ALogin and Ctrl
Ini.setProperty (Ini.P_CONNECTION, s_cc.toStringLong ());
Ini.saveProperties (Ini.isClient ());
}
}
else
{
@ -560,8 +578,9 @@ public class CConnection implements Serializable
else
m_connectionProfile = connectionProfile;
//reset initial context to null
//hengsin, reset initial context and env
m_iContext = null;
m_env = null;
}
else
log.warning("Invalid: " + connectionProfile);