Commit 73d26c3c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

configuration object contain type group allowing for grouping options into categories

parent 7808aaa5
[{"id":345331,"modelId":16728,"type":"ALIAS"},{"id":345330,"modelId":16729,"type":"ALIAS"},{"id":345337,"modelId":16731,"type":"ALIAS"}]
\ No newline at end of file
[{"id":345331,"modelId":16728,"type":"ALIAS"},{"id":345337,"modelId":16731,"type":"ALIAS"},{"id":345330,"modelId":16729,"type":"ALIAS"}]
\ No newline at end of file
......@@ -12,64 +12,74 @@ public enum ConfigurationElementType {
/**
* Email address used for sending email from the system.
*/
EMAIL_ADDRESS("E-mail address", "your.account@domain.com", ConfigurationElementEditType.EMAIL, true), //
EMAIL_ADDRESS("E-mail address", "your.account@domain.com", ConfigurationElementEditType.EMAIL, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Login for the email account.
*/
EMAIL_LOGIN("E-mail server login", "your@login", ConfigurationElementEditType.STRING, true), //
EMAIL_LOGIN("E-mail server login", "your@login", ConfigurationElementEditType.STRING, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Password for the email account.
*/
EMAIL_PASSWORD("E-mail server password", "email.secret.password", ConfigurationElementEditType.PASSWORD, true), //
EMAIL_PASSWORD("E-mail server password", "email.secret.password", ConfigurationElementEditType.PASSWORD, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Address of the IMAP server.
*/
EMAIL_IMAP_SERVER("IMAP server", "your.imap.domain.com", ConfigurationElementEditType.STRING, true), //
EMAIL_IMAP_SERVER("IMAP server", "your.imap.domain.com", ConfigurationElementEditType.STRING, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Address of the SMTP server.
*/
EMAIL_SMTP_SERVER("SMTP server", "your.smtp.domain.com", ConfigurationElementEditType.STRING, true), //
EMAIL_SMTP_SERVER("SMTP server", "your.smtp.domain.com", ConfigurationElementEditType.STRING, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Port used for SMTP connection (sending e-mails).
*/
EMAIL_SMTP_PORT("SMTP port", "25", ConfigurationElementEditType.INTEGER, true), //
EMAIL_SMTP_PORT("SMTP port", "25", ConfigurationElementEditType.INTEGER, true,
ConfigurationElementTypeGroup.EMAIL_NOTIFICATION), //
/**
* Default map that should be presented if no map is selected by user side.
*/
DEFAULT_MAP("Default Project Id", "empty", ConfigurationElementEditType.STRING, false), //
DEFAULT_MAP("Default Project Id", "empty", ConfigurationElementEditType.STRING, false, null), //
/**
* Logo presented in the system.
*/
LOGO_IMG("Logo icon", "udl.png", ConfigurationElementEditType.URL, false), //
LOGO_IMG("Logo icon", "udl.png", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO), //
/**
* Address connected to the logo.
*/
LOGO_LINK("Logo link (after click)", "http://wwwen.uni.lu/", ConfigurationElementEditType.URL, false), //
LOGO_LINK("Logo link (after click)", "http://wwwen.uni.lu/", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO), //
/**
* Maximum distance (in pixels) that is allowed during finding closest element
* on the map.
*/
SEARCH_DISTANCE("Max distance for clicking on element (px)", "10", ConfigurationElementEditType.DOUBLE, false),
SEARCH_DISTANCE("Max distance for clicking on element (px)", "10", ConfigurationElementEditType.DOUBLE, false,
ConfigurationElementTypeGroup.POINT_AND_CLICK),
/**
* Email used for requesting an account (in client side).
*/
REQUEST_ACCOUNT_EMAIL("Email used for requesting an account", "your.email@domain.com",
ConfigurationElementEditType.EMAIL, false),
ConfigurationElementEditType.EMAIL, false, ConfigurationElementTypeGroup.EMAIL_NOTIFICATION),
/**
* Max number of results in search box.
*/
SEARCH_RESULT_NUMBER("Max number of results in search box. ", "100", ConfigurationElementEditType.INTEGER, false),
SEARCH_RESULT_NUMBER("Max number of results in search box. ", "100", ConfigurationElementEditType.INTEGER, false,
ConfigurationElementTypeGroup.POINT_AND_CLICK),
/**
* Google Analytics tracking ID used for statistics. This tracking ID should
......@@ -78,89 +88,98 @@ public enum ConfigurationElementType {
* </a>.
*/
GOOGLE_ANALYTICS_IDENTIFIER("Google Analytics tracking ID used for statistics", "",
ConfigurationElementEditType.STRING, false),
ConfigurationElementEditType.STRING, false, null),
/**
* Description of the logo presented in the system.
*/
LOGO_TEXT("Logo description", "University of Luxembourg", ConfigurationElementEditType.STRING, false),
LOGO_TEXT("Logo description", "University of Luxembourg", ConfigurationElementEditType.STRING, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO),
/**
* Domain allowed to connect via x-frame technology.
*/
X_FRAME_DOMAIN("Domain allowed to connect via x-frame technology", "", ConfigurationElementEditType.URL, false),
X_FRAME_DOMAIN("Domain allowed to connect via x-frame technology", "", ConfigurationElementEditType.URL, false, null),
/**
* Relative directory (in webapps folder) where big files will be stored.
*/
BIG_FILE_STORAGE_DIR("Path to store big files", "minerva-big/", ConfigurationElementEditType.STRING, false),
BIG_FILE_STORAGE_DIR("Path to store big files", "minerva-big/", ConfigurationElementEditType.STRING, false, null),
/**
* File where legend 1/4 is stored.
*/
LEGEND_FILE_1("Legend 1 image file", "resources/images/legend_a.png", ConfigurationElementEditType.URL, false),
LEGEND_FILE_1("Legend 1 image file", "resources/images/legend_a.png", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO),
/**
* File where legend 2/4 is stored.
*/
LEGEND_FILE_2("Legend 2 image file", "resources/images/legend_b.png", ConfigurationElementEditType.URL, false),
LEGEND_FILE_2("Legend 2 image file", "resources/images/legend_b.png", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO),
/**
* File where legend 3/4 is stored.
*/
LEGEND_FILE_3("Legend 3 image file", "resources/images/legend_c.png", ConfigurationElementEditType.URL, false),
LEGEND_FILE_3("Legend 3 image file", "resources/images/legend_c.png", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO),
/**
* File where legend 4/4 is stored.
*/
LEGEND_FILE_4("Legend 4 image file", "resources/images/legend_d.png", ConfigurationElementEditType.URL, false),
LEGEND_FILE_4("Legend 4 image file", "resources/images/legend_d.png", ConfigurationElementEditType.URL, false,
ConfigurationElementTypeGroup.LEGEND_AND_LOGO),
/**
* File where legend 4/4 is stored.
*/
USER_MANUAL_FILE("User manual file", "resources/other/user_guide.pdf", ConfigurationElementEditType.URL, false),
USER_MANUAL_FILE("User manual file", "resources/other/user_guide.pdf", ConfigurationElementEditType.URL, false, null),
/**
* Color used for negative overlay values.
*/
MIN_COLOR_VAL("Overlay color for negative values", "FF0000", ConfigurationElementEditType.COLOR, false),
MIN_COLOR_VAL("Overlay color for negative values", "FF0000", ConfigurationElementEditType.COLOR, false,
ConfigurationElementTypeGroup.OVERLAYS),
/**
* Color used for positive overlay values.
*/
MAX_COLOR_VAL("Overlay color for postive values", "0000FF", ConfigurationElementEditType.COLOR, false),
MAX_COLOR_VAL("Overlay color for postive values", "0000FF", ConfigurationElementEditType.COLOR, false,
ConfigurationElementTypeGroup.OVERLAYS),
/**
* Color used for undefined overlay values.
*/
SIMPLE_COLOR_VAL("Overlay color when no values are defined", "00FF00", ConfigurationElementEditType.COLOR, false),
SIMPLE_COLOR_VAL("Overlay color when no values are defined", "00FF00", ConfigurationElementEditType.COLOR, false,
ConfigurationElementTypeGroup.OVERLAYS),
/**
* Color used for 0 overlay value.
*/
NEUTRAL_COLOR_VAL("Overlay color for value=0", "FFFFFF", ConfigurationElementEditType.COLOR, false),
NEUTRAL_COLOR_VAL("Overlay color for value=0", "FFFFFF", ConfigurationElementEditType.COLOR, false,
ConfigurationElementTypeGroup.OVERLAYS),
/**
* Opacity of data overlay objects in the frontend.
*/
OVERLAY_OPACITY("Opacity used when drwaing data overlays (value between 0.0-1.0)", "0.8",
ConfigurationElementEditType.DOUBLE, false),
ConfigurationElementEditType.DOUBLE, false, ConfigurationElementTypeGroup.OVERLAYS),
/**
* Default content of the email when requesting for an account in the system.
*/
REQUEST_ACCOUNT_DEFAULT_CONTENT("Email content used for requesting an account",
"Dear Disease map team,\nI would like to request an account in the system.\nKind regards",
ConfigurationElementEditType.TEXT, false),
ConfigurationElementEditType.TEXT, false, ConfigurationElementTypeGroup.EMAIL_NOTIFICATION),
DEFAULT_VIEW_PROJECT("Default user privilege for: " + PrivilegeType.VIEW_PROJECT.getCommonName(), "true",
ConfigurationElementEditType.BOOLEAN, true),
ConfigurationElementEditType.BOOLEAN, true, ConfigurationElementTypeGroup.DEFAULT_USER_PRIVILEGES),
DEFAULT_EDIT_COMMENTS_PROJECT("Default user privilege for: " + PrivilegeType.EDIT_COMMENTS_PROJECT.getCommonName(),
"false", ConfigurationElementEditType.BOOLEAN, true),
"false", ConfigurationElementEditType.BOOLEAN, true, ConfigurationElementTypeGroup.DEFAULT_USER_PRIVILEGES),
DEFAULT_LAYOUT_MANAGEMENT("Default user privilege for: " + PrivilegeType.LAYOUT_MANAGEMENT.getCommonName(), "false",
ConfigurationElementEditType.BOOLEAN, true),
ConfigurationElementEditType.BOOLEAN, true, ConfigurationElementTypeGroup.DEFAULT_USER_PRIVILEGES),
;
......@@ -181,6 +200,7 @@ public enum ConfigurationElementType {
private ConfigurationElementEditType editType = null;
private boolean serverSide = true;
private ConfigurationElementTypeGroup group = null;
/**
* Default constructor.
......@@ -193,11 +213,12 @@ public enum ConfigurationElementType {
* default value assigned to this parameter
*/
ConfigurationElementType(String commonName, String defaultVal, ConfigurationElementEditType editType,
boolean serverSide) {
boolean serverSide, ConfigurationElementTypeGroup group) {
this.defaultValue = defaultVal;
this.commonName = commonName;
this.editType = editType;
this.serverSide = serverSide;
this.group = group;
}
/**
......@@ -232,13 +253,7 @@ public enum ConfigurationElementType {
return serverSide;
}
/**
* @param serverSide
* the serverSide to set
* @see #serverSide
*/
public void setServerSide(boolean serverSide) {
this.serverSide = serverSide;
public ConfigurationElementTypeGroup getGroup() {
return group;
}
}
package lcsb.mapviewer.model.user;
public enum ConfigurationElementTypeGroup {
EMAIL_NOTIFICATION("Email notification details"), //
DEFAULT_USER_PRIVILEGES("Default user privileges"), //
LEGEND_AND_LOGO("Legend and logo"), //
OVERLAYS("Overlays"), //
POINT_AND_CLICK("Point and click"), //
;
private String commonName;
ConfigurationElementTypeGroup(String commonName) {
this.commonName = commonName;
}
public String getCommonName() {
return commonName;
}
public void setCommonName(String commonName) {
this.commonName = commonName;
}
}
......@@ -67,6 +67,9 @@ public class ConfigurationRestImpl extends BaseRestImpl {
result.put("valueType", option.getType().getEditType());
result.put("commonName", option.getType().getCommonName());
result.put("value", option.getValue());
if (option.getType().getGroup() != null) {
result.put("group", option.getType().getGroup().getCommonName());
}
return result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment