IDEMPIERE-3887 Setup / Console-setup improvements

This commit is contained in:
Carlos Ruiz 2019-02-09 14:26:45 +01:00
parent 8a2a01735e
commit 3ea6a2a17d
13 changed files with 62 additions and 39 deletions

View File

@ -296,6 +296,7 @@ public class ConfigurationData
} }
InetAddress localhost = null; InetAddress localhost = null;
@SuppressWarnings("unused")
String hostName = "unknown"; String hostName = "unknown";
try try
{ {
@ -318,7 +319,7 @@ public class ConfigurationData
setKeyStore(KEYSTORE_PASSWORD); setKeyStore(KEYSTORE_PASSWORD);
// AppsServer // AppsServer
initAppsServer(); initAppsServer();
setAppsServer(hostName); setAppsServer("0.0.0.0");
// Database Server // Database Server
initDatabase(Database.DB_POSTGRESQL); initDatabase(Database.DB_POSTGRESQL);
String connectionName = getDatabaseDiscovered(); String connectionName = getDatabaseDiscovered();
@ -326,18 +327,16 @@ public class ConfigurationData
setDatabaseName(resolveDatabaseName(connectionName)); setDatabaseName(resolveDatabaseName(connectionName));
} }
setDatabaseSystemPassword(""); setDatabaseSystemPassword("");
setDatabaseServer(hostName); setDatabaseServer("localhost");
setDatabaseUser("adempiere"); setDatabaseUser("adempiere");
setDatabasePassword("adempiere"); setDatabasePassword("adempiere");
// Mail Server // Mail Server
if (p_panel != null) setMailServer("localhost");
{ //setMailUser("info");
p_panel.fMailServer.setText(hostName); setMailUser("");
p_panel.fMailUser.setText("info"); setMailPassword("");
p_panel.fMailPassword.setText(""); //setAdminEMail("info@" + hostName);
p_panel.fAdminEMail.setText("info@" + hostName); setAdminEMail("");
}
//
} // !envLoaded } // !envLoaded
// Default FTP stuff // Default FTP stuff
@ -535,24 +534,28 @@ public class ConfigurationData
? 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;
try if (adminEMailString != null && adminEMailString.length() > 0) {
{ try
adminEMail = new InternetAddress (adminEMailString); {
} adminEMail = new InternetAddress (adminEMailString);
catch (Exception e) }
{ catch (Exception e)
error = "Not valid: " + adminEMailString + " - " + e.getMessage(); {
error = "Not valid: " + adminEMailString + " - " + e.getMessage();
pass = false;
}
//
if (pass)
{
error = "Not verified EMail = " + adminEMail;
pass = testMailServer(mailServer, adminEMail, mailUser, mailPassword);
}
if (p_panel != null)
p_panel.signalOK(p_panel.okMailUser, "ErrorMail",
pass, false, error);
} else {
pass = false; pass = false;
} }
//
if (pass)
{
error = "Not verified EMail = " + adminEMail;
pass = testMailServer(mailServer, adminEMail, mailUser, mailPassword);
}
if (p_panel != null)
p_panel.signalOK(p_panel.okMailUser, "ErrorMail",
pass, false, error);
if (pass) if (pass)
{ {
if (log.isLoggable(Level.INFO)) log.info("OK: EMail = " + adminEMail); if (log.isLoggable(Level.INFO)) log.info("OK: EMail = " + adminEMail);
@ -563,7 +566,11 @@ public class ConfigurationData
} }
else else
{ {
log.warning(error); if (adminEMailString != null && adminEMailString.length() > 0) {
log.warning(error);
} else {
if (log.isLoggable(Level.INFO)) log.info("OK: EMail not configured");
}
p_properties.setProperty(ADEMPIERE_ADMIN_EMAIL, ""); p_properties.setProperty(ADEMPIERE_ADMIN_EMAIL, "");
p_properties.setProperty(ADEMPIERE_MAIL_USER, ""); p_properties.setProperty(ADEMPIERE_MAIL_USER, "");
p_properties.setProperty(ADEMPIERE_MAIL_PASSWORD, ""); p_properties.setProperty(ADEMPIERE_MAIL_PASSWORD, "");

View File

@ -602,6 +602,8 @@ public class ConfigurationPanel extends JPanel implements ActionListener, IDBCon
} }
if (!pass && critical) if (!pass && critical)
cb.setBackground(Color.RED); cb.setBackground(Color.RED);
else if (!pass && !critical)
cb.setBackground(Color.YELLOW);
else else
cb.setBackground(Color.GREEN); cb.setBackground(Color.GREEN);
} // setOK } // setOK

View File

@ -300,7 +300,7 @@ public class KeyStoreMgt
: System.getProperty("user.name"); : System.getProperty("user.name");
String o = mgt.organizationUnit != null String o = mgt.organizationUnit != null
? mgt.organizationUnit ? mgt.organizationUnit
: "AdempiereUser"; : "iDempiereUser";
String l = mgt.location != null String l = mgt.location != null
? mgt.location ? mgt.location
: "MyTown"; : "MyTown";

