Skip to content

Commit

Permalink
Changed the name of the 'headers' property to 'execution.table.header…
Browse files Browse the repository at this point in the history
…s' changed it to use ';' as deliemeter instead of ','
  • Loading branch information
itaiag committed Sep 29, 2016
1 parent d6b19e0 commit 1ae1e45
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
9 changes: 6 additions & 3 deletions server/difido-server/config/difido_config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 =============
Expand Down
8 changes: 5 additions & 3 deletions server/difido-server/src/main/etc/difido_config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=

#===============================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand All @@ -34,15 +35,15 @@ public class ExecutionTableService {
public DataTable initTable(ExecutionMetadata[] metaData) {
DataTable table = new DataTable();
List<String> headers;
if (!Configuration.INSTANCE.readString(ConfigProps.HEADERS).isEmpty()) {
if (!Configuration.INSTANCE.readList(ConfigProps.EXECUTION_TABLE_HEADERS).isEmpty()) {
headers = new ArrayList<String>();
// There are some columns that we always want to display. And also,
// it is really hard to to handle the 'description' column when it
// is too dynamic in the client side.
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1ae1e45

Please sign in to comment.