You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2014/11/28 19:25:59 UTC

svn commit: r1642340 [1/2] - in /qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java: org/apache/qpid/server/management/plugin/servlet/rest/ org/apache/qpid/server/management/plugin/servlet/rest/action/ resources/ resources/authentication...

Author: orudyy
Date: Fri Nov 28 18:25:57 2014
New Revision: 1642340

URL: http://svn.apache.org/r1642340
Log:
QPID-6246: [Java Broker] Refactor authentication provider UIs to use dedicated dialogues

Added:
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/preferencesProviderForm.html
Removed:
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListAuthenticationProviderAttributes.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/preferences/filesystempreferences/add.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html
Modified:
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java Fri Nov 28 18:25:57 2014
@@ -34,7 +34,6 @@ import org.codehaus.jackson.map.ObjectMa
 import org.codehaus.jackson.map.SerializationConfig;
 
 import org.apache.qpid.server.management.plugin.servlet.rest.action.ListAccessControlProviderAttributes;
-import org.apache.qpid.server.management.plugin.servlet.rest.action.ListAuthenticationProviderAttributes;
 import org.apache.qpid.server.management.plugin.servlet.rest.action.ListBrokerAttribute;
 import org.apache.qpid.server.management.plugin.servlet.rest.action.ListGroupProviderAttributes;
 import org.apache.qpid.server.management.plugin.servlet.rest.action.ListTimeZones;
