You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by rm...@apache.org on 2014/04/06 13:11:43 UTC

svn commit: r1585286 - /incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java

Author: rmannibucau
Date: Sun Apr  6 11:11:43 2014
New Revision: 1585286

URL: http://svn.apache.org/r1585286
Log:
SIRONA-35 ignoring counter and role columns in csv format since they are forced as first

Modified:
    incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java

Modified: incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java?rev=1585286&r1=1585285&r2=1585286&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java (original)
+++ incubator/sirona/trunk/server/reporting/src/main/java/org/apache/sirona/reporting/web/plugin/report/format/CSVFormat.java Sun Apr  6 11:11:43 2014
@@ -26,7 +26,7 @@ import java.util.Map;
 
 public class CSVFormat extends MapFormat implements Format {
     private static final String SEPARATOR = Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "csv.separator", ";");
-    public static final String HEADER = "Monitor" + SEPARATOR + "Role" + SEPARATOR + toCsv(ATTRIBUTES_ORDERED_LIST);
+    public static final String HEADER = "Counter" + SEPARATOR + "Role" + SEPARATOR + toCsv(ATTRIBUTES_ORDERED_LIST);
 
     @Override
     public Template render(final Map<String, ?> params) {
@@ -47,6 +47,10 @@ public class CSVFormat extends MapFormat
     private static String toCsv(final Collection<String> line) {
         final StringBuilder builder = new StringBuilder();
         for (final String s : line) {
+            if ("Counter".equals(s) || "Role".equals(s)) { // forced first
+                continue;
+            }
+
             builder.append(s).append(SEPARATOR);
         }