Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED199CDCD for ; Fri, 14 Nov 2014 14:36:45 +0000 (UTC) Received: (qmail 40253 invoked by uid 500); 14 Nov 2014 14:36:45 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 40221 invoked by uid 500); 14 Nov 2014 14:36:45 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 40212 invoked by uid 99); 14 Nov 2014 14:36:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 14:36:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 14:36:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C302F2388B34; Fri, 14 Nov 2014 14:36:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1639650 - in /qpid/trunk/qpid/java: broker-core/src/main/resources/system.properties broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js Date: Fri, 14 Nov 2014 14:36:21 -0000 To: commits@qpid.apache.org From: kwall@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141114143621.C302F2388B34@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwall Date: Fri Nov 14 14:36:21 2014 New Revision: 1639650 URL: http://svn.apache.org/r1639650 Log: QPID-6227: [Java Broker] Refactor ConsoleHelper.js to avoid the need to hardcode docbook urls by reading url from context Modified: qpid/trunk/qpid/java/broker-core/src/main/resources/system.properties qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js Modified: qpid/trunk/qpid/java/broker-core/src/main/resources/system.properties URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/resources/system.properties?rev=1639650&r1=1639649&r2=1639650&view=diff ============================================================================== --- qpid/trunk/qpid/java/broker-core/src/main/resources/system.properties (original) +++ qpid/trunk/qpid/java/broker-core/src/main/resources/system.properties Fri Nov 14 14:36:21 2014 @@ -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 Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js?rev=1639650&r1=1639649&r2=1639650&view=diff ============================================================================== --- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js (original) +++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/ConsoleHelper.js Fri Nov 14 14:36:21 2014 @@ -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 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() --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org