modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadCrumb.java
| 116 +---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
| 110 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
| 128 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Presenter.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UnknownViewException.java
| 47 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/View.java
| 81 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewId.java
| 119 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewRenderer.java
| 36 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
| 288 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/report/InventorySummaryReportView.java
| 35 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
| 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourcesView.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java
| 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
| 86 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
| 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/places/Place.java
| 4
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/report/resourceInstallReport-body.xhtml
| 93 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-layout.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
| 4
25 files changed, 965 insertions(+), 269 deletions(-)
New commits:
commit b8e74ea0b436305d25b13cbe5df6d81d93c5b824
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Mon Mar 1 13:33:35 2010 -0500
implement Administration>Reports>Inventory Summary page (loads JSF page via
IFRAME); revamp history/breadcrumb API
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadCrumb.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadCrumb.java
index 2f5a744..c57c352 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadCrumb.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadCrumb.java
@@ -18,105 +18,89 @@
*/
package org.rhq.enterprise.gui.coregui.client;
-import org.rhq.enterprise.gui.coregui.client.places.Place;
-
-import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Hyperlink;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.HTMLPane;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.layout.HLayout;
-import com.smartgwt.client.widgets.layout.HStack;
import java.util.ArrayList;
+import java.util.List;
/**
+ * GWT widget for the breadcrumb trail, which is displayed at the top of each page.
+ *
* @author Greg Hinkle
+ * @author Ian Springer
*/
public class BreadCrumb extends HTMLPane {
- private ArrayList<Place> trail = new ArrayList<Place>();
+ private List<Breadcrumb> breadcrumbs = new ArrayList<Breadcrumb>();
public BreadCrumb() {
-
setHeight(28);
setBackgroundColor("#E6E3E3");
setPadding(5);
setOverflow(Overflow.CLIP_V);
}
-
- public void initialize(String historyPath) {
- String[] ids =historyPath.split("\\/");
-
- for (String id : ids) {
- trail.add(new Place(id,"?"));
- }
-
+ public List<Breadcrumb> getBreadcrumbs() {
+ return this.breadcrumbs;
}
- public void verify(String historyPath) {
- String[] ids = historyPath.split("\\/");
+ public void setBreadcrumbs(List<Breadcrumb> breadcrumbs) {
+ this.breadcrumbs = breadcrumbs;
+ }
- for (int i = 0; i < ids.length; i++) {
- if (trail.size() > i && !trail.get(i).getId().equals(ids[i])) {
- trail = new ArrayList(trail.subList(0,i));
- trail.add(new Place(ids[i], "?"));
- } else {
- if (trail.size() > i) {
- trail.set(i,new Place(ids[i],"?"));
+ public void refresh() {
+ try {
+ boolean first = true;
+ StringBuilder path = new StringBuilder();
+ StringBuilder content = new StringBuilder();
+ content.append("<div class=\"BreadCrumb\">");
+ for (int i = 0, trailSize = this.breadcrumbs.size(); i < trailSize; i++)
{
+ if (!first) {
+ path.append("/");
+ content.append(" > ");
} else {
- trail.add(new Place(ids[i],"?"));
+ first = false;
}
- }
- }
- }
+ Breadcrumb breadcrumb = breadcrumbs.get(i);
+ path.append(breadcrumb.getName());
-
- public void setPlace(Place place) {
- trail.clear();
- addPlace(place);
- }
-
- public void addPlace(Place place) {
- trail.add(place);
-
- refresh();
- }
-
- public void refresh() {
- String content = "";
- boolean first = true;
-
- String path = "";
- for (Place place : trail) {
- if (!first) {
- content += " > ";
- }
- first = false;
- if (path.length() > 0) {
- path += "/";
+ if ((i == (trailSize - 1) || !breadcrumb.isHyperlink())) {
+ // last item in trail is the current page and so should not be a
link
+ content.append(breadcrumb.getDisplayName());
+ } else {
+ content.append("<a href=\"#");
+ // NOTE: We have to call toString() below, because GWT chokes if you
try to append a StringBuilder.
+ content.append(path.toString());
+ content.append("\">");
+ content.append(breadcrumb.getDisplayName());
+ content.append("</a>");
+ }
+ content.append("\n");
}
- path += place.getId();
-
+ content.append("</div>");
- content += "<a class=\"BreadCrumb\" href=\"#" +
path + "\">" + place.getName() + "</a>";
+ setContents(content.toString());
+ } catch (Throwable t) {
+ System.err.println("Failed to refresh bread crumb HTML - cause: " +
t);
}
- setContents(content);
-
- History.newItem(path);
- if (!trail.isEmpty())
- Window.setTitle("RHQ: " + trail.get(trail.size()-1));
+ String title = "RHQ";
+ if (!breadcrumbs.isEmpty()) {
+ title += ": " + this.breadcrumbs.get(this.breadcrumbs.size() - 1);
+ }
+ Window.setTitle(title);
redraw();
}
-
- public ArrayList<Place> getTrail() {
- return trail;
+ @Override
+ public String toString() {
+ StringBuilder result = new StringBuilder("BreadCrumb[");
+ result.append(this.breadcrumbs);
+ result.append("]");
+ return result.toString();
}
-
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
new file mode 100644
index 0000000..4d61b96
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
@@ -0,0 +1,110 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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.
+ */
+package org.rhq.enterprise.gui.coregui.client;
+
+/**
+ * Information about a breadcrumb (i.e. history token component) that is used to render
that breadcrumb in the
+ * breadcrumb trail at the top of the page.
+ *
+ * @author Ian Springer
+ */
+public class Breadcrumb {
+ private String name;
+ private String displayName;
+ private boolean hyperlink;
+
+ public Breadcrumb(String name) {
+ this(name, null);
+ }
+
+ public Breadcrumb(String name, String displayName) {
+ this(name, displayName, true);
+ }
+
+ public Breadcrumb(String name, boolean hyperlink) {
+ this(name, null, hyperlink);
+ }
+
+ public Breadcrumb(String name, String displayName, boolean hyperlink) {
+ if (name == null) {
+ throw new IllegalArgumentException("Name is null.");
+ }
+ this.name = name;
+ setDisplayName(displayName);
+ this.hyperlink = hyperlink;
+ }
+
+ /**
+ * Returns this breadcrumb's name (e.g. "10001").
+ *
+ * @return this breadcrumb's name (e.g. "10001")
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Returns the display name to use for this breadcrumb in the breadcrumb trail, or
null if the display name should
+ * be derived from the name.
+ *
+ * @return the display name to use for this breadcrumb in the breadcrumb trail, or
null if the display name should
+ * be derived from the name
+ */
+ public String getDisplayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Sets the display name to use for this breadcrumb in the breadcrumb trail, or null
if the display name should
+ * be derived from the name.
+ */
+ public void setDisplayName(String displayName) {
+ this.displayName = (displayName != null) ? displayName :
getDefaultDisplayName();
+ }
+
+ /**
+ * Return true if this breadcrumb should be a hyperlink in the breadcrumb trail, or
false otherwise. NOTE:
+ * Regardless of what this method returns, if this breadcrumb is the last item in the
breadcrumb trail, it
+ * will not be made a hyperlink, since it already corresponds to the current view.
+ *
+ * @return true if this breadcrumb should be a hyperlink in the breadcrumb trail, or
false otherwise
+ */
+ public boolean isHyperlink() {
+ return this.hyperlink;
+ }
+
+ @Override
+ public String toString() {
+ return this.name;
+ }
+
+ private String getDefaultDisplayName() {
+ StringBuilder displayName = new StringBuilder();
+ boolean first = true;
+ for (int i = 0; i < this.name.length(); i++) {
+ char c = this.name.charAt(i);
+ if (Character.isUpperCase(c) && !first) {
+ displayName.append(" ");
+ }
+ first = false;
+ displayName.append(c);
+ }
+ return displayName.toString();
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 9b081c0..3ab6790 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -8,7 +8,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourcesView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView;
import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
-import org.rhq.enterprise.gui.coregui.client.places.Place;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
import com.google.gwt.core.client.EntryPoint;
@@ -33,6 +32,9 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.VLayout;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
/**
@@ -43,7 +45,7 @@ public class CoreGUI implements EntryPoint {
public static final String CONTENT_CANVAS_ID = "BaseContent";
private static Subject sessionSubject;
- private static Subject fullSubject;
+ //private static Subject fullSubject;
private static ErrorHandler errorHandler = new ErrorHandler();
@@ -51,6 +53,8 @@ public class CoreGUI implements EntryPoint {
private static Canvas content;
+ private View rootView;
+
public void onModuleLoad() {
if (!GWT.isScript()) {
@@ -118,9 +122,9 @@ public class CoreGUI implements EntryPoint {
private void buildCoreUI() {
- VLayout layout = new VLayout();
- layout.setWidth100();//(1200);
- layout.setHeight100(); //(900);
+ RootCanvas rootCanvas = new RootCanvas();
+ this.rootView = new View(new ViewId("", null), rootCanvas);
+
// HTMLPane menuPane = new HTMLPane();
// menuPane.setWidth100();
@@ -139,12 +143,12 @@ public class CoreGUI implements EntryPoint {
// menuCanvas.setWidth100();
// menuCanvas.draw();
- layout.addMember(menuBarView);
+ rootCanvas.addMember(menuBarView);
breadCrumb = new BreadCrumb();
- layout.addMember(breadCrumb);
+ rootCanvas.addMember(breadCrumb);
DOM.setInnerHTML(RootPanel.get("Loading-Panel").getElement(),
"");
@@ -154,34 +158,53 @@ public class CoreGUI implements EntryPoint {
canvas.setWidth100();
canvas.setHeight100();
- layout.addMember(canvas);
+ rootCanvas.addMember(canvas);
// canvas.addChild(new AdministrationView()) ; //DemoCanvas());
- layout.draw();
-
-
- breadCrumb.initialize(History.getToken());
-
+ rootCanvas.draw();
History.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent<String> historyChangeEvent)
{
- System.out.println("History request: " +
historyChangeEvent.getValue());
-
+ String path = historyChangeEvent.getValue();
+ System.out.println("History request: " + path);
+
+ List<String> viewIdNames = path.equals("") ?
Collections.<String>emptyList() : Arrays.asList(path.split("\\/"));
+
+ View parentView = CoreGUI.this.rootView;
+ ViewRenderer viewRenderer = (ViewRenderer)parentView.getCanvas();
+ List<Breadcrumb> breadcrumbs = new
ArrayList<Breadcrumb>(viewIdNames.size());
+ try {
+ for (String viewIdName : viewIdNames) {
+ Canvas parentCanvas = parentView.getCanvas();
+ if (parentCanvas != null && parentCanvas instanceof
ViewRenderer) {
+ viewRenderer = (ViewRenderer)parentCanvas;
+ }
+ ViewId viewId = new ViewId(viewIdName, parentView.getId());
+ parentView = viewRenderer.renderView(parentView, viewId);
+ breadcrumbs.add(parentView.getBreadcrumb());
+ }
+ } catch (UnknownViewException e) {
+ // Abort the for-loop, since once we hit an unknown name, we
don't care about any remaining names
+ // in the list. The breadcrumbs list will contain breadcrumbs for
only the names that were
+ // recognized.
+ System.err.println(e.getMessage());
+ }
- breadCrumb.verify(historyChangeEvent.getValue());
+ System.out.println("Breadcrumbs: " + breadcrumbs);
+ breadCrumb.setBreadcrumbs(breadcrumbs);
+ /*breadCrumb.initialize(path);
ArrayList<Place> trail = breadCrumb.getTrail();
Place base = trail.get(0);
-
if (content != null && content instanceof Presenter) {
Presenter p = ((Presenter) content);
if (!p.fireDisplay(base, trail.subList(1, trail.size()))) {
- Canvas c = displayContent(base.getId());
+ Canvas c = createContent(base.getId());
setContent(c);
if (trail.size() >= 2 && c instanceof Presenter) {
@@ -189,32 +212,36 @@ public class CoreGUI implements EntryPoint {
}
}
} else {
- Canvas c = displayContent(base.getId());
+ Canvas c = createContent(base.getId());
setContent(c);
if (trail.size() >= 2 && c instanceof Presenter) {
((Presenter) c).fireDisplay(trail.get(0), trail.subList(1,
trail.size()));
}
- }
+ }*/
+
+ breadCrumb.refresh();
}
});
History.fireCurrentHistoryState();
}
- public Canvas displayContent(String key) {
- Canvas c = null;
- if (key.equals("Administration")) {
- c = new AdministrationView();
- } else if (key.equals("Demo")) {
- c = new DemoCanvas();
- } else if (key.equals("Resources")) {
- c = new ResourcesView();
- } else if (key.equals("Resource")) {
- c = new ResourceView();
- } else if (key.equals("Dashboard")) {
- c = new DashboardView();
+ public Canvas createContent(String breadcrumbName) {
+ Canvas canvas;
+ if (breadcrumbName.equals("Administration")) {
+ canvas = new AdministrationView();
+ } else if (breadcrumbName.equals("Demo")) {
+ canvas = new DemoCanvas();
+ } else if (breadcrumbName.equals("Resources")) {
+ canvas = new ResourcesView();
+ } else if (breadcrumbName.equals("Resource")) {
+ canvas = new ResourceView();
+ } else if (breadcrumbName.equals("Dashboard")) {
+ canvas = new DashboardView();
+ } else {
+ canvas = null;
}
- return c;
+ return canvas;
}
@@ -250,16 +277,41 @@ public class CoreGUI implements EntryPoint {
contentCanvas.draw();
}
- public static void addBreadCrumb(Place place) {
- breadCrumb.addPlace(place);
+ public static void goTo(String path) {
+ History.newItem(path, true);
+ }
+ public static void updateBreadCrumbDisplayName(ViewId viewId, String displayName) {
+ int index = -1;
+ for (ViewId current = viewId.getParent(); current != null; current =
current.getParent()) {
+ index++;
+ }
+ List<Breadcrumb> breadcrumbs = breadCrumb.getBreadcrumbs();
+ if (index < breadcrumbs.size()) {
+ Breadcrumb breadcrumb = breadcrumbs.get(index);
+ if (breadcrumb.getName().equals(viewId.getName())) {
+ breadcrumbs.set(index, new Breadcrumb(breadcrumb.getName(),
displayName));
+ breadCrumb.refresh();
+ }
+ }
}
- public static void setBreadCrumb(Place place) {
- breadCrumb.setPlace(place);
+ private class RootCanvas extends VLayout implements ViewRenderer {
+ private RootCanvas() {
+ setWidth100(); // (1200);
+ setHeight100(); // (900);
+ }
+ public View renderView(View parentView, ViewId viewId) throws
UnknownViewException {
+ String path = viewId.getPath();
+ Canvas canvas = createContent(path);
+ if (canvas != null) {
+ setContent(canvas);
+ return new View(viewId, canvas);
+ }
+ throw new UnknownViewException(viewId);
+ }
}
-
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
index 0c000b2..4468edf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
@@ -18,11 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client;
-import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.types.TabBarControls;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Presenter.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Presenter.java
index 2f772db..84fa7e5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Presenter.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Presenter.java
@@ -20,19 +20,17 @@ package org.rhq.enterprise.gui.coregui.client;
import org.rhq.enterprise.gui.coregui.client.places.Place;
-import com.smartgwt.client.widgets.Canvas;
-
-import java.util.ArrayList;
import java.util.List;
/**
+ * @deprecated replaced by {@link ViewRenderer}
+ *
* @author Greg Hinkle
*/
+@Deprecated
public interface Presenter {
-
- boolean fireDisplay(Place place, List<Place> children);
-
+ boolean fireDisplay(Place baseLocation, List<Place> subLocations);
Place getPlace();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UnknownViewException.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UnknownViewException.java
new file mode 100644
index 0000000..8179b86
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UnknownViewException.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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.
+ */
+package org.rhq.enterprise.gui.coregui.client;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public class UnknownViewException extends Exception {
+ private ViewId viewId;
+ private String message;
+
+ public UnknownViewException(ViewId viewId) {
+ this(viewId, null);
+ }
+
+ public UnknownViewException(ViewId viewId, String message) {
+ this.viewId = viewId;
+ this.message = message;
+ }
+
+ @Override
+ public String getMessage() {
+ String message = "Unknown view id [" + this.viewId + "]";
+ if (this.message != null) {
+ message += ": " + this.message;
+ }
+ return message;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/View.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/View.java
new file mode 100644
index 0000000..6c37f97
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/View.java
@@ -0,0 +1,81 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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.
+ */
+package org.rhq.enterprise.gui.coregui.client;
+
+import com.smartgwt.client.widgets.Canvas;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public class View {
+ private ViewId id;
+ private Canvas canvas;
+ private Breadcrumb breadcrumb;
+
+ public View(ViewId id) {
+ this(id, null, null);
+ }
+
+ public View(ViewId id, Canvas canvas) {
+ this(id, canvas, null);
+ }
+
+ public View(ViewId id, Breadcrumb breadcrumb) {
+ this(id, null, breadcrumb);
+ }
+
+ public View(ViewId id, Canvas canvas, Breadcrumb breadcrumb) {
+ if (id == null) {
+ throw new IllegalArgumentException("Id is null.");
+ }
+ this.id = id;
+ if (breadcrumb != null) {
+ if (!breadcrumb.getName().equals(id.getName())) {
+ throw new IllegalArgumentException("Breadcrumb name is not equal to
id name.");
+ }
+ this.breadcrumb = breadcrumb;
+ } else {
+ this.breadcrumb = new Breadcrumb(id.getName());
+ }
+ this.canvas = canvas;
+ }
+
+ public ViewId getId() {
+ return id;
+ }
+
+ public Canvas getCanvas() {
+ return canvas;
+ }
+
+ public Breadcrumb getBreadcrumb() {
+ return breadcrumb;
+ }
+
+ @Override
+ public String toString() {
+ return "View[" +
+ "id=" + id +
+ ", canvas=" + canvas +
+ ", breadcrumb=" + breadcrumb +
+ ']';
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewId.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewId.java
new file mode 100644
index 0000000..77c7dd6
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewId.java
@@ -0,0 +1,119 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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.
+ */
+package org.rhq.enterprise.gui.coregui.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public class ViewId {
+ public static final char PATH_SEPARATOR = '/';
+ public static final ViewId ROOT_VIEW_ID = new ViewId("", null);
+
+ private String name;
+ private ViewId parent;
+ private String path;
+
+ public ViewId(String name, ViewId parent) {
+ if (name == null) {
+ throw new IllegalArgumentException("Name is null.");
+ }
+ if (name.indexOf(PATH_SEPARATOR) >= 0) {
+ throw new IllegalArgumentException("Name contains illegal character
'" + PATH_SEPARATOR + "'. ");
+ }
+ this.name = name;
+ this.parent = parent;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public ViewId getParent() {
+ return this.parent;
+ }
+
+ public String getPath() {
+ if (this.path == null) {
+ StringBuilder buffer = new StringBuilder();
+ List<String> names = new ArrayList<String>(5);
+ ViewId current = this;
+ do {
+ names.add(0, current.getName());
+ current = current.getParent();
+ } while (current != null &&
!current.getName().equals(ROOT_VIEW_ID.getName()));
+ boolean first = true;
+ for (String name : names) {
+ if (first) {
+ first = false;
+ } else {
+ buffer.append(PATH_SEPARATOR);
+ }
+ buffer.append(name);
+ }
+ this.path = buffer.toString();
+ }
+ return this.path;
+ }
+
+ /**
+ *
+ * @param viewId the id of some View that is an ancestor of the View represented by
this id
+ * (i.e. the following must be true:
this.getPath().startsWith(viewId.getPath())
+ * @return the path relative to the specified ancestral view id
+ */
+ public String getPathRelativeTo(ViewId viewId) {
+ if (viewId == null) {
+ throw new IllegalArgumentException("ViewId is null.");
+ }
+ if (!getPath().startsWith(viewId.getPath())) {
+ throw new IllegalArgumentException("ViewId [" + viewId + "] is
not an ancestor of this ViewId [" + this + "]");
+ }
+ if (viewId.getName().equals(ViewId.ROOT_VIEW_ID.getName())) {
+ return getPath();
+ }
+ return getPath().substring(viewId.getPath().length() + 1);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ViewId viewId = (ViewId) o;
+
+ if (!getPath().equals(viewId.getPath())) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return getPath().hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return getPath();
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewRenderer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewRenderer.java
new file mode 100644
index 0000000..f2eb39b
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewRenderer.java
@@ -0,0 +1,36 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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.
+ */
+package org.rhq.enterprise.gui.coregui.client;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public interface ViewRenderer {
+ /**
+ * TODO
+ *
+ * @param parentView
+ * @param viewId
+ * @return
+ * @throws UnknownViewException
+ */
+ View renderView(View parentView, ViewId viewId) throws UnknownViewException;
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 4a3ee93..455b00e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -18,10 +18,15 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin;
+import org.rhq.enterprise.gui.coregui.client.Breadcrumb;
+import org.rhq.enterprise.gui.coregui.client.UnknownViewException;
+import org.rhq.enterprise.gui.coregui.client.View;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewRenderer;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Presenter;
+import org.rhq.enterprise.gui.coregui.client.admin.report.InventorySummaryReportView;
import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView;
-import org.rhq.enterprise.gui.coregui.client.admin.users.UserEditView;
import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
import org.rhq.enterprise.gui.coregui.client.places.Place;
@@ -30,7 +35,6 @@ import com.smartgwt.client.types.VisibilityMode;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.HTMLPane;
-import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -41,17 +45,19 @@ import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
*
* @author Greg Hinkle
*/
-public class AdministrationView extends HLayout implements Presenter {
+public class AdministrationView extends HLayout implements Presenter, ViewRenderer {
private SectionStack sectionStack;
private Canvas contentCanvas;
+ private List<TreeGrid> treeGrids;
@Override
protected void onInit() {
@@ -60,35 +66,33 @@ public class AdministrationView extends HLayout implements Presenter
{
setWidth100();
setHeight100();
-
contentCanvas = new Canvas();
contentCanvas.setWidth("*");
contentCanvas.setHeight100();
-
sectionStack = new SectionStack();
sectionStack.setShowResizeBar(true);
sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
sectionStack.setWidth(250);
sectionStack.setHeight100();
+ this.treeGrids = new ArrayList<TreeGrid>(5);
sectionStack.addSection(buildSecuritySection());
sectionStack.addSection(buildPluginsSection());
sectionStack.addSection(buildManagementClusterSection());
sectionStack.addSection(buildSystemConfigurationSection());
+ sectionStack.addSection(buildReportsSection());
addMember(sectionStack);
addMember(contentCanvas);
-
- setContent(buildLanding());
- CoreGUI.setBreadCrumb(getPlace());
+ setContent(buildLanding());
}
private HTMLFlow buildLanding() {
String contents = "<h1>Administration</h1>\n" +
- "From this section, the RHQ global settings can be administered.
This includeds configuring \n" +
+ "From this section, the RHQ global settings can be administered.
This includes configuring \n" +
"<a href=\"\">Security</a>, setting up <a
href=\"\">Plugins</a> and other stuff.";
HTMLFlow flow = new HTMLFlow(contents);
flow.setPadding(20);
@@ -100,8 +104,9 @@ public class AdministrationView extends HLayout implements Presenter
{
final SectionStackSection section = new
SectionStackSection("Security");
section.setExpanded(true);
- TreeGrid treeGrid = new TreeGrid();
- treeGrid.setShowHeader(false);
+ final TreeGrid securityTreeGrid = new TreeGrid();
+ securityTreeGrid.setShowHeader(false);
+ this.treeGrids.add(securityTreeGrid);
Tree tree = new Tree();
final TreeNode manageUsersNode = new TreeNode("Manage Users");
@@ -112,24 +117,28 @@ public class AdministrationView extends HLayout implements Presenter
{
manageRolesNode,
manageGroups));
- treeGrid.setData(tree);
-
+ securityTreeGrid.setData(tree);
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ securityTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- if (selectionEvent.getRecord() == manageUsersNode) {
- setContent(new UsersView());
- } else if (selectionEvent.getRecord() == manageRolesNode) {
- setContent(new RolesView());
- } else if (selectionEvent.getRecord() == manageGroups) {
- setContent(new RolesView());
+ if (selectionEvent.getState()) {
+ if (selectionEvent.getRecord() == manageUsersNode) {
+ setContent(new UsersView());
+ } else if (selectionEvent.getRecord() == manageRolesNode) {
+ setContent(new RolesView());
+ } else if (selectionEvent.getRecord() == manageGroups) {
+ setContent(new RolesView());
+ }
+ for (TreeGrid treeGrid : treeGrids) {
+ if (treeGrid != securityTreeGrid) {
+ treeGrid.deselectAllRecords();
+ }
+ }
}
}
});
-
- section.addItem(treeGrid);
-
+ section.addItem(securityTreeGrid);
return section;
}
@@ -139,8 +148,9 @@ public class AdministrationView extends HLayout implements Presenter
{
final SectionStackSection section = new SectionStackSection("Management
Cluster");
section.setExpanded(true);
- TreeGrid treeGrid = new TreeGrid();
- treeGrid.setShowHeader(false);
+ final TreeGrid mgmtClusterTreeGrid = new TreeGrid();
+ mgmtClusterTreeGrid.setShowHeader(false);
+ this.treeGrids.add(mgmtClusterTreeGrid);
Tree tree = new Tree();
final TreeNode manageServersNode = new TreeNode("Servers");
@@ -154,34 +164,38 @@ public class AdministrationView extends HLayout implements Presenter
{
manageAffinityGroupsNode,
managePartitionEventsNode));
- treeGrid.setData(tree);
+ mgmtClusterTreeGrid.setData(tree);
-
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ mgmtClusterTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- HTMLPane pane = new HTMLPane();
- pane.setContentsType(ContentsType.PAGE);
- pane.setWidth100();
- pane.setHeight100();
-
- String url = null;
- if (selectionEvent.getRecord() == manageServersNode) {
- url = "/rhq/ha/listServers.xhtml";
- } else if (selectionEvent.getRecord() == manageAgentsNode) {
- url = "/rhq/ha/listAgents.xhtml";
- } else if (selectionEvent.getRecord() == manageAffinityGroupsNode) {
- url = "/rhq/ha/listAffinityGroups.xhtml";
- } else if (selectionEvent.getRecord() == managePartitionEventsNode) {
- url = "/rhq/ha/listPartitionEvents.xhtml";
+ if (selectionEvent.getState()) {
+ HTMLPane pane = new HTMLPane();
+ pane.setContentsType(ContentsType.PAGE);
+ pane.setWidth100();
+ pane.setHeight100();
+
+ String url = null;
+ if (selectionEvent.getRecord() == manageServersNode) {
+ url = "/rhq/ha/listServers.xhtml";
+ } else if (selectionEvent.getRecord() == manageAgentsNode) {
+ url = "/rhq/ha/listAgents.xhtml";
+ } else if (selectionEvent.getRecord() == manageAffinityGroupsNode) {
+ url = "/rhq/ha/listAffinityGroups.xhtml";
+ } else if (selectionEvent.getRecord() == managePartitionEventsNode)
{
+ url = "/rhq/ha/listPartitionEvents.xhtml";
+ }
+ pane.setContentsURL(url + "?nomenu=true");
+ setContent(pane);
+ for (TreeGrid treeGrid : treeGrids) {
+ if (treeGrid != mgmtClusterTreeGrid) {
+ treeGrid.deselectAllRecords();
+ }
+ }
}
- pane.setContentsURL(url + "?nomenu=true");
- setContent(pane);
-
}
});
-
- section.addItem(treeGrid);
+ section.addItem(mgmtClusterTreeGrid);
return section;
}
@@ -190,8 +204,9 @@ public class AdministrationView extends HLayout implements Presenter
{
final SectionStackSection section = new
SectionStackSection("Plugins");
section.setExpanded(true);
- TreeGrid treeGrid = new TreeGrid();
- treeGrid.setShowHeader(false);
+ final TreeGrid pluginsTreeGrid = new TreeGrid();
+ pluginsTreeGrid.setShowHeader(false);
+ this.treeGrids.add(pluginsTreeGrid);
Tree tree = new Tree();
final TreeNode managePlugins = new TreeNode("Plugins");
@@ -199,27 +214,32 @@ public class AdministrationView extends HLayout implements Presenter
{
tree.setRoot(new TreeNode("clustering",
managePlugins));
- treeGrid.setData(tree);
-
+ pluginsTreeGrid.setData(tree);
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ pluginsTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- HTMLPane pane = new HTMLPane();
- pane.setContentsType(ContentsType.PAGE);
- pane.setWidth100();
- pane.setHeight100();
-
- String url = null;
- if (selectionEvent.getRecord() == managePlugins) {
- url = "/rhq/admin/plugin/plugin-list.xhtml";
+ if (selectionEvent.getState()) {
+ HTMLPane pane = new HTMLPane();
+ pane.setContentsType(ContentsType.PAGE);
+ pane.setWidth100();
+ pane.setHeight100();
+
+ String url = null;
+ if (selectionEvent.getRecord() == managePlugins) {
+ url = "/rhq/admin/plugin/plugin-list.xhtml";
+ }
+ pane.setContentsURL(url + "?nomenu=true");
+ setContent(pane);
+ for (TreeGrid treeGrid : treeGrids) {
+ if (treeGrid != pluginsTreeGrid) {
+ treeGrid.deselectAllRecords();
+ }
+ }
}
- pane.setContentsURL(url + "?nomenu=true");
- setContent(pane);
}
});
- section.addItem(treeGrid);
-
+ section.addItem(pluginsTreeGrid);
return section;
}
@@ -229,40 +249,85 @@ public class AdministrationView extends HLayout implements Presenter
{
final SectionStackSection section = new SectionStackSection("System
Configuration");
section.setExpanded(true);
- TreeGrid treeGrid = new TreeGrid();
- treeGrid.setShowHeader(false);
+ final TreeGrid systemConfigTreeGrid = new TreeGrid();
+ systemConfigTreeGrid.setShowHeader(false);
+ this.treeGrids.add(systemConfigTreeGrid);
Tree tree = new Tree();
final TreeNode manageSettings = new TreeNode("System Settings");
final TreeNode manageTemplates = new TreeNode("Templates");
final TreeNode manageLicense = new TreeNode("License");
- tree.setRoot(new TreeNode("clustering",
+ tree.setRoot(new TreeNode("System Configuration",
manageSettings, manageTemplates, manageLicense));
- treeGrid.setData(tree);
+ systemConfigTreeGrid.setData(tree);
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ systemConfigTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- HTMLPane pane = new HTMLPane();
- pane.setContentsType(ContentsType.PAGE);
- pane.setWidth100();
- pane.setHeight100();
-
- String url = null;
- if (selectionEvent.getRecord() == manageSettings) {
- url = "/admin/config/Config.do?mode=edit";
- } else if (selectionEvent.getRecord() == manageTemplates) {
- url =
"/admin/config/EditDefaults.do?mode=monitor&viewMode=all";
+ if (selectionEvent.getState()) {
+ HTMLPane pane = new HTMLPane();
+ pane.setContentsType(ContentsType.PAGE);
+ pane.setWidth100();
+ pane.setHeight100();
+
+ String url = null;
+ if (selectionEvent.getRecord() == manageSettings) {
+ url = "/admin/config/Config.do?mode=edit";
+ } else if (selectionEvent.getRecord() == manageTemplates) {
+ url =
"/admin/config/EditDefaults.do?mode=monitor&viewMode=all";
+ }
+
+ pane.setContentsURL(url + "&nomenu=true");
+ setContent(pane);
+ for (TreeGrid treeGrid : treeGrids) {
+ if (treeGrid != systemConfigTreeGrid) {
+ treeGrid.deselectAllRecords();
+ }
+ }
}
+ }
+ });
- pane.setContentsURL(url + "&nomenu=true");
- setContent(pane);
+ section.addItem(systemConfigTreeGrid);
+
+ return section;
+ }
+
+ private SectionStackSection buildReportsSection() {
+ final SectionStackSection section = new
SectionStackSection("Reports");
+ section.setID("Reports");
+ section.setExpanded(true);
+
+ final TreeGrid reportsTreeGrid = new TreeGrid();
+ reportsTreeGrid.setShowHeader(false);
+ this.treeGrids.add(reportsTreeGrid);
+
+ Tree tree = new Tree();
+ final TreeNode inventorySummaryNode = new TreeNode("Inventory
Summary");
+
+ TreeNode reportsNode = new TreeNode("Reports", inventorySummaryNode);
+ tree.setRoot(reportsNode);
+
+ reportsTreeGrid.setData(tree);
+
+ reportsTreeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ if (selectionEvent.getState()) {
+ HTMLPane pane = new InventorySummaryReportView();
+ setContent(pane);
+ CoreGUI.goTo(InventorySummaryReportView.PATH);
+ for (TreeGrid treeGrid : treeGrids) {
+ if (treeGrid != reportsTreeGrid) {
+ treeGrid.deselectAllRecords();
+ }
+ }
+ }
}
});
- section.addItem(treeGrid);
+ section.addItem(reportsTreeGrid);
return section;
}
@@ -279,11 +344,66 @@ public class AdministrationView extends HLayout implements Presenter
{
}
- public boolean fireDisplay(Place place, List<Place> children) {
- return place.equals(getPlace());
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ try {
+ if (base.equals(getPlace())) {
+ if (!subLocations.isEmpty()) {
+ Place child = subLocations.get(0);
+ String childId = child.getId();
+ if (childId.equals("Reports")) {
+ if (subLocations.size() >= 2) {
+ Place grandchild = subLocations.get(1);
+ String grandchildId = grandchild.getId();
+ if (grandchildId.equals("InventorySummary")) {
+ HTMLPane pane = new InventorySummaryReportView();
+ setContent(pane);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ System.err.println(e);
+ }
+ return false;
}
public Place getPlace() {
return new Place("Administration", "Administration");
}
+
+ public List<Breadcrumb> render(List<String> breadcrumbNames) {
+ if (breadcrumbNames == null || breadcrumbNames.size() < 2) {
+ return Collections.emptyList();
+ }
+ List<Breadcrumb> renderedBreadcrumbs = new
ArrayList<Breadcrumb>(breadcrumbNames.size());
+ String firstBreadcrumbName = breadcrumbNames.get(0);
+ if (firstBreadcrumbName.equals("Reports")) {
+ String secondBreadcrumbName = breadcrumbNames.get(1);
+ if (secondBreadcrumbName.equals("InventorySummary")) {
+ HTMLPane pane = new InventorySummaryReportView();
+ setContent(pane);
+ renderedBreadcrumbs.add(new Breadcrumb("Reports"));
+ renderedBreadcrumbs.add(new Breadcrumb("InventorySummary"));
+ }
+ }
+ return renderedBreadcrumbs;
+ }
+
+ public View renderView(View parentView, ViewId viewId) throws UnknownViewException {
+ String parentPath = viewId.getParent().getPath();
+ if (parentPath.equals("Administration")) {
+ SectionStackSection stackSection =
this.sectionStack.getSection(viewId.getName());
+ if (stackSection != null) {
+ stackSection.setExpanded(true);
+ return new View(viewId, new Breadcrumb(viewId.getName(), false));
+ }
+ } else if (parentPath.equals("Administration/Reports")) {
+ InventorySummaryReportView canvas = new InventorySummaryReportView();
+ setContent(canvas);
+ return new View(viewId, canvas);
+ }
+ throw new UnknownViewException(viewId);
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/report/InventorySummaryReportView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/report/InventorySummaryReportView.java
new file mode 100644
index 0000000..1faeba5
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/report/InventorySummaryReportView.java
@@ -0,0 +1,35 @@
+package org.rhq.enterprise.gui.coregui.client.admin.report;
+
+import com.smartgwt.client.types.ContentsType;
+import com.smartgwt.client.widgets.HTMLPane;
+import org.rhq.enterprise.gui.coregui.client.BreadCrumb;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.Presenter;
+import org.rhq.enterprise.gui.coregui.client.places.Place;
+
+import java.util.List;
+
+/**
+ * @author Ian Springer
+ */
+public class InventorySummaryReportView extends HTMLPane implements Presenter {
+ public static final String PATH =
"Administration/Reports/InventorySummary";
+ public static final Place PLACE = new
Place(PATH.substring(PATH.lastIndexOf('/') + 1), null);
+ private static final String URL =
"/rhq/admin/report/resourceInstallReport-body.xhtml";
+
+ public InventorySummaryReportView() {
+ super();
+ setContentsType(ContentsType.PAGE);
+ setWidth100();
+ setHeight100();
+ setContentsURL(URL);
+ }
+
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ return false;
+ }
+
+ public Place getPlace() {
+ return PLACE;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
index ab78f58..bc88bad 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
@@ -152,8 +152,8 @@ public class RolesView extends VLayout implements Presenter {
}
- public boolean fireDisplay(Place place, List<Place> children) {
- if (!getPlace().equals(place)) {
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ if (!getPlace().equals(base)) {
return false;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
index 1c2b183..b6757ea 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
@@ -159,12 +159,12 @@ public class UsersView extends SectionStack implements Presenter {
}
- public boolean fireDisplay(Place place, List<Place> children) {
- if (!place.equals(getPlace())) {
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ if (!base.equals(getPlace())) {
return false;
}
- if (children.size() > 0) {
- int userId = Integer.parseInt(children.get(0).getId());
+ if (subLocations.size() > 0) {
+ int userId = Integer.parseInt(subLocations.get(0).getId());
}
return true;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 4f78085..ba07d21 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -25,18 +25,14 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
import org.rhq.enterprise.gui.coregui.client.places.Place;
import com.google.gwt.user.client.Random;
-import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.AnimationCallback;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -44,7 +40,6 @@ import java.util.List;
*/
public class DashboardView extends VLayout implements Presenter {
-
private static String[] colors = new String[]{
"FF6600", "808000", "008000",
"008080", "0000FF", "666699",
"FF0000", "FF9900", "99CC00",
"339966", "33CCCC", "3366FF",
@@ -193,8 +188,8 @@ public class DashboardView extends VLayout implements Presenter {
}
- public boolean fireDisplay(Place place, List<Place> children) {
- return place.equals(getPlace());
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ return base.equals(getPlace());
}
public Place getPlace() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourcesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourcesView.java
index ec5bea4..b3bf91f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourcesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourcesView.java
@@ -21,9 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Presenter;
-import org.rhq.enterprise.gui.coregui.client.admin.users.UserEditView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceDetailView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView;
import org.rhq.enterprise.gui.coregui.client.places.Place;
import com.smartgwt.client.types.ContentsType;
@@ -39,7 +36,6 @@ import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -47,10 +43,11 @@ import java.util.List;
*/
public class ResourcesView extends HLayout implements Presenter {
+ public static final String VIEW_PATH = "Resources";
+
private SectionStack sectionStack;
private Canvas contentCanvas;
-
@Override
protected void onInit() {
super.onInit();
@@ -58,12 +55,10 @@ public class ResourcesView extends HLayout implements Presenter {
setWidth100();
setHeight100();
-
contentCanvas = new Canvas();
contentCanvas.setWidth("*");
contentCanvas.setHeight100();
-
sectionStack = new SectionStack();
sectionStack.setShowResizeBar(true);
sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
@@ -77,8 +72,6 @@ public class ResourcesView extends HLayout implements Presenter {
addMember(contentCanvas);
setContent(buildResourceSearchView());
-
- CoreGUI.setBreadCrumb(getPlace());
}
@@ -86,7 +79,8 @@ public class ResourcesView extends HLayout implements Presenter {
ResourceSearchView searchView = new ResourceSearchView();
searchView.addResourceSelectedListener(new ResourceSelectListener() {
public void onResourceSelected(Resource resource) {
- CoreGUI.setContent(new ResourceView(resource));
+ //CoreGUI.setContent(new ResourceView(resource));
+ CoreGUI.goTo("Resource/" + resource.getId());
}
});
return searchView;
@@ -190,13 +184,13 @@ public class ResourcesView extends HLayout implements Presenter {
}
- public boolean fireDisplay(Place place, List<Place> children) {
- if (place.equals(getPlace())) {
- if (!children.isEmpty()) {
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ if (base.equals(getPlace())) {
+ if (!subLocations.isEmpty()) {
if (contentCanvas.getChildren().length > 0) {
Canvas element = contentCanvas.getChildren()[0];
if (element instanceof Presenter) {
- ((Presenter) element).fireDisplay(children.get(0),
children.subList(1, children.size() - 1));
+ ((Presenter) element).fireDisplay(subLocations.get(0),
subLocations.subList(1, subLocations.size() - 1));
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java
index 5fe42be..178043d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java
@@ -20,7 +20,6 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.Resource;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.widgets.tree.TreeGrid;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 0e2a101..f97a858 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -30,16 +30,13 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.places.Place;
-import com.smartgwt.client.types.ContentsType;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
import java.util.EnumSet;
-import java.util.HashMap;
import java.util.List;
/**
@@ -78,13 +75,10 @@ public class ResourceDetailView extends VLayout implements Presenter,
ResourceSe
setWidth100();
setHeight100();
-
-
// The header section
summaryView = new ResourceSummaryView();
summaryPanel = new SimpleCollapsiblePanel("Summary", summaryView);
-
// The Tabs section
topTabSet = new TabSet();
@@ -94,7 +88,6 @@ public class ResourceDetailView extends VLayout implements Presenter,
ResourceSe
topTabSet.setEdgeMarginSize(0);
topTabSet.setEdgeSize(0);
-
summaryTab = new Tab("Summary",
"/images/icons/Service_up_16.png");
monitoringTab = new Tab("Monitoring",
"/images/icons/Monitor_grey_16.png");
inventoryTab = new Tab("Inventory",
"/images/icons/Inventory_grey_16.png");
@@ -104,7 +97,6 @@ public class ResourceDetailView extends VLayout implements Presenter,
ResourceSe
eventsTab = new Tab("Events",
"/images/icons/Events_grey_16.png");
contentTab = new Tab("Content",
"/images/icons/Content_grey_16.png");
-
topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab, eventsTab, contentTab);
title.setContents("Loading...");
@@ -118,9 +110,8 @@ public class ResourceDetailView extends VLayout implements Presenter,
ResourceSe
}
- public boolean fireDisplay(Place place, List<Place> children) {
- if (place.equals(getPlace())) {
-
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
+ if (base.equals(getPlace())) {
}
return true;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index 37ad015..dce0409 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -279,11 +279,18 @@ public class ResourceTreeView extends VLayout {
importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0);
contextMenu.addItem(importChildMenu);
-
-
-
}
+ Resource getResource(int resourceId) {
+ if (this.treeGrid != null && this.treeGrid.getTree() != null) {
+ ResourceTreeDatasource.ResourceTreeNode treeNode =
+ (ResourceTreeDatasource.ResourceTreeNode)
this.treeGrid.getTree().findById(String.valueOf(resourceId));
+ if (treeNode != null) {
+ return treeNode.getResource();
+ }
+ }
+ return null;
+ }
public void setSelectedResource(final Resource selectedResource) {
this.selectedResource = selectedResource;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
index 0299905..aa1f7a9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
@@ -21,11 +21,16 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.Breadcrumb;
+import org.rhq.enterprise.gui.coregui.client.UnknownViewException;
+import org.rhq.enterprise.gui.coregui.client.View;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewRenderer;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Presenter;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourcesView;
import org.rhq.enterprise.gui.coregui.client.places.Place;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -38,14 +43,12 @@ import java.util.List;
/**
* @author Greg Hinkle
*/
-public class ResourceView extends HLayout implements Presenter {
+public class ResourceView extends HLayout implements Presenter, ViewRenderer {
private Canvas contentCanvas;
-
private Resource selectedResource;
- private Resource resourcePlatform;
-
+ //private Resource resourcePlatform;
private ResourceTreeView treeView;
private ResourceDetailView detailView;
@@ -60,7 +63,7 @@ public class ResourceView extends HLayout implements Presenter {
public ResourceView(Resource selectedResource) {
this.selectedResource = selectedResource;
- System.out.println("displaying resource: " + selectedResource);
+ System.out.println("Displaying Resource: " + selectedResource);
}
@Override
@@ -87,15 +90,15 @@ public class ResourceView extends HLayout implements Presenter {
}
- public boolean fireDisplay(Place place, List<Place> children) {
+ public boolean fireDisplay(Place base, List<Place> subLocations) {
try {
- if (place.equals(getPlace())) {
- if (children.size() > 0) {
- Place resourcePlace = children.get(0);
+ if (base.equals(getPlace())) {
+ if (subLocations.size() > 0) {
+ Place resourcePlace = subLocations.get(0);
int resourceId = Integer.parseInt(resourcePlace.getId());
if (selectedResource == null || selectedResource.getId() !=
resourceId) {
- setSelectedResource(resourceId);
+ setSelectedResource(resourceId, null);
}
}
return true;
@@ -108,27 +111,40 @@ public class ResourceView extends HLayout implements Presenter {
}
+ public void setSelectedResource(final int resourceId, final ViewId viewId) {
+ Resource resource = this.treeView.getResource(resourceId);
+ if (resource != null) {
+ setSelectedResource(resource);
+ CoreGUI.updateBreadCrumbDisplayName(viewId, resource.getName());
+ } else {
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(resourceId);
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ SC.say("Failed to load Resource with id " + resourceId +
": " + caught);
+ // TODO: Display this error in a red box at top of page instead?
+ CoreGUI.goTo(ResourcesView.VIEW_PATH);
+ }
- public void setSelectedResource(int resourceId) {
- ResourceCriteria criteria = new ResourceCriteria();
- criteria.addFilterId(resourceId);
- resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
- public void onFailure(Throwable caught) {
- SC.say("failed to load");
- }
-
- public void onSuccess(PageList<Resource> result) {
- Resource res = result.get(0);
- setSelectedResource(res);
- }
- });
+ public void onSuccess(PageList<Resource> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Resource with id [" +
resourceId + "] does not exist."));
+ } else {
+ Resource resource = result.get(0);
+ setSelectedResource(resource);
+ CoreGUI.updateBreadCrumbDisplayName(viewId, resource.getName());
+ }
+ }
+ });
+ }
}
public void setSelectedResource(Resource resource) {
this.selectedResource = resource;
- treeView.setSelectedResource(resource);
- detailView.onResourceSelected(resource);
+ this.treeView.setSelectedResource(resource);
+ this.detailView.onResourceSelected(resource);
}
@@ -143,4 +159,22 @@ public class ResourceView extends HLayout implements Presenter {
contentCanvas.addChild(newContent);
contentCanvas.draw();
}
+
+ public View renderView(View parentView, ViewId viewId) throws UnknownViewException {
+ String path = viewId.getPathRelativeTo(parentView.getId());
+ int resourceId;
+ try {
+ resourceId = Integer.parseInt(path);
+ } catch (NumberFormatException e) {
+ // not a valid Resource id - nothing for us to do
+ throw new UnknownViewException(viewId, "Invalid Resource id [" +
path + "]");
+ }
+ if (this.selectedResource == null || this.selectedResource.getId() != resourceId)
{
+ setSelectedResource(resourceId, viewId);
+ }
+ // Use "..." as temporary display name for breadcrumb. If the Resource
is fetched successfully, the display name
+ // will be updated to be the Resource's name.
+ Breadcrumb breadcrumb = new Breadcrumb(viewId.getName(), "...");
+ return new View(viewId, this.detailView, breadcrumb);
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
index df284fa..2c3a254 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
@@ -29,7 +29,6 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectLi
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.core.java.util.Arrays;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/places/Place.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/places/Place.java
index 4e6a086..cb63156 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/places/Place.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/places/Place.java
@@ -19,8 +19,12 @@
package org.rhq.enterprise.gui.coregui.client.places;
/**
+ * @deprecated replaced by {@link org.rhq.enterprise.gui.coregui.client.View} and
+ * {@link org.rhq.enterprise.gui.coregui.client.Breadcrumb}
+ *
* @author Greg Hinkle
*/
+@Deprecated
public class Place {
private String id;
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index 7211bc6..2011c8c 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -106,7 +106,7 @@ a:hover {
.BreadCrumb {
font-size: 12pt;
- font-weidght: bold;
+ font-weight: bold;
text-decoration: none;
color: darkgray;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/report/resourceInstallReport-body.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/report/resourceInstallReport-body.xhtml
new file mode 100644
index 0000000..65ce5ee
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/report/resourceInstallReport-body.xhtml
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+
+<ui:composition
+ template="/rhq/layout/main.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:rhq="http://rhq-project.org/rhq"
+
xmlns:onc="http://jboss.org/on/component">
+
+ <ui:param name="pageTitle" value="Resource Version Inventory
Report"/>
+ <ui:param name="disableMenu" value="true"/>
+ <ui:param name="disableBreadcrumbs" value="true"/>
+
+ <ui:define name="body">
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Resource Version Inventory
Report"/>
+ </f:facet>
+
+ <h:panelGrid columns="1" width="100%">
+
+ <h:form>
+ <h:selectBooleanCheckbox id="groupByVersion"
value="#{ResourceInstallReportUIBean.groupByVersion}"
+ label="gbvLabel">
+ <a4j:support reRender="reportTable"
event="onclick" status="commonStatus"/>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Group By Version"
id="gbvLabel"/>
+
+ <rich:dataTable
+ id="reportTable"
+
value="#{ResourceInstallReportUIBean.resourceInstallCounts}"
+ var="installReport"
+ width="100%"
+ columnsWidth="15%, 15%, 10%, 10%, 10%"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <rich:column title="Type">
+ <f:facet name="header">
+ Type
+ </f:facet>
+ <h:outputLink value="#Resources"
target="_top">
+ <h:outputText
value="#{installReport.typeName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column title="Plugin">
+ <f:facet name="header">
+ Plugin
+ </f:facet>
+ <h:outputText
value="#{installReport.typePlugin}"/>
+ </rich:column>
+
+ <rich:column title="Category">
+ <f:facet name="header">
+ Category
+ </f:facet>
+ <h:outputText
value="#{installReport.category}"/>
+ </rich:column>
+
+ <rich:column title="Version"
rendered="#{ResourceInstallReportUIBean.groupByVersion}">
+ <f:facet name="header">
+ Version
+ </f:facet>
+ <h:outputText
value="#{installReport.version}"/>
+ </rich:column>
+
+ <rich:column title="Imported Count">
+ <f:facet name="header">
+ Imported Count
+ </f:facet>
+ <h:outputText
value="#{installReport.count}"/>
+ </rich:column>
+
+ </rich:dataTable>
+ </h:form>
+
+ </h:panelGrid>
+
+ </rich:panel>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-layout.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-layout.xhtml
index dc5c95b..a210bb2 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-layout.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-layout.xhtml
@@ -98,7 +98,7 @@ Firefox and other Gecko-based browsers to render the page in
"Almost Standards"
<div id="PageHeader" style="border-bottom: 2px solid #999;
position: absolute; top: 0; bottom: 0; left: 0; right: 0;">
<!--<![endif]-->
- <c:if test="${empty param.nomenu}">
+ <c:if test="${empty param.nomenu and empty disableMenu}">
<ui:include src="/rhq/common/menu/menu.xhtml"/>
</c:if>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
index 78ea9d7..3d034e6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
@@ -16,9 +16,9 @@
<ui:define name="body-area">
<div id="content-full" style="width: 100%; height: 100%;
overflow: auto;">
- <div id="Breadcrumb">
+ <h:panelGroup id="Breadcrumb" layout="block"
rendered="#{empty disableBreadcrumbs}">
<ui:insert name="breadcrumbs">Default Full Screen
Content</ui:insert>
- </div>
+ </h:panelGroup>
<p />
<ui:insert name="body">Default Full Screen
Body</ui:insert>
</div>