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

View File

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

View File

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

View File

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

View File

@ -322,7 +322,7 @@ public class ConfigurationConsole {
cn = System.getProperty("user.name");
String ou = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG_UNIT);
if (ou == null)
ou = "AdempiereUser";
ou = "iDempiereUser";
String o = data.getProperty(ConfigurationData.ADEMPIERE_CERT_ORG);
if (o == null)
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.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
@ -33,6 +34,7 @@ import javax.swing.JMenuItem;
import javax.swing.JToggleButton;
import javax.swing.KeyStroke;
import org.compiere.install.ConfigurationPanel;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -178,8 +180,11 @@ public final class AppsAction extends AbstractAction
*/
private ImageIcon getIcon(String name, boolean small)
{
String fullName = name + (small ? "16" : "24");
return Env.getImageIcon2(fullName);
String fullName = name + (small ? "16" : "24") + ".gif";
URL imageURL = ConfigurationPanel.class.getResource("images/"+fullName);
if (imageURL == null)
return null;
return new ImageIcon(imageURL);
} // getIcon
/**

View File

@ -94,7 +94,7 @@ public class OnlineHelp extends JEditorPane implements HyperlinkListener
} // OnlineHelp
/** 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()
{

View File

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