felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1746242 - in /felix/trunk/webconsole/src/main: java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java resources/res/ui/config.js
Date Tue, 31 May 2016 07:19:34 GMT
Author: cziegeler
Date: Tue May 31 07:19:34 2016
New Revision: 1746242

URL: http://svn.apache.org/viewvc?rev=1746242&view=rev
Log:
FELIX-4941 : Web console doesn't work with fileinstall

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java
    felix/trunk/webconsole/src/main/resources/res/ui/config.js

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java?rev=1746242&r1=1746241&r2=1746242&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
Tue May 31 07:19:34 2016
@@ -68,6 +68,9 @@ class ConfigAdminSupport
     private static final Set CONFIG_PROPERTIES_HIDE = new HashSet();
     static {
         CONFIG_PROPERTIES_HIDE.add(PROPERTY_FACTORYCONFIG_NAMEHINT);
+        CONFIG_PROPERTIES_HIDE.add(ConfigurationAdmin.SERVICE_BUNDLELOCATION);
+        CONFIG_PROPERTIES_HIDE.add(ConfigurationAdmin.SERVICE_FACTORYPID);
+        CONFIG_PROPERTIES_HIDE.add(Constants.SERVICE_PID);
     }
     private static final Pattern NAMEHINT_PLACEHOLER_REGEXP = Pattern.compile("\\{([^\\{\\}]*)}");
 

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java?rev=1746242&r1=1746241&r2=1746242&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/MetaTypeServiceSupport.java
Tue May 31 07:19:34 2016
@@ -20,7 +20,9 @@ package org.apache.felix.webconsole.inte
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Dictionary;
+import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -273,7 +275,8 @@ class MetaTypeServiceSupport extends Met
 
         AttributeDefinition[] ad = ocd.getAttributeDefinitions( ObjectClassDefinition.ALL
);
         AttributeDefinition[] optionalArray = ocd.getAttributeDefinitions( ObjectClassDefinition.OPTIONAL
);
-        List/*<AttributeDefinition>*/ optional = optionalArray == null ? Collections.EMPTY_LIST
: Arrays.asList( optionalArray ); 
+        List/*<AttributeDefinition>*/ optional = optionalArray == null ? Collections.EMPTY_LIST
: Arrays.asList( optionalArray );
+        final Set metatypeAttributes = new HashSet(ignoreAttrIds);
         if ( ad != null )
         {
             json.key( "properties" ).object(); //$NON-NLS-1$
@@ -286,9 +289,27 @@ class MetaTypeServiceSupport extends Met
                     boolean isOptional = optional.contains( adi );
                     attributeToJson( json, new MetatypePropertyDescriptor( adi, isOptional
), props.get( attrId ) );
                 }
+                metatypeAttributes.add( attrId );
             }
             json.endObject();
         }
+        final StringBuffer sb = new StringBuffer();
+        final Enumeration e = props.keys();
+        while ( e.hasMoreElements() )
+        {
+            String key = (String)e.nextElement();
+            if ( !metatypeAttributes.contains(key) ) {
+                if ( sb.length() > 0 )
+                {
+                    sb.append(',');
+                }
+                sb.append(key);
+            }
+        }
+        if ( sb.length() > 0 )
+        {
+            json.key("additionalProperties").value(sb.toString());
+        }
     }
 
 

Modified: felix/trunk/webconsole/src/main/resources/res/ui/config.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/config.js?rev=1746242&r1=1746241&r2=1746242&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/config.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/config.js Tue May 31 07:19:34 2016
@@ -122,7 +122,7 @@ function displayConfigForm(obj) {
     
     if (obj.properties)
     {
-        printForm(bodyEl, obj.properties);
+        printForm(bodyEl, obj.properties, obj.additionalProperties);
     }
 
     printConfigurationInfo(parent, obj);
@@ -155,8 +155,11 @@ function displayConfigForm(obj) {
 	return element;
 }
 
-function printForm( /* Element */ parent, /* Object */ properties ) {
+function printForm( /* Element */ parent, /* Object */ properties, additionalProperties )
{
     var propList;
+    if ( additionalProperties != undefined ) {
+    	propList = additionalProperties;
+    }
     for (var prop in properties)
     {
         var attr = properties[prop];



Mime
View raw message