You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2018/09/16 15:10:46 UTC

svn commit: r1841021 - in /felix/trunk/webconsole-plugins/ds/src/main: java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java resources/res/plugin.js

Author: cziegeler
Date: Sun Sep 16 15:10:46 2018
New Revision: 1841021

URL: http://svn.apache.org/viewvc?rev=1841021&view=rev
Log:
FELIX-5841 : Update webconsole plugin to DS 1.4 (R7)

Modified:
    felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java
    felix/trunk/webconsole-plugins/ds/src/main/resources/res/plugin.js

Modified: felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java?rev=1841021&r1=1841020&r2=1841021&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java (original)
+++ felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/ComponentConfigurationPrinter.java Sun Sep 16 15:10:46 2018
@@ -61,11 +61,12 @@ class ComponentConfigurationPrinter impl
     /**
      * @see org.apache.felix.inventory.InventoryPrinter#print(java.io.PrintWriter, org.apache.felix.inventory.Format, boolean)
      */
+    @Override
     public void print(PrintWriter pw, Format format, boolean isZip)
     {
-        final List<ComponentDescriptionDTO> noConfig = new ArrayList<ComponentDescriptionDTO>();
-        final List<ComponentDescriptionDTO> disabled = new ArrayList<ComponentDescriptionDTO>();
-        final List<ComponentConfigurationDTO> configurations = new ArrayList<ComponentConfigurationDTO>();
+        final List<ComponentDescriptionDTO> noConfig = new ArrayList<>();
+        final List<ComponentDescriptionDTO> disabled = new ArrayList<>();
+        final List<ComponentConfigurationDTO> configurations = new ArrayList<>();
 
         final Collection<ComponentDescriptionDTO> descs = scrService.getComponentDescriptionDTOs();
         for(final ComponentDescriptionDTO d : descs)
@@ -172,7 +173,7 @@ class ComponentConfigurationPrinter impl
             pw.println("Component Configurations:");
             pw.println(SEP);
             // order components by id
-            TreeMap<Long, ComponentConfigurationDTO> componentMap = new TreeMap<Long, ComponentConfigurationDTO>();
+            TreeMap<Long, ComponentConfigurationDTO> componentMap = new TreeMap<>();
             for(final ComponentConfigurationDTO cfg : configurations)
             {
                 componentMap.put(new Long(cfg.id), cfg);
@@ -197,7 +198,7 @@ class ComponentConfigurationPrinter impl
         pw.println("  Bundle=" + cfg.description.bundle.symbolicName + " ("
                 + cfg.description.bundle.id + ")");
         pw.println("  State=" + toStateString(cfg.state));
-        if ( cfg.state == ComponentConfigurationDTO.FAILED_ACTIVATION && cfg.failure != null ) {
+        if ( cfg.state == ComponentConfigurationDTO.FAILED_ACTIVATION ) {
             pw.println("  Failure=" + cfg.failure);
         }
         pw.println("  DefaultState="
@@ -341,7 +342,7 @@ class ComponentConfigurationPrinter impl
         {
 
             pw.println("  Properties=");
-            TreeSet<String> keys = new TreeSet<String>(props.keySet());
+            TreeSet<String> keys = new TreeSet<>(props.keySet());
             for (Iterator<String> ki = keys.iterator(); ki.hasNext();)
             {
                 String key = ki.next();
@@ -356,7 +357,7 @@ class ComponentConfigurationPrinter impl
         }
         if ( cfg == null && description.factoryProperties != null ) {
             pw.println("  FactoryProperties=");
-            TreeSet<String> keys = new TreeSet<String>(description.factoryProperties.keySet());
+            TreeSet<String> keys = new TreeSet<>(description.factoryProperties.keySet());
             for (Iterator<String> ki = keys.iterator(); ki.hasNext();)
             {
                 String key = ki.next();

Modified: felix/trunk/webconsole-plugins/ds/src/main/resources/res/plugin.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/ds/src/main/resources/res/plugin.js?rev=1841021&r1=1841020&r2=1841021&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/ds/src/main/resources/res/plugin.js (original)
+++ felix/trunk/webconsole-plugins/ds/src/main/resources/res/plugin.js Sun Sep 16 15:10:46 2018
@@ -149,7 +149,11 @@ function renderDetails( data ) {
 					i++;
 				}
 			} else {
-				txt = txt + prop.value;
+				if ( prop.key == "serviceId" ) {
+					txt = txt + '<a href="../services/' + prop.value + '">' + prop.value + '</a>';
+				} else {
+					txt = txt + prop.value;					
+				}
 			}
 		} else {
 			txt = txt + '\u00a0';