felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r829782 - in /felix/trunk/webconsole/src/main: java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java resources/res/ui/configmanager.js
Date Mon, 26 Oct 2009 13:06:41 GMT
Author: fmeschbe
Date: Mon Oct 26 13:06:41 2009
New Revision: 829782

URL: http://svn.apache.org/viewvc?rev=829782&view=rev
Log:
FELIX-1808 Support manual configuration unbinding and extend the confirmation
dialogs with the configuration PID (and current binding if available)

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
    felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js

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=829782&r1=829781&r2=829782&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
Mon Oct 26 13:06:41 2009
@@ -144,6 +144,14 @@
             config = getConfiguration( ca, pid );
         }
 
+        // check for configuration unbinding
+        if ( request.getParameter( "unbind" ) != null )
+        {
+            config.setBundleLocation( null );
+            sendRedirect( request, response, config.getPid() );
+            return;
+        }
+
         // send the result
         response.setContentType( "application/json" );
         response.setCharacterEncoding( "UTF-8" );
@@ -751,7 +759,7 @@
         String location;
         if ( config.getBundleLocation() == null )
         {
-            location = "None";
+            location = "";
         }
         else
         {

Modified: felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js?rev=829782&r1=829781&r2=829782&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js Mon Oct 26 13:06:41
2009
@@ -158,7 +158,7 @@
     innerHTML += '   ';
     innerHTML += '<input type="reset" class="submit" name="reset" value="Reset" />';
     innerHTML += '&nbsp;&nbsp;&nbsp;';
-    innerHTML += '<input type="submit" class="submit" name="delete" value="Delete" onClick="return
confirmDelete();"/>';
+    innerHTML += '<input type="submit" class="submit" name="delete" value="Delete" onClick="return
confirmDelete(\'' + obj.pid + '\', \'' + obj.bundleLocation + '\');"/>';
     tdEl.innerHTML = innerHTML;
 
     printConfigurationInfo(parent, obj);
@@ -297,6 +297,35 @@
             ])
         ])
     );
+    
+    if (obj.bundleLocation)
+    {         
+        parent.appendChild( tr( "content", null, [
+                td( "content", null, [
+                    text( " " )
+                ]),
+                td( "content", null, [
+                    createElement( "form", null, {
+                            method: "POST",
+                            action: pluginRoot + "/" + obj.pid
+                        }, [
+                            createElement( "input", null, {
+                                type: "hidden",
+                                name: "unbind",
+                                value: "true"
+                            }),
+                            createElement( "input", "submit", {
+                                type: "submit",
+                                name: "submit",
+                                value: "Unbind",
+                                title: "Unbind Configuration from Bundle",
+                                onClick: "return confirmUnbind('" + obj.pid + "', '" + obj.bundleLocation
+ "');"
+                            })
+                        ])
+                ])
+            ])
+        );
+    }
 }
 
 
@@ -441,7 +470,26 @@
     span.parentNode.removeChild(span);
 }
 
-function confirmDelete()
+function configConfirm(/* String */ message, /* String */ title, /* String */ location)
+{
+    var message = "Are you sure to delete this configuration ?";
+    
+    if (title) {
+        message += "\r\nConfiguration: " + title;
+    }
+    if (location) {
+        message += "\r\nBundle: " + location;
+    }
+    
+    return confirm(message);
+}
+
+function confirmDelete(/* String */ title, /* String */ location)
+{
+    return configConfirm("Are you sure to unbind this configuration ?", title, location);
+}
+
+function confirmUnbind(/* String */ title, /* String */ location)
 {
-    return confirm("Are you sure to delete this configuration ?");
+    return configConfirm("Are you sure to unbind this configuration ?", title, location);
 }



Mime
View raw message