@@ -55,7 +54,6 @@ public class HelperServlet extends Abstr
         _mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
 
         Action[] supportedActions = {
-                new ListAuthenticationProviderAttributes(),
                 new ListBrokerAttribute(Broker.SUPPORTED_VIRTUALHOSTNODE_TYPES, "ListVirtualHostNodeTypes"),
                 new ListBrokerAttribute(Broker.SUPPORTED_VIRTUALHOST_TYPES, "ListVirtualHostTypes"),
                 new ListBrokerAttribute(Broker.SUPPORTED_PREFERENCES_PROVIDER_TYPES, "ListPreferencesProvidersTypes"),

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html Fri Nov 28 18:25:57 2014
@@ -15,32 +15,50 @@
   ~ limitations under the License.
   -->
 <div class="dijitHidden">
-    <div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Authentication Provider'" id="addAuthenticationProvider">
-        <form id="formAddAuthenticationProvider" method="post" dojoType="dijit.form.Form">
-            <div style="width:420px; overflow: auto">
-                <table class="tableContainer-table tableContainer-table-horiz" width="100%" cellspacing="1">
-                <tr>
-                    <td class="tableContainer-labelCell">Type*:</td>
-                    <td class="tableContainer-valueCell"><div id="addAuthenticationProvider.selectAuthenticationProviderDiv"></div></td>
-                </tr>
-                <tr>
-                    <td class="tableContainer-labelCell">Name*:</td>
-                    <td class="tableContainer-valueCell"><input type="text" required="true" name="name"
-                        id="formAddAuthenticationProvider.name" placeholder="Name"
-                        dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" /></td>
-                </tr>
-                </table>
-                <input type="hidden" id="formAddAuthenticationProvider.id" name="id"/>
-                <div id="addAuthenticationProvider.fieldSets"></div>
-                <br/>
-                <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Preferences Provider',  open: true" id="addAuthenticationProvider.preferencesProviderPanel">
-                  <div id="addAuthenticationProvider.preferencesProvider"></div>
+    <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Authentication Provider'" id="addAuthenticationProvider">
+        <div id="addAuthenticationProvider.contentPane">
+            <form id="addAuthenticationProvider.form" method="post" data-dojo-type="dijit/form/Form">
+                <div class="formBox">
+                    <fieldset>
+                        <legend>Authentication Provider</legend>
+                        <div class="clear">
+                            <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div>
+                            <div class="formLabel-controlCell tableContainer-valueCell">
+                                <input type="text" id="addAuthenticationProvider.name"
+                                       data-dojo-type="dijit/form/ValidationTextBox"
+                                       data-dojo-props="
+                                  name: 'name',
+                                  placeHolder: 'authentication provider name',
+                                  required: true,
+                                  promptMessage: 'Name of authentication provider, must be unique',
+                                  title: 'Enter a unique authentication provider name per broker'" />
+                            </div>
+                        </div>
+                        <div class="clear">
+                            <div class="formLabel-labelCell tableContainer-labelCell">Type*:</div>
+                            <div class="tableContainer-valueCell formLabel-controlCell">
+                                <select id="addAuthenticationProvider.type" data-dojo-type="dijit/form/FilteringSelect"
+                                        data-dojo-props="
+                                        name: 'type',
+                                        required: true,
+                                        placeHolder: 'select authentication provider type',
+                                        promptMessage: 'Type of  authentication provider',
+                                        title: 'Select  authentication provider type',
+                                        searchAttr: 'name'">
+                                </select>
+                            </div>
+                        </div>
+                        <div class="clear"></div>
+                        <div id="addAuthenticationProvider.typeFields"></div>
+                    </fieldset>
                 </div>
-            </div>
-            <div class="dijitDialogPaneActionBar">
-                <!-- submit buttons -->
-                <input type="submit" value="Save Authentication Provider" label="Save Authentication Provider" dojoType="dijit.form.Button" />
-            </div>
-        </form>
+            </form>
+
+            <div id="addPreferencesProvider.form" xxx-data-dojo-type="qpid/management/preferencesprovider/PreferencesProviderForm"></div>
+        </div>
+        <div class="dijitDialogPaneActionBar">
+            <button data-dojo-type="dijit/form/Button" id="addAuthenticationProvider.addButton" data-dojo-props="label: 'Add'" type="submit"></button>
+            <button data-dojo-type="dijit/form/Button" id="addAuthenticationProvider.cancelButton" data-dojo-props="label: 'Cancel'" ></button>
+        </div>
     </div>
 </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/addPreferencesProvider.html Fri Nov 28 18:25:57 2014
@@ -15,17 +15,14 @@
   ~ limitations under the License.
   -->
 <div class="dijitHidden">
-    <div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Preferences Provider'" id="addPreferencesProvider">
-        <form id="formAddPreferencesProvider" method="post" data-dojo-type="dijit.form.Form">
-            <input type="hidden" id="preferencesProvider.id" name="id"/>
-            <div style="width:420px; overflow: auto">
-                <div id="addPreferencesProvider.preferencesProvider"></div>
-            </div>
-            <div class="dijitDialogPaneActionBar">
-                <!-- submit buttons -->
-                <input type="submit" value="Save Preferences Provider" data-dojo-props="label: 'Save Preferences Provider'" data-dojo-type="dijit.form.Button" />
-                <input type="button" value="Cancel" data-dojo-props="label: 'Cancel'" data-dojo-type="dijit.form.Button" id="addPreferencesProvider.cancelButton"/>
-            </div>
-        </form>
+    <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Preferences Provider'" id="addPreferencesProvider">
+
+        <div id="addPreferencesProvider.preferencesProvider" data-dojo-type="qpid/management/preferencesprovider/PreferencesProviderForm"></div>
+
+        <div class="dijitDialogPaneActionBar">
+            <!-- submit buttons -->
+            <input type="button" value="Save" data-dojo-props="label: 'Save'" data-dojo-type="dijit/form/Button" id="addPreferencesProvider.saveButton"/>
+            <input type="button" value="Cancel" data-dojo-props="label: 'Cancel'" data-dojo-type="dijit/form/Button" id="addPreferencesProvider.cancelButton"/>
+        </div>
     </div>
 </div>

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html Fri Nov 28 18:25:57 2014
@@ -0,0 +1,26 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<div class="clear">
+    <div class="formLabel-labelCell tableContainer-labelCell">Use full DN:</div>
+    <div class="formLabel-controlCell tableContainer-valueCell">
+        <input type="text" class="useFullDN"
+               data-dojo-type="dijit/form/CheckBox"
+               data-dojo-props=" name: 'useFullDN' " />
+    </div>
+</div>

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html Fri Nov 28 18:25:57 2014
@@ -0,0 +1,31 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<div class="clear">
+    <div class="formLabel-labelCell tableContainer-labelCell">Path*:</div>
+    <div class="formLabel-controlCell tableContainer-valueCell">
+        <input type="text" class="path"
+               data-dojo-type="dijit/form/ValidationTextBox"
+               data-dojo-props="
+                              name: 'path',
+                              required: true,
+                              placeHolder: 'path/to/store',
+                              title: 'Enter path to user store',
+                              promptMessage: 'File system location for the users store.'"/>
+    </div>
+</div>

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html Fri Nov 28 18:25:57 2014
@@ -0,0 +1,129 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">LDAP server URL*:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="providerUrl"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'providerUrl',
+                              required: true,
+                              placeHolder: 'ldap://host:port',
+                              title: 'Enter LDAP server URL',
+                              promptMessage: 'LDAP server URL'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Search context*:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="searchContext"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'searchContext',
+                              required: true,
+                              placeHolder: 'dc=users,dc=example,dc=com',
+                              title: 'Enter search context',
+                              promptMessage: 'The distinguished name of the search base object'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Search filter*:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="searchFilter"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'searchFilter',
+                              required: true,
+                              placeHolder: '(uid={0})',
+                              title: 'Enter user search filter ',
+                              promptMessage: 'DN template to find an LDAP user entry by provided user name'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Search username:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="searchUsername"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'searchUsername',
+                              placeHolder: 'username',
+                              title: 'Enter username for authenticated search',
+                              promptMessage: 'Username for authenticated search'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Search password:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="searchPassword"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'searchPassword',
+                              placeHolder: '****',
+                              title: 'Enter password for authenticated search',
+                              promptMessage: 'Password for authenticated search'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Trust Store:</div>
+        <div class="tableContainer-valueCell formLabel-controlCell">
+            <select class="trustStore" data-dojo-type="dijit/form/FilteringSelect"
+                    data-dojo-props="
+                                    required: false,
+                                    name: 'trustStore',
+                                    placeHolder: 'Select trust store',
+                                    promptMessage: 'Trust store containing certificate for SSL transport',
+                                    title: 'Select trust store for secure connection',
+                                    searchAttr: 'name'">
+            </select>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Bind without search:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="bindWithoutSearch"
+                   data-dojo-type="dijit/form/CheckBox"
+                   data-dojo-props=" name: 'bindWithoutSearch' " />
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">LDAP Context Factory:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="ldapContextFactory"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'ldapContextFactory',
+                              placeHolder: 'com.sun.jndi.ldap.LdapCtxFactory',
+                              title: 'Enter fully qualified class name for LDAP Context Factory',
+                              promptMessage: 'Fully qualified class name for LDAP Context Factory'"/>
+        </div>
+    </div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">LDAP authentication URL</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="providerAuthUrl"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'providerAuthUrl',
+                              placeHolder: 'ldap://host:port',
+                              title: 'Enter optional LDAP authentication URL',
+                              promptMessage: 'URL of LDAP server for performing \'ldap bind\'. If not specified, the LDAP server URL will be used for both searches and authentications'"/>
+        </div>
+    </div>
+</div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js Fri Nov 28 18:25:57 2014
@@ -65,6 +65,10 @@ define(["dojo/_base/xhr",
            }
         }
         return values;
+     },
+     implementsManagedInterface: function (category, type, managedInterfaceName)
+     {
+        return this.getMetaData(category, type).managedInterfaces.indexOf(managedInterfaceName) >= 0;
      }
    };
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js Fri Nov 28 18:25:57 2014
@@ -152,8 +152,12 @@ define(["dojo/_base/xhr",
 
            util.isProviderManagingUsers = function(type)
            {
-               return (type === "PlainPasswordFile" || type === "Base64MD5PasswordFile" || type === "SCRAM-SHA-1"
-                        || type === "SCRAM-SHA-256" || type === "Plain" || type === "MD5" );
+               return metadata.implementsManagedInterface("AuthenticationProvider", type, "PasswordCredentialManagingAuthenticationProvider");
+           };
+
+           util.supportsPreferencesProvider = function(type)
+           {
+               return metadata.implementsManagedInterface("AuthenticationProvider", type, "PreferencesSupportingAuthenticationProvider");
            };
 
            util.showSetAttributesDialog = function(attributeWidgetFactories, data, putURL, dialogTitle, category, type, appendNameToUrl)

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js Fri Nov 28 18:25:57 2014
@@ -26,13 +26,15 @@ define(["dojo/_base/xhr",
         "dojo/parser",
         "dojo/_base/array",
         "dojo/_base/event",
-        'dojo/_base/json',
+        'dojo/json',
         "dojo/store/Memory",
         "dijit/form/FilteringSelect",
         "dojo/_base/connect",
         "dojo/dom-style",
-        "qpid/management/PreferencesProviderFields",
         "qpid/common/util",
+        "qpid/common/metadata",
+        "dojo/text!addAuthenticationProvider.html",
+        "qpid/management/preferencesprovider/PreferencesProviderForm",
         /* dojox/ validate resources */
         "dojox/validate/us", "dojox/validate/web",
         /* basic dijit classes */
@@ -46,252 +48,136 @@ define(["dojo/_base/xhr",
         "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect",
         "dojox/layout/TableContainer",
         "dojo/domReady!"],
-    function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields, util) {
-
-        var addAuthenticationProvider = {};
-
-        var node = construct.create("div", null, win.body(), "last");
-
-        var convertToAuthenticationProvider = function convertToAuthenticationProvider(formValues)
+    function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, util, metadata, template)
+    {
+        var addAuthenticationProvider =
         {
-            var newProvider = {};
+            init:function()
+            {
+                var that=this;
+                this.containerNode = construct.create("div", {innerHTML: template});
+                parser.parse(this.containerNode);
+
+                var authenticationProviderName = registry.byId("addAuthenticationProvider.name");
+                authenticationProviderName.set("regExpGen", util.nameOrContextVarRegexp);
+
+                this.dialog = registry.byId("addAuthenticationProvider");
+                this.addButton = registry.byId("addAuthenticationProvider.addButton");
+                this.cancelButton = registry.byId("addAuthenticationProvider.cancelButton");
+                this.cancelButton.on("click", function(e){that._cancel(e);});
+                this.addButton.on("click", function(e){that._add(e);});
+
+                this.authenticationProviderTypeFieldsContainer = dom.byId("addAuthenticationProvider.typeFields");
+                this.authenticationProviderForm = registry.byId("addAuthenticationProvider.form");
+                this.authenticationProviderType = registry.byId("addAuthenticationProvider.type");
+                this.supportedAuthenticationProviderTypes = metadata.getTypesForCategory("AuthenticationProvider");
+                this.supportedAuthenticationProviderTypes.sort();
+                var authenticationProviderTypeStore = util.makeTypeStore(this.supportedAuthenticationProviderTypes);
+                this.authenticationProviderType.set("store", authenticationProviderTypeStore);
+                this.authenticationProviderType.on("change", function(type){that._authenticationProviderTypeChanged(type);});
+
+                this.preferencesProviderForm = new qpid.preferencesprovider.PreferencesProviderForm({disabled: true});
+                this.preferencesProviderForm.placeAt(dom.byId("addPreferencesProvider.form"));
+            },
+            show:function(providerName)
+            {
+                this.authenticationProviderForm.reset();
+                this.preferencesProviderForm.reset();
 
-            newProvider.name = dijit.byId("formAddAuthenticationProvider.name").value;
-            newProvider.type = dijit.byId("authenticationProviderType").value;
-            var id = dojo.byId("formAddAuthenticationProvider.id").value;
-            if (id)
+                this.dialog.show();
+                if (!this.resizeEventRegistered)
+                {
+                    this.resizeEventRegistered = true;
+                    util.resizeContentAreaAndRepositionDialog(dom.byId("addAuthenticationProvider.contentPane"), this.dialog);
+                }
+            },
+            _cancel: function(e)
             {
-                newProvider.id = id;
-            }
-            for(var propName in formValues)
+                event.stop(e);
+                this.dialog.hide();
+            },
+            _add: function(e)
+            {
+                event.stop(e);
+                this._submit();
+            },
+            _submit: function()
             {
-                if(formValues.hasOwnProperty(propName))
+                if(this.authenticationProviderForm.validate() && this.preferencesProviderForm.validate())
                 {
-                    if (propName.indexOf("preferencesProvider") == 0)
+                    var success = false,failureReason=null;
+
+                    var authenticationProviderData = util.getFormWidgetValues(this.authenticationProviderForm); // TODO initialValues
+
+                    var encodedAuthenticationProviderName = encodeURIComponent(authenticationProviderData.name);
+                    xhr.put({
+                        url: "api/latest/authenticationprovider/" + encodedAuthenticationProviderName,
+                        sync: true,
+                        handleAs: "json",
+                        headers: { "Content-Type": "application/json"},
+                        putData: json.stringify(authenticationProviderData),
+                        load: function(x) {success = true; },
+                        error: function(error) {success = false; failureReason = error;}
+                    });
+
+                    if(success === true)
                     {
-                      continue;
-                    }
-                    if(formValues[ propName ] !== "") {
-                        newProvider[ propName ] = formValues[propName];
+                        var preferencesProviderResult = this.preferencesProviderForm.submit(encodedAuthenticationProviderName);
+                        success = preferencesProviderResult.success;
+                        failureReason = preferencesProviderResult.failureReason;
                     }
 
+                    if (success == true)
+                    {
+                        this.dialog.hide();
+                    }
+                    else
+                    {
+                        util.xhrErrorHandler(failureReason);
+                    }
                 }
-            }
-            return newProvider;
-        }
-
-        var showFieldSets = function showFieldSets(providerType, fieldSets)
-        {
-            for(var key in fieldSets)
-            {
-                var layout = fieldSets[key];
-                var disabled = key != providerType;
-                var displayValue = key == providerType ? "block" : "none";
-                var widgets = layout.getDescendants();
-                array.forEach(widgets, function(widget)
+                else
                 {
-                    widget.set("disabled", disabled);
-                });
-
-                domStyle.set(fieldSets[key].domNode, "display", displayValue);
-            }
-            if (fieldSets[providerType])
+                    alert('Form contains invalid data. Please correct first');
+                }
+            },
+            _authenticationProviderTypeChanged: function(type)
             {
-                fieldSets[providerType].getParent().resize();
+                this._typeChanged(type, this.authenticationProviderTypeFieldsContainer, "qpid/management/authenticationprovider/", "AuthenticationProvider" );
+            },
+            _typeChanged: function(type, typeFieldsContainer, baseUrl, category )
+            {
+                var widgets = registry.findWidgets(typeFieldsContainer);
+                array.forEach(widgets, function(item) { item.destroyRecursive();});
+                this.preferencesProviderForm.set("disabled", !type || !util.supportsPreferencesProvider(type));
+                if (type)
+                {
+                    var that = this;
+                    require([ baseUrl + type.toLowerCase() + "/add"], function(typeUI)
+                    {
+                        try
+                        {
+                            typeUI.show({containerNode:typeFieldsContainer, parent: that});
+                            util.applyMetadataToWidgets(typeFieldsContainer, category, type);
+                        }
+                        catch(e)
+                        {
+                            console.warn(e);
+                        }
+                    });
+                }
             }
-        }
-
-        var getAuthenticationProviderWidgetId = function getAuthenticationProviderWidgetId(providerType, attribute)
-        {
-            return "ap_" + providerType + "Field" + attribute;
-        }
+        };
 
-        var showPreferencesProviderFields = function showPreferencesProviderFields(provider)
+        try
         {
-          var preferencesProviderDiv = dojo.byId("addAuthenticationProvider.preferencesProvider");
-          var preferencesProviderPanel = dijit.byId("addAuthenticationProvider.preferencesProviderPanel");
-          if (provider && provider.type == "Anonymous")
-          {
-            preferencesProviderPanel.domNode.style.display = 'none';
-          }
-          else
-          {
-            preferencesProviderPanel.domNode.style.display = 'block';
-            PreferencesProviderFields.show(preferencesProviderDiv, provider && provider.preferencesproviders ? provider.preferencesproviders[0] : null);
-          }
+            addAuthenticationProvider.init();
         }
-
-        var loadProviderAndDisplayForm = function loadProviderAndDisplayForm(providerName, dialog)
+        catch(e)
         {
-            if (providerName)
-            {
-                xhr.get({
-                    url: "api/latest/authenticationprovider/" + encodeURIComponent(providerName),
-                    content: { actuals: true },
-                    handleAs: "json"
-                }).then(
-                   function(data) {
-                       var provider = data[0];
-                       var providerType = provider.type;
-                       var nameField = dijit.byId("formAddAuthenticationProvider.name");
-                       nameField.set("value", provider.name);
-                       nameField.set("disabled", true);
-                       nameField.set("regExpGen", util.nameOrContextVarRegexp);
-                       dialog.providerChooser.set("value", providerType);
-                       dialog.providerChooser.set("disabled", true);
-                       dojo.byId("formAddAuthenticationProvider.id").value=provider.id;
-                       for(var attribute in provider)
-                       {
-                           if (provider.hasOwnProperty(attribute))
-                           {
-                               var widject = dijit.byId(getAuthenticationProviderWidgetId(providerType, attribute));
-                               if (widject)
-                               {
-                                   widject.set("value", provider[attribute]);
-                               }
-                           }
-                       }
-                       showPreferencesProviderFields(provider);
-                       registry.byId("addAuthenticationProvider").show();
-               });
-            }
-            else
-            {
-                showPreferencesProviderFields();
-                registry.byId("addAuthenticationProvider").show();
-            }
+            console.warn(e);
         }
-
-        xhr.get({url: "addAuthenticationProvider.html",
-                 sync: true,
-                 load:  function(data) {
-                            var theForm;
-                            node.innerHTML = data;
-                            addAuthenticationProvider.dialogNode = dom.byId("addAuthenticationProvider");
-                            parser.instantiate([addAuthenticationProvider.dialogNode]);
-                            theForm = registry.byId("formAddAuthenticationProvider");
-                            theForm.on("submit", function(e) {
-
-                                event.stop(e);
-                                if(theForm.validate()){
-
-                                    var newAuthenticationManager = convertToAuthenticationProvider(theForm.getValues());
-                                    var that = this;
-
-                                    xhr.put({url: "api/latest/authenticationprovider/" + encodeURIComponent(newAuthenticationManager.name),
-                                             sync: true, handleAs: "json",
-                                             headers: { "Content-Type": "application/json"},
-                                             putData: json.toJson(newAuthenticationManager),
-                                             load: function(x) {that.success = true; },
-                                             error: function(error) {that.success = false; that.failureReason = error;}});
-
-                                    if(this.success === true)
-                                    {
-                                      if (PreferencesProviderFields.save(newAuthenticationManager.name))
-                                      {
-                                        registry.byId("addAuthenticationProvider").hide();
-                                      }
-                                    }
-                                    else
-                                    {
-                                        util.xhrErrorHandler(this.failureReason);
-                                    }
-                                    return false;
-                                }else{
-                                    alert('Form contains invalid data.  Please correct first');
-                                    return false;
-                                }
-                            });
-                        }});
-
-        addAuthenticationProvider.show = function(providerName) {
-            var that = this;
-            registry.byId("formAddAuthenticationProvider").reset();
-            dojo.byId("formAddAuthenticationProvider.id").value="";
-            registry.byId("formAddAuthenticationProvider.name").set("disabled", false);
-            if (this.providerChooser)
-            {
-                this.providerChooser.set("disabled", false);
-            }
-
-            if (!that.hasOwnProperty("providerFieldSets"))
-            {
-                xhr.get({
-                    url: "service/helper?action=ListAuthenticationProviderAttributes",
-                    handleAs: "json"
-                }).then(
-                   function(data) {
-                       var providers =  [];
-                       var providerIndex = 0;
-                       that.providerFieldSetsContainer = dom.byId("addAuthenticationProvider.fieldSets");
-                       that.providerFieldSets = [];
-
-                       for (var providerType in data) {
-                           if (data.hasOwnProperty(providerType)) {
-                               providers[providerIndex++] = {id: providerType, name: providerType};
-
-                               var attributes = data[providerType].attributes;
-                               var resources = data[providerType].descriptions;
-                               var layout = new dojox.layout.TableContainer( {
-                                   id: providerType + "FieldSet",
-                                   cols: 1,
-                                   "labelWidth": "200",
-                                   showLabels: true,
-                                   orientation: "horiz"
-                               });
-                               for(var i=0; i < attributes.length; i++) {
-                                   if ("type" == attributes[i])
-                                   {
-                                       continue;
-                                   }
-                                   var labelValue = attributes[i];
-                                   if (resources && resources[attributes[i]])
-                                   {
-                                       labelValue = resources[attributes[i]];
-                                   }
-                                   var text = new dijit.form.TextBox({
-                                       label: labelValue + ":",
-                                       id: getAuthenticationProviderWidgetId(providerType, attributes[i]),
-                                       name: attributes[i]
-                                   });
-                                   layout.addChild(text);
-                               }
-                               layout.placeAt("addAuthenticationProvider.fieldSets");
-                               that.providerFieldSets[providerType]=layout;
-                               layout.startup();
-                           }
-                       }
-
-                       var providersStore = new Memory({ data: providers });
-                       if(that.providerChooser) {
-                           that.providerChooser.destroy( false );
-                       }
-
-                       var providersDiv = dom.byId("addAuthenticationProvider.selectAuthenticationProviderDiv");
-                       var input = construct.create("input", {id: "addAuthenticationProviderType"}, providersDiv);
-
-                       that.providerChooser = new FilteringSelect({ id: "authenticationProviderType",
-                                                                 name: "type",
-                                                                 store: providersStore,
-                                                                 searchAttr: "name"}, input);
-                       that.providerChooser.on("change",
-                           function(value)
-                           {
-                               dijit.byId("addAuthenticationProvider.preferencesProviderPanel").domNode.style.display = (value == "Anonymous" ? "none" : "block");
-                               showFieldSets(that.providerChooser.value, that.providerFieldSets);
-                           }
-                       );
-                       var providerType = providers[0].name;
-                       that.providerChooser.set("value", providerType);
-                       showFieldSets(providerType, that.providerFieldSets);
-                       loadProviderAndDisplayForm(providerName, that)
-               });
-            }
-            else
-            {
-                loadProviderAndDisplayForm(providerName, that);
-            }
-        }
-
         return addAuthenticationProvider;
-    });
\ No newline at end of file
+    }
+
+);

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js?rev=1642340&r1=1642339&r2=1642340&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPreferencesProvider.js Fri Nov 28 18:25:57 2014
@@ -18,77 +18,74 @@
  * under the License.
  *
  */
