mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
[DS-2034] Check for null (unset) properties and replace with an indicator
This commit is contained in:
@@ -474,11 +474,22 @@ public class ControlPanel extends AbstractDSpaceTransformer implements Serviceab
|
||||
}
|
||||
}
|
||||
|
||||
private static final String T_UNSET = "UNSET";
|
||||
|
||||
/**
|
||||
* Guarantee a non-null String.
|
||||
*
|
||||
* @param value candidate string.
|
||||
* @return {@code value} or a constant indicating an unset value.
|
||||
*/
|
||||
private static String notnull(String value) { return null == value ? T_UNSET : value; }
|
||||
|
||||
/**
|
||||
* List important DSpace configuration parameters.
|
||||
*/
|
||||
private void addDSpaceConfiguration(Division div) throws WingException
|
||||
{
|
||||
|
||||
// LIST: DSpace
|
||||
List dspace = div.addList("dspace");
|
||||
dspace.setHead(T_DSPACE_HEAD);
|
||||
@@ -487,47 +498,46 @@ public class ControlPanel extends AbstractDSpaceTransformer implements Serviceab
|
||||
dspace.addItem(Util.getSourceVersion());
|
||||
|
||||
dspace.addLabel(T_DSPACE_DIR);
|
||||
dspace.addItem(ConfigurationManager.getProperty("dspace.dir"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("dspace.dir")));
|
||||
|
||||
dspace.addLabel(T_DSPACE_URL);
|
||||
dspace.addItem(ConfigurationManager.getProperty("dspace.url"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("dspace.url")));
|
||||
|
||||
dspace.addLabel(T_DSPACE_HOST_NAME);
|
||||
dspace.addItem(ConfigurationManager.getProperty("dspace.hostname"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("dspace.hostname")));
|
||||
|
||||
dspace.addLabel(T_DSPACE_NAME);
|
||||
dspace.addItem(ConfigurationManager.getProperty("dspace.name"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("dspace.name")));
|
||||
|
||||
dspace.addLabel(T_DB_NAME);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.name"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.name")));
|
||||
|
||||
dspace.addLabel(T_DB_URL);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.url"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.url")));
|
||||
|
||||
dspace.addLabel(T_DB_DRIVER);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.driver"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.driver")));
|
||||
|
||||
dspace.addLabel(T_DB_MAX_CONN);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.maxconnections"));
|
||||
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.maxconnections")));
|
||||
|
||||
dspace.addLabel(T_DB_MAX_WAIT);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.maxwait"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.maxwait")));
|
||||
|
||||
dspace.addLabel(T_DB_MAX_IDLE);
|
||||
dspace.addItem(ConfigurationManager.getProperty("db.maxidle"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("db.maxidle")));
|
||||
|
||||
dspace.addLabel(T_MAIL_SERVER);
|
||||
dspace.addItem(ConfigurationManager.getProperty("mail.server"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("mail.server")));
|
||||
|
||||
dspace.addLabel(T_MAIL_FROM_ADDRESS);
|
||||
dspace.addItem(ConfigurationManager.getProperty("mail.from.address"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("mail.from.address")));
|
||||
|
||||
dspace.addLabel(T_FEEDBACK_RECIPIENT);
|
||||
dspace.addItem(ConfigurationManager.getProperty("feedback.recipient"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("feedback.recipient")));
|
||||
|
||||
dspace.addLabel(T_MAIL_ADMIN);
|
||||
dspace.addItem(ConfigurationManager.getProperty("mail.admin"));
|
||||
dspace.addItem(notnull(ConfigurationManager.getProperty("mail.admin")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user