You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by lq...@apache.org on 2016/04/29 13:04:44 UTC
svn commit: r1741609 [6/31] - in /qpid/java/trunk:
bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/
bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/
bdbstore/src/main/java/resources/js/qpid/management/virtualh...
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/GridUpdater.js Fri Apr 29 11:04:40 2016
@@ -19,7 +19,6 @@
*
*/
-
define(["dojo/_base/xhr",
"dojo/parser",
"dojo/_base/array",
@@ -33,199 +32,210 @@ define(["dojo/_base/xhr",
"qpid/common/grid/EnhancedFilter",
"dojox/grid/enhanced/plugins/NestedSorting",
"dojo/domReady!"],
- function (xhr, parser, array, lang, properties, updater, UpdatableStore, util, Memory, ObjectStore) {
+ function (xhr, parser, array, lang, properties, updater, UpdatableStore, util, Memory, ObjectStore)
+ {
- function GridUpdater(args, store) {
- this.updatable = args.hasOwnProperty("updatable") ? args.updatable : true ;
- this.serviceUrl = args.serviceUrl;
- this.userPreferences = args.userPreferences;
- this.onUpdate = [];
- if (args.onUpdate)
- {
- this.onUpdate.push(args.onUpdate);
- }
- this.dataTransformer = args.dataTransformer;
-
- this.appendData = args.append;
- this.appendLimit = args.appendLimit;
- this.initialData = args.data;
- this.initializeStore(store);
- };
-
- GridUpdater.prototype.buildUpdatableGridArguments = function(args)
- {
- var filterPluginFound = args && args.hasOwnProperty("plugins") && args.plugins.filter ? true: false;
-
- var gridProperties = {
- autoHeight: true,
- plugins: {
- pagination: {
- defaultPageSize: 25,
- pageSizes: [10, 25, 50, 100],
- description: true,
- sizeSwitch: true,
- pageStepper: true,
- gotoButton: true,
- maxPageStep: 4,
- position: "bottom"
- },
- enhancedFilter: {
- disableFiltering: filterPluginFound,
- userPreferences: this.userPreferences
- }
- }
- };
-
- if(args)
- {
- for(var argProperty in args)
+ function GridUpdater(args, store)
+ {
+ this.updatable = args.hasOwnProperty("updatable") ? args.updatable : true;
+ this.serviceUrl = args.serviceUrl;
+ this.userPreferences = args.userPreferences;
+ this.onUpdate = [];
+ if (args.onUpdate)
{
- if(args.hasOwnProperty(argProperty))
+ this.onUpdate.push(args.onUpdate);
+ }
+ this.dataTransformer = args.dataTransformer;
+
+ this.appendData = args.append;
+ this.appendLimit = args.appendLimit;
+ this.initialData = args.data;
+ this.initializeStore(store);
+ };
+
+ GridUpdater.prototype.buildUpdatableGridArguments = function (args)
+ {
+ var filterPluginFound = args && args.hasOwnProperty("plugins") && args.plugins.filter ? true : false;
+
+ var gridProperties = {
+ autoHeight: true,
+ plugins: {
+ pagination: {
+ defaultPageSize: 25,
+ pageSizes: [10, 25, 50, 100],
+ description: true,
+ sizeSwitch: true,
+ pageStepper: true,
+ gotoButton: true,
+ maxPageStep: 4,
+ position: "bottom"
+ },
+ enhancedFilter: {
+ disableFiltering: filterPluginFound,
+ userPreferences: this.userPreferences
+ }
+ }
+ };
+
+ if (args)
+ {
+ for (var argProperty in args)
{
- if (argProperty == "plugins")
+ if (args.hasOwnProperty(argProperty))
{
- var argPlugins = args[ argProperty ];
- for(var argPlugin in argPlugins)
- {
- if(argPlugins.hasOwnProperty(argPlugin))
+ if (argProperty == "plugins")
{
- var argPluginProperties = argPlugins[ argPlugin ];
- if (argPluginProperties && gridProperties.plugins.hasOwnProperty(argPlugin))
- {
- var gridPlugin = gridProperties.plugins[ argPlugin ];
- for(var pluginProperty in argPluginProperties)
+ var argPlugins = args[argProperty];
+ for (var argPlugin in argPlugins)
{
- if(argPluginProperties.hasOwnProperty(pluginProperty))
- {
- gridPlugin[pluginProperty] = argPluginProperties[pluginProperty];
- }
+ if (argPlugins.hasOwnProperty(argPlugin))
+ {
+ var argPluginProperties = argPlugins[argPlugin];
+ if (argPluginProperties && gridProperties.plugins.hasOwnProperty(argPlugin))
+ {
+ var gridPlugin = gridProperties.plugins[argPlugin];
+ for (var pluginProperty in argPluginProperties)
+ {
+ if (argPluginProperties.hasOwnProperty(pluginProperty))
+ {
+ gridPlugin[pluginProperty] = argPluginProperties[pluginProperty];
+ }
+ }
+ }
+ else
+ {
+ gridProperties.plugins[argPlugin] = argPlugins[argPlugin];
+ }
+ }
}
- }
- else
- {
- gridProperties.plugins[ argPlugin ] = argPlugins[ argPlugin ];
- }
}
- }
- }
- else
- {
- gridProperties[ argProperty ] = args[ argProperty ];
+ else
+ {
+ gridProperties[argProperty] = args[argProperty];
+ }
}
}
}
- }
- gridProperties.updater = this;
- gridProperties.store = this.dataStore;
+ gridProperties.updater = this;
+ gridProperties.store = this.dataStore;
- return gridProperties;
+ return gridProperties;
};
- GridUpdater.prototype.initializeStore = function(store)
- {
- var self = this;
-
- function processData(data)
- {
- if (self.dataTransformer)
- {
- data = self.dataTransformer(data);
- }
- var dataSet = false;
- if (!store)
- {
- store = new ObjectStore({objectStore: new Memory({data: data, idProperty: "id"})});
- dataSet = true;
- }
- self.dataStore = store
- self.store = store;
- if (store instanceof ObjectStore)
- {
- if( store.objectStore instanceof Memory)
- {
- self.memoryStore = store.objectStore;
- }
- self.store = store.objectStore
- }
-
- if (data)
- {
- if ((dataSet || self.updateOrAppend(data)) && self.onUpdate.length > 0)
+ GridUpdater.prototype.initializeStore = function (store)
+ {
+ var self = this;
+
+ function processData(data)
+ {
+ if (self.dataTransformer)
{
- self.fireUpdate(data);
+ data = self.dataTransformer(data);
+ }
+ var dataSet = false;
+ if (!store)
+ {
+ store = new ObjectStore({
+ objectStore: new Memory({
+ data: data,
+ idProperty: "id"
+ })
+ });
+ dataSet = true;
+ }
+ self.dataStore = store
+ self.store = store;
+ if (store instanceof ObjectStore)
+ {
+ if (store.objectStore instanceof Memory)
+ {
+ self.memoryStore = store.objectStore;
+ }
+ self.store = store.objectStore
}
- }
- };
- if (this.serviceUrl)
- {
- var requestUrl = lang.isFunction(this.serviceUrl) ? this.serviceUrl() : this.serviceUrl;
- xhr.get({url: requestUrl, sync: true, handleAs: "json"}).then(processData, util.xhrErrorHandler);
- }
- else
- {
- processData(this.initialData);
- }
+ if (data)
+ {
+ if ((dataSet || self.updateOrAppend(data)) && self.onUpdate.length > 0)
+ {
+ self.fireUpdate(data);
+ }
+ }
+ };
+
+ if (this.serviceUrl)
+ {
+ var requestUrl = lang.isFunction(this.serviceUrl) ? this.serviceUrl() : this.serviceUrl;
+ xhr.get({
+ url: requestUrl,
+ sync: true,
+ handleAs: "json"
+ }).then(processData, util.xhrErrorHandler);
+ }
+ else
+ {
+ processData(this.initialData);
+ }
};
- GridUpdater.prototype.start = function(grid)
+ GridUpdater.prototype.start = function (grid)
{
this.grid = grid;
if (this.serviceUrl)
{
- updater.add(this);
+ updater.add(this);
}
};
- GridUpdater.prototype.destroy = function()
+ GridUpdater.prototype.destroy = function ()
{
- updater.remove(this);
- if (this.dataStore)
- {
- this.dataStore.close();
- this.dataStore = null;
- }
- this.store = null;
- this.memoryStore = null;
- this.grid = null;
- this.onUpdate = null;
+ updater.remove(this);
+ if (this.dataStore)
+ {
+ this.dataStore.close();
+ this.dataStore = null;
+ }
+ this.store = null;
+ this.memoryStore = null;
+ this.grid = null;
+ this.onUpdate = null;
};
- GridUpdater.prototype.updateOrAppend = function(data)
+ GridUpdater.prototype.updateOrAppend = function (data)
{
- return this.appendData ?
- UpdatableStore.prototype.append.call(this, data, this.appendLimit):
- UpdatableStore.prototype.update.call(this, data);
+ return this.appendData
+ ? UpdatableStore.prototype.append.call(this, data, this.appendLimit)
+ : UpdatableStore.prototype.update.call(this, data);
};
- GridUpdater.prototype.refresh = function(data)
+ GridUpdater.prototype.refresh = function (data)
{
if (this.dataTransformer && data)
{
- data = this.dataTransformer(data);
+ data = this.dataTransformer(data);
}
this.updating = true;
try
{
if (this.updateOrAppend(data))
{
- // EnhancedGrid with Filter plugin has "filter" layer.
- // The filter expression needs to be re-applied after the data update
- var filterLayer = this.grid.layer("filter");
- if ( filterLayer && filterLayer.filterDef)
- {
- var currentFilter = filterLayer.filterDef();
-
- if (currentFilter)
- {
- // re-apply filter in the filter layer
- filterLayer.filterDef(currentFilter);
- }
- }
+ // EnhancedGrid with Filter plugin has "filter" layer.
+ // The filter expression needs to be re-applied after the data update
+ var filterLayer = this.grid.layer("filter");
+ if (filterLayer && filterLayer.filterDef)
+ {
+ var currentFilter = filterLayer.filterDef();
- // refresh grid to render updates
- this.grid._refresh();
+ if (currentFilter)
+ {
+ // re-apply filter in the filter layer
+ filterLayer.filterDef(currentFilter);
+ }
+ }
+
+ // refresh grid to render updates
+ this.grid._refresh();
}
}
finally
@@ -235,23 +245,30 @@ define(["dojo/_base/xhr",
}
}
- GridUpdater.prototype.update = function()
+ GridUpdater.prototype.update = function ()
{
- if (this.updatable)
- {
- this.performUpdate();
- }
+ if (this.updatable)
+ {
+ this.performUpdate();
+ }
};
- GridUpdater.prototype.performUpdate = function()
+ GridUpdater.prototype.performUpdate = function ()
{
- var self = this;
- var requestUrl = lang.isFunction(this.serviceUrl) ? this.serviceUrl() : this.serviceUrl;
- var requestArguments = {url: requestUrl, sync: properties.useSyncGet, handleAs: "json"};
- xhr.get(requestArguments).then(function(data){self.refresh(data);});
+ var self = this;
+ var requestUrl = lang.isFunction(this.serviceUrl) ? this.serviceUrl() : this.serviceUrl;
+ var requestArguments = {
+ url: requestUrl,
+ sync: properties.useSyncGet,
+ handleAs: "json"
+ };
+ xhr.get(requestArguments).then(function (data)
+ {
+ self.refresh(data);
+ });
};
- GridUpdater.prototype.performRefresh = function(data)
+ GridUpdater.prototype.performRefresh = function (data)
{
if (!this.updating)
{
@@ -259,39 +276,43 @@ define(["dojo/_base/xhr",
}
};
- GridUpdater.prototype.fireUpdate=function(data)
+ GridUpdater.prototype.fireUpdate = function (data)
{
- if (this.onUpdate.length > 0)
- {
- for(var i=0; i<this.onUpdate.length;i++)
- {
- var onUpdate= this.onUpdate[i];
- try
- {
- onUpdate(data);
- }
- catch(e)
- {
- if (console && console.error)
+ if (this.onUpdate.length > 0)
+ {
+ for (var i = 0; i < this.onUpdate.length; i++)
{
- console.error(e);
+ var onUpdate = this.onUpdate[i];
+ try
+ {
+ onUpdate(data);
+ }
+ catch (e)
+ {
+ if (console && console.error)
+ {
+ console.error(e);
+ }
+ }
}
- }
}
- }
};
- GridUpdater.prototype.addOnUpdate = function(obj) {
- this.onUpdate.push(obj);
+ GridUpdater.prototype.addOnUpdate = function (obj)
+ {
+ this.onUpdate.push(obj);
};
- GridUpdater.prototype.removeOnUpdate = function(obj) {
- for(var i = 0; i < this.onUpdate.length; i++) {
- if(this.onUpdate[i] === obj) {
- this.onUpdate.splice(i,1);
- return;
- }
- }
+ GridUpdater.prototype.removeOnUpdate = function (obj)
+ {
+ for (var i = 0; i < this.onUpdate.length; i++)
+ {
+ if (this.onUpdate[i] === obj)
+ {
+ this.onUpdate.splice(i, 1);
+ return;
+ }
+ }
};
return GridUpdater;
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/RowNumberLimitDialog.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/RowNumberLimitDialog.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/RowNumberLimitDialog.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/RowNumberLimitDialog.js Fri Apr 29 11:04:40 2016
@@ -19,84 +19,89 @@
*
*/
-define([
- "dojo/_base/declare",
- "dojo/_base/event",
- "dojo/_base/array",
- "dojo/_base/lang",
- "dojo/parser",
- "dojo/dom-construct",
- "dojo/query",
- "dijit/registry",
- "dijit/form/Button",
- "dijit/form/CheckBox",
- "dojox/grid/enhanced/plugins/Dialog",
- "dojo/text!../../../grid/showRowNumberLimitDialog.html",
- "dojo/domReady!"
-], function(declare, event, array, lang, parser, dom, query, registry, Button, CheckBox, Dialog, template ){
-
-
-return declare("qpid.management.logs.RowNumberLimitDialog", null, {
-
- grid: null,
- dialog: null,
-
- constructor: function(domNode, limitChangedCallback)
- {
- var that = this;
- this.containerNode = dom.create("div", {innerHTML: template});
- parser.parse(this.containerNode).then(function(instances)
- {
- that._postParse(domNode, limitChangedCallback);
- });
- },
- _postParse: function(domNode, limitChangedCallback)
- {
- this.rowNumberLimit = registry.byNode(query(".rowNumberLimit", this.containerNode)[0])
- this.submitButton = registry.byNode(query(".submitButton", this.containerNode)[0]);
- this.closeButton = registry.byNode(query(".cancelButton", this.containerNode)[0]);
-
- this.dialog = new Dialog({
- "refNode": domNode,
- "title": "Grid Rows Number",
- "content": this.containerNode
- });
-
- var self = this;
- this.submitButton.on("click", function(e){
- if (self.rowNumberLimit.value > 0)
- {
- try
- {
- limitChangedCallback(self.rowNumberLimit.value);
- }
- catch(e)
- {
- console.error(e);
- }
- finally
- {
- self.dialog.hide();
- }
- }
- });
-
- this.closeButton.on("click", function(e){self.dialog.hide(); });
- this.dialog.startup();
- },
-
- destroy: function(){
- this.submitButton.destroy();
- this.closeButton.destroy();
- this.dialog.destroy();
- this.dialog = null;
- },
-
- showDialog: function(currentLimit){
- this.rowNumberLimit.set("value", currentLimit);
- this.dialog.show();
- }
+define(["dojo/_base/declare",
+ "dojo/_base/event",
+ "dojo/_base/array",
+ "dojo/_base/lang",
+ "dojo/parser",
+ "dojo/dom-construct",
+ "dojo/query",
+ "dijit/registry",
+ "dijit/form/Button",
+ "dijit/form/CheckBox",
+ "dojox/grid/enhanced/plugins/Dialog",
+ "dojo/text!../../../grid/showRowNumberLimitDialog.html",
+ "dojo/domReady!"],
+ function (declare, event, array, lang, parser, dom, query, registry, Button, CheckBox, Dialog, template)
+ {
+
+ return declare("qpid.management.logs.RowNumberLimitDialog", null, {
+
+ grid: null,
+ dialog: null,
+
+ constructor: function (domNode, limitChangedCallback)
+ {
+ var that = this;
+ this.containerNode = dom.create("div", {innerHTML: template});
+ parser.parse(this.containerNode).then(function (instances)
+ {
+ that._postParse(domNode, limitChangedCallback);
+ });
+ },
+ _postParse: function (domNode, limitChangedCallback)
+ {
+ this.rowNumberLimit = registry.byNode(query(".rowNumberLimit", this.containerNode)[0])
+ this.submitButton = registry.byNode(query(".submitButton", this.containerNode)[0]);
+ this.closeButton = registry.byNode(query(".cancelButton", this.containerNode)[0]);
+
+ this.dialog = new Dialog({
+ "refNode": domNode,
+ "title": "Grid Rows Number",
+ "content": this.containerNode
+ });
+
+ var self = this;
+ this.submitButton.on("click", function (e)
+ {
+ if (self.rowNumberLimit.value > 0)
+ {
+ try
+ {
+ limitChangedCallback(self.rowNumberLimit.value);
+ }
+ catch (e)
+ {
+ console.error(e);
+ }
+ finally
+ {
+ self.dialog.hide();
+ }
+ }
+ });
+
+ this.closeButton.on("click", function (e)
+ {
+ self.dialog.hide();
+ });
+ this.dialog.startup();
+ },
+
+ destroy: function ()
+ {
+ this.submitButton.destroy();
+ this.closeButton.destroy();
+ this.dialog.destroy();
+ this.dialog = null;
+ },
+
+ showDialog: function (currentLimit)
+ {
+ this.rowNumberLimit.set("value", currentLimit);
+ this.dialog.show();
+ }
- });
+ });
-});
+ });
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/UpdatableGrid.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/UpdatableGrid.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/UpdatableGrid.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/grid/UpdatableGrid.js Fri Apr 29 11:04:40 2016
@@ -19,38 +19,38 @@
*
*/
-define([
- "dojo/_base/declare",
- "dojox/grid/EnhancedGrid",
- "dojo/domReady!"], function(declare, EnhancedGrid){
-
- return declare("qpid.common.grid.UpdatableGrid", [EnhancedGrid], {
-
- updater: null,
-
- postCreate: function(){
- this.inherited(arguments);
- if (this.updater)
+define(["dojo/_base/declare", "dojox/grid/EnhancedGrid", "dojo/domReady!"], function (declare, EnhancedGrid)
+{
+
+ return declare("qpid.common.grid.UpdatableGrid", [EnhancedGrid], {
+
+ updater: null,
+
+ postCreate: function ()
{
- this.updater.start(this);
- }
- },
+ this.inherited(arguments);
+ if (this.updater)
+ {
+ this.updater.start(this);
+ }
+ },
- destroy: function(){
- if (this.updater)
- {
- try
- {
- this.updater.destroy();
- }
- catch(e)
- {
- console.error(e)
- }
- this.updater = null;
- }
- this.inherited(arguments);
- }
- });
+ destroy: function ()
+ {
+ if (this.updater)
+ {
+ try
+ {
+ this.updater.destroy();
+ }
+ catch (e)
+ {
+ console.error(e)
+ }
+ this.updater = null;
+ }
+ this.inherited(arguments);
+ }
+ });
});
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/metadata.js Fri Apr 29 11:04:40 2016
@@ -16,99 +16,98 @@
* specific language governing permissions and limitations
* under the License.
*/
-define(["dojo/_base/array", "dojox/lang/functional/object" ],
- function (array, fobject)
- {
- function Metadata(data)
- {
- this.metadata = data;
- }
-
- Metadata.prototype.getMetaData = function (category, type)
- {
- if (this.metadata)
- {
- return this.metadata[category][type];
- }
- return null;
- };
-
- Metadata.prototype.getDefaultValueForAttribute = function (category, type, attributeName)
- {
- var metaDataForInstance = this.getMetaData(category, type);
- var attributesForType = metaDataForInstance["attributes"];
- var attributesForName = attributesForType[attributeName];
- return attributesForName ? attributesForName["defaultValue"] : undefined;
- };
-
- Metadata.prototype.isImmutable = function (category, type, attributeName)
- {
- var metaDataForInstance = this.getMetaData(category, type);
- var attributesForType = metaDataForInstance["attributes"];
- var attributesForName = attributesForType[attributeName];
- return attributesForName ? attributesForName["immutable"] : undefined;
- };
+define(["dojo/_base/array", "dojox/lang/functional/object"], function (array, fobject)
+{
+ function Metadata(data)
+ {
+ this.metadata = data;
+ }
+
+ Metadata.prototype.getMetaData = function (category, type)
+ {
+ if (this.metadata)
+ {
+ return this.metadata[category][type];
+ }
+ return null;
+ };
+
+ Metadata.prototype.getDefaultValueForAttribute = function (category, type, attributeName)
+ {
+ var metaDataForInstance = this.getMetaData(category, type);
+ var attributesForType = metaDataForInstance["attributes"];
+ var attributesForName = attributesForType[attributeName];
+ return attributesForName ? attributesForName["defaultValue"] : undefined;
+ };
- Metadata.prototype.getDefaultValueForType = function (category, type)
- {
+ Metadata.prototype.isImmutable = function (category, type, attributeName)
+ {
var metaDataForInstance = this.getMetaData(category, type);
- var attributesForType = metaDataForInstance["attributes"];
+ var attributesForType = metaDataForInstance["attributes"];
+ var attributesForName = attributesForType[attributeName];
+ return attributesForName ? attributesForName["immutable"] : undefined;
+ };
+
+ Metadata.prototype.getDefaultValueForType = function (category, type)
+ {
+ var metaDataForInstance = this.getMetaData(category, type);
+ var attributesForType = metaDataForInstance["attributes"];
var defaultValues = {};
for (var attributeName in attributesForType)
{
- var attribute = attributesForType[attributeName];
- if (attribute.defaultValue)
- {
- if (attribute.type == "Boolean")
+ var attribute = attributesForType[attributeName];
+ if (attribute.defaultValue)
{
- defaultValues[attributeName] = (attribute.defaultValue === "true");
+ if (attribute.type == "Boolean")
+ {
+ defaultValues[attributeName] = (attribute.defaultValue === "true");
+ }
+ else
+ {
+ defaultValues[attributeName] = attribute.defaultValue;
+ }
}
- else
+ }
+ return defaultValues;
+ };
+
+ Metadata.prototype.getTypesForCategory = function (category)
+ {
+ return fobject.keys(this.metadata[category]);
+ };
+
+ Metadata.prototype.extractUniqueListOfValues = function (data)
+ {
+ var values = [];
+ for (i = 0; i < data.length; i++)
+ {
+ for (j = 0; j < data[i].length; j++)
{
- defaultValues[attributeName] = attribute.defaultValue;
+ var current = data[i][j];
+ if (array.indexOf(values, current) == -1)
+ {
+ values.push(current);
+ }
}
- }
}
- return defaultValues;
- };
+ return values;
+ };
+
+ Metadata.prototype.implementsManagedInterface = function (category, type, managedInterfaceName)
+ {
+ var md = this.getMetaData(category, type);
+ if (md && md.managedInterfaces)
+ {
+ return array.indexOf(md.managedInterfaces, managedInterfaceName) >= 0;
+ }
+ return false;
+ };
- Metadata.prototype.getTypesForCategory = function (category)
- {
- return fobject.keys(this.metadata[category]);
- };
-
- Metadata.prototype.extractUniqueListOfValues = function(data)
- {
- var values = [];
- for (i = 0; i < data.length; i++)
- {
- for (j = 0; j < data[i].length; j++)
- {
- var current = data[i][j];
- if (array.indexOf(values, current) == -1)
- {
- values.push(current);
- }
- }
- }
- return values;
- };
-
- Metadata.prototype.implementsManagedInterface = function (category, type, managedInterfaceName)
- {
- var md = this.getMetaData(category, type);
- if (md && md.managedInterfaces)
- {
- return array.indexOf(md.managedInterfaces, managedInterfaceName) >= 0 ;
- }
- return false;
- };
-
- Metadata.prototype.validChildTypes= function (category, type, childCategory)
- {
- var metaData = this.getMetaData(category, type);
- return metaData ? metaData.validChildTypes[childCategory] : [];
- }
+ Metadata.prototype.validChildTypes = function (category, type, childCategory)
+ {
+ var metaData = this.getMetaData(category, type);
+ return metaData ? metaData.validChildTypes[childCategory] : [];
+ }
- return Metadata;
- });
+ return Metadata;
+});
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/properties.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/properties.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/properties.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/properties.js Fri Apr 29 11:04:40 2016
@@ -18,9 +18,9 @@
* under the License.
*
*/
-define(["dojo/has", "dojo/_base/sniff", "dojo/domReady!"],
- function (has) {
- var properties = {};
- properties.useSyncGet = (has("ie") <= 8);
- return properties;
- });
\ No newline at end of file
+define(["dojo/has", "dojo/_base/sniff", "dojo/domReady!"], function (has)
+{
+ var properties = {};
+ properties.useSyncGet = (has("ie") <= 8);
+ return properties;
+});
\ No newline at end of file
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/timezone.js Fri Apr 29 11:04:40 2016
@@ -19,56 +19,56 @@
*
*/
-define([], function () {
+define([], function ()
+{
-
- var timeZoneSortFunction = function(a, b)
+ var timeZoneSortFunction = function (a, b)
{
- if (a.region == b.region)
- {
- if (a.city == b.city)
- {
+ if (a.region == b.region)
+ {
+ if (a.city == b.city)
+ {
return 0;
- }
- return a.city < b.city ? -1 : 1;
- }
- return a.region < b.region ? -1 : 1;
+ }
+ return a.city < b.city ? -1 : 1;
+ }
+ return a.region < b.region ? -1 : 1;
}
- var Timezone = function(timezones)
+ var Timezone = function (timezones)
{
this.timezones = timezones.sort(timeZoneSortFunction)
};
- Timezone.prototype.getAllTimeZones= function()
+ Timezone.prototype.getAllTimeZones = function ()
{
- return this.timezones;
+ return this.timezones;
}
- Timezone.prototype.getTimeZoneInfo = function(timeZone)
+ Timezone.prototype.getTimeZoneInfo = function (timeZone)
{
if (timeZone == "UTC")
{
- return {
- "id" : "UTC",
- "name" : "UTC",
- "offset" : 0
- }
+ return {
+ "id": "UTC",
+ "name": "UTC",
+ "offset": 0
+ }
}
var tzi = this[timeZone];
if (!tzi)
{
- var data = this.timezones;
- for(var i = 0; i < data.length; i++)
- {
- var zone = data[i];
- if (zone.id == timeZone)
+ var data = this.timezones;
+ for (var i = 0; i < data.length; i++)
{
- tzi = zone;
- this[timeZone] = zone;
- break;
+ var zone = data[i];
+ if (zone.id == timeZone)
+ {
+ tzi = zone;
+ this[timeZone] = zone;
+ break;
+ }
}
- }
}
return tzi;
}
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js?rev=1741609&r1=1741608&r2=1741609&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/common/updater.js Fri Apr 29 11:04:40 2016
@@ -18,51 +18,55 @@
* under the License.
*
*/
-define([], function () {
+define([], function ()
+{
var updateList = new Array();
function invokeUpdates()
{
- for(var i = 0; i < updateList.length; i++)
- {
- var obj = updateList[i];
- obj.update();
- }
+ for (var i = 0; i < updateList.length; i++)
+ {
+ var obj = updateList[i];
+ obj.update();
+ }
}
- var updatePeriod = 5;
+ var updatePeriod = 5;
var timer = setInterval(invokeUpdates, updatePeriod * 1000);
var updateIntervalListener = {
- onPreferencesChange: function(preferences)
+ onPreferencesChange: function (preferences)
{
- if (preferences.updatePeriod && preferences.updatePeriod != updatePeriod)
- {
- updatePeriod = preferences.updatePeriod;
- clearInterval(timer);
- timer = setInterval(invokeUpdates, updatePeriod * 1000);
- }
+ if (preferences.updatePeriod && preferences.updatePeriod != updatePeriod)
+ {
+ updatePeriod = preferences.updatePeriod;
+ clearInterval(timer);
+ timer = setInterval(invokeUpdates, updatePeriod * 1000);
+ }
}
};
-
return {
- registerUpdateIntervalListener: function(userPreferences)
+ registerUpdateIntervalListener: function (userPreferences)
+ {
+ userPreferences.addListener(updateIntervalListener);
+ },
+ add: function (obj)
+ {
+ updateList.push(obj);
+ },
+
+ remove: function (obj)
+ {
+ for (var i = 0; i < updateList.length; i++)
{
- userPreferences.addListener(updateIntervalListener);
- },
- add: function(obj) {
- updateList.push(obj);
- },
-
- remove: function(obj) {
- for(var i = 0; i < updateList.length; i++) {
- if(updateList[i] === obj) {
- updateList.splice(i,1);
- return;
- }
+ if (updateList[i] === obj)
+ {
+ updateList.splice(i, 1);
+ return;
}
}
- };
+ }
+ };
});
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org