diff --git a/server/difido-server/config/difido_config.properties b/server/difido-server/config/difido_config.properties index 0728c29f..39d9f180 100644 --- a/server/difido-server/config/difido_config.properties +++ b/server/difido-server/config/difido_config.properties @@ -21,9 +21,12 @@ enable.html.reports=true # List of plugin classes plugin.classes=il.co.topq.report.plugins.mail.DefaultMailPlugin -# The order and definitions of the headers that will be displayed in the Execution Reports view. If no headers specified, it will be the default values. -# The 'id' and 'description' headers are always added to the view, so there is no need to define them here. -headers= +# ';' separated list of the headers that will be displayed in the Execution Reports view and the order of them (left to right). +# If no headers specified, The default values will be kept. +# The 'id' and 'description' headers are always added to the view, so there is no need to add them here. +# Notice that this is case sensitive. +execution.table.headers= + #=============================== #=========== Mail ============= diff --git a/server/difido-server/src/main/etc/difido_config.properties b/server/difido-server/src/main/etc/difido_config.properties index df150824..864d596d 100644 --- a/server/difido-server/src/main/etc/difido_config.properties +++ b/server/difido-server/src/main/etc/difido_config.properties @@ -21,9 +21,11 @@ enable.html.reports=true # List of plugin classes plugin.classes=il.co.topq.report.plugins.mail.DefaultMailPlugin -# The order and definitions of the headers that will be displayed in the Execution Reports view. If no headers specified, it will be the default values. -# The 'id' and 'description' headers are always added to the view, so there is no need to define them here. -headers= +# ';' separated list of the headers that will be displayed in the Execution Reports view and the order of them (left to right). +# If no headers specified, The default values will be kept. +# The 'id' and 'description' headers are always added to the view, so there is no need to add them here. +# Notice that this is case sensitive. +execution.table.headers= #=============================== diff --git a/server/difido-server/src/main/java/il/co/topq/report/Configuration.java b/server/difido-server/src/main/java/il/co/topq/report/Configuration.java index 41fcd236..e6af09e4 100644 --- a/server/difido-server/src/main/java/il/co/topq/report/Configuration.java +++ b/server/difido-server/src/main/java/il/co/topq/report/Configuration.java @@ -37,7 +37,7 @@ public enum ConfigProps { MAIL_FROM_ADDRESS("mail.from.address",""), MAIL_TO_ADDRESS("mail.to.address",""), MAIL_CC_ADDRESS("mail.cc.address", ""), - HEADERS("headers", ""), + EXECUTION_TABLE_HEADERS("execution.table.headers", ""), /** * semicolon separated list of custom properties that can be added to @@ -118,7 +118,7 @@ private void useDefaultProperties() { addPropWithDefaultValue(ConfigProps.MAIL_CC_ADDRESS); addPropWithDefaultValue(ConfigProps.CUSTOM_EXECUTION_PROPERTIES); addPropWithDefaultValue(ConfigProps.PLUGIN_CLASSES); - addPropWithDefaultValue(ConfigProps.HEADERS); + addPropWithDefaultValue(ConfigProps.EXECUTION_TABLE_HEADERS); try (FileOutputStream out = new FileOutputStream( new File(Common.CONFIUGRATION_FOLDER_NAME, CONFIG_PROP_NAME))) { configProperties.store(out, "Default difido server properties"); diff --git a/server/difido-server/src/main/java/il/co/topq/report/business/execution/ExecutionTableService.java b/server/difido-server/src/main/java/il/co/topq/report/business/report/ExecutionTableService.java similarity index 93% rename from server/difido-server/src/main/java/il/co/topq/report/business/execution/ExecutionTableService.java rename to server/difido-server/src/main/java/il/co/topq/report/business/report/ExecutionTableService.java index 42ea2161..6b9d1ac2 100644 --- a/server/difido-server/src/main/java/il/co/topq/report/business/execution/ExecutionTableService.java +++ b/server/difido-server/src/main/java/il/co/topq/report/business/report/ExecutionTableService.java @@ -1,4 +1,4 @@ -package il.co.topq.report.business.execution; +package il.co.topq.report.business.report; import java.util.ArrayList; import java.util.Arrays; @@ -11,6 +11,7 @@ import il.co.topq.report.Configuration; import il.co.topq.report.Configuration.ConfigProps; +import il.co.topq.report.business.execution.ExecutionMetadata; import il.co.topq.report.front.rest.ReportsResource.DataTable; @Service @@ -34,7 +35,7 @@ public class ExecutionTableService { public DataTable initTable(ExecutionMetadata[] metaData) { DataTable table = new DataTable(); List headers; - if (!Configuration.INSTANCE.readString(ConfigProps.HEADERS).isEmpty()) { + if (!Configuration.INSTANCE.readList(ConfigProps.EXECUTION_TABLE_HEADERS).isEmpty()) { headers = new ArrayList(); // There are some columns that we always want to display. And also, // it is really hard to to handle the 'description' column when it @@ -42,7 +43,7 @@ public DataTable initTable(ExecutionMetadata[] metaData) { headers.add(ID); headers.add(DESCRIPTION); headers.add(LINK); - for (String desiredHeader: Configuration.INSTANCE.readString(ConfigProps.HEADERS).split(",")){ + for (String desiredHeader: Configuration.INSTANCE.readList(ConfigProps.EXECUTION_TABLE_HEADERS)){ desiredHeader = desiredHeader.trim(); if (desiredHeader.equals(ID) || desiredHeader.equals(DESCRIPTION) || desiredHeader.equals(LINK)){ // We already added those headers. diff --git a/server/difido-server/src/main/java/il/co/topq/report/front/rest/ReportsResource.java b/server/difido-server/src/main/java/il/co/topq/report/front/rest/ReportsResource.java index b31e82d3..ca68adfd 100644 --- a/server/difido-server/src/main/java/il/co/topq/report/front/rest/ReportsResource.java +++ b/server/difido-server/src/main/java/il/co/topq/report/front/rest/ReportsResource.java @@ -17,8 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RestController; -import il.co.topq.report.business.execution.ExecutionTableService; import il.co.topq.report.business.execution.MetadataProvider; +import il.co.topq.report.business.report.ExecutionTableService; @RestController @Path("api/reports")