View File

@ -99,6 +99,7 @@ public class Setup_Help extends JDialog implements ActionListener
} }
catch (Exception ex) catch (Exception ex)
{ {
ex.printStackTrace();
} }
} // init } // init
@ -139,7 +140,7 @@ public class Setup_Help extends JDialog implements ActionListener
{ {
try try
{ {
editorPane.setPage("http://www.adempiere.com/wiki/index.php/ServerSetupHelp"); editorPane.setPage("http://wiki.idempiere.org/en/Server_Setup_Help");
} }
catch (IOException ex) catch (IOException ex)
{ {

View File

@ -322,7 +322,7 @@ public class ConfigurationConsole {
cn = System.getProperty("user.name"); cn = System.getProperty("user.name");
String ou = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG_UNIT); String ou = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG_UNIT);
if (ou == null) if (ou == null)
ou = "AdempiereUser"; ou = "iDempiereUser";
String o = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG); String o = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG);
if (o == null) if (o == null)
o = System.getProperty("user.name"); o = System.getProperty("user.name");

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

View File

@ -20,6 +20,7 @@ import java.awt.Dimension;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.net.URL;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
@ -33,6 +34,7 @@ import javax.swing.JMenuItem;
import javax.swing.JToggleButton; import javax.swing.JToggleButton;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import org.compiere.install.ConfigurationPanel;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -178,8 +180,11 @@ public final class AppsAction extends AbstractAction
*/ */
private ImageIcon getIcon(String name, boolean small) private ImageIcon getIcon(String name, boolean small)
{ {
String fullName = name + (small ? "16" : "24"); String fullName = name + (small ? "16" : "24") + ".gif";
return Env.getImageIcon2(fullName); URL imageURL = ConfigurationPanel.class.getResource("images/"+fullName);
if (imageURL == null)
return null;
return new ImageIcon(imageURL);
} // getIcon } // getIcon
/** /**

View File

@ -94,7 +94,7 @@ public class OnlineHelp extends JEditorPane implements HyperlinkListener
} // OnlineHelp } // OnlineHelp
/** Base of Online Help System */ /** Base of Online Help System */
protected static final String BASE_URL = "http://www.adempiere.com/wiki/index.php/OnlineLoginHelp"; protected static final String BASE_URL = "http://wiki.idempiere.org/en/Server_Setup_Help";
public static void openInDefaultBrowser() public static void openInDefaultBrowser()
{ {

View File

@ -392,9 +392,13 @@ public class ConfigOracle implements IDatabaseConfig
// Ignore result as it might not be imported // Ignore result as it might not be imported
pass = testJDBC(url, databaseUser, databasePassword); pass = testJDBC(url, databaseUser, databasePassword);
error = "Cannot connect to User: " + databaseUser + "/" + databasePassword + " - Database may not be imported yet (OK on initial run)."; error = "Cannot connect to User: " + databaseUser + "/" + databasePassword + " - Database may not be imported yet (OK on initial run).";
if (monitor != null) if (monitor != null) {
monitor.update(new DBConfigStatus(DBConfigStatus.DATABASE_USER, "ErrorJDBC", boolean critical = true;
pass, true, error)); if (!isDBExists) {
critical = false;
}
monitor.update(new DBConfigStatus(DBConfigStatus.DATABASE_USER, "ErrorJDBC", pass, critical, error));
}
if (pass) if (pass)
{ {
if (log.isLoggable(Level.INFO)) log.info("OK: Database User = " + databaseUser); if (log.isLoggable(Level.INFO)) log.info("OK: Database User = " + databaseUser);

View File

@ -158,9 +158,13 @@ public class ConfigPostgreSQL implements IDatabaseConfig
// Ignore result as it might not be imported // Ignore result as it might not be imported
pass = testJDBC(url, databaseUser, databasePassword); pass = testJDBC(url, databaseUser, databasePassword);
error = "Database imported? Cannot connect to User: " + databaseUser + "/" + databasePassword; error = "Database imported? Cannot connect to User: " + databaseUser + "/" + databasePassword;
if (monitor != null) if (monitor != null) {
monitor.update(new DBConfigStatus(DBConfigStatus.DATABASE_USER, "ErrorJDBC", boolean critical = true;
pass, true, error)); if (!isDBExists) {
critical = false;
}
monitor.update(new DBConfigStatus(DBConfigStatus.DATABASE_USER, "ErrorJDBC", pass, critical, error));
}
if (pass) if (pass)
{ {
if (log.isLoggable(Level.INFO)) log.info("OK: Database User = " + databaseUser); if (log.isLoggable(Level.INFO)) log.info("OK: Database User = " + databaseUser);