modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
| 14 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PopupWindow.java
| 63 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java
| 59 +++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
| 12 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
| 3
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16_open.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_new_16.png
|binary
12 files changed, 160 insertions(+), 3 deletions(-)
New commits:
commit efcf0c5f3ec664ee2899756cd45df7a591837d99
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 1 16:18:28 2011 -0400
add change set menu item "show configuration" - not implemented yet until we
get the proper composite query
added new icons for "coverage" change sets versus "drift"
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
index a513687..4c1c429 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
@@ -79,7 +79,21 @@ public class ImageManager {
return "[SKIN]/actions/undo.png";
}
+ /**
+ * Returns a drift icon given the category of the drift.
+ * Note that if the category is null, it will be assumed the drift icon
+ * should be one that indicates the file is "new" (presumably from
+ * a coverage change set report - that is, its the first time the file
+ * has been seen).
+ *
+ * @param category
+ * @return path to icon
+ */
public static String getDriftCategoryIcon(DriftCategory category) {
+ if (category == null) {
+ return "subsystems/drift/Drift_new_16.png";
+ }
+
switch (category) {
case FILE_ADDED:
return "subsystems/drift/Drift_add_16.png";
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PopupWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PopupWindow.java
new file mode 100644
index 0000000..e72518a
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PopupWindow.java
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 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;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
+
+/**
+ * Generic window that you can use to popup details. Populate the popup
+ * window with any canvas.
+ *
+ * @author John Mazzitelli
+ */
+public class PopupWindow extends LocatableWindow {
+ /**
+ * Create the popup dialog window.
+ *
+ * @param locatorId
+ * @param canvas if not <code>null</code>, this will be added to the
window.
+ */
+ public PopupWindow(String locatorId, Canvas canvas) {
+ super(locatorId);
+ setTitle(MSG.common_title_details());
+ setShowMinimizeButton(false);
+ setShowMaximizeButton(true);
+ setIsModal(true);
+ setShowModalMask(true);
+ setWidth(600);
+ setHeight(400);
+ setAutoCenter(true);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+ addCloseClickHandler(new CloseClickHandler() {
+ public void onCloseClick(CloseClientEvent event) {
+ markForDestroy();
+ }
+ });
+ if (canvas != null) {
+ addItem(canvas);
+ }
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java
index 8203361..20e5bf1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java
@@ -40,12 +40,17 @@ import com.smartgwt.client.widgets.tree.TreeNode;
import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent;
import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.PopupWindow;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid;
@@ -230,9 +235,42 @@ public abstract class AbstractDriftChangeSetsTreeView extends
LocatableTreeGrid
});
contextMenu.addItem(deleteItem);
+ // item that shows the drift configuration
+ MenuItem configItem = new
MenuItem(MSG.view_drift_changeset_tree_showConfiguration());
+ configItem.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ showDriftConfiguration(node.getChangeSetId());
+ }
+ });
+ contextMenu.addItem(configItem);
+
return contextMenu;
}
+ protected void showDriftConfiguration(final String changeSetId) {
+ ConfigurationDefinition def = DriftConfigurationDefinition.getInstance();
+ Configuration config = new Configuration();
+ ConfigurationEditor editor = new
ConfigurationEditor(extendLocatorId("driftConfigEditor"), def, config);
+ editor.setReadOnly(true);
+ PopupWindow window = new PopupWindow("details", editor);
+ window.show();
+
+ // DriftChangeSetCriteria criteria = new BasicDriftChangeSetCriteria();
+ // criteria.addFilterId(changeSetId);
+ // criteria.fetchDriftConfiguration(true);
+ //
GWTServiceLookup.getDriftService().findDriftChangeSetCompositesByCriteria(criteria,
+ // new AsyncCallback<PageList<DriftChangeSet>>() {
+ // public void onSuccess(PageList<DriftChangeSet> result) {
+ // // TODO
+ // }
+ //
+ // public void onFailure(Throwable t) {
+ //
CoreGUI.getErrorHandler().handleError(MSG.view_drift_changeset_tree_loadConfigFailure(changeSetId),
+ // t);
+ // }
+ // });
+ }
+
/**
* We override this because we know all of our nodes will have titles. Without this,
* I could not get the title of change set nodes to show - it always fell back to
using
@@ -248,11 +286,23 @@ public abstract class AbstractDriftChangeSetsTreeView extends
LocatableTreeGrid
static class ChangeSetTreeNode extends TreeNode {
public ChangeSetTreeNode(DriftChangeSet changeset) {
setIsFolder(true);
- setIcon("subsystems/drift/ChangeSet_16.png");
setShowOpenIcon(true);
setID(changeset.getId());
setName(padWithZeroes(changeset.getVersion())); // we sort on this column,
hence we make sure the version # is padded
setTitle(buildDriftChangeSetNodeName(changeset));
+
+ switch (changeset.getCategory()) {
+ case COVERAGE:
+ setIcon("subsystems/drift/ChangeSet_Coverage_16.png");
+ break;
+ case DRIFT:
+ setIcon("subsystems/drift/ChangeSet_16.png");
+ break;
+ }
+ }
+
+ public String getChangeSetId() {
+ return getAttribute("id");
}
private String buildDriftChangeSetNodeName(DriftChangeSet changeset) {
@@ -263,7 +313,7 @@ public abstract class AbstractDriftChangeSetsTreeView extends
LocatableTreeGrid
str.append(" (");
str.append(TimestampCellFormatter.format(changeset.getCtime(),
TimestampCellFormatter.DATE_TIME_FORMAT_SHORT));
- str.append(')');
+ str.append(")");
return str.toString();
}
@@ -285,6 +335,11 @@ public abstract class AbstractDriftChangeSetsTreeView extends
LocatableTreeGrid
setParentID(parentID);
setID(parentID + '_' + drift.getId());
setName(drift.getPath()); // we sort on this column
+ setAttribute("driftId", drift.getId());
+ }
+
+ public String getDriftId() {
+ return getAttribute("driftId");
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
index 0d59be8..8a6c448 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java
@@ -63,6 +63,7 @@ import
org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*/
public class DriftDataSource extends RPCDataSource<DriftComposite, DriftCriteria>
{
+ public static final String CATEGORY_ICON_NEW =
ImageManager.getDriftCategoryIcon(null);
public static final String CATEGORY_ICON_ADD =
ImageManager.getDriftCategoryIcon(DriftCategory.FILE_ADDED);
public static final String CATEGORY_ICON_CHANGE =
ImageManager.getDriftCategoryIcon(DriftCategory.FILE_CHANGED);
public static final String CATEGORY_ICON_REMOVE =
ImageManager.getDriftCategoryIcon(DriftCategory.FILE_REMOVED);
@@ -121,6 +122,8 @@ public class DriftDataSource extends RPCDataSource<DriftComposite,
DriftCriteria
return MSG.view_drift_category_fileChanged();
} else if (CATEGORY_ICON_REMOVE.equals(cat)) {
return MSG.view_drift_category_fileRemoved();
+ } else if (CATEGORY_ICON_NEW.equals(cat)) {
+ return MSG.view_drift_category_fileNew();
} else {
return ""; // will never get here
}
@@ -304,7 +307,14 @@ public class DriftDataSource extends RPCDataSource<DriftComposite,
DriftCriteria
Drift drift = from.getDrift();
record.setAttribute(ATTR_ID, drift.getId());
record.setAttribute(ATTR_CTIME, new Date(drift.getCtime()));
- record.setAttribute(ATTR_CATEGORY,
ImageManager.getDriftCategoryIcon(drift.getCategory()));
+ switch (drift.getChangeSet().getCategory()) {
+ case COVERAGE:
+ record.setAttribute(ATTR_CATEGORY, ImageManager.getDriftCategoryIcon(null));
+ break;
+ case DRIFT:
+ record.setAttribute(ATTR_CATEGORY,
ImageManager.getDriftCategoryIcon(drift.getCategory()));
+ break;
+ }
record.setAttribute(ATTR_PATH, drift.getPath());
record.setAttribute(ATTR_CHANGESET_VERSION, drift.getChangeSet().getVersion());
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 ea8c956..0ba3347 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
@@ -1120,10 +1120,13 @@ view_drift = Drift
view_drift_button_detectNow = Detect Now
view_drift_category_fileAdded = File Added
view_drift_category_fileChanged = File Changed
+view_drift_category_fileNew = New Detection
view_drift_category_fileRemoved = File Removed
view_drift_changeSets = Change Sets
view_drift_changeSets_resourceViewTitle = Resource Drift Change Sets
+view_drift_changeset_tree_loadConfigFailure = Failed to load drift configuration for
change set id [{0}]
view_drift_changeset_tree_loadFailure = Failed to load drift change set tree.
+view_drift_changeset_tree_showConfiguration = Show Configuration
view_drift_delete_confirm = Delete the selected drift(s)?
view_drift_delete_confirmAll = Delete all drifts from this source?
view_drift_failure_delete = Failed to delete drift targets with id''s: {0}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index a07568a..977f4a4 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -938,10 +938,13 @@ view_dashboards_title = Dashboard
##view_drift_button_detectNow = Detect Now
##view_drift_category_fileAdded = File Added
##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileNew = New Detection
##view_drift_category_fileRemoved = File Removed
##view_drift_changeSets = Change Sets
##view_drift_changeSets_resourceViewTitle = Resource Drift Change Sets
+##view_drift_changeset_tree_loadConfigFailure = Failed to load drift configuration for
change set id [{0}]
##view_drift_changeset_tree_loadFailure = Failed to load drift change set tree.
+##view_drift_changeset_tree_showConfiguration = Show Configuration
##view_drift_delete_confirm = Delete the selected drift(s)?
##view_drift_delete_confirmAll = Delete all drifts from this source?
##view_drift_failure_delete = Failed to delete drift targets with id''s: {0}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 6e68cff..6af4be0 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1104,9 +1104,12 @@ view_dashboards_portlets_refresh_success1 = ポートレットの自動リフレ
view_dashboards_portlets_refresh_success2 = 自動リフレッシュするポートレットのリロードを停止しています
view_dashboards_title = ダッシュボード
##view_drift = Drift
+##view_drift_category_fileNew = New Detection
##view_drift_changeSets = Change Sets
##view_drift_changeSets_resourceViewTitle = Resource Drift Change Sets
+##view_drift_changeset_tree_loadConfigFailure = Failed to load drift configuration for
change set id [{0}]
##view_drift_changeset_tree_loadFailure = Failed to load drift change set tree.
+##view_drift_changeset_tree_showConfiguration = Show Configuration
##view_drift_table_baseDir = Base Directory
##view_drift_table_changeSet = Change Set
##view_drift_table_newFile = New File
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index fa86006..0d1e7c9 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -1138,10 +1138,13 @@ view_dashboards_title = Dashboard~
##view_drift_button_detectNow = Detect Now
##view_drift_category_fileAdded = File Added
##view_drift_category_fileChanged = File Changed
+##view_drift_category_fileNew = New Detection
##view_drift_category_fileRemoved = File Removed
##view_drift_changeSets = Change Sets
##view_drift_changeSets_resourceViewTitle = Resource Drift Change Sets
+##view_drift_changeset_tree_loadConfigFailure = Failed to load drift configuration for
change set id [{0}]
##view_drift_changeset_tree_loadFailure = Failed to load drift change set tree.
+##view_drift_changeset_tree_showConfiguration = Show Configuration
##view_drift_delete_confirm = Delete the selected drift(s)?
##view_drift_delete_confirmAll = Delete all drifts from this source?
##view_drift_failure_delete = Failed to delete drift targets with id''s: {0}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 79816c5..a6c6880 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -1113,9 +1113,12 @@ view_dashboards_portlets_refresh_success1 =
\u6210\u529f\u4fee\u6539portlets\u81
view_dashboards_portlets_refresh_success2 =
\u6210\u529f\u505c\u7528portlets\u81ea\u52a8\u5237\u65b0\u7684\u91cd\u8f7d
view_dashboards_title = \u7edf\u8ba1\u8868\u76d8
##view_drift = Drift
+##view_drift_category_fileNew = New Detection
##view_drift_changeSets = Change Sets
##view_drift_changeSets_resourceViewTitle = Resource Drift Change Sets
+##view_drift_changeset_tree_loadConfigFailure = Failed to load drift configuration for
change set id [{0}]
##view_drift_changeset_tree_loadFailure = Failed to load drift change set tree.
+##view_drift_changeset_tree_showConfiguration = Show Configuration
##view_drift_table_baseDir = Base Directory
##view_drift_table_changeSet = Change Set
##view_drift_table_newFile = New File
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16.png
new file mode 100644
index 0000000..7ae8f52
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16_open.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16_open.png
new file mode 100644
index 0000000..85e3cf4
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/ChangeSet_Coverage_16_open.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_new_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_new_16.png
new file mode 100644
index 0000000..e3e4f97
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Drift_new_16.png
differ