diff options
| author | Andrew MacBean <macbean@apache.org> | 2014-07-25 16:16:12 +0000 |
|---|---|---|
| committer | Andrew MacBean <macbean@apache.org> | 2014-07-25 16:16:12 +0000 |
| commit | 151622bd91d7eb031498ff598a31a295af27799b (patch) | |
| tree | 37c36b0b878866689603d6c85da3a217d6125d2d /qpid/java/broker-plugins/jdbc-store | |
| parent | 6b02c4c08fdc26de6e048357111d9e0b85ab4927 (diff) | |
| download | qpid-python-151622bd91d7eb031498ff598a31a295af27799b.tar.gz | |
QPID-5928: [Java Broker] Implement or update virtualhostnode & virtualhost
Work completed by Alex Rudyy <orudyy@apache.org> and me.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1613461 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/jdbc-store')
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java | 2 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js | 33 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js | 56 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js | 57 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html | 31 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html | 20 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/store/pool/none/add.html (renamed from qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html) | 0 |
7 files changed, 122 insertions, 77 deletions
diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java index 9e10c54f7e..0a829696f0 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java @@ -30,7 +30,7 @@ import java.util.Set; @PluggableService public class DefaultConnectionProviderFactory implements JDBCConnectionProviderFactory { - public static final String TYPE = "DEFAULT"; + public static final String TYPE = "NONE"; @Override public String getType() diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js new file mode 100644 index 0000000000..39cb2bf507 --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js @@ -0,0 +1,33 @@ +/* + * + * 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 () + { + function NonePool(data) + { + } + + NonePool.prototype.update=function(data) + { + }; + + return NonePool; +}); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js new file mode 100644 index 0000000000..5e3a5a087c --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js @@ -0,0 +1,56 @@ +/* + * + * 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", "dojo/query", "dojo/domReady!"], + function (util, query) + { + var fieldNames = ["connectionUrl", "username", "connectionPoolType"]; + + function JDBC(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhostnode/jdbc/show.html", fieldNames, this); + this.usernameAttributeContainer=query(".usernameAttributeContainer", data.containerNode)[0]; + this.connectionPoolTypeAttributeContainer=query(".connectionPoolTypeAttributeContainer", data.containerNode)[0]; + } + + JDBC.prototype.update = function(data) + { + util.updateUI(data, fieldNames, this); + this.usernameAttributeContainer.style.display = data.username ? "block" : "none"; + if (!this.poolDetails) + { + var that = this; + require(["qpid/management/store/pool/" + data.connectionPoolType.toLowerCase() + "/show"], + function(PoolDetails) + { + that.poolDetails = new PoolDetails({containerNode:that.connectionPoolTypeAttributeContainer, parent: that}); + that.poolDetails.update(data); + } + ); + } + else + { + this.poolDetails.update(data); + } + } + + return JDBC; + } +); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js index eb58b3e7c7..ced243241b 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js @@ -18,46 +18,43 @@ * under the License. * */ -define(["dojo/_base/xhr", - "dojo/_base/lang", - "dojo/_base/connect", - "dojo/parser", - "dojo/string", - "dojox/html/entities", + +define(["qpid/common/util", "dojo/query", - "dojo/json", "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json) + function (util, query) { - var fieldNames = ["connectionUrl", "bigIntType", "varBinaryType", "blobType", "bytesForBlob", "connectionPoolType"]; + var fieldNames = ["connectionUrl", "username", "connectionPoolType"]; - function JdbcNode(data) + function Jdbc(data) { - var containerNode = data.containerNode; - this.parent = data.parent; - var that = this; - xhr.get({url: "virtualhostnode/jdbc/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - for(var i=0; i<fieldNames.length;i++) - { - var fieldName = fieldNames[i]; - this[fieldName]= query("." + fieldName, containerNode)[0]; - } + util.buildUI(data.containerNode, data.parent, "virtualhostnode/jdbc/show.html", fieldNames, this); + + this.usernameAttributeContainer=query(".usernameAttributeContainer", data.containerNode)[0]; + this.connectionPoolTypeAttributeContainer=query(".connectionPoolTypeAttributeContainer", data.containerNode)[0]; } - JdbcNode.prototype.update=function(data) + Jdbc.prototype.update=function(data) { - for(var i=0; i<fieldNames.length;i++) + util.updateUI(data, fieldNames, this); + + this.usernameAttributeContainer.style.display = data.username ? "block" : "none"; + if (!this.poolDetails) + { + var that = this; + require(["qpid/management/store/pool/" + data.connectionPoolType.toLowerCase() + "/show"], + function(PoolDetails) + { + that.poolDetails = new PoolDetails({containerNode:that.connectionPoolTypeAttributeContainer, parent: that}); + that.poolDetails.update(data); + } + ); + } + else { - var fieldName = fieldNames[i]; - var value = data[fieldName]; - this[fieldName].innerHTML= value?entities.encode(String(value)):""; + this.poolDetails.update(data); } }; - return JdbcNode; + return Jdbc; }); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html deleted file mode 100644 index 0644887a43..0000000000 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html +++ /dev/null @@ -1,31 +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. - --> -<table class="tableContainer-table tableContainer-table-horiz"> - <tr> - <td class="tableContainer-labelCell" style="width: 300px;"><strong>JDBC Url*: </strong></td> - <td class="tableContainer-valueCell"> - <input dojoType="dijit/form/ValidationTextBox" required="true" id="formAddVirtualHost.specific.store.connectionURL" - name="connectionUrl" placeholder="jdbc:provider:info" /> - </tr> - <tr> - <td class="tableContainer-labelCell" style="width: 300px;"><strong>Connection Pool: </strong></td> - <td class="tableContainer-valueCell" ><div id="addVirtualHost.specific.selectPoolType"></div></td> - </td> - </tr> -</table> -<div id="addVirtualHost.poolSpecificDiv"> -</div> diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html index 63fec28012..7ba60f2f6b 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html @@ -19,26 +19,16 @@ <div class="formLabel-labelCell" style="float:left; width: 200px;">Connection URL:</div> <div class="connectionUrl" style="float:left;"></div> </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Big Integer Type:</div> - <div class="bigIntType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Var Binary Type:</div> - <div class="varBinaryType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Blob Type:</div> - <div class="blobType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Bytes For Blob:</div> - <div class="bytesForBlob" style="float:left;"></div> + <div class="usernameAttributeContainer" style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 200px;">Username:</div> + <div class="username" style="float:left;"></div> </div> <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 200px;">Connection Pool Type:</div> <div class="connectionPoolType" style="float:left;"></div> </div> + <div class="connectionPoolTypeAttributeContainer" style="clear:both"/> + <div style="clear:both"></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/store/pool/none/add.html index 2666129a1f..2666129a1f 100644 --- 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/store/pool/none/add.html |
