diff options
| author | Keith Wall <kwall@apache.org> | 2015-01-20 16:25:28 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2015-01-20 16:25:28 +0000 |
| commit | 5d8797f0deec8ee295634f42fb6ac7b366e45165 (patch) | |
| tree | 03d017bac5bdb7e4d9d4de72f1d1918540899751 /qpid/java | |
| parent | 82033b2f28c22bf48851502a75bada14ed513e7a (diff) | |
| download | qpid-python-5d8797f0deec8ee295634f42fb6ac7b366e45165.tar.gz | |
QPID-6318: [Java Broker] Make UI support the upload of JKS files
Work completed by Andrew MacBean <macbean@apache.org>
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1653285 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
20 files changed, 1084 insertions, 342 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/accesscontrolprovider/aclfile/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/accesscontrolprovider/aclfile/add.html index f4058d5180..796988c410 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/accesscontrolprovider/aclfile/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/accesscontrolprovider/aclfile/add.html @@ -18,6 +18,7 @@ --> <div> + <div id="addAccessControlProvider.oldBrowserWarning" class="infoMessage hidden clear"></div> <div class="clear"> <div id="addAccessControlProvider.serverPathLabel" class="formLabel-labelCell tableContainer-labelCell">Server path or upload*:</div> <div class="formLabel-controlCell tableContainer-valueCell"> @@ -54,7 +55,8 @@ <button id="addAccessControlProvider.fileClearButton" data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Clear', - disabled: true" /> + disabled: true"> + </button> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addStore.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addStore.html new file mode 100644 index 0000000000..dd6e7a3d38 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addStore.html @@ -0,0 +1,66 @@ +<!-- + ~ 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="dijitHidden"> + <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Add Store'" id="addStore"> + <div id="addStore.contentPane"> + <form id="addStore.form" method="post" data-dojo-type="dijit/form/Form"> + <div class="formBox"> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Name*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.name" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'name', + placeHolder: 'store name', + required: true, + promptMessage: 'Name of store, must be unique', + title: 'Enter a unique store name per broker'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Type*:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <select id="addStore.type" data-dojo-type="dijit/form/FilteringSelect" + data-dojo-props=" + name: 'type', + required: true, + placeHolder: 'store type', + promptMessage: 'Type of store', + title: 'Select type', + searchAttr: 'name'"> + </select> + </div> + </div> + <div class="clear"> + <div id="addStore.typeFields"></div> + </div> + </div> + </form> + <div class="clear"> + </div> + </div> + + <div class="dijitDialogPaneActionBar"> + <button data-dojo-type="dijit/form/Button" id="addStore.addButton" data-dojo-props="label: 'Save'" type="submit"></button> + <button data-dojo-type="dijit/form/Button" id="addStore.cancelButton" data-dojo-props="label: 'Cancel'" ></button> + </div> + </div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js index c6741ca3cc..161ce4f83c 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js @@ -159,8 +159,8 @@ define(["dojo/_base/xhr", this.deletePreferencesProviderButton = query(".deletePreferencesProviderButton", node)[0]; this.preferencesProviderAttributes = dom.byId("preferencesProviderAttributes") this.preferencesNode = query(".preferencesProviderDetails", node)[0]; - this.authenticationProviderDetailsContainer = query(".authenticationProviderDetails", node)[0]; +this.authenticationProviderDetailsContainer = query(".authenticationProviderDetails", node)[0]; this.query = "api/latest/authenticationprovider/" + encodeURIComponent(authProviderObj.name); } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js index 5363882eb2..a0a2e8324f 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js @@ -23,6 +23,7 @@ define(["dojo/_base/xhr", "dojo/query", "dojo/json", "dojo/_base/connect", + "dojo/store/Memory", "qpid/common/properties", "qpid/common/updater", "qpid/common/util", @@ -33,7 +34,7 @@ define(["dojo/_base/xhr", "qpid/management/addAuthenticationProvider", "qpid/management/addVirtualHostNodeAndVirtualHost", "qpid/management/addPort", - "qpid/management/addKeystore", + "qpid/management/addStore", "qpid/management/addGroupProvider", "qpid/management/addAccessControlProvider", "qpid/management/editBroker", @@ -50,8 +51,8 @@ define(["dojo/_base/xhr", "dijit/Menu", "dijit/MenuItem", "dojo/domReady!"], - function (xhr, parser, query, json, connect, properties, updater, util, UpdatableStore, EnhancedGrid, registry, entities, - addAuthenticationProvider, addVirtualHostNodeAndVirtualHost, addPort, addKeystore, addGroupProvider, addAccessControlProvider, editBroker) { + function (xhr, parser, query, json, connect, memory, properties, updater, util, UpdatableStore, EnhancedGrid, registry, entities, + addAuthenticationProvider, addVirtualHostNodeAndVirtualHost, addPort, addStore, addGroupProvider, addAccessControlProvider, editBroker) { var brokerAttributeNames = ["name", "operatingSystem", "platform", "productVersion", "modelVersion", "defaultVirtualHost", "statisticsReportingPeriod", "statisticsReportingResetEnabled", @@ -153,7 +154,11 @@ define(["dojo/_base/xhr", var addKeystoreButton = query(".addKeystore", contentPane.containerNode)[0]; connect.connect(registry.byNode(addKeystoreButton), "onClick", - function(evt){ addKeystore.showKeystoreDialog() }); + function(evt) + { + addStore.setupTypeStore("KeyStore"); + addStore.show(); + }); var deleteKeystore = query(".deleteKeystore", contentPane.containerNode)[0]; connect.connect(registry.byNode(deleteKeystore), "onClick", @@ -168,7 +173,11 @@ define(["dojo/_base/xhr", var addTruststoreButton = query(".addTruststore", contentPane.containerNode)[0]; connect.connect(registry.byNode(addTruststoreButton), "onClick", - function(evt){ addKeystore.showTruststoreDialog() }); + function(evt) + { + addStore.setupTypeStore("TrustStore"); + addStore.show(); + }); var deleteTruststore = query(".deleteTruststore", contentPane.containerNode)[0]; connect.connect(registry.byNode(deleteTruststore), "onClick", diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js index 84103fdc47..6cb9ad727d 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js @@ -29,16 +29,15 @@ define(["dojo/dom", "qpid/common/updater", "qpid/common/util", "qpid/common/formatter", - "qpid/management/addKeystore", + "qpid/management/addStore", "dojo/domReady!"], - function (dom, xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, addKeystore) { + function (dom, xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, addStore) { - function KeyStore(name, parent, controller, objectType) { + function KeyStore(name, parent, controller) { this.keyStoreName = name; this.controller = controller; this.modelObj = { type: "keystore", name: name, parent: parent}; this.url = "api/latest/keystore/" + encodeURIComponent(name); - this.dialog = addKeystore.showKeystoreDialog; } KeyStore.prototype.getTitle = function() { @@ -48,7 +47,7 @@ define(["dojo/dom", KeyStore.prototype.open = function(contentPane) { var that = this; this.contentPane = contentPane; - xhr.get({url: "showKeyStore.html", + xhr.get({url: "showStore.html", sync: true, load: function(data) { contentPane.containerNode.innerHTML = data; @@ -60,22 +59,22 @@ define(["dojo/dom", that.keyStoreUpdater.update(); - var deleteKeyStoreButton = query(".deleteKeyStoreButton", contentPane.containerNode)[0]; + var deleteKeyStoreButton = query(".deleteStoreButton", contentPane.containerNode)[0]; var node = registry.byNode(deleteKeyStoreButton); connect.connect(node, "onClick", function(evt){ that.deleteKeyStore(); }); - var editKeyStoreButton = query(".editKeyStoreButton", contentPane.containerNode)[0]; + var editKeyStoreButton = query(".editStoreButton", contentPane.containerNode)[0]; var node = registry.byNode(editKeyStoreButton); connect.connect(node, "onClick", function(evt){ xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) .then(function(data) { - // calls showKeystoreDialog - that.dialog(data[0], that.url); + addStore.setupTypeStore("KeyStore"); + addStore.show(data[0], that.url); }); }); }}); @@ -88,9 +87,10 @@ define(["dojo/dom", function KeyStoreUpdater(containerNode, keyStoreObj, controller, url) { var that = this; + this.keyStoreDetailsContainer = query(".typeFieldsContainer", containerNode)[0]; function findNode(name) { - return query("." + name + "Value", containerNode)[0]; + return query("." + name, containerNode)[0]; } function storeNodes(names) @@ -101,12 +101,8 @@ define(["dojo/dom", } storeNodes(["name", - "path", - "keyStoreType", - "keyStoreState", - "keyManagerFactoryAlgorithm", - "certificateAlias", - "peersOnly" + "type", + "state" ]); this.query = url; @@ -122,22 +118,27 @@ define(["dojo/dom", KeyStoreUpdater.prototype.updateHeader = function() { this.name.innerHTML = entities.encode(String(this.keyStoreData[ "name" ])); - this.path.innerHTML = entities.encode(String(this.keyStoreData[ "path" ])); - this.keyStoreType.innerHTML = entities.encode(String(this.keyStoreData[ "keyStoreType" ])); - this.keyStoreState.innerHTML = entities.encode(String(this.keyStoreData[ "state" ])); - this.keyManagerFactoryAlgorithm.innerHTML = entities.encode(String(this.keyStoreData[ "keyManagerFactoryAlgorithm" ])); - this.certificateAlias.innerHTML = this.keyStoreData[ "certificateAlias" ] ? entities.encode(String( this.keyStoreData[ "certificateAlias" ])) : ""; + this.type.innerHTML = entities.encode(String(this.keyStoreData[ "type" ])); + this.state.innerHTML = entities.encode(String(this.keyStoreData[ "state" ])); }; KeyStoreUpdater.prototype.update = function() { - var thisObj = this; + var that = this; xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}).then(function(data) { - thisObj.keyStoreData = data[0]; - thisObj.updateHeader(); + that.keyStoreData = data[0]; + that.updateHeader(); + + require(["qpid/management/store/" + encodeURIComponent(that.keyStoreData.type.toLowerCase()) + "/show"], + function(DetailsUI) + { + that.details = new DetailsUI({containerNode:that.keyStoreDetailsContainer, parent: that}); + that.details.update(that.keyStoreData); + } + ); }); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js index 9b243ccb1f..f3fa06ccba 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js @@ -29,16 +29,15 @@ define(["dojo/dom", "qpid/common/updater", "qpid/common/util", "qpid/common/formatter", - "qpid/management/addKeystore", + "qpid/management/addStore", "dojo/domReady!"], - function (dom, xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, addKeystore) { + function (dom, xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, addStore) { function TrustStore(name, parent, controller) { this.keyStoreName = name; this.controller = controller; this.modelObj = { type: "truststore", name: name, parent: parent}; this.url = "api/latest/truststore/" + encodeURIComponent(name); - this.dialog = addKeystore.showTruststoreDialog; } TrustStore.prototype.getTitle = function() { @@ -48,7 +47,7 @@ define(["dojo/dom", TrustStore.prototype.open = function(contentPane) { var that = this; this.contentPane = contentPane; - xhr.get({url: "showTrustStore.html", + xhr.get({url: "showStore.html", sync: true, load: function(data) { contentPane.containerNode.innerHTML = data; @@ -60,28 +59,27 @@ define(["dojo/dom", that.keyStoreUpdater.update(); - var deleteTrustStoreButton = query(".deleteTrustStoreButton", contentPane.containerNode)[0]; + var deleteTrustStoreButton = query(".deleteStoreButton", contentPane.containerNode)[0]; var node = registry.byNode(deleteTrustStoreButton); connect.connect(node, "onClick", function(evt){ that.deleteKeyStore(); }); - var editTrustStoreButton = query(".editTrustStoreButton", contentPane.containerNode)[0]; + var editTrustStoreButton = query(".editStoreButton", contentPane.containerNode)[0]; var node = registry.byNode(editTrustStoreButton); connect.connect(node, "onClick", function(evt){ xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) .then(function(data) { - that.dialog(data[0], that.url); + addStore.setupTypeStore("TrustStore"); + addStore.show(data[0], that.url); }); }); }}); }; - - TrustStore.prototype.close = function() { updater.remove( this.keyStoreUpdater ); }; @@ -89,9 +87,10 @@ define(["dojo/dom", function KeyStoreUpdater(containerNode, keyStoreObj, controller, url) { var that = this; + this.keyStoreDetailsContainer = query(".typeFieldsContainer", containerNode)[0]; function findNode(name) { - return query("." + name + "Value", containerNode)[0]; + return query("." + name , containerNode)[0]; } function storeNodes(names) @@ -102,12 +101,8 @@ define(["dojo/dom", } storeNodes(["name", - "path", - "trustStoreType", - "trustStoreState", - "trustManagerFactoryAlgorithm", - "certificateAlias", - "peersOnly" + "type", + "state" ]); this.query = url; @@ -123,23 +118,26 @@ define(["dojo/dom", KeyStoreUpdater.prototype.updateHeader = function() { this.name.innerHTML = entities.encode(String(this.keyStoreData[ "name" ])); - this.path.innerHTML = entities.encode(String(this.keyStoreData[ "path" ])); - this.trustStoreType.innerHTML = entities.encode(String(this.keyStoreData[ "trustStoreType" ])); - this.trustStoreState.innerHTML = entities.encode(String(this.keyStoreData[ "state" ])); - this.trustManagerFactoryAlgorithm.innerHTML = entities.encode(String(this.keyStoreData[ "trustManagerFactoryAlgorithm" ])); - this.peersOnly.innerHTML = "<input type='checkbox' disabled='disabled' "+(this.keyStoreData[ "peersOnly" ] ? "checked='checked'": "")+" />" ; + this.type.innerHTML = entities.encode(String(this.keyStoreData[ "type" ])); + this.state.innerHTML = entities.encode(String(this.keyStoreData[ "state" ])); }; KeyStoreUpdater.prototype.update = function() { - - var thisObj = this; - + var that = this; xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}).then(function(data) - { - thisObj.keyStoreData = data[0]; - thisObj.updateHeader(); - }); + { + that.trustStoreData = data[0]; + that.updateHeader(); + + require(["qpid/management/store/" + encodeURIComponent(that.trustStoreData.type.toLowerCase()) + "/show"], + function(DetailsUI) + { + that.details = new DetailsUI({containerNode:that.keyStoreDetailsContainer, parent: that}); + that.details.update(that.trustStoreData); + } + ); + }); }; TrustStore.prototype.deleteKeyStore = function() { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/accesscontrolprovider/aclfile/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/accesscontrolprovider/aclfile/add.js index 8f7baec063..e42dafb3c3 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/accesscontrolprovider/aclfile/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/accesscontrolprovider/aclfile/add.js @@ -39,6 +39,7 @@ define(["dojo/dom","dojo/query","dijit/registry","qpid/common/util"], this.aclSelectedFileStatusContainer = dom.byId("addAccessControlProvider.selectedFileStatus"); this.aclFile = registry.byId("addAccessControlProvider.file"); this.aclFileClearButton = registry.byId("addAccessControlProvider.fileClearButton"); + this.aclFileOldBrowserWarning = dom.byId("addAccessControlProvider.oldBrowserWarning"); //Only submitted field this.aclPath = registry.byId("addAccessControlProvider.path"); @@ -56,6 +57,8 @@ define(["dojo/dom","dojo/query","dijit/registry","qpid/common/util"], { // Fall back for IE8/9 which do not support FileReader this.aclUploadFields.style.display = "none"; + this.aclFileOldBrowserWarning.innerHTML = "File upload requires a more recent browser with HTML5 support"; + this.aclFileOldBrowserWarning.className = this.aclFileOldBrowserWarning.className.replace("hidden", ""); } this.aclServerPath.on("blur", function(){that._aclServerPathChanged()}); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js deleted file mode 100644 index e7e79e742d..0000000000 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js +++ /dev/null @@ -1,181 +0,0 @@ -/* - * - * 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/lang", - "dojo/_base/xhr", - "dojo/dom", - "dojo/dom-construct", - "dijit/registry", - "dojo/parser", - "dojo/_base/array", - "dojo/_base/event", - 'dojo/_base/json', - "qpid/common/util", - "dojo/store/Memory", - "dojox/validate/us", - "dojox/validate/web", - "dijit/Dialog", - "dijit/form/CheckBox", - "dijit/form/Textarea", - "dijit/form/ComboBox", - "dijit/form/TextBox", - "dijit/form/ValidationTextBox", - "dijit/form/Button", - "dijit/form/Form", - "dijit/TitlePane", - "dojox/layout/TableContainer", - "dojo/domReady!"], - function (lang, xhr, dom, construct, registry, parser, array, event, json, util) { - - var addKeystore = { }; - - addKeystore.createWidgetFactories = function(isKeystore) - { - var fields = [{ - name: "name", - createWidget: function(keystore) { - return new dijit.form.ValidationTextBox({ - required: true, - value: keystore.name, - disabled: keystore.name ? true : false, - label: "Name:", - regExpGen: util.nameOrContextVarRegexp, - promptMessage: "Name of keystore. Used to refer to the keystore from other objects within the Broker.", - placeHolder: "name", - name: "name"}); - } - }, { - name: "path", - createWidget: function(keystore) { - return new dijit.form.ValidationTextBox({ - required: true, - value: keystore.path, - label: "Path to keystore:", - promptMessage: "File system location to the keystore file", - placeHolder: "path/to/keystore", - name: "path"}); - } - }, { - name: "password", - requiredFor: "path", - createWidget: function(keystore) { - return new dijit.form.ValidationTextBox({ - required: false, - label: "Keystore password:", - promptMessage: "Password used to open the keystore", - name: "password", - placeHolder: keystore["password"] ? keystore["password"] : "" - }); - } - }]; - if (!isKeystore) - { - fields.push({ - name: "peersOnly", - createWidget: function(keystore) { - return new dijit.form.CheckBox({ - required: false, - checked: keystore && keystore.peersOnly, - label: "Peers only:", - name: "peersOnly"}); - } - }); - } - fields.push({ - name: "Options", - - createWidget: function(keystore) { - var optionalFieldContainer = new dojox.layout.TableContainer({ - cols: 1, - "labelWidth": "300", - showLabels: true, - orientation: "horiz", - customClass: "formLabel" - }); - if (isKeystore) - { - optionalFieldContainer.addChild(new dijit.form.ValidationTextBox({ - required: false, - value: keystore.certificateAlias, - label: "Keystore certificate alias:", - name: "certificateAlias", - placeHolder: "alias", - promptMessage: "Used to identify one certificate in a store that has many"})); - - optionalFieldContainer.addChild( new dijit.form.ValidationTextBox({ - required: false, - value: keystore.keyManagerFactoryAlgorithm, - label: "Key manager factory algorithm:", - placeHolder: "algorithm name", - promptMessage: "Name of the key manager algorithm known to Java", - name: "keyManagerFactoryAlgorithm"})); - } - else - { - optionalFieldContainer.addChild( new dijit.form.ValidationTextBox({ - required: false, - value: keystore.trustManagerFactoryAlgorithm, - label: "Trust manager factory algorithm:", - placeHolder: "algorithm name", - promptMessage: "Name of the trust manager algorithm known to Java", - name: "trustManagerFactoryAlgorithm"})); - } - optionalFieldContainer.addChild(new dijit.form.ValidationTextBox({ - required: false, - value: isKeystore ? keystore.keyStoreType : keystore.trustStoreType, - label: "Key store type:", - placeHolder: "store type", - promptMessage: "Name of the store type known to Java", - name: isKeystore ? "keyStoreType" : "trustStoreType"})); - - var panel = new dijit.TitlePane({title: "Optional Attributes", content: optionalFieldContainer.domNode, open: false}); - - return panel; - } - }); - return fields; - } - - addKeystore.showKeystoreDialog = function(keystore, putURL) { - var keystoreAttributeWidgetFactories = addKeystore.createWidgetFactories(true); - - util.showSetAttributesDialog( - keystoreAttributeWidgetFactories, - keystore ? keystore : {}, - keystore ? putURL : "api/latest/keystore", - keystore ? "Edit keystore - " + keystore.name : "Add keystore", - "KeyStore", - keystore && keystore.type ? keystore.type : "FileKeyStore", // GET?actuals=true doesn't get type for objects of the default type for the category - keystore ? false : true); - }; - - addKeystore.showTruststoreDialog = function(truststore, putURL) { - var truststoreAttributeWidgetFactories = addKeystore.createWidgetFactories(false); - util.showSetAttributesDialog( - truststoreAttributeWidgetFactories, - truststore ? truststore : {}, - truststore ? putURL : "api/latest/truststore", - truststore ? "Edit truststore - " + truststore.name : "Add truststore", - "TrustStore", - truststore && truststore.type ? truststore.type : "FileTrustStore", - truststore ? false : true); - }; - return addKeystore; - });
\ No newline at end of file diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addStore.js new file mode 100644 index 0000000000..98068f2376 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addStore.js @@ -0,0 +1,211 @@ +/* + * + * 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/lang", + "dojo/_base/xhr", + "dojo/dom", + "dojo/dom-construct", + "dijit/registry", + "dojo/parser", + "dojo/store/Memory", + "dojo/_base/array", + "dojo/_base/event", + 'dojo/json', + "qpid/common/util", + "qpid/common/metadata", + "dojo/text!addStore.html", + "dojo/store/Memory", + "dojox/validate/us", + "dojox/validate/web", + "dijit/Dialog", + "dijit/form/CheckBox", + "dijit/form/Textarea", + "dijit/form/ComboBox", + "dijit/form/TextBox", + "dijit/form/ValidationTextBox", + "dijit/form/Button", + "dijit/form/Form", + "dijit/layout/ContentPane", + "dojox/layout/TableContainer", + "dojo/domReady!"], + function (lang, xhr, dom, construct, registry, parser, memory, array, event, json, util, metadata, template) + { + var addStore = + { + init: function() + { + var that=this; + this.containerNode = construct.create("div", {innerHTML: template}); + parser.parse(this.containerNode); + + this.storeName = registry.byId("addStore.name"); + this.storeName.set("regExpGen", util.nameOrContextVarRegexp); + + this.dialog = registry.byId("addStore"); + this.addButton = registry.byId("addStore.addButton"); + this.cancelButton = registry.byId("addStore.cancelButton"); + this.cancelButton.on("click", function(e){that._cancel(e);}); + this.addButton.on("click", function(e){that._add(e);}); + + this.storeTypeFieldsContainer = dom.byId("addStore.typeFields"); + this.storeForm = registry.byId("addStore.form"); + + this.storeType = registry.byId("addStore.type"); + this.storeType.on("change", function(type){that._storeTypeChanged(type);}); + }, + setupTypeStore: function(category) + { + this.category = category; + var storeTypeSupportedTypes = metadata.getTypesForCategory(category); + storeTypeSupportedTypes.sort(); + var storeTypeStore = util.makeTypeStore(storeTypeSupportedTypes); + this.storeType.set("store", storeTypeStore); + }, + show: function(effectiveData) + { + this.storeForm.reset(); + + if (effectiveData) + { + this.effectiveData = effectiveData; + this._destroyTypeFields(this.containerNode); + this._initFields(effectiveData); + } + this.storeName.set("disabled", effectiveData == null ? false : true); + this.storeType.set("disabled", effectiveData == null ? false : true); + this.dialog.show(); + }, + _initFields:function(data) + { + var type = data["type"]; + var attributes = metadata.getMetaData(this.category, type).attributes; + for(var name in attributes) + { + var widget = registry.byId("addStore."+name); + if (widget) + { + widget.set("value", data[name]); + } + } + }, + _cancel: function(e) + { + event.stop(e); + if (this.reader) + { + this.reader.abort(); + } + this.dialog.hide(); + }, + _add: function(e) + { + event.stop(e); + this._submit(); + }, + _submit: function() + { + if (this.storeForm.validate()) + { + var success = false,failureReason=null; + + var storeData = util.getFormWidgetValues(this.storeForm, this.initialData); + var encodedStoreName = encodeURIComponent(this.storeName.value); + var encodedCategory = encodeURIComponent(this.category.toLowerCase()); + var jsonString = json.stringify(storeData); + + try { + xhr.put( + { + url: "api/latest/" + encodedCategory + "/" + encodedStoreName, + sync: true, + handleAs: "json", + headers: { "Content-Type": "application/json"}, + putData: jsonString, + load: function(x) {success = true; }, + error: function(error) {success = false; failureReason = error;} + }); + } + catch (e) + { + console.warn(e); + } + + if (success == true) + { + this.dialog.hide(); + } + else + { + util.xhrErrorHandler(failureReason); + } + } + else + { + alert('Form contains invalid data. Please correct first'); + } + }, + _storeTypeChanged: function(type) + { + this._typeChanged(type, this.storeTypeFieldsContainer, "qpid/management/store/", this.category ); + }, + _destroyTypeFields: function(typeFieldsContainer) + { + var widgets = registry.findWidgets(typeFieldsContainer); + array.forEach(widgets, function(item) { item.destroyRecursive();}); + construct.empty(typeFieldsContainer); + }, + _typeChanged: function(type, typeFieldsContainer, baseUrl, category ) + { + this._destroyTypeFields(typeFieldsContainer); + + if (type) + { + var that = this; + require([ baseUrl + type.toLowerCase() + "/add"], function(typeUI) + { + try + { + typeUI.show({containerNode:typeFieldsContainer, parent: that, data: that.initialData, effectiveData: that.effectiveData}); + util.applyMetadataToWidgets(typeFieldsContainer, category, type); + if (that.effectiveData) + { + typeUI.update(that.effectiveData); + that.effectiveData = undefined; + } + } + catch(e) + { + console.warn(e); + } + }); + } + } + }; + + try + { + addStore.init(); + } + catch(e) + { + console.warn(e); + } + return addStore; + }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js new file mode 100644 index 0000000000..b158b9e051 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/add.js @@ -0,0 +1,152 @@ +/* + * + * 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/dom","dojo/query", "dojo/_base/array", "dijit/registry","qpid/common/util", "qpid/common/metadata"], + function (dom, query, array, registry, util, metadata) + { + var addKeyStore = + { + init: function() + { + // Readers are HTML5 + this.reader = window.FileReader ? new FileReader() : undefined; + }, + show: function(data) + { + var that=this; + util.parseHtmlIntoDiv(data.containerNode, "store/filekeystore/add.html"); + + this.containerNode = data.containerNode; + this.keyStoreServerPath = registry.byId("addStore.serverPath"); + this.keyStoreUploadFields = dom.byId("addStore.uploadFields"); + this.keyStoreSelectedFileContainer = dom.byId("addStore.selectedFile"); + this.keyStoreSelectedFileStatusContainer = dom.byId("addStore.selectedFileStatus"); + this.keyStoreFile = registry.byId("addStore.file"); + this.keyStoreFileClearButton = registry.byId("addStore.fileClearButton"); + this.keyStoreOldBrowserWarning = dom.byId("addStore.oldBrowserWarning"); + + //Only submitted field + this.keyStorePath = registry.byId("addStore.path"); + + this.addButton = data.parent.addButton; + + if (this.reader) + { + this.reader.onload = function(evt) {that._keyStoreUploadFileComplete(evt);}; + this.reader.onerror = function(ex) {console.error("Failed to load key store file", ex);}; + this.keyStoreFile.on("change", function(selected){that._keyStoreFileChanged(selected)}); + this.keyStoreFileClearButton.on("click", function(event){that._keyStoreFileClearButtonClicked(event)}); + } + else + { + // Fall back for IE8/9 which do not support FileReader + this.keyStoreUploadFields.style.display = "none"; + this.keyStoreOldBrowserWarning.innerHTML = "File upload requires a more recent browser with HTML5 support"; + this.keyStoreOldBrowserWarning.className = this.keyStoreOldBrowserWarning.className.replace("hidden", ""); + } + + this.keyStoreServerPath.on("blur", function(){that._keyStoreServerPathChanged()}); + }, + _keyStoreFileChanged: function (evt) + { + // We only ever expect a single file + var file = this.keyStoreFile.domNode.children[0].files[0]; + + this.addButton.setDisabled(true); + this.keyStoreSelectedFileContainer.innerHTML = file.name; + this.keyStoreSelectedFileStatusContainer.className = "loadingIcon"; + + console.log("Beginning to read key store file " + file.name); + this.reader.readAsDataURL(file); + }, + _keyStoreUploadFileComplete: function(evt) + { + var reader = evt.target; + var result = reader.result; + console.log("Key store file read complete, contents " + result); + this.addButton.setDisabled(false); + this.keyStoreSelectedFileStatusContainer.className = "loadedIcon"; + + this.keyStoreServerPath.set("value", ""); + this.keyStoreServerPath.setDisabled(true); + this.keyStoreServerPath.set("required", false); + + this.keyStoreFileClearButton.setDisabled(false); + + this.keyStorePath.set("value", result); + }, + _keyStoreFileClearButtonClicked: function(event) + { + this.keyStoreFile.reset(); + this.keyStoreSelectedFileStatusContainer.className = ""; + this.keyStoreSelectedFileContainer.innerHTML = ""; + this.keyStoreServerPath.set("required", true); + this.keyStoreServerPath.setDisabled(false); + this.keyStoreFileClearButton.setDisabled(true); + + this.keyStorePath.set("value", ""); + }, + _keyStoreServerPathChanged: function() + { + var serverPathValue = this.keyStoreServerPath.get("value"); + this.keyStorePath.set("value", serverPathValue); + }, + update: function(effectiveData) + { + var attributes = metadata.getMetaData("KeyStore", "FileKeyStore").attributes; + var widgets = registry.findWidgets(this.containerNode); + array.forEach(widgets, function(item) + { + var name = item.id.replace("addStore.",""); + if (name in attributes && item.type != "password") + { + item.set("value", effectiveData[name]); + } + }); + + var keyStorePathValue = effectiveData["path"]; + var isDataUrl = keyStorePathValue.indexOf("data:") == 0; + + if (isDataUrl) + { + this.keyStoreSelectedFileStatusContainer.className = "loadedIcon"; + this.keyStoreSelectedFileContainer.innerHTML = "uploaded.jks"; + this.keyStoreServerPath.setDisabled(true); + this.keyStoreServerPath.set("required", false); + this.keyStoreFileClearButton.setDisabled(false); + } + else + { + this.keyStoreServerPath.set("value", keyStorePathValue); + } + } + }; + + try + { + addKeyStore.init(); + } + catch(e) + { + console.warn(e); + } + return addKeyStore; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js new file mode 100644 index 0000000000..fbe2bbc9c2 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filekeystore/show.js @@ -0,0 +1,42 @@ +/* + * 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/domReady!"], + function (util, metadata) + { + + function FileKeyStoreProvider(data) + { + this.fields = []; + var attributes = metadata.getMetaData("KeyStore", "FileKeyStore").attributes; + for(var name in attributes) + { + this.fields.push(name); + } + util.buildUI(data.containerNode, data.parent, "store/filekeystore/show.html", this.fields, this); + } + + FileKeyStoreProvider.prototype.update = function(data) + { + util.updateUI(data, this.fields, this); + } + + return FileKeyStoreProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js new file mode 100644 index 0000000000..9d113a9d9e --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/add.js @@ -0,0 +1,152 @@ +/* + * + * 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/dom","dojo/query", "dojo/_base/array", "dijit/registry","qpid/common/util", "qpid/common/metadata"], + function (dom, query, array, registry, util, metadata) + { + var addTrustStore = + { + init: function() + { + // Readers are HTML5 + this.reader = window.FileReader ? new FileReader() : undefined; + }, + show: function(data) + { + var that=this; + util.parseHtmlIntoDiv(data.containerNode, "store/filetruststore/add.html"); + + this.containerNode = data.containerNode; + this.keyStoreServerPath = registry.byId("addStore.serverPath"); + this.keyStoreUploadFields = dom.byId("addStore.uploadFields"); + this.keyStoreSelectedFileContainer = dom.byId("addStore.selectedFile"); + this.keyStoreSelectedFileStatusContainer = dom.byId("addStore.selectedFileStatus"); + this.keyStoreFile = registry.byId("addStore.file"); + this.keyStoreFileClearButton = registry.byId("addStore.fileClearButton"); + this.keyStoreOldBrowserWarning = dom.byId("addStore.oldBrowserWarning"); + + //Only submitted field + this.keyStorePath = registry.byId("addStore.path"); + + this.addButton = data.parent.addButton; + + if (this.reader) + { + this.reader.onload = function(evt) {that._keyStoreUploadFileComplete(evt);}; + this.reader.onerror = function(ex) {console.error("Failed to load trust store file", ex);}; + this.keyStoreFile.on("change", function(selected){that._keyStoreFileChanged(selected)}); + this.keyStoreFileClearButton.on("click", function(event){that._keyStoreFileClearButtonClicked(event)}); + } + else + { + // Fall back for IE8/9 which do not support FileReader + this.keyStoreUploadFields.style.display = "none"; + this.keyStoreOldBrowserWarning.innerHTML = "File upload requires a more recent browser with HTML5 support"; + this.keyStoreOldBrowserWarning.className = this.keyStoreOldBrowserWarning.className.replace("hidden", ""); + } + + this.keyStoreServerPath.on("blur", function(){that._keyStoreServerPathChanged()}); + }, + _keyStoreFileChanged: function (evt) + { + // We only ever expect a single file + var file = this.keyStoreFile.domNode.children[0].files[0]; + + this.addButton.setDisabled(true); + this.keyStoreSelectedFileContainer.innerHTML = file.name; + this.keyStoreSelectedFileStatusContainer.className = "loadingIcon"; + + console.log("Beginning to read trust store file " + file.name); + this.reader.readAsDataURL(file); + }, + _keyStoreUploadFileComplete: function(evt) + { + var reader = evt.target; + var result = reader.result; + console.log("Trust store file read complete, contents " + result); + this.addButton.setDisabled(false); + this.keyStoreSelectedFileStatusContainer.className = "loadedIcon"; + + this.keyStoreServerPath.set("value", ""); + this.keyStoreServerPath.setDisabled(true); + this.keyStoreServerPath.set("required", false); + + this.keyStoreFileClearButton.setDisabled(false); + + this.keyStorePath.set("value", result); + }, + _keyStoreFileClearButtonClicked: function(event) + { + this.keyStoreFile.reset(); + this.keyStoreSelectedFileStatusContainer.className = ""; + this.keyStoreSelectedFileContainer.innerHTML = ""; + this.keyStoreServerPath.set("required", true); + this.keyStoreServerPath.setDisabled(false); + this.keyStoreFileClearButton.setDisabled(true); + + this.keyStorePath.set("value", ""); + }, + _keyStoreServerPathChanged: function() + { + var serverPathValue = this.keyStoreServerPath.get("value"); + this.keyStorePath.set("value", serverPathValue); + }, + update: function(effectiveData) + { + var attributes = metadata.getMetaData("TrustStore", "FileTrustStore").attributes; + var widgets = registry.findWidgets(this.containerNode); + array.forEach(widgets, function(item) + { + var name = item.id.replace("addStore.",""); + if (name in attributes && item.type != "password") + { + item.set("value", effectiveData[name]); + } + }); + + var keyStorePathValue = effectiveData["path"]; + var isDataUrl = keyStorePathValue.indexOf("data:") == 0; + + if (isDataUrl) + { + this.keyStoreSelectedFileStatusContainer.className = "loadedIcon"; + this.keyStoreSelectedFileContainer.innerHTML = "uploaded.jks"; + this.keyStoreServerPath.setDisabled(true); + this.keyStoreServerPath.set("required", false); + this.keyStoreFileClearButton.setDisabled(false); + } + else + { + this.keyStoreServerPath.set("value", keyStorePathValue); + } + } + }; + + try + { + addTrustStore.init(); + } + catch(e) + { + console.warn(e); + } + return addTrustStore; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js new file mode 100644 index 0000000000..b03199021d --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/filetruststore/show.js @@ -0,0 +1,42 @@ +/* + * 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/domReady!"], + function (util, metadata) + { + + function FileTrustStoreProvider(data) + { + this.fields = []; + var attributes = metadata.getMetaData("TrustStore", "FileTrustStore").attributes; + for(var name in attributes) + { + this.fields.push(name); + } + util.buildUI(data.containerNode, data.parent, "store/filetruststore/show.html", this.fields, this); + } + + FileTrustStoreProvider.prototype.update = function(data) + { + util.updateUI(data, this.fields, this); + } + + return FileTrustStoreProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showKeyStore.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showKeyStore.html deleted file mode 100644 index 33987a8397..0000000000 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showKeyStore.html +++ /dev/null @@ -1,51 +0,0 @@ -<!-- - - - - 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="keystore"> - <div class="keyStoreContainer" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'KeyStore Attributes', open: true"> - - <div class="formLabel-labelCell">Name:</div> - <div class="nameValue"></div> - - <div class="formLabel-labelCell">Type:</div> - <div class="keyStoreTypeValue"></div> - - <div class="formLabel-labelCell">State:</div> - <div class="keyStoreStateValue"></div> - - <div class="formLabel-labelCell">Key Manager Factory Algorithm:</div> - <div class="keyManagerFactoryAlgorithmValue"></div> - - <div class="formLabel-labelCell">Path:</div> - <div class="pathValue"></div> - - <div class="certificateAlias"> - <div class="formLabel-labelCell">Certificate alias:</div> - <div class="certificateAliasValue"></div> - </div> - <div class="clear"></div> - </div> - - <br/> - <div class="dijitDialogPaneActionBar"> - <button data-dojo-type="dijit.form.Button" class="editKeyStoreButton" type="button">Edit</button> - <button data-dojo-type="dijit.form.Button" class="deleteKeyStoreButton" type="button">Delete</button> - </div> -</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showStore.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showStore.html new file mode 100644 index 0000000000..e564726cbb --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showStore.html @@ -0,0 +1,46 @@ +<!-- + ~ 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 data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Show Store', open: true"> + <div id="showStore.contentPane"> + <div class="clear"> + <div class="formLabel-labelCell">Name:</div> + <div class="name"></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Type:</div> + <div class="type"></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">State:</div> + <div class="state"></div> + </div> + <div class="clear"> + <div class="typeFieldsContainer"></div> + </div> + <div class="clear"> + </div> + </div> + + <div class="dijitDialogPaneActionBar"> + <button data-dojo-type="dijit.form.Button" class="editStoreButton" type="button">Edit</button> + <button data-dojo-type="dijit.form.Button" class="deleteStoreButton" type="button">Delete</button> + </div> + </div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showTrustStore.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showTrustStore.html deleted file mode 100644 index 2b35efd502..0000000000 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showTrustStore.html +++ /dev/null @@ -1,51 +0,0 @@ -<!-- - - - - 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="truststore"> - <div class="trustStoreContainer" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'TrustStore Attributes', open: true"> - - <div class="formLabel-labelCell">Name:</div> - <div class="nameValue"></div> - - <div class="formLabel-labelCell">Type:</div> - <div class="trustStoreTypeValue"></div> - - <div class="formLabel-labelCell">State:</div> - <div class="trustStoreStateValue"></div> - - <div class="formLabel-labelCell">Trust Manager Factory Algorithm:</div> - <div class="trustManagerFactoryAlgorithmValue"></div> - - <div class="formLabel-labelCell">Path:</div> - <div class="pathValue"></div> - - <div class="peersOnly"> - <div class="formLabel-labelCell">Peer store:</div> - <div class="peersOnlyValue"></div> - </div> - <div class="clear"></div> - </div> - - <br/> - <div class="dijitDialogPaneActionBar"> - <button data-dojo-type="dijit.form.Button" class="editTrustStoreButton" type="button">Edit</button> - <button data-dojo-type="dijit.form.Button" class="deleteTrustStoreButton" type="button">Delete</button> - </div> -</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/add.html new file mode 100644 index 0000000000..1732688ba7 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/add.html @@ -0,0 +1,114 @@ +<!-- + ~ 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 id="addStore.oldBrowserWarning" class="infoMessage hidden clear"></div> + <div class="clear"> + <div id="addStore.serverPathLabel" class="formLabel-labelCell tableContainer-labelCell">Server path or upload*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.serverPath" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'serverPath', + placeHolder: 'key store file server path', + required: true, + excluded: true, + promptMessage: 'Location of the key store file on the server', + title: 'Enter the key store file path'" /> + + <!-- Hidden and used purely for form submission --> + <input type="hidden" id="addStore.path" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'path', + required: true" /> + </div> + + <div id="addStore.uploadFields"> + <div id="addStore.fileLabel" class="formLabel-labelCell tableContainer-labelCell"></div> + <div class="fileUpload clear"> + <span id="addStore.selectedFile" class="infoMessage"></span> + <span id="addStore.selectedFileStatus"></span> + </div> + + <div class="fileUpload clear"> + <input type="file" id="addStore.file" + multiple="false" + data-dojo-type="dojox/form/Uploader" + data-dojo-props="label: 'Upload'"/> + <button id="addStore.fileClearButton" + data-dojo-type="dijit/form/Button" + data-dojo-props="label: 'Clear', + disabled: true"> + </button> + </div> + </div> + + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Password*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="password" id="addStore.password" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'password', + placeHolder: 'store password', + required: true, + promptMessage: 'password for store', + title: 'Enter a password for the store'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Certificate alias:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.certificateAlias" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'certificateAlias', + placeHolder: 'certificate alias', + promptMessage: 'Used to identify one certificate in a store that has many', + title: 'Enter an alias to identify one certificate in a store with many'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell clear">Key manager factory algorithm:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.keyManagerFactoryAlgorithm" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'keyManagerFactoryAlgorithm', + placeHolder: 'key manager factory algorithm', + promptMessage: 'Name of the key manager algorithm known to Java', + title: 'Enter the key manager algorithm known to Java'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Java key store type:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.keyStoreType" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'keyStoreType', + placeHolder: 'java key store type', + promptMessage: 'Name of the store type known to Java', + title: 'Enter the store type known to Java'" /> + </div> + </div> + + </div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/show.html new file mode 100644 index 0000000000..9a1d93d83a --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filekeystore/show.html @@ -0,0 +1,39 @@ +<!-- + ~ 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">Path:</div> + <div ><span class="path" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Certificate alias:</div> + <div><span class="certificateAlias" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Java key store type:</div> + <div><span class="keyStoreType" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Key manager factory algorithm:</div> + <div><span class="keyManagerFactoryAlgorithm" ></span></div> + </div> + <div class="clear"></div> +</div> + diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/add.html new file mode 100644 index 0000000000..36180d8a39 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/add.html @@ -0,0 +1,109 @@ +<!-- + ~ 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 id="addStore.oldBrowserWarning" class="infoMessage hidden clear"></div> + <div class="clear"> + <div id="addStore.serverPathLabel" class="formLabel-labelCell tableContainer-labelCell">Server path or upload*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.serverPath" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'serverPath', + placeHolder: 'trust store file server path', + required: true, + excluded: true, + promptMessage: 'Location of the trust store file on the server', + title: 'Enter the store file path'" /> + <!-- Hidden and used purely for form submission --> + <input type="hidden" id="addStore.path" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'path', + required: true" /> + </div> + <div id="addStore.uploadFields"> + <div id="addStore.fileLabel" class="formLabel-labelCell tableContainer-labelCell"></div> + <div class="fileUpload clear"> + <span id="addStore.selectedFile" class="infoMessage"></span> + <span id="addStore.selectedFileStatus"></span> + </div> + <div class="fileUpload clear"> + <input type="file" id="addStore.file" + multiple="false" + data-dojo-type="dojox/form/Uploader" + data-dojo-props="label: 'Upload'"/> + <button id="addStore.fileClearButton" + data-dojo-type="dijit/form/Button" + data-dojo-props="label: 'Clear', + disabled: true"> + </button> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Password*:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="password" id="addStore.password" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'password', + placeHolder: 'store password', + required: true, + promptMessage: 'password for store', + title: 'Enter a password for the store'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Peers only:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.peersOnly" + data-dojo-type="dijit/form/CheckBox" + data-dojo-props=" + name: 'peersOnly', + promptMessage: 'Peers only or not', + title: 'Tick if peers only'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Trust manager factory algorithm:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.keyManagerFactoryAlgorithm" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'trustManagerFactoryAlgorithm', + placeHolder: 'trust manager factory algorithm', + promptMessage: 'Name of the trust manager algorithm known to Java', + title: 'Enter the trust manager algorithm known to Java'" /> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Java trust store type:</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" id="addStore.trustStoreType" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'trustStoreType', + placeHolder: 'java trust store type', + promptMessage: 'Name of the store type known to Java', + title: 'Enter the store type known to Java'" /> + </div> + </div> + + </div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/show.html new file mode 100644 index 0000000000..1c3744b83c --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/store/filetruststore/show.html @@ -0,0 +1,39 @@ +<!-- + ~ 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">Path:</div> + <div ><span class="path" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Peers only:</div> + <div><span class="peersOnly" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Java trust store type:</div> + <div><span class="trustStoreType" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Trust manager factory algorithm:</div> + <div><span class="trustManagerFactoryAlgorithm" ></span></div> + </div> + <div class="clear"></div> +</div> + |
