summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/jdbc-store/src
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-07-16 11:07:18 +0000
committerKeith Wall <kwall@apache.org>2014-07-16 11:07:18 +0000
commite9f4e542b245f40cdcbe4694657b19e636bbecaa (patch)
treee29da884b37fb3e27da1e7bd6b92ab95c9f494c9 /qpid/java/broker-plugins/jdbc-store/src
parentee4da00c15c9af165766060dc365255b910c9381 (diff)
downloadqpid-python-e9f4e542b245f40cdcbe4694657b19e636bbecaa.tar.gz
QPID-5413: [Java Broker] Add virtualhostnode/virtualhost creation dialogue
Work by Andrew MacBean <macbean@apache.org> and me. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1610967 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/jdbc-store/src')
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java2
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/add.js (renamed from qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js)8
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/add.js71
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js93
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/add.js8
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/jdbc/add.html76
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html57
-rw-r--r--qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html17
8 files changed, 210 insertions, 122 deletions
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java
index ed25d97af0..6764b7b715 100644
--- a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java
@@ -110,7 +110,7 @@ public class GenericJDBCConfigurationStore extends AbstractJDBCConfigurationStor
catch (SQLException e)
{
throw new StoreException("Failed to create connection provider for connectionUrl: " + _connectionURL +
- " and username: " + settings.getUsername());
+ " and username: " + settings.getUsername(), e);
}
_blobType = details.getBlobType();
_varBinaryType = details.getVarBinaryType();
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/add.js
index 7276737873..ccdcf643fb 100644
--- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/pool/none/add.js
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/add.js
@@ -33,18 +33,18 @@ define(["dojo/_base/xhr",
"dojo/domReady!"],
function (xhr, dom, construct, win, registry, parser, array, event, json, string, Memory, FilteringSelect) {
return {
- show: function() {
- var node = dom.byId("addVirtualHost.poolSpecificDiv");
+ show: function(poolSpecificDivId, formFieldPrefix, htmlUrl) {
+ var node = dom.byId(poolSpecificDivId);
var that = this;
array.forEach(registry.toArray(),
function(item) {
- if(item.id.substr(0,39) == "formAddVirtualHost.specific.store.pool.") {
+ if(item.id.substr(0,formFieldPrefix.length) == formFieldPrefix) {
item.destroyRecursive();
}
});
- xhr.get({url: "virtualhost/store/pool/none/add.html",
+ xhr.get({url: htmlUrl,
sync: true,
load: function(data) {
node.innerHTML = data;
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/add.js
new file mode 100644
index 0000000000..12279f2455
--- /dev/null
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/add.js
@@ -0,0 +1,71 @@
+/*
+ * 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/_base/array",
+ "dojo/parser",
+ "dojo/dom",
+ "dojo/dom-construct",
+ "dojo/json",
+ "dojo/string",
+ "dojo/store/Memory",
+ "dijit/registry",
+ "dojo/text!virtualhost/jdbc/add.html",
+ "dojo/text!service/helper?action=pluginList&plugin=JDBCConnectionProviderFactory",
+ "dijit/form/ValidationTextBox",
+ "dijit/form/CheckBox",
+ "dojo/domReady!"],
+ function (xhr, array, parser, dom, domConstruct, json, string, Memory, registry, template, poolTypeJsonString)
+ {
+ return {
+ show: function (data)
+ {
+ this.containerNode = domConstruct.create("div", {innerHTML: template}, data.containerNode);
+ parser.parse(this.containerNode);
+
+ var poolTypes = json.parse(poolTypeJsonString);
+ var poolTypesData = [];
+ for (var i =0 ; i < poolTypes.length; i++)
+ {
+ poolTypesData[i]= {id: poolTypes[i], name: poolTypes[i]};
+ }
+ var poolTypesStore = new Memory({ data: poolTypesData });
+ var poolTypeControl = registry.byId("addVirtualHost.connectionPoolType");
+ poolTypeControl.set("store", poolTypesStore);
+
+ var poolTypeFieldsDiv = dom.byId("addVirtualHost.poolSpecificDiv");
+ poolTypeControl.on("change",
+ function(type)
+ {
+ if(type && string.trim(type) != "")
+ {
+ var widgets = registry.findWidgets(poolTypeFieldsDiv);
+ array.forEach(widgets, function(item) { item.destroyRecursive();});
+ domConstruct.empty(poolTypeFieldsDiv);
+ require(["qpid/management/store/pool/"+type.toLowerCase()+"/add"],
+ function(poolType)
+ {
+ poolType.show("addVirtualHost.poolSpecificDiv", "formAddVirtualHost.qpid.jdbcstore.bonecp", "virtualhost/store/pool/"+type.toLowerCase()+"/add.html");
+ });
+ }
+ }
+ );
+ }
+ };
+ }
+);
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js
deleted file mode 100644
index 21c0c17de9..0000000000
--- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js
+++ /dev/null
@@ -1,93 +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/xhr",
- "dojo/dom",
- "dojo/dom-construct",
- "dojo/_base/window",
- "dijit/registry",
- "dojo/parser",
- "dojo/_base/array",
- "dojo/_base/event",
- "dojo/_base/json",
- "dojo/string",
- "dojo/store/Memory",
- "dijit/form/FilteringSelect",
- "dojo/domReady!"],
- function (xhr, dom, construct, win, registry, parser, array, event, json, string, Memory, FilteringSelect) {
- return {
- show: function() {
- var node = dom.byId("addVirtualHost.storeSpecificDiv");
- var that = this;
-
- array.forEach(registry.toArray(),
- function(item) {
- if(item.id.substr(0,34) == "formAddVirtualHost.specific.store.") {
- item.destroyRecursive();
- }
- });
-
- xhr.get({url: "virtualhost/store/jdbc/add.html",
- sync: true,
- load: function(data) {
- node.innerHTML = data;
- parser.parse(node);
-
- if (that.hasOwnProperty("poolTypeChooser"))
- {
- that.poolTypeChooser.destroy();
- }
-
- var selectPoolType = function(type) {
- if(type && string.trim(type) != "") {
- require(["qpid/management/virtualhost/store/pool/"+type.toLowerCase()+"/add"],
- function(poolType)
- {
- poolType.show();
- });
- }
- }
-
- xhr.get({
- sync: true,
- url: "service/helper?action=pluginList&plugin=JDBCConnectionProviderFactory",
- handleAs: "json"
- }).then(
- function(data) {
- var poolTypes = data;
- var poolTypesData = [];
- for (var i =0 ; i < poolTypes.length; i++)
- {
- poolTypesData[i]= {id: poolTypes[i], name: poolTypes[i]};
- }
- var poolTypesStore = new Memory({ data: poolTypesData });
- var poolTypesDiv = dom.byId("addVirtualHost.specific.selectPoolType");
- var input = construct.create("input", {id: "addPoolType", required: false}, poolTypesDiv);
- that.poolTypeChooser = new FilteringSelect({ id: "addVirtualHost.specific.store.poolType",
- name: "connectionPoolType",
- store: poolTypesStore,
- searchAttr: "name", required: false,
- onChange: selectPoolType }, input);
- });
-
- }});
- }
- };
- });
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/add.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/add.js
index 1f8b8d39d3..96e96eb454 100644
--- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/add.js
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/add.js
@@ -47,10 +47,10 @@ define(["dojo/_base/xhr",
poolTypesData[i]= {id: poolTypes[i], name: poolTypes[i]};
}
var poolTypesStore = new Memory({ data: poolTypesData });
- var poolTypeControl = registry.byId("addVirtualHostNode.jdbcConnectionPoolType");
+ var poolTypeControl = registry.byId("addVirtualHostNode.connectionPoolType");
poolTypeControl.set("store", poolTypesStore);
- var poolTypeFieldsDiv = dom.byId("addVirtualHost.poolSpecificDiv");
+ var poolTypeFieldsDiv = dom.byId("addVirtualHostNode.poolSpecificDiv");
poolTypeControl.on("change",
function(type)
{
@@ -59,10 +59,10 @@ define(["dojo/_base/xhr",
var widgets = registry.findWidgets(poolTypeFieldsDiv);
array.forEach(widgets, function(item) { item.destroyRecursive();});
domConstruct.empty(poolTypeFieldsDiv);
- require(["qpid/management/virtualhost/store/pool/"+type.toLowerCase()+"/add"],
+ require(["qpid/management/store/pool/"+type.toLowerCase()+"/add"],
function(poolType)
{
- poolType.show();
+ poolType.show("addVirtualHostNode.poolSpecificDiv", "formAddVirtualHostNode.qpid.jdbcstore.bonecp", "virtualhostnode/store/pool/" + type.toLowerCase() + "/add.html");
});
}
}
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/jdbc/add.html
new file mode 100644
index 0000000000..6555faf2f9
--- /dev/null
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/jdbc/add.html
@@ -0,0 +1,76 @@
+<!--
+ ~ 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 style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">JDBC Url*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="text" id="addVirtualHost.connectionUrl"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'connectionUrl',
+ placeHolder: 'jdbc:provider:info',
+ required: true,
+ missingMessage: 'JDBC URL must be supplied',
+ title: 'Enter JDBC URL',
+ pattern: '^jdbc:.*:.*$'"/>
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Username*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="text" id="addVirtualHost.username"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'username',
+ placeHolder: 'username',
+ required: true,
+ missingMessage: 'Username must be supplied',
+ title: 'Enter username'" />
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Password*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="password" id="addVirtualHost.password"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'password',
+ placeHolder: 'password',
+ required: true,
+ missingMessage: 'Password must be supplied',
+ title: 'Enter password'" />
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Connection Pool*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="text" id="addVirtualHost.connectionPoolType"
+ data-dojo-type="dijit/form/FilteringSelect"
+ data-dojo-props="
+ name: 'connectionPoolType',
+ required: true,
+ missingMessage: 'Connection Pool type must be supplied',
+ title: 'Select Connection Pool',
+ placeHolder: 'Select pool type'" />
+ </div>
+ </div>
+
+ <div style="clear:both"></div>
+ <div id="addVirtualHost.poolSpecificDiv"></div>
+</div>
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html
index e08e709253..b2b8de862e 100644
--- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html
@@ -20,36 +20,63 @@
-->
<div>
<div style="clear:both">
- <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Virtual Host Node Name*:</div>
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Name*:</div>
<div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
- <input type="text" id="addVirtualHostNode.jdbcNodeName"
+ <input type="text" id="addVirtualHostNode.name"
data-dojo-type="dijit/form/ValidationTextBox"
data-dojo-props="
name: 'name',
- placeHolder: 'node name',
+ placeHolder: 'virtual host node name',
required: true,
- missingMessage: 'A node name must be supplied',
- title: 'Enter node name',
+ missingMessage: 'A virtual host node name must be supplied',
+ title: 'Enter virtual host node name',
pattern: '^[\x20-\x2e\x30-\x7F]{1,255}$'" />
</div>
</div>
<div style="clear:both">
<div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">JDBC Url*:</div>
<div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
- <input type="text" id="addVirtualHostNode.jdbcConnectionUrl"
+ <input type="text" id="addVirtualHostNode.connectionUrl"
data-dojo-type="dijit/form/ValidationTextBox"
data-dojo-props="
name: 'connectionUrl',
placeHolder: 'jdbc:provider:info',
required: true,
missingMessage: 'JDBC URL must be supplied',
- title: 'Enter JDBC URL'" />
+ title: 'Enter JDBC URL',
+ pattern: '^jdbc:.*:.*$'"/>
</div>
</div>
<div style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Username*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="text" id="addVirtualHostNode.username"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'username',
+ placeHolder: 'username',
+ required: true,
+ missingMessage: 'Username must be supplied',
+ title: 'Enter username'" />
+ </div>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Password*:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
+ <input type="password" id="addVirtualHostNode.password"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'password',
+ placeHolder: 'password',
+ required: true,
+ missingMessage: 'Password must be supplied',
+ title: 'Enter password'" />
+ </div>
+ </div>
+ <div style="clear:both">
<div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Connection Pool*:</div>
<div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
- <input type="text" id="addVirtualHostNode.jdbcConnectionPoolType"
+ <input type="text" id="addVirtualHostNode.connectionPoolType"
data-dojo-type="dijit/form/FilteringSelect"
data-dojo-props="
name: 'connectionPoolType',
@@ -59,17 +86,7 @@
placeHolder: 'Select pool type'" />
</div>
</div>
- <div style="clear:both;display:none">
- <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Combined store:</div>
- <div class="formLabel-controlCell tableContainer-valueCell" style="float:left;">
- <input type="text" id="addVirtualHostNode.derbyMessageStoreProvider"
- data-dojo-type="dijit/form/CheckBox"
- data-dojo-props="
- name: 'messageStoreProvider',
- required: true,
- checked: true" />
- </div>
- </div>
+
<div style="clear:both"></div>
- <div id="addVirtualHost.poolSpecificDiv"></div>
+ <div id="addVirtualHostNode.poolSpecificDiv"></div>
</div>
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html
new file mode 100644
index 0000000000..2666129a1f
--- /dev/null
+++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html
@@ -0,0 +1,17 @@
+<!--
+ ~ 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.
+ -->
+