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 | |
| 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')
| -rw-r--r-- | qpid/java/broker-core/src/main/resources/system.properties | 20 | ||||
| -rw-r--r-- | qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js | 29 |
2 files changed, 34 insertions, 15 deletions
diff --git a/qpid/java/broker-core/src/main/resources/system.properties b/qpid/java/broker-core/src/main/resources/system.properties index e69de29bb2..202d31e042 100644 --- a/qpid/java/broker-core/src/main/resources/system.properties +++ b/qpid/java/broker-core/src/main/resources/system.properties @@ -0,0 +1,20 @@ +# +# 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. +# + +qpid.helpURL = http://qpid.apache.org/releases/qpid-0.32-SNAPSHOT/java-broker/book
\ No newline at end of file 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() |
