felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r734512 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Date Wed, 14 Jan 2009 21:08:24 GMT
Author: cziegeler
Date: Wed Jan 14 13:08:24 2009
New Revision: 734512

URL: http://svn.apache.org/viewvc?rev=734512&view=rev
Log:
FELIX-878 : Add export of configurations as json. The configs are exported by adding ".json"
to the request url. The url can either contain a pid as the path info or a filter expression.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java?rev=734512&r1=734511&r2=734512&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Wed Jan 14 13:08:24 2009
@@ -177,11 +177,18 @@
                 pw.write("[");
                 final SortedMap services = this.getServices(pid, pidFilter, locale, false);
                 final Iterator i = services.keySet().iterator();
+                boolean printColon = false;
                 while ( i.hasNext() ) {
                     final String servicePid = i.next().toString();
 
                     final Configuration config = this.getConfiguration(ca, servicePid);
-                    this.printConfigurationJson(pw, servicePid, config, pidFilter, locale);
+                    if ( config != null ) {
+                        if ( printColon ) {
+                            pw.print(',');
+                        }
+                        this.printConfigurationJson(pw, servicePid, config, pidFilter, locale);
+                        printColon = true;
+                    }
                 }
                 pw.write("]");
             } catch (InvalidSyntaxException e) {



Mime
View raw message