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 2009/04/27 22:45:10 UTC

svn commit: r769154 - in /felix/trunk/webconsole/src/main: java/org/apache/felix/webconsole/internal/Util.java java/org/apache/felix/webconsole/internal/core/BundlesServlet.java resources/res/ui/bundles.js

Author: cziegeler
Date: Mon Apr 27 20:45:09 2009
New Revision: 769154

URL: http://svn.apache.org/viewvc?rev=769154&view=rev
Log:
FELIX-1049 : Display version and symbolic name in bundles list.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/Util.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
    felix/trunk/webconsole/src/main/resources/res/ui/bundles.js

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/Util.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/Util.java?rev=769154&r1=769153&r2=769154&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/Util.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/Util.java Mon Apr 27 20:45:09 2009
@@ -124,7 +124,19 @@
         return name;
     }
 
-
+    /**
+     * Returns the value of the header or the empty string if the header
+     * is not available.
+     */
+    public static String getHeaderValue( Bundle bundle, String headerName )
+    {
+       Object value = bundle.getHeaders().get(headerName);
+       if ( value != null )
+       {
+           return value.toString();
+       }
+       return "";
+    }
     /**
      * Orders the bundles according to their name as returned by
      * {@link #getName(Bundle)}, with the exception that the system bundle is

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java?rev=769154&r1=769153&r2=769154&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java Mon Apr 27 20:45:09 2009
@@ -410,6 +410,10 @@
         jw.value( Util.getName( bundle ) );
         jw.key( "state" );
         jw.value( toStateString( bundle ) );
+        jw.key( "version" );
+        jw.value( Util.getHeaderValue(bundle, Constants.BUNDLE_VERSION) );
+        jw.key( "symbolicName" );
+        jw.value( Util.getHeaderValue(bundle, Constants.BUNDLE_SYMBOLICNAME) );
 
         jw.key( "actions" );
         jw.array();

Modified: felix/trunk/webconsole/src/main/resources/res/ui/bundles.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/bundles.js?rev=769154&r1=769153&r2=769154&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/bundles.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/bundles.js Mon Apr 27 20:45:09 2009
@@ -105,6 +105,8 @@
     
     parent.appendChild( td( null, null, [ text( id ) ] ) );
     parent.appendChild( td( null, null, [ inputElement, text(" "), titleElement ] ) );
+    parent.appendChild( td( null, null, [ text( dataEntry.version ) ] ) );
+    parent.appendChild( td( null, null, [ text( dataEntry.symbolicName ) ] ) );
     parent.appendChild( td( null, null, [ text( state ) ] ) );
     var actionsTd = td( null, null );
     var div = createElement("div", null, {
@@ -210,7 +212,7 @@
 
 function renderBundles(data) {
 	$(document).ready(function(){
-    	renderView( ["Id", "Name", "Status", "Actions"],
+    	renderView( ["Id", "Name", "Version", "Symbolic Name", "Status", "Actions"],
         		"<input type='hidden' name='action' value='install'/>" +
                 "<input class='fileinput' type='file' name='bundlefile' style='margin-left:10px'/>" +
          		" - Start <input class='checkradio' type='checkbox' name='bundlestart' value='start' style='vertical-align:middle;'/>" +
@@ -231,7 +233,7 @@
         $("#plugin_table").tablesorter({
             headers: {
         	    0: { sorter:"digit"},
-                3: { sorter: false }
+                5: { sorter: false }
             },
             sortList: [[1,0]],
             textExtraction:extractMethod