modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java | 158 +++++++++- modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 47 ++ 2 files changed, 190 insertions(+), 15 deletions(-)
New commits: commit adecbd7152e2b41d21cd8a9dc0acb7aedef7ea84 Author: John Mazzitelli mazz@redhat.com Date: Thu Feb 10 16:37:11 2011 -0500
finish the bulk of the downloads page. one thing left to do - get a scrollbar to show up when the section stack overflows
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 eb4274d..e824e46 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 @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.Map;
import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.Overflow; import com.smartgwt.client.types.VisibilityMode; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.LinkItem; @@ -63,6 +64,7 @@ public class DownloadsView extends LocatableVLayout { super(locatorId); setHeight100(); setWidth100(); + setOverflow(Overflow.AUTO);
TitleBar titleBar = new TitleBar(this, MSG.view_adminConfig_downloads(), "global/Download_24.png"); addMember(titleBar); @@ -155,11 +157,94 @@ public class DownloadsView extends LocatableVLayout { }
private void prepareCLISection() { - // TODO Auto-generated method stub + systemManager.getClientVersionProperties(new AsyncCallback<HashMap<String, String>>() { + @Override + public void onSuccess(HashMap<String, String> result) { + String version = result.get("rhq-server.version"); + String build = result.get("rhq-server.build-number"); + String md5 = result.get("rhq-client.md5"); + + LocatableDynamicForm form = new LocatableDynamicForm(extendLocatorId("cliForm")); + form.setMargin(10); + form.setWidth100(); + + StaticTextItem versionItem = new StaticTextItem("cliVersion", MSG.view_admin_downloads_cli_version()); + versionItem.setValue(version); + versionItem.setWrapTitle(false); + + StaticTextItem buildItem = new StaticTextItem("cliBuild", MSG.view_admin_downloads_cli_buildNumber()); + buildItem.setValue(build); + buildItem.setWrapTitle(false); + + StaticTextItem md5Item = new StaticTextItem("cliMd5", MSG.view_admin_downloads_cli_md5()); + md5Item.setValue(md5); + md5Item.setWrapTitle(false); + + LinkItem linkItem = new LinkItem("cliLink"); + linkItem.setTitle(MSG.view_admin_downloads_cli_link_label()); + linkItem.setLinkTitle(MSG.view_admin_downloads_cli_link_value(version, build)); + linkItem.setValue("/client/download"); + + SpacerItem spacerItem = new SpacerItem("clientSpacer"); + spacerItem.setHeight(1); + + StaticTextItem helpItem = new StaticTextItem("clientHelp"); + helpItem.setColSpan(2); + helpItem.setShowTitle(false); + helpItem.setValue(MSG.view_admin_downloads_cli_help()); + + form.setItems(versionItem, buildItem, md5Item, linkItem, spacerItem, helpItem); + + cliSection.setItems(form); + cliSection.setExpanded(true); + sectionStack.markForRedraw(); + } + + @Override + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError(MSG.view_admin_downloads_cli_loadError(), caught); + } + }); }
private void prepareBundleSection() { - // TODO Auto-generated method stub + systemManager.getBundleDeployerDownload(new AsyncCallback<HashMap<String, String>>() { + @Override + public void onSuccess(HashMap<String, String> result) { + LocatableDynamicForm form = new LocatableDynamicForm(extendLocatorId("bundleForm")); + form.setMargin(10); + form.setWidth100(); + + // there is only one item in the returned map - key=name, value=url + String name = result.keySet().iterator().next(); + String url = result.values().iterator().next(); + + LinkItem linkItem = new LinkItem("bundleLink"); + linkItem.setTitle(MSG.view_admin_downloads_bundle_link_label()); + linkItem.setLinkTitle(MSG.view_admin_downloads_bundle_link_value(name)); + linkItem.setValue(url); + + SpacerItem spacerItem = new SpacerItem("bundleSpacer"); + spacerItem.setHeight(1); + + StaticTextItem helpItem = new StaticTextItem("bundleHelp"); + helpItem.setColSpan(2); + helpItem.setShowTitle(false); + helpItem.setValue(MSG.view_admin_downloads_bundle_help()); + + form.setItems(linkItem, spacerItem, helpItem); + + bundleSection.setItems(form); + bundleSection.setExpanded(true); + sectionStack.markForRedraw(); + } + + @Override + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError(MSG.view_admin_downloads_bundle_loadError(), caught); + } + }); + }
private void prepareConnectorsSection() { diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties index b0c7264..aaf8bb6 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties @@ -716,12 +716,12 @@ view_admin_downloads_cliDownload = Command Line Client Download view_admin_downloads_bundleDownload = Bundle Deployer Download view_admin_downloads_connectorsDownload = Connectors Download
+view_admin_downloads_agent_loadError = Cannot get agent version info view_admin_downloads_agent_version = Agent Version view_admin_downloads_agent_buildNumber = Agent Build view_admin_downloads_agent_md5 = Agent MD5 view_admin_downloads_agent_link_label = Link view_admin_downloads_agent_link_value = Download Agent {0} ({1}) -view_admin_downloads_agent_loadError = Cannot get agent version info view_admin_downloads_agent_help = <p> \ This is the RHQ Agent Update Binary jar file. The purpose of this \ jar file is to allow you to install a fresh agent on a machine \ @@ -743,14 +743,31 @@ view_admin_downloads_agent_help = <p> \ </p>
view_admin_downloads_cli_loadError = Cannot get CLI version info +view_admin_downloads_cli_version = CLI Version +view_admin_downloads_cli_buildNumber = CLI Build +view_admin_downloads_cli_md5 = CLI MD5 +view_admin_downloads_cli_link_label = Link +view_admin_downloads_cli_link_value = Download CLI {0} ({1}) +view_admin_downloads_cli_help = <p> \ + This is the Command Line Client tool, otherwise known as the CLI. \ + It is a standalone tool that runs from within a console and provides a \ + command line interface to the RHQ Server. You can invoke commands via the CLI \ + as well as run scripts to perform automated tasks. See the documentation for \ + more information on how to install and use the CLI. \ + </p>
view_admin_downloads_bundle_loadError = Cannot get bundle deployer info +view_admin_downloads_bundle_link_label = Link +view_admin_downloads_bundle_link_value = Download Bundle Deployer {0} +view_admin_downloads_bundle_help = <p> \ + This is the Bundle Deployer tool. It is for use by developers and packagers of RHQ bundles. \ + This standalone tool allows you to test your bundles and their recipes from a console. \ + </p>
view_admin_downloads_connectors_loadError = Cannot get connectors info view_admin_downloads_connectors_none = No connectors are available for download view_admin_downloads_connectors_help = Connectors are software that is needed in order for some products to be manageable by RHQ. You install connectors into some managed products so RHQ agents can talk to them. See the documentation for more information.
- #==================== Alerts ====================== view_alerts_table_title_group = Group Alert History view_alerts_table_title_resource = Resource Alert History
commit d3774fec9244fafc3c34dd31de663a6da697b5d1 Author: John Mazzitelli mazz@redhat.com Date: Thu Feb 10 16:05:35 2011 -0500
add some help text add connectors
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 69c9bdc..eb4274d 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 @@ -20,11 +20,13 @@ package org.rhq.enterprise.gui.coregui.client.admin;
import java.util.HashMap; +import java.util.Map;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.VisibilityMode; -import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.LinkItem; +import com.smartgwt.client.widgets.form.fields.SpacerItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.layout.SectionStackSection;
@@ -130,7 +132,15 @@ public class DownloadsView extends LocatableVLayout { linkItem.setLinkTitle(MSG.view_admin_downloads_agent_link_value(version, build)); linkItem.setValue("/agentupdate/download");
- form.setItems(versionItem, buildItem, md5Item, linkItem); + SpacerItem spacerItem = new SpacerItem("agentSpacer"); + spacerItem.setHeight(10); + + StaticTextItem helpItem = new StaticTextItem("agentHelp"); + helpItem.setColSpan(2); + helpItem.setShowTitle(false); + helpItem.setValue(MSG.view_admin_downloads_agent_help()); + + form.setItems(versionItem, buildItem, md5Item, linkItem, spacerItem, helpItem);
agentSection.setItems(form); agentSection.setExpanded(true); @@ -139,7 +149,7 @@ public class DownloadsView extends LocatableVLayout {
@Override public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Cannot get agent version info", caught); + CoreGUI.getErrorHandler().handleError(MSG.view_admin_downloads_agent_loadError(), caught); } }); } @@ -153,16 +163,51 @@ public class DownloadsView extends LocatableVLayout { }
private void prepareConnectorsSection() { - // TODO Auto-generated method stub - } + systemManager.getConnectorDownloads(new AsyncCallback<HashMap<String, String>>() { + @Override + public void onSuccess(HashMap<String, String> result) { + LocatableDynamicForm form = new LocatableDynamicForm(extendLocatorId("connectors")); + form.setMargin(10); + form.setWidth100();
- @Deprecated - private void cleanSectionStackSection(SectionStackSection section) { - Canvas[] items = section.getItems(); - if (items != null) { - for (Canvas canvas : items) { - canvas.destroy(); + if (result != null && !result.isEmpty()) { + int i = 0; + FormItem[] items = new FormItem[result.size() + 1]; + + StaticTextItem helpText = new StaticTextItem("connectorHelp"); + helpText.setColSpan(2); + helpText.setShowTitle(false); + helpText.setValue(MSG.view_admin_downloads_connectors_help()); + items[i] = helpText; + i++; + + for (Map.Entry<String, String> entry : result.entrySet()) { + LinkItem linkItem = new LinkItem("connectorLink" + i); + linkItem.setColSpan(2); + linkItem.setShowTitle(false); + linkItem.setLinkTitle(entry.getKey()); + linkItem.setValue(entry.getValue()); + items[i] = linkItem; + i++; + } + form.setItems(items); + } else { + StaticTextItem item = new StaticTextItem("noConnectors"); + item.setColSpan(2); + item.setShowTitle(false); + item.setValue(MSG.view_admin_downloads_connectors_none()); + form.setItems(item); + } + + connectorsSection.setItems(form); + connectorsSection.setExpanded(true); + sectionStack.markForRedraw(); } - } + + @Override + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError(MSG.view_admin_downloads_connectors_loadError(), caught); + } + }); } } diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties index 5662e52..b0c7264 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties @@ -721,6 +721,34 @@ view_admin_downloads_agent_buildNumber = Agent Build view_admin_downloads_agent_md5 = Agent MD5 view_admin_downloads_agent_link_label = Link view_admin_downloads_agent_link_value = Download Agent {0} ({1}) +view_admin_downloads_agent_loadError = Cannot get agent version info +view_admin_downloads_agent_help = <p> \ + This is the RHQ Agent Update Binary jar file. The purpose of this \ + jar file is to allow you to install a fresh agent on a machine \ + where an agent does not yet exist and to allow you to update \ + an agent that is already installed on a machine. \ + For more details, run this agent download jar with the --help command line option:<br/> \ + <b>java -jar <agent-download.jar> --help</b> \ + </p> \ + <h3>Agent Install</h3> \ + <p> \ + <b>java -jar <agent-download.jar> --install[=<new agent directory>]</b><br/> \ + This command will install a new agent. If you do not specify the new agent directory, the default will be "." \ + </p> \ + <h3>Agent Update</h3> \ + <p> \ + <b>java -jar <agent-download.jar> --update[=<old agent home>]</b><br/> \ + This will update an existing agent that was already installed. \ + If you do not specify the directory where the old, existing agent was installed, it will assumed to be "rhq-agent". \ + </p> + +view_admin_downloads_cli_loadError = Cannot get CLI version info + +view_admin_downloads_bundle_loadError = Cannot get bundle deployer info + +view_admin_downloads_connectors_loadError = Cannot get connectors info +view_admin_downloads_connectors_none = No connectors are available for download +view_admin_downloads_connectors_help = Connectors are software that is needed in order for some products to be manageable by RHQ. You install connectors into some managed products so RHQ agents can talk to them. See the documentation for more information.
#==================== Alerts ======================
rhq-commits@lists.fedorahosted.org