-define(["dojo/_base/xhr",
-        "dojo/dom",
+define([
+        "dojo/_base/event",
         "dojo/dom-construct",
-        "dojo/query",
-        "dojo/_base/window",
-        "dijit/registry",
         "dojo/parser",
-        "dojo/_base/array",
-        "dojo/_base/event",
-        'dojo/_base/json',
-        "dojo/store/Memory",
-        "dijit/form/FilteringSelect",
-        "dojo/_base/connect",
-        "dojo/dom-style",
-        "dojo/string",
+        "dijit/registry",
+        "qpid/management/preferencesprovider/PreferencesProviderForm",
+        "qpid/common/util",
+        "dojo/text!addPreferencesProvider.html",
         "dojox/html/entities",
-        "qpid/management/PreferencesProviderFields",
         "dojox/validate/us",
         "dojox/validate/web",
         "dijit/Dialog",
-        "dijit/form/CheckBox",
-        "dijit/form/Textarea",
-        "dijit/form/TextBox",
-        "dijit/form/ValidationTextBox",
         "dijit/form/Button",
-        "dijit/form/Form",
-        "dojox/form/BusyButton",
-        "dojox/form/CheckedMultiSelect",
-        "dojox/layout/TableContainer",
         "dojo/domReady!"],
-    function (xhr, dom, construct, query, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, string, entities, PreferencesProviderFields) {
+    function ( event, construct, parser, registry, PreferencesProviderForm, util, template, entities) {
 
-        var addPreferencesProvider = {};
-
-        var node = construct.create("div", null, win.body(), "last");
-
-        xhr.get({url: "addPreferencesProvider.html",
-                 sync: true,
-                 load:  function(data) {
-                            node.innerHTML = data;
-                            addPreferencesProvider.dialogNode = dom.byId("addPreferencesProvider");
-                            parser.instantiate([addPreferencesProvider.dialogNode]);
-
-                            var cancelButton = registry.byId("addPreferencesProvider.cancelButton");
-                            cancelButton.on("click", function(){
-                              registry.byId("addPreferencesProvider").hide();
-                            });
-                            var theForm = registry.byId("formAddPreferencesProvider");
-                            theForm.on("submit", function(e) {
-
-                                event.stop(e);
-                                if(theForm.validate()){
-                                    if(PreferencesProviderFields.save(addPreferencesProvider.authenticationProviderName))
-                                    {
-                                        registry.byId("addPreferencesProvider").hide();
-                                    }
-                                    return false;
-                                }else{
-                                    alert('Form contains invalid data.  Please correct first');
-                                    return false;
-                                }
-                            });
-                        }});
-
-        addPreferencesProvider.show = function(authenticationProviderName, providerName) {
-            this.authenticationProviderName = authenticationProviderName;
-            PreferencesProviderFields.show(dom.byId("addPreferencesProvider.preferencesProvider"), providerName, authenticationProviderName)
-            var dialog = registry.byId("addPreferencesProvider");
-            dialog.set("title", (providerName ? "Edit preferences provider '" + entities.encode(String(providerName)) + "' " : "Add preferences provider ") + " for '" + entities.encode(String(authenticationProviderName)) + "' ")
-            dialog.show();
+        var addPreferencesProvider =
+        {
+            init: function()
+            {
+                var that=this;
+                this.containerNode = construct.create("div", {innerHTML: template});
+                parser.parse(this.containerNode);
+
+                this.preferencesProviderForm = registry.byId("addPreferencesProvider.preferencesProvider");
+                this.dialog = registry.byId("addPreferencesProvider");
+
+                var cancelButton = registry.byId("addPreferencesProvider.cancelButton");
+                cancelButton.on("click", function() { that.dialog.hide(); });
+
+                var saveButton = registry.byId("addPreferencesProvider.saveButton");
+                saveButton.on("click", function()
+                {
+                    var result = that.preferencesProviderForm.submit(encodeURIComponent(addPreferencesProvider.authenticationProviderName));
+                    if (result.success)
+                    {
+                        that.dialog.hide();
+                    }
+                    else
+                    {
+                        util.xhrErrorHandler(result.failureReason);
+                    }
+                });
+            },
+            show: function(authenticationProviderName, providerName)
+            {
+                this.authenticationProviderName = authenticationProviderName;
+                this.dialog.set("title", (providerName ? "Edit preferences provider '" + entities.encode(String(providerName)) + "' " : "Add preferences provider ") + " for '" + entities.encode(String(authenticationProviderName)) + "' ");
+                if (providerName)
+                {
+                    this.preferencesProviderForm.load(authenticationProviderName, providerName);
+                }
+                else
+                {
+                    this.preferencesProviderForm.reset();
+                }
+                this.dialog.show();
+            }
+        };
+
+        try
+        {
+            addPreferencesProvider.init();
+        }
+        catch(e)
+        {
+            console.warn("Initialisation of add preferences dialog failed", e);
         }
 
         return addPreferencesProvider;
-    });
\ No newline at end of file
+    });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,21 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/query","dijit/registry","qpid/common/util"],
+    function (query, registry, util)
+    {
+        return {
+            show: function(data)
+            {
+                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/passwordfile/add.html");
+                if (data.data)
+                {
+                    var path = registry.byNode(query(".path", data.containerNode)[0]);
+                    path.set("value", data.data.useFullDN);
+                }
+            }
+        };
+    }
+);
+

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/query","dijit/registry","qpid/common/util"],
+    function (query, registry, util)
+    {
+        return {
+            show: function(data)
+            {
+                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/external/add.html");
+                if (data.data)
+                {
+                    var useFullDN = registry.byNode(query(".useFullDN", data.containerNode)[0]);
+                    useFullDN.set("value", data.data.useFullDN);
+                }
+            }
+        };
+    }
+);
+

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,22 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });
+

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,21 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,21 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/query","dijit/registry","qpid/common/util"],
+    function (query, registry, util)
+    {
+        return {
+            show: function(data)
+            {
+                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/passwordfile/add.html");
+                if (data.data)
+                {
+                    var path = registry.byNode(query(".path", data.containerNode)[0]);
+                    path.set("value", data.data.useFullDN);
+                }
+            }
+        };
+    }
+);
+

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,21 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,21 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([], function () { return { show: function(data){} }; });

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr","dojo/query","dijit/registry","qpid/common/util","qpid/common/metadata","dojo/store/Memory","dijit/form/FilteringSelect","dijit/form/ValidationTextBox","dijit/form/CheckBox"],
+    function (xhr, query, registry, util, metadata, Memory)
+    {
+        return {
+            show: function(data)
+            {
+                util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/simpleldap/add.html");
+
+                var that = this;
+                xhr.get({url: "api/latest/truststore", sync: true, handleAs: "json"}).then(
+                    function(data)
+                    {
+                        that._initTrustStores(data,data.containerNode);
+                    }
+                );
+
+                if (data.data)
+                {
+                    this._initFields(data.data);
+                }
+            },
+            _initTrustStores: function(trustStores, containerNode)
+            {
+                var data = [];
+                for (var i=0; i< trustStores.length; i++)
+                {
+                    data.push( {id: trustStores[i].name, name: trustStores[i].name} );
+                }
+                var trustStoresStore = new Memory({ data: data });
+
+                var trustStore = registry.byNode(query(".trustStore", data.containerNode)[0]);
+                trustStore.set("store", trustStoresStore);
+            },
+            _initFields:function(data)
+            {
+                var attributes = metadata.getMetaData("AuthenticationProvider", "SimpleLDAP").attributes;
+                for(var name in attributes)
+                {
+                    var widget = registry.byNode(query("." + name, data.containerNode)[0]);
+                    if (widget)
+                    {
+                        if (widget instanceof dijit.form.CheckBox)
+                        {
+                            widget.set("checked", data[name]);
+                        }
+                        else
+                        {
+                            widget.set("value", data[name]);
+                        }
+                    }
+                }
+                var bindWithoutSearch =
+                bindWithoutSearch.set("checked", data.data.bindWithoutSearch);
+            }
+        };
+    }
+);

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/PreferencesProviderForm.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,190 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define([
+        "qpid/common/util",
+        "qpid/common/metadata",
+        "dojo/_base/xhr",
+        "dojo/_base/declare",
+        "dojo/_base/array",
+        "dojo/dom-construct",
+        "dojo/_base/window",
+        "dojo/query",
+        "dojo/json",
+        "dijit/_WidgetBase",
+        "dijit/_OnDijitClickMixin",
+        "dijit/_TemplatedMixin",
+        "dijit/_WidgetsInTemplateMixin",
+        "dijit/registry",
+        "dojo/text!preferencesprovider/preferencesProviderForm.html",
+        "dojox/html/entities",
+        "dijit/form/ValidationTextBox",
+        "dijit/form/FilteringSelect",
+        "dojox/validate/us",
+        "dojox/validate/web",
+        "dojo/domReady!"],
+function (util, metadata, xhr, declare, array, domConstruct, win, query, json, _WidgetBase,
+            _OnDijitClickMixin, _TemplatedMixin, _WidgetsInTemplateMixin, registry, template, entities)
+ {
+
+  return declare("qpid.preferencesprovider.PreferencesProviderForm",
+                    [_WidgetBase, _OnDijitClickMixin, _TemplatedMixin, _WidgetsInTemplateMixin], {
+
+    templateString: template,
+    domNode: null,
+    preferencesProviderForm : null,
+    preferencesProviderNameWidget : null,
+    preferencesProviderTypeWidget : null,
+    preferencesProviderTypeFieldsContainer: null,
+
+    buildRendering: function()
+    {
+        //Strip out the apache comment header from the template html as comments unsupported.
+        this.templateString = this.templateString.replace(/<!--[\s\S]*?-->/g, "");
+        this.inherited(arguments);
+    },
+    postCreate: function()
+    {
+        this.inherited(arguments);
+        var that = this;
+
+        this.preferencesProviderNameWidget.set("regExpGen", util.nameOrContextVarRegexp);
+
+        var supportedPreferencesProviderTypes = metadata.getTypesForCategory("PreferencesProvider");
+        supportedPreferencesProviderTypes.sort();
+        supportedPreferencesProviderTypes.splice(0,0,"None");
+        var preferencesProviderTypeStore = util.makeTypeStore(supportedPreferencesProviderTypes);
+        this.preferencesProviderTypeWidget.set("store", preferencesProviderTypeStore);
+        this.preferencesProviderTypeWidget.on("change", function(type){that._preferencesProviderTypeChanged(type);});
+        this.preferencesProviderForm.on("submit", function() { return false; })
+    },
+    reset: function()
+    {
+        this.data = null;
+        this.preferencesProviderForm.reset();
+        this.preferencesProviderTypeWidget.set("value", "None");
+    },
+    submit: function(encodedAuthenticationProviderName)
+    {
+        if (this.preferencesProviderTypeWidget.get("value") != "None")
+        {
+            var preferencesProviderData = util.getFormWidgetValues(this.preferencesProviderForm); // TODO initialValues
+            var encodedPreferencesProviderName = encodeURIComponent(preferencesProviderData.name);
+            var success = false;
+            var failureReason = null;
+            xhr.put({
+                url: "api/latest/preferencesprovider/" + encodedAuthenticationProviderName + "/" + encodedPreferencesProviderName,
+                sync: true,
+                handleAs: "json",
+                headers: { "Content-Type": "application/json"},
+                putData: json.stringify(preferencesProviderData),
+                load: function (x) { success = true; },
+                error: function (error) { success = false; failureReason = error; }
+            });
+            return { success: success, failureReason: failureReason };
+        }
+        return { success: true, failureReason: null };
+    },
+    validate: function()
+    {
+        return this.preferencesProviderForm.validate();
+    },
+    load: function(authenticationProviderName, providerName)
+    {
+        var that = this;
+        xhr.get({
+            url: "api/latest/preferencesprovider/" + encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(providerName),
+            handleAs: "json"
+        }).then(function(data){that._load(data[0])});
+    },
+    _load:function(data)
+    {
+        this.data = data;
+        this.preferencesProviderNameWidget.set("value", data.name);
+        if (data.type == this.preferencesProviderTypeWidget.get("value"))
+        {
+            this._toggleWidgets(data.type);
+        }
+        else
+        {
+            this.preferencesProviderTypeWidget.set("value", data.type);
+        }
+    },
+    _preferencesProviderTypeChanged: function(type)
+    {
+        var typeFieldsContainer = this.preferencesProviderTypeFieldsContainer;
+        var widgets = registry.findWidgets(typeFieldsContainer);
+        array.forEach(widgets, function(item) { item.destroyRecursive();});
+        domConstruct.empty(typeFieldsContainer);
+        this._toggleWidgets(type);
+        if (type)
+        {
+            if (type == "None")
+            {
+                this.preferencesProviderNameWidget.set("value", "");
+            }
+            else
+            {
+                var that = this;
+                require([ "qpid/management/preferencesprovider/" + type.toLowerCase() + "/add"], function(typeUI)
+                {
+                    try
+                    {
+                        typeUI.show({containerNode:typeFieldsContainer, parent: that, data: that.data});
+                        util.applyMetadataToWidgets(typeFieldsContainer, "PreferencesProvider", type);
+                    }
+                    catch(e)
+                    {
+                        console.warn(e);
+                    }
+                });
+            }
+        }
+    },
+    _toggleWidgets: function(type)
+    {
+        if (this.disabled)
+        {
+            this.preferencesProviderNameWidget.set("disabled", true);
+            this.preferencesProviderTypeWidget.set("disabled", true);
+        }
+        else
+        {
+            if (this.data)
+            {
+                // editing
+                this.preferencesProviderNameWidget.set("disabled", true);
+                this.preferencesProviderTypeWidget.set("disabled", true);
+            }
+            else
+            {
+                this.preferencesProviderNameWidget.set("disabled", !type || type == "None");
+                this.preferencesProviderTypeWidget.set("disabled", false);
+            }
+        }
+    },
+    _setDisabledAttr: function(disabled)
+    {
+        this.inherited(arguments);
+        this.disabled = disabled;
+        this.reset();
+    },
+  });
+});

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/add.js?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/preferencesprovider/filesystempreferences/add.js Fri Nov 28 18:25:57 2014
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+define(["dojo/query", "dijit/registry", "qpid/common/util"],
+  function (query, registry, util)
+  {
+    return {
+        show: function (data)
+        {
+            util.parseHtmlIntoDiv(data.containerNode, "preferencesprovider/filesystempreferences/add.html");
+            if (data.data)
+            {
+                var pathWidget = registry.byNode(query(".addPreferencesProviderPath", data.containerNode)[0]);
+                pathWidget.set("value", data.data.path);
+            }
+        }
+    };
+  }
+);

Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/add.html?rev=1642340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/add.html (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/preferencesprovider/filesystempreferences/add.html Fri Nov 28 18:25:57 2014
@@ -0,0 +1,37 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements.  See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership.  The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied.  See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<div>
+    <div class="clear">
+        <div class="formLabel-labelCell tableContainer-labelCell">Path*:</div>
+        <div class="formLabel-controlCell tableContainer-valueCell">
+            <input type="text" class="addPreferencesProviderPath"
+                   data-dojo-type="dijit/form/ValidationTextBox"
+                   data-dojo-props="
+                              name: 'path',
+                              required: true,
+                              placeHolder: 'path/to/store',
+                              title: 'Enter preferences store path',
+                              promptMessage: 'File system location for the preferences store.'"/>
+        </div>
+    </div>
+
+    <div class="clear"></div>
+</div>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org