diff options
| author | Keith Wall <kwall@apache.org> | 2014-11-14 14:36:21 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-11-14 14:36:21 +0000 |
| commit | b5ac18e452948cb0498ddfc821deaec180fcb9ba (patch) | |
| tree | 809cdb48475296dce21db4b8621a6ab831a2ce28 /qpid/java/broker-plugins | |
| parent | 39e17735f25a8c22c6f16c7a9ff6a3f4859f3f0a (diff) | |
| download | qpid-python-b5ac18e452948cb0498ddfc821deaec180fcb9ba.tar.gz | |
QPID-6227: [Java Broker] Refactor ConsoleHelper.js to avoid the need to hardcode docbook urls by reading url from context
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1639650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
| -rw-r--r-- | qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js index 9ff8afeaa9..9cebf48ce6 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js @@ -20,10 +20,8 @@ */ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr) { - var qpidHelpLocation = "http://qpid.apache.org/releases/qpid-"; var preferencesDialog = null; var helpURL = null; - var qpidVersion = null; return { showPreferencesDialog: function () { @@ -41,26 +39,27 @@ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr) { preferencesDialog.showDialog(); } }, - getVersion: function() + getHelpUrl: function() { - if (!qpidVersion) + if (!helpURL) { xhr.get({ sync: true, - url: "service/helper?action=version", + url: "api/latest/broker", + content: { "depth" : 1, "includeSysContext" : true }, handleAs: "json" - }).then(function(version) { - qpidVersion = version; + }).then(function(data) { + var broker = data[0]; + if ("context" in broker && "qpid.helpURL" in broker["context"] ) + { + helpURL = broker["context"]["qpid.helpURL"]; + } + else + { + helpURL = "http://qpid.apache.org/"; + } }); } - return qpidVersion; - }, - getHelpUrl: function() - { - if (!helpURL) - { - helpURL = qpidHelpLocation + this.getVersion() + "/java-broker/book/index.html"; - } return helpURL; }, showHelp: function() |
