QPID-7543; [Broker-J] Add UI for UserOrConnectionSpecific LogInclusionRule
diff --git a/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/brokerloginclusionrule/userorconnectionspecific/add.js b/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/brokerloginclusionrule/userorconnectionspecific/add.js
new file mode 100644
index 0000000..e9d4d89
--- /dev/null
+++ b/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/brokerloginclusionrule/userorconnectionspecific/add.js
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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",
+ "dojo/parser",
+ "dojo/text!loginclusionrule/userorconnectionspecific/add.html",
+ "dojo/domReady!"], function (dom, query, array, registry, util, parser, template)
+{
+ var addLogInclusionRule = {
+ show: function (data)
+ {
+ var that = this;
+ this.metadata = data.metadata;
+ this.containerNode = data.containerNode;
+ data.containerNode.innerHTML = template;
+ return parser.parse(this.containerNode)
+ .then(function (instances)
+ {
+ var logLevelWidget = registry.byId("addLogInclusionRule.specific.level");
+ var validValues = that.metadata.getMetaData(data.category, data.type).attributes.level.validValues;
+ var validValueStore = util.makeTypeStore(validValues);
+ logLevelWidget.set("store", validValueStore);
+ });
+ }
+ };
+
+ return addLogInclusionRule;
+});
diff --git a/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/virtualhostloginclusionrule/userorconnectionspecific/add.js b/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/virtualhostloginclusionrule/userorconnectionspecific/add.js
new file mode 100644
index 0000000..f6b3b81
--- /dev/null
+++ b/broker-plugins/logging-logback/src/main/java/resources/js/qpid/management/loginclusionrule/virtualhostloginclusionrule/userorconnectionspecific/add.js
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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",
+ "dojo/parser",
+ "dojo/text!lloginclusionrule/userorconnectionspecific/add.html",
+ "dojo/domReady!"], function (dom, query, array, registry, util, parser, template)
+{
+ var addLogInclusionRule = {
+ show: function (data)
+ {
+ var that = this;
+ this.metadata = data.metadata;
+ this.containerNode = data.containerNode;
+ data.containerNode.innerHTML = template;
+ return parser.parse(this.containerNode)
+ .then(function (instances)
+ {
+ var logLevelWidget = registry.byId("addLogInclusionRule.specific.level");
+ var validValues = that.metadata.getMetaData(data.category, data.type).attributes.level.validValues;
+ var validValueStore = util.makeTypeStore(validValues);
+ logLevelWidget.set("store", validValueStore);
+ });
+ }
+ };
+
+ return addLogInclusionRule;
+});
diff --git a/broker-plugins/logging-logback/src/main/java/resources/loginclusionrule/userorconnectionspecific/add.html b/broker-plugins/logging-logback/src/main/java/resources/loginclusionrule/userorconnectionspecific/add.html
new file mode 100644
index 0000000..54f5bdc
--- /dev/null
+++ b/broker-plugins/logging-logback/src/main/java/resources/loginclusionrule/userorconnectionspecific/add.html
@@ -0,0 +1,85 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<div>
+ <div class="clear">
+ <div class="formLabel-labelCell tableContainer-labelCell">Log Event Source Name:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell">
+ <input type="text" id="addLogInclusionRule.specific.loggerName"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'loggerName',
+ placeHolder: 'ROOT',
+ promptMessage: 'Enter name of log event source (usually the package name). To capture log events from subpackages you must specify the ".*" wildcard at the end (e.g., org.apache.qpid.*)',
+ title: 'Enter log event source name'"/>
+ </div>
+ </div>
+ <div class="clear">
+ <div class="formLabel-labelCell tableContainer-labelCell">Level:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell">
+ <input type="text" id="addLogInclusionRule.specific.level"
+ data-dojo-type="dijit/form/FilteringSelect"
+ data-dojo-props="
+ name: 'level',
+ required: false,
+ placeHolder: 'level',
+ promptMessage: 'Select log level for this rule',
+ title: 'Select log level for this rule'"/>
+ </div>
+ </div>
+ <div class="clear">
+ <div class="formLabel-labelCell tableContainer-labelCell">Connection Name:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell">
+ <input type="text" id="addLogInclusionRule.specific.connectionName"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'connectionName',
+ required: false,
+ placeHolder: 'connection name',
+ promptMessage: 'connection name reg exp',
+ title: 'Please enter connection name reg exp'"/>
+ </div>
+ </div>
+ <div class="clear">
+ <div class="formLabel-labelCell tableContainer-labelCell">Remote Container ID:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell">
+ <input type="text" id="addLogInclusionRule.specific.remoteContainerId"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'remoteContainerId',
+ required: false,
+ placeHolder: 'remote container id',
+ promptMessage: 'remote container id reg exp',
+ title: 'Please enter remote container id reg exp'"/>
+ </div>
+ </div>
+ <div class="clear">
+ <div class="formLabel-labelCell tableContainer-labelCell">Username:</div>
+ <div class="formLabel-controlCell tableContainer-valueCell">
+ <input type="text" id="addLogInclusionRule.specific.username"
+ data-dojo-type="dijit/form/ValidationTextBox"
+ data-dojo-props="
+ name: 'username',
+ required: false,
+ placeHolder: 'user name',
+ promptMessage: 'user name reg exp',
+ title: 'Please enter user name reg exp'"/>
+ </div>
+ </div>
+</div>