modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
| 12 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
| 18 +++++-----
2 files changed, 17 insertions(+), 13 deletions(-)
New commits:
commit 12317968d83d7ca408b01e7b9715364215fd5907
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon Sep 30 16:23:01 2013 +0200
Bug 1013489 - It is not possible to download an agent from RHQ server (HTTP Status
404)
Fixed 'Downloads' page broken links
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
index 950b57d..5f3b9b6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.admin;
@@ -53,6 +53,8 @@ public class DownloadsView extends EnhancedVLayout {
public static final String VIEW_PATH = AdministrationView.VIEW_ID + "/"
+ AdministrationView.SECTION_CONFIGURATION_VIEW_ID + "/" + VIEW_ID;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private final SystemGWTServiceAsync systemManager =
GWTServiceLookup.getSystemService();
private SectionStack sectionStack;
@@ -143,7 +145,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("agentLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a
href=\"/agentupdate/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/agentupdate/download\">"
+ MSG.view_admin_downloads_agent_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("agentSpacer");
@@ -194,7 +196,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("cliLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a
href=\"/client/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/client/download\">"
+ MSG.view_admin_downloads_cli_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("clientSpacer");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index 168522d..9792b5f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
@@ -48,6 +48,8 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
private static final long serialVersionUID = 1L;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private SystemManagerLocal systemManager = LookupUtil.getSystemManager();
private AgentManagerLocal agentManager = LookupUtil.getAgentManager();
private RemoteClientManagerLocal remoteClientManager =
LookupUtil.getRemoteClientManager();
@@ -136,7 +138,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> map = new HashMap<String,
String>(files.size());
for (File file : files) {
// key is the filename, value is the relative URL to download the file
from the server
- map.put(file.getName(), "/downloads/connectors/" +
file.getName());
+ map.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/connectors/" + file.getName());
}
return map;
} catch (Throwable t) {
@@ -156,7 +158,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/cli-alert-scripts/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/cli-alert-scripts/" + file.getName());
}
return ret;
}
@@ -176,7 +178,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/script-modules/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/script-modules/" + file.getName());
}
return ret;
}
@@ -205,7 +207,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
}
File file = files.get(0);
HashMap<String, String> ret = new HashMap<String, String>(1);
- ret.put(file.getName(), "/downloads/bundle-deployer/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/bundle-deployer/" + file.getName());
return ret;
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -297,4 +299,4 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
}
return map;
}
-}
\ No newline at end of file
+}