[rhq] modules/enterprise
by mazz
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit b40f968a004a227fbdd98ed0a8a3b6cb07610776
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 27 12:55:24 2011 -0400
set the log level to debug for this one message
diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
index deddb02..6cea6b8 100644
--- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
+++ b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
@@ -93,9 +93,11 @@ public class HibernateDetachUtility {
return;
} else {
- // TODO: this can be tuned down to debug after we're done evaluating this logic
- LOG.warn("UNEQUAL IDENTITY HASHCODE [" + valueIdentity + "]\n\tCurrent : " + value.getClass().getName()
- + "\n\t" + value + "\n\tPrevious: " + checkedObject.getClass().getName() + "\n\t" + checkedObject);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("UNEQUAL IDENTITY HASHCODE [" + valueIdentity + "]\n\tCurrent : "
+ + value.getClass().getName() + "\n\t" + value + "\n\tPrevious: "
+ + checkedObject.getClass().getName() + "\n\t" + checkedObject);
+ }
}
if (value instanceof Object[]) {
13 years, 1 month
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 4 ++--
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 512eb56e0f87b42a7e0f2592fcc4069479ea5593
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 27 12:00:43 2011 -0400
BZ 700158 - i18n wizard's step x of y message
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
index cdfd98b..6b82ade 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
@@ -219,8 +219,8 @@ public class WizardView extends LocatableVLayout {
// a valid step, continue
currentStep = stepIndex;
- // TODO: i18n
- stepLabel.setContents("Step " + (stepIndex + 1) + " of " + wizardSteps.size());
+ stepLabel.setContents(MSG.common_msg_step_x_of_y(String.valueOf(stepIndex + 1), String.valueOf(wizardSteps
+ .size())));
stepLabel.setWrap(false);
WizardStep step = wizardSteps.get(currentStep);
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 e586fe3..01045ce 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
@@ -230,6 +230,7 @@ common_msg_loading = Loading...
common_msg_noItemsToShow = No items to show
common_msg_notYetImplemented = Not Yet Implemented
common_msg_see_more = see more...
+common_msg_step_x_of_y = Step {0} of {1}
# Common Values
#--------------
13 years, 1 month
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 7ca9bf695f0ce8e7bd360ecca6e1b65f92dc7d0c
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 27 11:27:04 2011 -0400
widening the iframe window a little more for better viewing.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 1ffc4db..c1f1042 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -672,7 +672,7 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
setShowCloseButton(true);
setIsModal(true);
setShowModalMask(true);
- setWidth(850);
+ setWidth(900);
setHeight(650);
setShowResizer(true);
setCanDragResize(true);
13 years, 1 month
[rhq] Branch 'as7plugin' - 107 commits - etc/m2 modules/core modules/enterprise modules/helpers modules/jopr modules/plugins
by Heiko W. Rupp
etc/m2/smartgwt-war-archetype/pom.xml | 2
etc/m2/smartgwt-war-archetype/src/main/resources/archetype-resources/pom.xml | 6
modules/core/dbutils/pom.xml | 25
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java | 6
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertCriteria.java | 9
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java | 18
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java | 3
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java | 6
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java | 8
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java | 21
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementOOB.java | 45
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java | 27
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ui/MetricDisplayConstants.java | 22
modules/core/domain/src/main/java/org/rhq/core/domain/operation/GroupOperationHistory.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceAncestryFormat.java | 4
modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java | 169 --
modules/enterprise/gui/coregui/pom.xml | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 68
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 32
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java | 60
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 68
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java | 27
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java | 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnumSelectItem.java | 48
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/IconField.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 100 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java | 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortletUtil.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 37
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java | 29
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 19
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java | 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java | 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AgentGWTService.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java | 27
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java | 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java | 54
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleListView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 50
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java | 57
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java | 52
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java | 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java | 55
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java | 66
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java | 72 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java | 69
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationTable.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java | 175 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java | 77 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java | 96 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java | 19
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java | 57
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView3.java | 702 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java | 52
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 148 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/OverviewForm.java | 57
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 68
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationHistoryDataSource.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java | 45
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView3.java | 691 ---------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java | 77 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java | 106 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java | 126 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java | 30
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/disambiguation/ReportDecorator.java | 141 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestDataSourceResponseStatisticsView.java | 406 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRemoteServiceStatisticsView.java | 348 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java | 348 ----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 36
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/DataSourceResponseStatistics.java | 64
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHTMLFlow.java | 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 59
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java | 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java | 20
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 6
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 42
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 240 +--
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html | 4
modules/enterprise/gui/installer-war/pom.xml | 13
modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallatonTest.java | 17
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java | 17
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListReposUIBean.java | 6
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java | 31
modules/enterprise/gui/portal-war/src/main/webapp/portal/MainLayout.jsp | 10
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartLegend.jsp | 8
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartParams.jsp | 5
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp | 37
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/DashCharts.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricsDisplayRows.jsp | 14
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp | 16
modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/listRepos-plain.xhtml | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml | 12
modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml | 4
modules/enterprise/server/container/pom.xml | 36
modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml | 29
modules/enterprise/server/container/src/main/shell/zip_all_plugins | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java | 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 48
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupPluginConfigurationUpdateJob.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupResourceConfigurationUpdateJob.java | 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/AgentPluginScanner.java | 23
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java | 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java | 60
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 27
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java | 20
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 68
modules/helpers/pluginGen/src/main/resources/component.ftl | 3
modules/jopr/etc/jbas5-jnp-client/client.sh | 12
modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java | 26
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 71 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 172 ++
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 198 --
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 257 ++-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java | 6
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java | 2
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java | 21
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirectiveTree.java | 10
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java | 2
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java | 68
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java | 89 +
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java | 304 ++++
modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml | 19
modules/plugins/augeas/src/main/java/org/rhq/augeas/config/AugeasConfigurationSimple.java | 2
modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java | 48
modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationComponent.java | 2
modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java | 2
modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java | 2
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ConversionUtils.java | 67
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 8
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java | 47
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java | 111 +
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 45
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java | 247 +++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java | 96 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java | 92 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java | 2
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java | 164 +-
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Result.java | 19
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 173 +-
modules/plugins/pattern-generator/pom.xml | 179 ++
modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java | 97 +
modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java | 39
modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml | 26
modules/plugins/pom.xml | 1
modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml | 13
modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml | 43
221 files changed, 5880 insertions(+), 4016 deletions(-)
New commits:
commit 9dc32bcb1ff5af961cd980c7d0ec518057bedba2
Merge: 0559cb7 0086a69
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 16:18:48 2011 +0200
Merge branch 'master' into as7plugin
commit 0086a6972af8645766363fa42ea6a38ac16ea2dc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 16:12:23 2011 +0200
Add the pattern generator plugin
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
new file mode 100644
index 0000000..afd78d2
--- /dev/null
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -0,0 +1,179 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ >
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-plugins-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version><!-- TODO adjust RHQ version -->
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>pattern-plugin</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ pattern Plugin</name>
+ <description>Generate metrics that follow given patterns</description>
+
+ <properties>
+ <scm.module.path>TODO</scm.module.path>
+ <rhq.version>4.0.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see above too -->
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar"
+ dest="${project.build.outputDirectory}">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ <jar destfile="${deployment.file}"
+ manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+ update="true">
+ </jar>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Repository</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ <!-- TODO add your own maven repositories here (if needed) -->
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Plugin Repository</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TODO add your dependencies here -->
+
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java
new file mode 100644
index 0000000..5ac3304
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java
@@ -0,0 +1,97 @@
+
+package org.rhq.plugins.pattern;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+
+@SuppressWarnings("unused")
+public class PatternComponent implements ResourceComponent, MeasurementFacet
+{
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ int count = 0;
+ int number = 0; // We start with returning zeros
+ int[] wanted = new int[2];
+
+ /**
+ * Return availability of this resource
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
+ */
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+
+ /**
+ * Start the resource connection
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
+ */
+ public void start(ResourceContext context) throws InvalidPluginConfigurationException {
+
+ Configuration conf = context.getPluginConfiguration();
+ String tmp = conf.getSimpleValue("ones","1");
+ int wantedOnes = Integer.parseInt(tmp);
+ if (wantedOnes<1)
+ throw new InvalidPluginConfigurationException("Ones must be > 0");
+ tmp = conf.getSimpleValue("zeros","1");
+ int wantedZeros = Integer.parseInt(tmp);
+ if (wantedZeros<1)
+ throw new InvalidPluginConfigurationException("Zeros must be > 0");
+
+ wanted[0] = wantedZeros;
+ wanted[1] = wantedOnes;
+ }
+
+
+ /**
+ * Tear down the resource connection
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
+ */
+ public void stop() {
+ // Nothing to do.
+ }
+
+
+
+ /**
+ * Gather "measurement" data - actually a series of 1s and 0s starting with 0.
+ * @see org.rhq.core.pluginapi.measurement.MeasurementFacet#getValues(org.rhq.core.domain.measurement.MeasurementReport, java.util.Set)
+ */
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
+
+ for (MeasurementScheduleRequest req : metrics) {
+ if (req.getName().equals("pattern1")) {
+
+ double val;
+
+ val = (double) number;
+
+ if (number==1)
+ System.out.println("XX 1 _ " + new Date());
+
+ count++;
+ // enough of this? Flip over to the other number and reset the series.
+ if (count>=wanted[number]) {
+ number = 1-number;
+ count=0;
+ }
+
+ MeasurementDataNumeric res = new MeasurementDataNumeric(req, val);
+ report.addData(res);
+ }
+ }
+ }
+}
diff --git a/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java
new file mode 100644
index 0000000..cf2b1ac
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java
@@ -0,0 +1,39 @@
+package org.rhq.plugins.pattern;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+
+/**
+ * Discovery class
+ */
+@SuppressWarnings("unused")
+public class PatternDiscovery implements ResourceDiscoveryComponent
+{
+
+ /**
+ * Run the auto-discovery
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception {
+ Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(1);
+
+
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(), // ResourceType
+ "pattern",
+ "pattern",
+ "1.1",
+ "Generate metrics that follow a pattern",
+ discoveryContext.getDefaultPluginConfiguration(),
+ null
+ );
+
+
+ // Add to return values
+ discoveredResources.add(detail);
+ return discoveredResources;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml
new file mode 100644
index 0000000..c3ad075
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<plugin name="pattern-generator"
+ displayName="pattern-generator Plugin"
+ description="Devs plugin that generates metrics that follow patterns"
+ package="org.rhq.plugins.pattern"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+
+ <server name="pattern"
+ discovery="PatternDiscovery"
+ class="PatternComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="ones" description="Number of ones in a row" type="integer" default="1"/>
+ <c:simple-property name="zeros" description="Number of zeros in a row" type="integer" default="2"/>
+ </plugin-configuration>
+
+ <metric property="pattern1" displayName="Pattern 1 metric" defaultInterval="60000" displayType="summary" defaultOn="true"/>
+
+ </server>
+
+</plugin>
\ No newline at end of file
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f39e509..b1eec53 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -191,6 +191,7 @@
<module>twitter</module>
<module>virt</module>
<module>kickstart</module>
+ <module>pattern-generator</module>
</modules>
</profile>
commit 277a5dd0b06aad80fe420b45b86cf18601e84e03
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:28:09 2011 +0200
Some more translations.
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 805d4bf..667f040 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
@@ -72,7 +72,7 @@ common_title_add_column=Spalte hinzufügen
common_title_add_portlet=Portlet hinzufügen
common_title_alert_range=Alert Range~
common_title_availability = Verfügbar
-common_title_average_metrics=Dursch. Anzahl Metriken pro Minute
+common_title_average_metrics=Durchsch. Anzahl Metriken pro Minute
common_title_available_resources=Verfügbare Ressourcen
common_title_background=Hintergrund
common_title_category = Kategorie
@@ -144,7 +144,6 @@ common_title_status=Status
common_title_summary=Zusammenfassung
common_title_tag_cloud=Tag-Wolke
common_title_the=Die
-common_title_summary_counts=Summary Counts~
common_title_timestamp =Zeitpunkt
common_title_total=Total
common_title_type = Typ
@@ -426,7 +425,6 @@ view_adminTopology_remoteAgentInstall = Installation entfernter Agenten
view_adminTopology_servers = Server
view_adminConfig_downloads = Downloads
-view_adminConfig_license = Lizenz
view_adminConfig_plugins = Plugins
view_adminConfig_systemSettings = Systemeinstellungen
view_adminConfig_templates = Voreinstellungen
@@ -501,40 +499,36 @@ view_alerts_field_created_time=Erstellungszeitpunkt
view_alerts_field_modified_time=Zuletzt geändert
view_alerts_field_enabled=Aktiviert
view_alerts_field_ack_time=Zeitpunkt Bestätigung
-view_alerts_field_ack_subject=Bestätigender benutzer
+view_alerts_field_ack_subject=Bestätigender Benutzer
view_alerts_field_ack_status=Status
-view_alerts_field_ack_status_empty=Noch nicht bestätigt
-view_alerts_field_ack_status_filled={0} bestätigt am {1}
view_alerts_field_name=Name
view_alerts_field_condition_text=Bedingung(en)
-view_alerts_field_condition_text_none=No Conditions~
-view_alerts_field_condition_text_many=Multiple Conditions~
-view_alerts_field_condition_value=Condition Value~
-view_alerts_field_resource=Ressource
+view_alerts_field_condition_text_none=Keine Bedingungen
+view_alerts_field_condition_text_many=Mehrere Bedingungen
+view_alerts_field_condition_value=Bedingung
view_alerts_field_priority=Priorität
-view_alerts_field_parent=Parent~
+view_alerts_field_parent=Eltern
view_alerts_field_protected=Geschützt
view_alerts_field_protected_tooltip=If true, this definition is protected from being changed by the parent definition. In other words, the parent definition settings will not override this definition.~
-view_alerts_loadFailed=Failed to fetch alerts data~
-view_alerts_delete_confirm=Delete the selected alert(s)?~
-view_alerts_delete_confirm_all=Delete all alerts from this source?~
-view_alerts_delete_success=Successfully deleted {0} alerts~
-view_alerts_delete_failure=Failed to delete alerts with id''s: {0}~
-view_alerts_delete_failure_all=Failed to delete all alerts from this source~
+view_alerts_loadFailed=Konnte die Daten für die Alarme nicht laden
+view_alerts_delete_confirm=Die ausgewählten Alarme löschen?
+view_alerts_delete_confirm_all=Alle Alarme aus dieser Quele löschen?
+view_alerts_delete_success=Erfolgreich {0} Alarme gelöscht
+view_alerts_delete_failure=Konnte die Alarme mit den IDs {0} nicht löschen
+view_alerts_delete_failure_all=Löschen aller Alarme dieser Quelle fehlgeschlagen
view_alerts_ack_confirm=Die ausgewählten Alarme bestätigen?
view_alerts_ack_confirm_all=Alle Alarme dieser Quelle bestätigen?
-view_alerts_ack_success=Successfully acknowledged {0} alerts~
-view_alerts_ack_failure=Failed to acknowledge alerts with id''s: {0}~
-view_alerts_ack_failure_all=Failed to acknowledge all alerts from this source~
-view_alert_details_loadFailed=Failed to fetch alert details~
-view_alert_details_breadcrumb=Details
+view_alerts_ack_success=Erfolgreich {0} Alarme bestätigt
+view_alerts_ack_failure=Bestätigen der Alarme mit den IDs {0} fehlgeschlagen
+view_alerts_ack_failure_all=Bestätigung aller Alarme deiser Quelle fehlgeschlagen
+view_alert_details_loadFailed=Laden der Details für den Alarm fehlgeschlagen
view_alert_details_field_ack_by=Bestätigt durch
view_alert_details_field_ack_at=Bestätigt um
-view_alert_details_field_recovery_info=Recovery Info~
-view_alert_definition_for_type=View Template~
+view_alert_details_field_recovery_info=Info zur Erholung
+view_alert_definition_for_type=Vorlage ansehen
view_alert_definition_for_group=View Group Definition~
-view_alert_definitions_table_title_group=Group Alert Definitions~
-view_alert_definitions_table_title_resource=Resource Alert Definitions~
+view_alert_definitions_table_title_group=Alarm-Definitionen für Gruppen
+view_alert_definitions_table_title_resource=Alarm-Definitionen für Ressourcen
view_alert_definitions_loadFailed=Failed to fetch alert definition data~
view_alert_definitions_loadFailed_single=Failed to fetch data for alert definition with id {0}~
view_alert_definitions_enable_confirm=Enable the selected alert definition(s)?~
@@ -546,31 +540,31 @@ view_alert_definitions_disable_failure=Failed to disable the selected alert defi
view_alert_definitions_delete_confirm=Delete the selected alert definition(s)?~
view_alert_definitions_delete_success=Successfully deleted {0} alert definitions~
view_alert_definitions_delete_failure=Failed to deleted the selected alert definitions~
-view_alert_definitions_create_success=Alert definition successfully created~
-view_alert_definitions_create_failure=Alert definition creation failed~
-view_alert_definitions_update_success=Alert definition successfully updated~
-view_alert_definitions_update_failure=Alert definition update failed~
-view_alert_definition_condition_editor_option_label=Condition Type~
+view_alert_definitions_create_success=Alarm-Definition erfolgreich angelegt
+view_alert_definitions_create_failure=Anlegen der Alarm-Definition fehlgeschlagen
+view_alert_definitions_update_success=Alarm-Definition erfolgreich aktualisiert
+view_alert_definitions_update_failure=Aktualisieren der Alarm-Definition fehlgeschlagen
+view_alert_definition_condition_editor_option_label=Typ der Bedingung
view_alert_definition_condition_editor_option_availability=Änderung der Verfügbarkeit
-view_alert_definition_condition_editor_option_metric_threshold=Measurement Absolute Value Threshold~
-view_alert_definition_condition_editor_option_metric_baseline=Measurement Baseline Threshold~
-view_alert_definition_condition_editor_option_metric_change=Measurement Value Change~
+view_alert_definition_condition_editor_option_metric_threshold=Absoluter Metrikschwellwert
+view_alert_definition_condition_editor_option_metric_baseline=Schwelle des Referenzbands
+view_alert_definition_condition_editor_option_metric_change=Wert der Metrik ändert sich
view_alert_definition_condition_editor_option_metric_calltime_threshold=Call Time Value Threshold~
-view_alert_definition_condition_editor_option_metric_calltime_change=Call Time Value Change~
-view_alert_definition_condition_editor_option_metric_trait_change=Trait Value Change~
-view_alert_definition_condition_editor_option_operation=Operation Execution~
-view_alert_definition_condition_editor_option_resource_configuration=Resource Configuration Change~
+view_alert_definition_condition_editor_option_metric_calltime_change=Änderung des Call-Time-Werts
+view_alert_definition_condition_editor_option_metric_trait_change=Änderung des Trait-Werts
+view_alert_definition_condition_editor_option_operation=Ausführung der Operation
+view_alert_definition_condition_editor_option_resource_configuration=Änderung der Konfiguration der Ressource
view_alert_definition_condition_editor_option_event=Event Detection~
view_alert_definition_condition_editor_avilability_tooltip=Specify the availability state change that will trigger the condition.~
-view_alert_definition_condition_editor_avilability_value=Verfügbarkeit~
+view_alert_definition_condition_editor_avilability_value=Verfügbarkeit
view_alert_definition_condition_editor_avilability_option_up=Wird verfügbar
view_alert_definition_condition_editor_avilability_option_down=Wird unverfügbar
view_alert_definition_condition_editor_metric_common_definition_not_found=Should have found metric definition - something is wrong~
view_alert_definition_condition_editor_metric_threshold_tooltip=Specify the threshold value that, when violated, triggers the condition. The value you specify is an absolute value with an optional units specifier.~
view_alert_definition_condition_editor_metric_threshold_name=Metrik
-view_alert_definition_condition_editor_metric_threshold_value=Metric Value~
+view_alert_definition_condition_editor_metric_threshold_value=Wert der Metrik
view_alert_definition_condition_editor_metric_threshold_value_tooltip=The threshold value of the metric that will trigger the condition when compared using the selected comparator.~
-view_alert_definition_condition_editor_metric_threshold_comparator=Comparator~
+view_alert_definition_condition_editor_metric_threshold_comparator=Komparator
view_alert_definition_condition_editor_metric_threshold_comparator_less=Kleiner als
view_alert_definition_condition_editor_metric_threshold_comparator_equal=Gleich
view_alert_definition_condition_editor_metric_threshold_comparator_greater=Größer als
@@ -578,18 +572,18 @@ view_alert_definition_condition_editor_metric_threshold_comparator_tooltip=How a
view_alert_definition_condition_editor_metric_baseline_tooltip=Specify the baseline value that must be violated to trigger the condition. The value you specify is a percentage of the given baseline value.~
view_alert_definition_condition_editor_metric_baseline_percentage=Baseline Percentage~
view_alert_definition_condition_editor_metric_baseline_percentage_tooltip=A collected metric value will trigger this condition when compared to this percentage of the selected baseline value using the selected comparator~
-view_alert_definition_condition_editor_metric_baseline_value=Baseline~
+view_alert_definition_condition_editor_metric_baseline_value=Referenzband~
view_alert_definition_condition_editor_metric_change_tooltip=Specify the metric whose value must change to trigger the condition.~
view_alert_definition_condition_editor_metric_calltime_threshold_tooltip=Specify the calltime threshold value that, when violated, triggers the condition. The value you specify is an absolute value with an optional units specifier. You also must specify which calltime limit to compare the value with (minimum, maximum or average calltime value).~
view_alert_definition_condition_editor_metric_calltime_common_name=Call Time Metric~
view_alert_definition_condition_editor_metric_calltime_common_limit=Call Time Limit~
view_alert_definition_condition_editor_metric_calltime_common_limit_tooltip=The calltime limit value that is to be compared with the given value~
-view_alert_definition_condition_editor_metric_calltime_common_regex=Regular Expression~
+view_alert_definition_condition_editor_metric_calltime_common_regex=Regulärer Ausdruck
view_alert_definition_condition_editor_metric_calltime_common_regex_tooltip=If specified, this is a regular expression that must match a call destination in order to trigger the condition.~
-view_alert_definition_condition_editor_metric_calltime_common_comparator=Comparator~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_shrinks=Shrinks~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_grows=Grows~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_changes=Changes~
+view_alert_definition_condition_editor_metric_calltime_common_comparator=Komparator
+view_alert_definition_condition_editor_metric_calltime_common_comparator_shrinks=Schrumpft
+view_alert_definition_condition_editor_metric_calltime_common_comparator_grows=Wächst
+view_alert_definition_condition_editor_metric_calltime_common_comparator_changes=Ändert sich
view_alert_definition_condition_editor_metric_calltime_common_comparator_tooltip=How a collected calltime value should be compared to the given calltime limit~
view_alert_definition_condition_editor_metric_calltime_threshold_value=Call Time Value~
view_alert_definition_condition_editor_metric_calltime_threshold_value_tooltip=The threshold value of the metric that will trigger the condition when compared using the selected comparator.~
@@ -621,11 +615,11 @@ view_alert_definition_condition_editor_common_max=Maximum
view_alert_definition_notification_editor_title_add=Benachrichtigung hinzufügen
view_alert_definition_notification_editor_title_edit=Benachrichtigung bearbeiten
view_alert_definition_notification_editor_sender=Notification Sender~
-view_alert_definition_notification_editor_none_available=No alert senders available~
+view_alert_definition_notification_editor_none_available=Keine Alarm-Sender verfügbar
view_alert_definition_notification_editor_loadFailed=Cannot get alert senders~
view_alert_definition_notification_editor_loadFailed_single=Cannot get alert sender configuration definition~
view_alert_definition_notification_editor_saveFailed=Cannot save the notification configuration~
-view_alert_definition_notification_editor_field_sender=Sender~
+view_alert_definition_notification_editor_field_sender=Sender
view_alert_definition_notification_editor_field_configuration=Konfiguration
view_alert_definition_notification_editor_field_configuration_not_loaded=Unbekannt
view_alert_definition_notification_editor_field_configuration_loadFailed=Failed to get notification configuration preview~
@@ -657,12 +651,12 @@ view_alert_definition_notification_role_editor_saveFailed=Cannot save the select
view_alert_definition_notification_user_editor_loadFailed=Cannot determine current users - starting empty~
view_alert_definition_notification_user_editor_restoreFailed=Cannot use current users - starting empty~
view_alert_definition_notification_user_editor_saveFailed=Cannot save the selected users~
-view_alert_definition_recovery_editor_disable_when_fired=Disable When Fired~
+view_alert_definition_recovery_editor_disable_when_fired=Nach dem Auslösen inaktiv schalten
view_alert_definition_recovery_editor_disable_when_fired_tooltip=Indicates if this alert will be disabled after it fires. Once disabled, the alert can be manually re-enabled or a recovery alert can be set up to automatically re-enable it. If this alert is a recovery alert itself, this setting cannot be turned on.~
view_alert_definition_recovery_editor_recovery_alert=Recover Alert~
view_alert_definition_recovery_editor_recovery_alert_tooltip=The target alert that will be recovered (i.e. re-enabled) after this alert triggers. Do not select an alert here if you are not defining a recovery alert.~
view_alert_definition_recovery_editor_loadFailed=Cannot build recovery menu~
-view_alert_definition_recovery_editor_none_available=None~
+view_alert_definition_recovery_editor_none_available=Keiner
view_alert_common_tab_general=Allgemeine Eigenschaften
view_alert_common_tab_conditions=Bedingungen
view_alert_common_tab_conditions_modal_title=Bedingung hinzufügen
@@ -673,49 +667,49 @@ view_alert_common_tab_conditions_value=Wert
view_alert_common_tab_conditions_type_availability=Änderung der Verfügbarkeit
view_alert_common_tab_conditions_type_availability_down=Wurde unverfügbar
view_alert_common_tab_conditions_type_availability_up=Wurde wieder verfügbar
-view_alert_common_tab_conditions_type_metric_threshold=Metric Value Exceeds Threshold~
-view_alert_common_tab_conditions_type_metric_calltime_threshold=Call Time Value Exceeds Threshold~
+view_alert_common_tab_conditions_type_metric_threshold=Metrik überschreitet Schwellwert
+view_alert_common_tab_conditions_type_metric_calltime_threshold=Call-Time überschreitet Schwellwert
view_alert_common_tab_conditions_type_metric_calltime_destination=with call destination matching~
-view_alert_common_tab_conditions_type_metric_calltime_change=Call Time Value Changes~
-view_alert_common_tab_conditions_type_metric_calltime_change_verb=by at least~
-view_alert_common_tab_conditions_type_metric_calltime_delta_grows=Grows~
-view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks=Shrinks~
-view_alert_common_tab_conditions_type_metric_calltime_delta_other=Changes~
-view_alert_common_tab_conditions_type_metric_baseline=Metric Value Exceeds Baseline~
-view_alert_common_tab_conditions_type_metric_baseline_verb=of~
-view_alert_common_tab_conditions_type_metric_change=Metric Value Change~
-view_alert_common_tab_conditions_type_metric_trait_change=Trait Change~
-view_alert_common_tab_conditions_type_operation=Operation Execution~
-view_alert_common_tab_conditions_type_operation_status=with result status~
+view_alert_common_tab_conditions_type_metric_calltime_change=Call-Time-Wert ändert sich
+view_alert_common_tab_conditions_type_metric_calltime_change_verb=um mindestens
+view_alert_common_tab_conditions_type_metric_calltime_delta_grows=Wächst
+view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks=Schrumpft
+view_alert_common_tab_conditions_type_metric_calltime_delta_other=Ändert sich
+view_alert_common_tab_conditions_type_metric_baseline=Metrik überschreitet Referenzband
+view_alert_common_tab_conditions_type_metric_baseline_verb=von
+view_alert_common_tab_conditions_type_metric_change=Wert der Metrik ändert sich
+view_alert_common_tab_conditions_type_metric_trait_change=Trait-Änderung
+view_alert_common_tab_conditions_type_operation=Ausführung der Operation
+view_alert_common_tab_conditions_type_operation_status=mit Ergebnis-Status
view_alert_common_tab_conditions_type_resource_configuration=Resource Configuration Change~
view_alert_common_tab_conditions_type_event=Event Detection~
view_alert_common_tab_conditions_type_event_matching=with event source matching~
view_alert_common_tab_conditions_recovery_enabled=Triggered ''{0}'' to be re-enabled~
-view_alert_common_tab_conditions_recovery_disabled=This alert caused its alert definition to be disabled~
+view_alert_common_tab_conditions_recovery_disabled=Dieser Alarm hat seine Definition deaktiviert.
view_alert_common_tab_notifications=Benachrichtigung
view_alert_common_tab_notifications_sender=Sender
view_alert_common_tab_notifications_status=Status
view_alert_common_tab_notifications_message=Nachricht
view_alert_common_tab_dampening=Dämpfung
view_alert_common_tab_dampening_category_none=Keine
-view_alert_common_tab_dampening_category_none_tooltip=Dampening is disabled. Every time the condition set is true, an alert will be triggered.~
-view_alert_common_tab_dampening_category_consecutive_count=Consecutive~
-view_alert_common_tab_dampening_category_consecutive_count_tooltip=An alert is triggered once every X occurrences the condition set is true consecutively.~
-view_alert_common_tab_dampening_category_partial_count=Last N Evaluations~
-view_alert_common_tab_dampening_category_partial_count_tooltip=An alert is triggered once every X occurrences the condition set is true during the last N evaluations of the condition set.~
-view_alert_common_tab_dampening_category_duration_count=Time Period~
-view_alert_common_tab_dampening_category_duration_count_tooltip=An alert is triggered once every X occurrences the condition set is true within a given time period.~
-view_alert_common_tab_dampening_consecutive_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip=The number of times the condition set must be consecutively true before the alert is triggered~
-view_alert_common_tab_dampening_partial_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_partial_occurrences_label_tooltip=The number of times the condition set must be true during the last N evaluations before the alert is triggered.~
-view_alert_common_tab_dampening_partial_evalatuions_label=Evaluations~
-view_alert_common_tab_dampening_partial_evalatuions_label_tooltip=The total number of times the condition set will be tested to see if the given number of occurrences are true.~
-view_alert_common_tab_dampening_duration_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_duration_occurrences_label_tooltip=The number of times the condition set must be true during the given time period before the alert is triggered.~
-view_alert_common_tab_dampening_duration_period_label=Time Period~
-view_alert_common_tab_dampening_duration_period_label_tooltip=The time span in which the condition set will be tested to see if the given number of occurrences are true.~
-view_alert_common_tab_recovery=Recovery~
+view_alert_common_tab_dampening_category_none_tooltip=Dämpfung ist abgeschaltet. Jedes Mal wenn die Bedingungen zutreffen wird ein Alarm ausgelöst.
+view_alert_common_tab_dampening_category_consecutive_count=Aufeinanderfolgend
+view_alert_common_tab_dampening_category_consecutive_count_tooltip=Ein Alarm wird ausgelöst, wenn bei X aufeinanderfolgenden Werten die Bedingungen zutreffen.
+view_alert_common_tab_dampening_category_partial_count=Letzt N Auswertungen
+view_alert_common_tab_dampening_category_partial_count_tooltip=Ein Alarm wird ausgelöst, wenn die Bedingungen X-Mal innerhalb der letzten N Werte zutreffen.
+view_alert_common_tab_dampening_category_duration_count=Zeitraum
+view_alert_common_tab_dampening_category_duration_count_tooltip=Ein Alarm wird ausgelöst, wenn die Bedingungen X-Mal innerhalb des gegebenen Zeitraums zutreffen.
+view_alert_common_tab_dampening_consecutive_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip=Anzahl wie oft die Bedingungen aufeinandefolgend wahr sein müssen, befor der Alarm ausgelöst wird.
+view_alert_common_tab_dampening_partial_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_partial_occurrences_label_tooltip=Anzahl wie oft die Bedingungen innerhalb der letzten N Auswertungen wahr sein müssen, bevor der Alarm ausgelöst wird.
+view_alert_common_tab_dampening_partial_evalatuions_label=Auswertungen
+view_alert_common_tab_dampening_partial_evalatuions_label_tooltip=Anzahl wie oft die Bedingungen ausgewertet werden, um zu prüfen, ob sie 'Vorkommen' mal zutreffen.
+view_alert_common_tab_dampening_duration_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_duration_occurrences_label_tooltip=Anzahl wie oft die Bedingungen im gegebenen Zeitraum zutreffen müssen, um den Alarm auszulösen.
+view_alert_common_tab_dampening_duration_period_label=Zeitraum
+view_alert_common_tab_dampening_duration_period_label_tooltip=Der Zeitraum in dem die Bedingungen geprüft werden, ob sie 'Vorkommen' mal zutreffen.
+view_alert_common_tab_recovery=Erholung
view_alert_common_tab_invalid_condition_category=Invalid condition category - please report this as a bug: {0}~
view_alert_common_tab_invalid_dampening_category=Invalid dampening category - please report this as a bug: {0}~
view_alert_common_tab_invalid_time_units=Ungültige Zeiteinheit - bitte berichten Sie diesen Fehler: {0}
@@ -730,18 +724,18 @@ view_autoDiscoveryQ_unignore=Ignorieren aufheben
view_autoDiscoveryQ_new=Neu
view_autoDiscoveryQ_newAndIgnored=Neu und Ignoriert
view_autoDiscoveryQ_importFailure=Konnte die Ressourcen nicht importieren
-view_autoDiscoveryQ_importSuccessful=You have successfully imported the selected resources.~
-view_autoDiscoveryQ_ignoreFailure=Failed to ignore resources~
-view_autoDiscoveryQ_ignoreSuccessful=You have successfully ignored the selected resources.~
-view_autoDiscoveryQ_unignoreFailure=Failed to unignore resources~
-view_autoDiscoveryQ_unignoreSuccessful=You have successfully unignored the selected resources.~
-view_autoDiscoveryQ_noperm=(Required manage inventory permissions missing. See Administrator to change)~
+view_autoDiscoveryQ_importSuccessful=Sie haben die ausgewählten Ressourcen erfolgreich importiert
+view_autoDiscoveryQ_ignoreFailure=Konnte die Ressourcen nicht ignorieren
+view_autoDiscoveryQ_ignoreSuccessful=Sie haben die ausgewählten Ressourcen erfolgreich ignoriert
+view_autoDiscoveryQ_unignoreFailure=Konnte das Ignorieren für die Ressourcen nicht aufheben.
+view_autoDiscoveryQ_unignoreSuccessful=Sie haben erfolgreich das Ignorieren der ausgewählten Ressourcen aufgehoben.
+view_autoDiscoveryQ_noperm=(Die erforderlichen "manage inventory" Rechte fehlen. Kontaktieren Sie den Administrator)
view_autoDiscoveryQ_noItems=Keine Einträge gefunden
-view_autoDiscoveryQ_field_parentId=Parent ID~
+view_autoDiscoveryQ_field_parentId=Eltern-ID
view_autoDiscoveryQ_field_name=Ressourcen-Name
-view_autoDiscoveryQ_field_key=Resource Key~
-view_autoDiscoveryQ_field_discoveryTime=Discovery Time~
-view_autoDiscoveryQ_field_inventoryStatus=Inventory Status~
+view_autoDiscoveryQ_field_key=Ressourcen-Schlüssel
+view_autoDiscoveryQ_field_discoveryTime=Zeitpunkt des Auffindens
+view_autoDiscoveryQ_field_inventoryStatus=Inventar-Status
view_autoDiscoveryQ_loadFailure=Failed to load the inventory discovery queue~
#==================== Bundles ======================
@@ -759,7 +753,7 @@ view_bundle_bundleVersions=Bundle-Versionen
view_bundle_deploy=Deploy
view_bundle_deployed=Deployed
view_bundle_deployDir=Deploy-Verzeichnis
-view_bundle_deployments=Deployments~
+view_bundle_deployments=Deployments
view_bundle_destinations=Ziele
view_bundle_files=Dateien
view_bundle_latestVersion=Aktuelle Version
@@ -1006,11 +1000,7 @@ view_dashboards_title=Dashboard
view_dashboards_confirm1=Sind Sie sicher, dass Sie löschen möchten
view_dashboardsManager_error1=Failed to add new dashboard~
# // dup in common
-view_dashboardsManager_inventory_title=Inventarübersicht
-view_dashboardsManager_mashup_title=RHQ Neuigkeiten
-view_dashboardsManager_message_title=Willkommen bei RHQ
view_dashboardsManager_message_title_details=<h1>Willkommen bei RHQ</h1>\n<p>Das RHQ-Projekt is an abstraction and plug-in based systems management suite that provides extensible and integrated systems management for multiple products and platforms across a set of core features. The project is designed with layered modules that provide a flexible architecture for deployment. It delivers a core user interface that delivers audited and historical management across an entire enterprise. A Server/Agent architecture provides remote management and plugins implement all specific support for managed products.</p>\n <p>This default dashboard can be edited by clicking the (edit mode) button above.</p>~
-view_dashboardsManager_tagcloud_title=Tag-Wolke
view_portlet_autodiscovery_config_platform_selection = Number of platforms to display~
view_portlet_autodiscovery_help_msg = This portlet offers the ability to import newly discovered resources into the inventory for monitoring and management or to ignore them from further action.~
view_portlet_autodiscovery_title = Discovery-Warteschlange
@@ -1026,7 +1016,7 @@ view_portlet_graph_help_msg = This Portlet supports the graphing of a resource m
view_portlet_graph_help_title = Graph Portlet~
view_portlet_graph_help_unconfigured=This graph is unconfigured, click the settings button to configure.~
view_portlet_graph_title = Resource Graph~
-view_portlet_inventory_error1=Failed to retrieve inventory summary~
+view_portlet_inventory_error1=Konnte die Inventarübersicht nicht laden
view_portlet_mashup_config_title=MashupPorlet Configuration~
view_portlet_mashup_config_title_desc=The configuration settings for the mashup portlet.~
view_portlet_mashup_help=This portlet can include a web page via an HTTP request into an iframe on the dashboard.~
@@ -1034,7 +1024,7 @@ view_portlet_mashup_unconfigured=Page address not yet configured, click the sett
view_portlet_message_config_title=MessagePortlet Configuration~
view_portlet_message_config_title_desc=The configuration settings for the message portlet.~
view_portlet_message_help=This portlet can display an HTML message on the dashboard.~
-view_portlet_message_title=Message~
+view_portlet_message_title=Nachricht
view_portlet_message_unconfigured=Message not yet configured, click the settings button to setup this portlet.~
view_portlet_operations_config_completed_maximum=Maximum number of Completed operations to display.~
view_portlet_operations_config_completed_enable=Whether to enable completed operations results grouping for dashboard.~
@@ -1064,7 +1054,7 @@ view_portlet_recentAlerts_config_priority_label = priority Alerts,~
view_portlet_recentAlerts_config_when=innerhalb der letzten
view_portlet_recentAlerts_help_msg = Displays recent alerts fired on resources visible to the current user login.~
# // dup in common
-view_portlet_recentAlerts_title = Kürzliche Alarme
+view_portlet_recentAlerts_title = Frische Alarme
view_portlet_recentlyAdded_approved_platforms=recently approved platforms on dashboard.~
view_portlet_recentlyAdded_error1=Failed to load recently added resources~
view_portlet_recentlyAdded_help_msg=This portlet displays resources that have recently been imported into the inventory.~
@@ -1076,11 +1066,9 @@ view_portlet_tagCloud_title=Tag-Wolke
#=================== Inventory =====================
view_inventory_adq = Discovery-Warteschlange
view_inventory_sectionHelp = In diesem Abschnitt können neu gefundene Ressourcen, sowie Ressourcen und Gruppen im Inventar angesehen und verwaltet werden.
-view_inventory_cannotGetGlobalPerms = Could not determine global permissions - assuming none.~
view_inventory_problemGroups=Gruppen mit Problemen
view_inventory_collectionInterval=Erfassungs-Intervall
view_inventory_mixed=gemischt
-view_inventory_downServers=Nicht-verfügbare Server
view_inventory_groups = Gruppen
view_inventory_allGroups = Alle Gruppen
view_inventory_allResources = Alle Ressourcen
@@ -1151,7 +1139,7 @@ view_tree_common_contextMenu_editPluginConfiguration=Edit [{0}] Plugin Configura
view_tree_common_contextMenu_editResourceConfiguration=Edit [{0}] Resource Configuration~
view_tree_common_contextMenu_operations=Operations~
view_tree_common_contextMenu_operations_loadFailed=Failure to start wizard for running operations~
-view_tree_common_contextMenu_measurements=Measurements~
+view_tree_common_contextMenu_measurements=Metriken
view_tree_common_contextMenu_addChartToDashboard=Diagramm zum Dashboard [{0}] hinzufügen
view_tree_common_contextMenu_resourceGraph = Resource Metric Graph~
view_tree_common_contextMenu_groupGraph = Group Metric Graph~
@@ -1224,7 +1212,6 @@ view_dynagroup_expression=Ausdruck
view_dynagroup_recursive=Rekursiv
view_dynagroup_loadDefinitionFailure=Konnte die Gruppen-Definition [{0}] nicht laden
view_dynagroup_loadDefinitionMissing=There is no group definition with the ID of [{0}]~
-view_dynagroup_permUnknown=Could not determine if you have the proper permissions - access is denied~
view_dynagroup_permDenied=You do not have permission to view group definitions~
view_dynagroup_definitions=DynaGroup-Definitionen
view_group_membership_saveFailure=Failed to update membership of group [{0}]~
@@ -1427,8 +1414,8 @@ view_aboutBox_version = Version:
#--------------
view_core_error_1 = Konnte keine Alarminformationen laden
view_core_loggedOut = Ausgeloggt
-view_core_recentAlerts = [{0}] kürzliche Alarme
-view_core_uncaught = Globally uncaught exception~
+view_core_recentAlerts = [{0}] frische Alarme
+view_core_uncaught = Es ist eine nicht abgefangene Ausnahme aufgetreten.
# Login
#--------------
@@ -1474,7 +1461,7 @@ common_title_address=Adresse
common_title_component_errors=Fehler der Komponente
common_title_show_more=Mehr anzeigen...
view_inventory_summary_agent_error1=Fehler beim Ermitteln des Agent, der dies Ressource managt
-view_inventory_summary_agent_error2=Fehler beim Kontaktieren des Agent, der dies Ressource managt
+view_inventory_summary_agent_error2=Fehler beim Kontaktieren des Agent, der diese Ressource managt
view_inventory_summary_agent_fullEnpoint=Vollständiger Kommunikationsendpunkt
view_inventory_summary_agent_fullEnpoint_err1=Es ist kein entfernter Endpunkt mit dieser Ressource assoziiert
view_inventory_summary_agent_last_title=Zeitpunkt des letzten Verfügbarkeitsberichts
@@ -1596,7 +1583,7 @@ widget_recordEditor_error_permissionCreate=Sie haben nicht die nötigen Rechte,
widget_recordEditor_warn_validation=Ein oder mehrere Felder haben ungültige Werte. Diese [{0}] kann nicht gesichert werden bis die Werte korrigiert wurden.
widget_resourceFactoryWizard_infoStep_loadFail=Konnte die verfügbaren Architekturen nicht ermitteln
widget_typeCache_loadFail=Konnte die Metadaten für den Ressourcen-Typ nicht laden
-widget_typeTree_badTemplateType=Ungültige URL. Unbekannter Template-Type [{0}]
+widget_typeTree_badTemplateType=Ungültige URL. Unbekannter Vorlagen-Typ [{0}]
widget_typeTree_badTypeId=Ungültige URL. Unbekannte Ressource-Typ-ID [{0}]
widget_typeTree_loadFail=Konnte die Ressource-Typen nicht laden
dataSource_bundle_loadFailed=Konnte die Bundle-Daten nicht laden
@@ -1661,6 +1648,41 @@ view_alert_definition_notification_cliScript_editor_script=Skript
view_alert_definition_notification_cliScript_editor_thisUser=Aktueller Benutzer
view_autoDiscoveryQ_confirmSelect=Sollen auch die Kinder der Platform ausgewählt werden?
view_autoDiscoveryQ_showStatus=Zeige
+common_title_count=Anzahl
+common_title_resource_key=Ressourcen-Schlüssel
+common_title_resource_type=Ressourcen-Typ
+common_title_results_count=Anzahl Ergebnisse
+common_title_results_count_tooltip=Zeige diese Anzahl Ergebnisse an
+common_title_stop=Stop
+common_title_sort_order=Sortierreihenfolge
+common_title_sort_order_tooltip=Legt die Sortierreihenfolge für Ergebnisse fest.
+common_title_metric_chart=Metrik-Diagramm
+common_title_operation_status=Status der Operation
+common_title_recent_bundle_deployments=Kürzliche Bundle-Deployments
+common_title_recent_configuration_updates=Frische Konfigurationsaktualisierungen
+common_title_recent_event_counts=Anzahl frischer Events
+common_title_recent_measurements=Frische Messwerte
+common_title_recent_oob_metrics=Kürzlich aus dem Ruder gelaufene Metriken
+dataSource_users_invalidEmailAddress=Ungültige E-Mail-Adresse
+dataSource_users_passwordsDoNotMatch=Passworte stimmen nicht überein.
+view_alerts_field_ack_status_ack=Best.\\ ({0})
+view_alerts_field_ack_status_ackHover=Bestätigt durch {0} um {1}
+view_alerts_field_ack_status_noAck=Unbest.
+view_alerts_field_ack_status_noAckHover=Noch nicht bestätigt
+view_core_noRecentAlerts=Es liegen keine frischen Alarme vor
+view_dynagroup_compatible=Kompatible
+view_dynagroup_mixed=Gemischt
+view_inventory_summary_agent_error3=Sie haben nicht die Rechte, um die Details für diesen Agent anzusehen.
+view_inventory_unavailableServers=Nichtverfügbare Server
+view_messageCenter_clearAllMessages=Alle Nachrichten löschen
+view_messageCenter_lastNMessages=Letzte {0} Nachrichten
+view_messageCenter_messageBarShowDetails=Details zeigen
+view_messageCenter_stackTraceFollows=--- STACK TRACE FOLGT ---
+view_operationHistoryDetails_noResults=Diese Operation liefert keine Ergebnisse zurück.
+view_operationScheduleDetails_enterParametersBelow=Geben Sie die Parameter unten an...
+view_operationScheduleDetails_field_description=Beschreibung
+view_operationScheduleDetails_field_parameters=Parameter
+view_operationScheduleDetails_noParameters=Diese Operation benötigt keine Parameter.
commit 34a417ec03c5278c3aaf79d878bcdf2f824e57f2
Merge: 1bba9e4 acdaf3f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:23:12 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 1bba9e4a61e82160afc7924e167f3da56187cabb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:22:40 2011 +0200
BZ-698320 Make '=' stateful, as otherwise the counter is not reset when the condition is not true.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
index 09d3e81..bd5aabc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
@@ -27,8 +27,8 @@ public enum AlertConditionOperator {
* absolute value comparison operators
*/
LESS_THAN_OR_EQUAL_TO(Type.STATEFUL), //
- LESS_THAN(Type.STATEFUL), //
- EQUALS(Type.STATELESS), //
+ LESS_THAN(Type.STATEFUL), //
+ EQUALS(Type.STATEFUL), //
REGEX(Type.STATELESS), // more flexible form of EQUALS
GREATER_THAN(Type.STATEFUL), //
GREATER_THAN_OR_EQUAL_TO(Type.STATEFUL), //
@@ -56,17 +56,17 @@ public enum AlertConditionOperator {
}
public enum Type {
- /*
- * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
+ /*
+ * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
* condition threshold is met, stateful cache elements are disabled until the threshold is crossed once again
* into the expected range;
*/
STATEFUL,
/*
- * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
+ * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
* worried about being able to suppress sliding-scale conditions once a threshold is meet, mark your operator
- * as stateful
+ * as stateful
*/
STATELESS,
commit acdaf3fed4df4adaf5dadcbedc95f1cc736e2479
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 27 07:42:08 2011 -0400
pkg history group/resource portlet link fix.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
index 83f047b..7e02ec9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
@@ -30,7 +30,6 @@ import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -231,7 +230,9 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
String title = history.getPackageVersion().getFileName() + ":";
String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + groupId
+ "&selectedHistoryId=" + history.getId();
- LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ //spinder 4/27/11: diabling links as they point into portal.war content pages
+ // LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ StaticTextItem link = AbstractActivityView.newTextItem(title);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(history.getTimestamp()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
index 3ead00a..6071704 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
@@ -22,7 +22,6 @@ import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -120,7 +119,9 @@ public class ResourcePkgHistoryPortlet extends GroupPkgHistoryPortlet {
String title = history.getPackageVersion().getFileName() + ":";
String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + resourceId
+ "&selectedHistoryId=" + history.getId();
- LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ //spinder 4/27/11: diabling links as they point into portal.war content pages
+ // LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ StaticTextItem link = AbstractActivityView.newTextItem(title);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(history.getTimestamp()));
commit 8e53d0bf2d74f06f299a8c7fb0e1115a8765fa27
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 27 03:57:31 2011 -0400
-converted iframe of Group>Monitor>Table page to gwt.
-reenabled compare metric functionality from monitor>tables.
-commented out regions of CompareMetrics for better iframing in coreGui
-i18n messages for the new widgets.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 6e7415f..1ffc4db 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -657,8 +657,16 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
public static class ChartViewWindow extends LocatableWindow {
public ChartViewWindow(String locatorId, String title) {
+ this(locatorId, title, null);
+ }
+
+ public ChartViewWindow(String locatorId, String title, String windowTitle) {
super(locatorId);
- setTitle(CHART_TITLE + ": " + title);
+ if ((windowTitle != null) && (!windowTitle.trim().isEmpty())) {
+ setTitle(windowTitle + ": " + title);
+ } else {
+ setTitle(CHART_TITLE + ": " + title);
+ }
setShowMinimizeButton(true);
setShowMaximizeButton(true);
setShowCloseButton(true);
@@ -680,6 +688,7 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
}
}
});
+
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index 8cb6a1d..e980129 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -60,11 +60,14 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.G
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.HistoryGroupPluginConfigurationView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.MembersView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.GroupMeasurementTableView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.GroupMembersHealthView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.traits.TraitsView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history.GroupOperationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.schedule.GroupOperationScheduleListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.ActivityView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* Right panel of the Resource Group view (#ResourceGroup/*).
@@ -275,8 +278,18 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- return new FullHTMLPane(monitorTables.extendLocatorId("View"),
- "/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId);
+ // return new FullHTMLPane(monitorTables.extendLocatorId("View"),
+ // "/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId);
+ //gwt version of group table view.
+ LocatableVLayout groupTableView = new LocatableVLayout(monitorTables
+ .extendLocatorId("monitorTable"));
+ GroupMeasurementTableView metrics = new GroupMeasurementTableView(monitorTables
+ .extendLocatorId("ViewMetrics"), groupComposite, groupId);
+ GroupMembersHealthView memberHealth = new GroupMembersHealthView(monitorTables
+ .extendLocatorId("ViewHealth"), groupId, false);
+ groupTableView.addMember(metrics);
+ groupTableView.addMember(memberHealth);
+ return groupTableView;
}
};
updateSubTab(this.monitoringTab, this.monitorTables, visible, true, viewFactory);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java
new file mode 100644
index 0000000..0511e9a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java
@@ -0,0 +1,175 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Set;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.ui.MetricDisplaySummary;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.MeasurementTableDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPreferences;
+import org.rhq.enterprise.gui.coregui.client.util.preferences.UserPreferences;
+
+/**
+ * A simple data source to read in metric data summaries for a resource.
+ * This doesn't support paging - everything is returned in one query. Since
+ * the number of metrics per resource is relatively small (never more than tens of them),
+ * we just load them all in at once.
+ *
+ * @author John Mazzitelli
+ * @author Simeon PInder
+ */
+public class GroupMeasurementTableDataSource extends MeasurementTableDataSource {
+
+ public static final String FIELD_MEMBERS_REPORTING = "membersReporting";
+
+ private int groupId;
+ private ResourceGroupComposite groupComposite;
+
+ public GroupMeasurementTableDataSource(ResourceGroupComposite groupComposite, int groupId) {
+ super(groupId);
+ this.groupComposite = groupComposite;
+ this.groupId = groupId;
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+
+ ListGridField memberCountField = new ListGridField(FIELD_MEMBERS_REPORTING, MSG
+ .common_title_members_reporting());
+ memberCountField.setWidth("15%");
+ fields.add(memberCountField);
+
+ ListGridField nameField = new ListGridField(FIELD_METRIC_LABEL, MSG.common_title_name());
+ //launching modal window, not normal link so javascript target set.
+ nameField.setType(ListGridFieldType.LINK);
+ nameField.setTarget("javascript");
+ nameField.setWidth("30%");
+ fields.add(nameField);
+
+ ListGridField alertsField = new ListGridField(FIELD_ALERT_COUNT, MSG.view_resource_monitor_table_alerts());
+ alertsField.setWidth("10%");
+ fields.add(alertsField);
+
+ ListGridField minField = new ListGridField(FIELD_MIN_VALUE, MSG.view_resource_monitor_table_min());
+ minField.setWidth("15%");
+ fields.add(minField);
+
+ ListGridField maxField = new ListGridField(FIELD_MAX_VALUE, MSG.view_resource_monitor_table_max());
+ maxField.setWidth("15%");
+ fields.add(maxField);
+
+ ListGridField avgField = new ListGridField(FIELD_AVG_VALUE, MSG.view_resource_monitor_table_avg());
+ avgField.setWidth("15%");
+ fields.add(avgField);
+
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MetricDisplaySummary from) {
+ MeasurementUtility.formatSimpleMetrics(from);
+
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_METRIC_LABEL, from.getLabel());
+ record.setAttribute(FIELD_ALERT_COUNT, String.valueOf(from.getAlertCount()));
+ record.setAttribute(FIELD_MIN_VALUE, getMetricStringValue(from.getMinMetric()));
+ record.setAttribute(FIELD_MAX_VALUE, getMetricStringValue(from.getMaxMetric()));
+ record.setAttribute(FIELD_AVG_VALUE, getMetricStringValue(from.getAvgMetric()));
+ record.setAttribute(FIELD_METRIC_DEF_ID, from.getDefinitionId());
+ record.setAttribute(FIELD_METRIC_SCHED_ID, from.getScheduleId());
+ record.setAttribute(FIELD_METRIC_UNITS, from.getUnits());
+ record.setAttribute(FIELD_METRIC_NAME, from.getMetricName());
+ record.setAttribute(FIELD_MEMBERS_REPORTING, from.getNumberCollecting());
+ return record;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final Criteria unused) {
+ final ResourceGroupComposite groupComposite = this.groupComposite;
+ final ResourceGroup group = groupComposite.getResourceGroup();
+ // Load the fully fetched ResourceType.
+ ResourceType groupType = group.getResourceType();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ groupType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.measurements, ResourceTypeRepository.MetadataType.events,
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ group.setResourceType(type);
+ //metric definitions
+ Set<MeasurementDefinition> definitions = type.getMetricDefinitions();
+
+ //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
+ final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition definition : definitions) {
+ measurementDefMap.put(definition.getDisplayName(), definition);
+ }
+ //bundle definition ids for asynch call.
+ int[] definitionArrayIds = new int[definitions.size()];
+ final String[] displayOrder = new String[definitions.size()];
+ measurementDefMap.keySet().toArray(displayOrder);
+ //sort the charting data ex. Free Memory, Free Swap Space,..System Load
+ Arrays.sort(displayOrder);
+
+ //organize definitionArrayIds for ordered request on server.
+ int index = 0;
+ for (String definitionToDisplay : displayOrder) {
+ definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay).getId();
+ }
+
+ UserPreferences prefs = UserSessionManager.getUserPreferences();
+ MeasurementUserPreferences mprefs = new MeasurementUserPreferences(prefs);
+ ArrayList<Long> range = mprefs.getMetricRangePreferences().getBeginEndTimes();
+
+ //now retrieve metric display sumamries
+ GWTServiceLookup.getMeasurementChartsService().getMetricDisplaySummariesForCompatibleGroup(groupId,
+ definitionArrayIds, Long.valueOf(range.get(0)).longValue(),
+ Long.valueOf(range.get(1)).longValue(), false,
+ new AsyncCallback<ArrayList<MetricDisplaySummary>>() {
+ @Override
+ public void onSuccess(ArrayList<MetricDisplaySummary> result) {
+ ArrayList<MetricDisplaySummary> validSummaries = new ArrayList<MetricDisplaySummary>();
+ for (MetricDisplaySummary mds : result) {
+ if (mds.getValuesPresent()) {//include only populated datapoints.
+ validSummaries.add(mds);
+ }
+ }
+ response.setData(buildRecords(validSummaries));
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Cannot load metrics", caught);
+ }
+ });
+ }
+ });
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
new file mode 100644
index 0000000..69f990c
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
@@ -0,0 +1,77 @@
+/*
+ * 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.inventory.groups.detail.monitoring.table;
+
+import java.util.ArrayList;
+
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.events.CellClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellClickHandler;
+
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.components.measurement.UserPreferencesMeasurementRangeEditor;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+
+/**
+ * Views a resource's measurements in a tabular view.
+ *
+ * @author John Mazzitelli
+ * @author Simeon Pinder
+ */
+public class GroupMeasurementTableView extends Table<GroupMeasurementTableDataSource> {
+
+ private final int groupId;
+
+ public GroupMeasurementTableView(String locatorId, ResourceGroupComposite groupComposite, int groupId) {
+ super(locatorId);
+ this.groupId = groupId;
+ setDataSource(new GroupMeasurementTableDataSource(groupComposite, groupId));
+ //disable fields used when is full screen
+ setShowFooterRefresh(false);
+ setTitle(MSG.common_title_numeric_metrics());
+ }
+
+ protected void configureTable() {
+ ArrayList<ListGridField> fields = getDataSource().getListGridFields();
+
+ //add cell click handler to execute on Table data entries.
+ getListGrid().addCellClickHandler(new CellClickHandler() {
+ @Override
+ public void onCellClick(CellClickEvent event) {
+ Record record = event.getRecord();
+ String title = record.getAttribute(GroupMeasurementTableDataSource.FIELD_METRIC_LABEL);
+ ChartViewWindow window = new ChartViewWindow("MeasurementTableFrame", title);
+ //Ex. /resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId=10141&m=10172
+ //generate and include iframed content
+ String defId = record.getAttribute(GroupMeasurementTableDataSource.FIELD_METRIC_DEF_ID);
+ String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId=";
+ destination += groupId + "&m=" + defId;
+ FullHTMLPane iframe = new FullHTMLPane("MeasurementTableFrameView", destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+ setListGridFields(fields.toArray(new ListGridField[getDataSource().getListGridFields().size()]));
+ addExtraWidget(new UserPreferencesMeasurementRangeEditor(extendLocatorId("range")), true);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
new file mode 100644
index 0000000..30617a8
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
@@ -0,0 +1,96 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.inventory.groups.detail.monitoring.table;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.MembersView;
+
+/**
+ * The content pane for the group Monitoring>Tables subtab.
+ *
+ * @author Jay Shaughnessy
+ * @author Simeon Pinder
+ */
+public class GroupMembersHealthView extends MembersView {
+
+ private int groupId;
+ private boolean canModifyMembers;
+
+ public GroupMembersHealthView(String locatorId, int groupId, boolean canModifyMembers) {
+ super(locatorId, groupId, false);
+ this.canModifyMembers = canModifyMembers;
+ this.groupId = groupId;
+ setShowFilterForm(false);
+ setShowFooterRefresh(false);
+ //diable search view
+ setHideSearchBar(true);
+ setTitle(MSG.common_title_group_member_health());
+ }
+
+ @Override
+ protected void configureTable() {
+ List<ListGridField> fields = createFields();
+ //add extra list grid field for alerts
+ setListGridFields(fields.toArray(new ListGridField[fields.size()]));
+
+ //add chart selected metric action
+ addTableAction(extendLocatorId("chartValues"), MSG.common_title_compare_metrics(), new TableAction() {
+ @Override
+ public boolean isEnabled(ListGridRecord[] selection) {
+ return selection != null && selection.length > 1;
+ }
+
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ if (selection == null || selection.length == 0) {
+ return;
+ }
+ // keyed on metric name - string[0] is the metric label, [1] is the units
+ final HashMap<String, String[]> scheduleNamesAndUnits = new HashMap<String, String[]>();
+ int[] resourceIds = new int[selection.length];
+ int i = 0;
+ for (ListGridRecord record : selection) {
+ Integer defId = record.getAttributeAsInt(FIELD_ID);
+ resourceIds[i++] = defId.intValue();
+ }
+
+ //build portal.war chart page to iFrame
+ String destination = "/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
+ for (int rId : resourceIds) {
+ destination += "&r=" + rId;
+ }
+ ChartViewWindow window = new ChartViewWindow(extendLocatorId("CompareWindow"), "", MSG
+ .common_title_compare_metrics());
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(extendLocatorId("View"), destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
index 8228061..8913ab7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
@@ -112,7 +112,7 @@ public class MeasurementTableDataSource extends RPCDataSource<MetricDisplaySumma
return record;
}
- private String getMetricStringValue(MetricDisplayValue value) {
+ protected String getMetricStringValue(MetricDisplayValue value) {
return (value != null) ? value.toString() : "";
}
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 e51c083..e586fe3 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
@@ -107,6 +107,7 @@ common_title_category = Category
common_title_change_refresh_time=Refresh Interval
common_title_columns = Columns
common_title_configuration = Configuration
+common_title_compare_metrics = Compare Metrics
common_title_compatibleGroups = Compatible Groups
common_title_compatibleGroups_total = Compatible Group Total
common_title_component_errors = Component Errors
@@ -130,6 +131,7 @@ common_title_generalProp = General Properties
common_title_group = Group
common_title_groups = Groups
common_title_group_def_total = Group Definition Total
+common_title_group_member_health = Group Member Health
common_title_icon =
common_title_id = ID
common_title_id_parent = Parent ID
@@ -142,6 +144,7 @@ common_title_lastUpdated = Last Updated
common_title_lastUpdatedBy = Last Updated By
common_title_ldapGroups = LDAP Groups
common_title_mashup = Mashup
+common_title_members_reporting = Members Reporting
common_title_message = Message
common_title_metric = Metric
common_title_metric_chart = Metric Chart
@@ -149,6 +152,7 @@ common_title_mixedGroups = Mixed Groups
common_title_mixedGroups_total = Mixed Group Total
common_title_name = Name
common_title_new_dashboard = New Dashboard
+common_title_numeric_metrics = Numeric Metrics
common_title_numeric_type = Numeric Type
common_title_operation_status = Operation Status
common_title_operations = Operations
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
index 379c720..4a2949c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
@@ -68,18 +68,18 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
symbol="LAST_KEY"
var="last"/>
<!-- COMPARE METRICS TITLE Need to bring this back once we get the groupname in the params-->
-<%--<c:set var="titleName" value="${CompareMetricsForm.name}" />--%>
+<%--<c:set var="titleName" value="${CompareMetricsForm.name}" />
<tiles:insert definition=".page.title.resource.generic">
<tiles:put name="titleKey" value="resource.common.monitor.visibility.CompareMetricsTitle"/>
- <tiles:put name="titleName" beanName="titleName" />
-</tiles:insert>
-<html:form action="/resource/common/monitor/visibility/CompareMetrics">
+ <tiles:put name="titleName" beanName="titleName" />
+</tiles:insert>--%>
+<!--<html:form action="/resource/common/monitor/visibility/CompareMetrics">-->
-<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
+<!--<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
<fmt:message key="resource.common.monitor.visibility.CompareMetricsReturnLink">
<fmt:param value="${TitleParam}"/>
</fmt:message>
-</html:link>
+</html:link>-->
<tiles:insert definition=".header.tab">
<tiles:put name="tabKey" value="resource.common.monitor.visibility.CompareMetricsTab"/>
</tiles:insert>
@@ -136,8 +136,13 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
</c:url>
<tr class="ListRow">
<td class="ListCellCheckbox"> </td>
- <td width="1%" class="ListCellCheckbox"><a href="<c:out value="${chartUrl}" />"><html:img page="/images/icon_chart.gif" width="10" height="10" alt="" border="0"/></a></td>
- <td class="ListCell"><a href="<c:out value="${chartUrl}" />"><c:out value="${metricList.key.displayName}" /></a></td>
+ <td width="1%" class="ListCellCheckbox"><!--<a href="<c:out value="${chartUrl}" />">-->
+ <html:img page="/images/icon_chart.gif" width="10" height="10" alt="" border="0"/>
+ <!--</a> --></td>
+ <td class="ListCell">
+ <!--<a href="<c:out value="${chartUrl}" />">-->
+ <c:out value="${metricList.key.displayName}" />
+ <!--</a>--></td>
<td class="ListCellRight" nowrap> </td>
<td class="ListCellRight" nowrap> </td>
<td class="ListCellRight" nowrap> </td>
@@ -154,9 +159,9 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
<td class="ListCellCheckbox"> </td>
<td width="1%" class="ListCellCheckbox"> </td>
<td class="ListCell">
- <a href="<c:out value="${singleResourceSingleMetricChartUrl}"/>">
+ <!--<a href="<c:out value="${singleResourceSingleMetricChartUrl}"/>">-->
<c:out value="${rmds.resource.name}"/>
- </a>
+ <!--</a>-->
</td>
<td class="ListCellRight" width="%5" nowrap><c:out value="${rmds.metrics[min].valueFmt}" /></td>
<c:choose>
@@ -181,11 +186,11 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
<tiles:put name="useCurrentButton" value="true"/>
</tiles:insert>
</div>
-<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
+<!--<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
<fmt:message key="resource.common.monitor.visibility.CompareMetricsReturnLink">
<fmt:param value="${TitleParam}"/>
</fmt:message>
-</html:link>
+</html:link>-->
<html:hidden property="groupId"/>
<html:hidden property="category"/>
commit 9fa27ab58dfd8ce9eb94e346ada11a96620c2e96
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 17:48:07 2011 -0400
[BZ 699542 - Intermittent Serialization issues with Hibernate types]
This is a fix that I think solves the issue. It introduces changes
and logging that indicate that a potential problem in HibernateDetcahUtility
has been identified and avoided. In short we treated System.identityHashCode()
as if it guaranteed unique values, which it may not. We now handle the
situation whete the identity hash may in fact not be unique among the set
of objects being scrubbed.
The logging will be tuned down in a subsequent commit but for now dumps out
the objects that have the same hash but are not the same.
diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
index dcc6643..deddb02 100644
--- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
+++ b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
@@ -57,33 +57,51 @@ public class HibernateDetachUtility {
public static void nullOutUninitializedFields(Object value, SerializationType serializationType) throws Exception {
long start = System.currentTimeMillis();
- Set<Integer> checkedObjs = new HashSet<Integer>();
- nullOutUninitializedFields(value, checkedObjs, 0, serializationType);
+ Map<Integer, Object> checkedObjects = new HashMap<Integer, Object>();
+ nullOutUninitializedFields(value, checkedObjects, 0, serializationType);
long duration = System.currentTimeMillis() - start;
if (duration > 1000) {
- LOG.info("Detached [" + checkedObjs.size() + "] objects in [" + duration + "]ms");
+ LOG.info("Detached [" + checkedObjects.size() + "] objects in [" + duration + "]ms");
} else {
- LOG.debug("Detached [" + checkedObjs.size() + "] objects in [" + duration + "]ms");
+ LOG.debug("Detached [" + checkedObjects.size() + "] objects in [" + duration + "]ms");
}
+ // help the garbage collector be clearing these before we leave
+ checkedObjects.clear();
}
- private static void nullOutUninitializedFields(Object value, Set<Integer> nulledObjects, int depth,
+ private static void nullOutUninitializedFields(Object value, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
if (depth > 50) {
LOG.warn("Getting different object hierarchies back from calls: " + value.getClass().getName());
return;
}
- if ((value == null) || nulledObjects.contains(System.identityHashCode(value))) {
+ if (null == value) {
return;
}
- nulledObjects.add(System.identityHashCode(value));
+ // System.identityHashCode is a hash code, and therefore not guaranteed to be unique. And we've seen this
+ // be the case. So, we use it to try and avoid duplicating work, but handle the case when two objects may
+ // have an identity crisis.
+ Integer valueIdentity = System.identityHashCode(value);
+ Object checkedObject = checkedObjects.get(valueIdentity);
+
+ if (null == checkedObject) {
+ checkedObjects.put(valueIdentity, value);
+
+ } else if (value == checkedObject) {
+ return;
+
+ } else {
+ // TODO: this can be tuned down to debug after we're done evaluating this logic
+ LOG.warn("UNEQUAL IDENTITY HASHCODE [" + valueIdentity + "]\n\tCurrent : " + value.getClass().getName()
+ + "\n\t" + value + "\n\tPrevious: " + checkedObject.getClass().getName() + "\n\t" + checkedObject);
+ }
if (value instanceof Object[]) {
Object[] objArray = (Object[]) value;
for (int i = 0; i < objArray.length; i++) {
- nullOutUninitializedFields(objArray[i], nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(objArray[i], checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof List) {
@@ -96,7 +114,7 @@ public class HibernateDetachUtility {
val = replace;
i.set(replace);
}
- nullOutUninitializedFields(val, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(val, checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof Collection) {
@@ -110,14 +128,14 @@ public class HibernateDetachUtility {
replacementItems.add(replacementItem);
item = replacementItem;
}
- nullOutUninitializedFields(item, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(item, checkedObjects, depth + 1, serializationType);
}
collection.removeAll(itemsToBeReplaced);
collection.addAll(replacementItems); // watch out! if this collection is a Set, HashMap$MapSet doesn't support addAll. See BZ 688000
} else if (value instanceof Map) {
for (Object key : ((Map) value).keySet()) {
- nullOutUninitializedFields(((Map) value).get(key), nulledObjects, depth + 1, serializationType);
- nullOutUninitializedFields(key, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(((Map) value).get(key), checkedObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(key, checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof Enum) {
// don't need to detach enums, treat them as special objects
@@ -127,17 +145,17 @@ public class HibernateDetachUtility {
if (serializationType == SerializationType.JAXB) {
XmlAccessorType at = value.getClass().getAnnotation(XmlAccessorType.class);
if (at != null && at.value() == XmlAccessType.FIELD) {
- nullOutFieldsByFieldAccess(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(value, checkedObjects, depth, serializationType);
} else {
- nullOutFieldsByAccessors(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByAccessors(value, checkedObjects, depth, serializationType);
}
} else if (serializationType == SerializationType.SERIALIZATION) {
- nullOutFieldsByFieldAccess(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(value, checkedObjects, depth, serializationType);
}
}
- private static void nullOutFieldsByFieldAccess(Object object, Set<Integer> nulledObjects, int depth,
+ private static void nullOutFieldsByFieldAccess(Object object, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
Class tmpClass = object.getClass();
@@ -147,11 +165,11 @@ public class HibernateDetachUtility {
tmpClass = tmpClass.getSuperclass();
}
- nullOutFieldsByFieldAccess(object, fieldsToClean, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(object, fieldsToClean, checkedObjects, depth, serializationType);
}
- private static void nullOutFieldsByFieldAccess(Object object, List<Field> classFields, Set<Integer> nulledObjects,
- int depth, SerializationType serializationType) throws Exception {
+ private static void nullOutFieldsByFieldAccess(Object object, List<Field> classFields,
+ Map<Integer, Object> checkedObjects, int depth, SerializationType serializationType) throws Exception {
boolean accessModifierFlag = false;
for (Field field : classFields) {
@@ -176,7 +194,7 @@ public class HibernateDetachUtility {
String className = fieldValue.getClass().getName();
className = className.substring(0, className.indexOf("_$$_"));
if (!replacement.getClass().getName().contains("hibernate")) {
- nullOutUninitializedFields(replacement, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(replacement, checkedObjects, depth + 1, serializationType);
field.set(object, replacement);
} else {
@@ -236,7 +254,7 @@ public class HibernateDetachUtility {
replacement = new ArrayList((List) fieldValue);
} else if (fieldValue instanceof Set) {
ArrayList l = new ArrayList((Set) fieldValue); // cannot recurse Sets, see BZ 688000
- nullOutUninitializedFields(l, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(l, checkedObjects, depth + 1, serializationType);
replacement = new HashSet(l); // convert it back to a Set since that's the type of the real collection, see BZ 688000
needToNullOutFields = false;
} else if (fieldValue instanceof Collection) {
@@ -245,7 +263,7 @@ public class HibernateDetachUtility {
setField(object, field.getName(), replacement);
if (needToNullOutFields) {
- nullOutUninitializedFields(replacement, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(replacement, checkedObjects, depth + 1, serializationType);
}
}
@@ -253,7 +271,7 @@ public class HibernateDetachUtility {
if (fieldValue != null
&& (fieldValue.getClass().getName().contains("org.rhq") || fieldValue instanceof Collection
|| fieldValue instanceof Object[] || fieldValue instanceof Map))
- nullOutUninitializedFields((fieldValue), nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields((fieldValue), checkedObjects, depth + 1, serializationType);
}
}
if (accessModifierFlag) {
@@ -282,7 +300,7 @@ public class HibernateDetachUtility {
return replacement;
}
- private static void nullOutFieldsByAccessors(Object value, Set<Integer> nulledObjects, int depth,
+ private static void nullOutFieldsByAccessors(Object value, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
// Null out any collections that aren't loaded
BeanInfo bi = Introspector.getBeanInfo(value.getClass(), Object.class);
@@ -318,7 +336,7 @@ public class HibernateDetachUtility {
} else {
if ((propertyValue instanceof Collection)
|| ((propertyValue != null) && propertyValue.getClass().getName().startsWith("org.rhq.core.domain"))) {
- nullOutUninitializedFields(propertyValue, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(propertyValue, checkedObjects, depth + 1, serializationType);
}
}
}
commit da7bcb054f3c0b7deed1a679bdc15a1049c7770e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:37:05 2011 -0400
Don't trap throwables, let them get passed up so we can detect problems
thrown in HbernateDetach (for example) as opposed to deferring issues to
the serialization step.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
index 7433805..8e1499b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
@@ -18,8 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.server.util;
-import org.rhq.enterprise.server.util.HibernateDetachUtility;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
@@ -27,6 +25,8 @@ import java.io.ObjectOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.enterprise.server.util.HibernateDetachUtility;
+
/**
* @author Greg Hinkle
*/
@@ -34,21 +34,19 @@ public class SerialUtility {
private static Log log = LogFactory.getLog(SerialUtility.class);
- public static <T> T prepare(T value, String message) {
+ public static <T> T prepare(T value, String message) throws Exception {
long start = System.currentTimeMillis();
- try {
- HibernateDetachUtility.nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION);
- if (log.isDebugEnabled())
- log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) +
- "ms, Size is: " + serialSize(value));
- } catch (Exception e) {
- e.printStackTrace();
+ HibernateDetachUtility
+ .nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION);
+ if (log.isDebugEnabled()) {
+ log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start)
+ + "ms, Size is: " + serialSize(value));
}
+
return value;
}
-
public static int serialSize(Object value) {
try {
commit 2ccc5f0c36132b169ac736015c1ce5a40e530cf6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:35:56 2011 -0400
Make sure the slsb calls are wrapped in try/catch and throw
appropriate exceptions.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
index ad42c8c..1b844aa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
@@ -142,15 +142,23 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
}
public ResourceOperationSchedule getResourceOperationSchedule(int scheduleId) throws RuntimeException {
- ResourceOperationSchedule resourceOperationSchedule = operationManager.getResourceOperationSchedule(
- getSessionSubject(), scheduleId);
- return SerialUtility.prepare(resourceOperationSchedule, "getResourceOperationSchedule");
+ try {
+ ResourceOperationSchedule resourceOperationSchedule = operationManager.getResourceOperationSchedule(
+ getSessionSubject(), scheduleId);
+ return SerialUtility.prepare(resourceOperationSchedule, "getResourceOperationSchedule");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
}
public GroupOperationSchedule getGroupOperationSchedule(int scheduleId) throws RuntimeException {
- GroupOperationSchedule groupOperationSchedule = operationManager.getGroupOperationSchedule(getSessionSubject(),
- scheduleId);
- return SerialUtility.prepare(groupOperationSchedule, "getGroupOperationSchedule");
+ try {
+ GroupOperationSchedule groupOperationSchedule = operationManager.getGroupOperationSchedule(
+ getSessionSubject(), scheduleId);
+ return SerialUtility.prepare(groupOperationSchedule, "getGroupOperationSchedule");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
}
public void unscheduleResourceOperation(ResourceOperationSchedule resourceOperationSchedule)
commit 3279b49d5fc317070669bf049c9d051a5639eb18
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:34:50 2011 -0400
make sure initial data load happens for portlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
index 0624311..f88774f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
@@ -104,7 +104,7 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
//disable the refresh timer for this run
currentlyLoading = true;
initializeUi();
- redraw();
+ loadData();
}
/**Defines layout for the portlet page.
commit 62875f0309b333009c97c18b00e03e8fa6d3d178
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 26 12:55:18 2011 -0400
BZ 697699 - do not set autoFitData on the listgrid - it appears to trigger a bug in smartgwt when the list is empty
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 7c8fcc9..3e4b27b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -36,7 +36,6 @@ import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.SelectionStyle;
@@ -88,8 +87,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
-
/**
* A tabular view of set of data records from an {@link RPCDataSource}.
*
@@ -255,7 +252,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
listGrid.setSelectionType(getDefaultSelectionStyle());
if (flexRowDisplay) {
- listGrid.setAutoFitData(Autofit.HORIZONTAL);
+ //listGrid.setAutoFitData(Autofit.HORIZONTAL); // do NOT set this - smartgwt appears to have a problem that causes it to eat CPU
listGrid.setWrapCells(true);
listGrid.setFixedRecordHeights(false);
}
commit ab5402c8d9990f27c568b593445ff97a0018be35
Merge: 8889b7e 2bbcd54
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Apr 26 17:46:34 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 2bbcd54f004ad605d5ffba99c4d31adfdc7cb886
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Apr 26 11:16:59 2011 -0400
update smartgwt war archetype to use SmartGWT 2.4 and bump up its version from 1.0.2 to 1.0.3
diff --git a/etc/m2/smartgwt-war-archetype/pom.xml b/etc/m2/smartgwt-war-archetype/pom.xml
index 261d8e1..d884d8c 100644
--- a/etc/m2/smartgwt-war-archetype/pom.xml
+++ b/etc/m2/smartgwt-war-archetype/pom.xml
@@ -8,7 +8,7 @@
<groupId>org.rhq.maven</groupId>
<artifactId>smartgwt-war-archetype</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3</version>
<!-- As of v2.0 of the archetype plugin, using 'maven-archetype' as the
packaging doesn't work correctly, so use 'jar' instead. -->
<!--<packaging>maven-archetype</packaging>-->
diff --git a/etc/m2/smartgwt-war-archetype/src/main/resources/archetype-resources/pom.xml b/etc/m2/smartgwt-war-archetype/src/main/resources/archetype-resources/pom.xml
index 5b99b5f..f092a4d 100644
--- a/etc/m2/smartgwt-war-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/etc/m2/smartgwt-war-archetype/src/main/resources/archetype-resources/pom.xml
@@ -18,10 +18,10 @@
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<gwt.version>2.0.4</gwt.version>
- <smartgwt.version>2.2</smartgwt.version>
+ <smartgwt.version>2.4</smartgwt.version>
- <maven.compiler.source>1.5</maven.compiler.source>
- <maven.compiler.target>1.5</maven.compiler.target>
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
commit 70e719c5ecdb3f0671248e3603f86832398d267f
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Apr 26 10:27:22 2011 -0400
697586: removing jquery reference in CoreGui.html. Dashboard single metric graphs and Activity sparklines continue to work.
Unsure if there are other places that may still reference these libraries so only commenting for now.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index 7659443..5432ecb 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -7,8 +7,8 @@
<script type="text/javascript">
var isomorphicDir = "org.rhq.enterprise.gui.coregui.CoreGUI/sc/";
</script>
- <script type="text/javascript" src="js/jquery-1.4.4.js"></script>
- <script type="text/javascript" src="js/jquery.sparkline-1.6.js"></script>
+ <!--<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
+ <script type="text/javascript" src="js/jquery.sparkline-1.6.js"></script>-->
<!-- support internationalized characters -->
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
commit 2aca1350343fe1dae6d2667dc48d0baddd5b8457
Merge: 97f1e4a 18f9722
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Apr 26 10:22:50 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 97f1e4a21981274064e0abb3c1b485a3e3b27fd0
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Apr 26 10:20:15 2011 -0400
Adding a temporary hack for zipping up all plugins (agent and server)
This is temporary work around for hudson builds. Zipping up all of the
plugins is normally done as a post-build action using the M2 Extra Steps
hudson plugin; however, that plugin is not yet available on the new
hudson server. Once the plugin is available, the changes in this commit
will be undone.
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index b4116aa..4905ef7 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -431,6 +431,42 @@
</plugins>
</build>
</profile>
+
+ <!--
+ As the profile id indicates, this is a short-term temporary hack until
+ our hudson server gets the M2 Extra Build Steps plugin involved. Once
+ that plugin is available, this profile along with the shell script it
+ references will be removed.
+ -->
+ <profile>
+ <id>hudson-hack</id>
+ <activation>
+ <property>
+ <name>hudson.hack</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-plugin-zip</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <executable>${basedir}/src/main/shell/zip_all_plugins</executable>
+ <workingDirectory>../../../</workingDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/modules/enterprise/server/container/src/main/shell/zip_all_plugins b/modules/enterprise/server/container/src/main/shell/zip_all_plugins
new file mode 100755
index 0000000..dd823b6
--- /dev/null
+++ b/modules/enterprise/server/container/src/main/shell/zip_all_plugins
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+rm -rf rhq-plugin-pack-all-SNAPSHOT.zip
+zip -r1 rhq-plugin-pack-all-SNAPSHOT.zip plugins/* enterprise/server/plugins/* -i *.jar
commit 18f9722ccdd6bae13576e0bf5e790a9fd4849b55
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Apr 26 09:07:44 2011 -0400
enable MMSR for resource>monitor>tables. Group has different iframe impl.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
index f79dfef..66667e9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
@@ -34,10 +34,12 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.measurement.UserPreferencesMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
@@ -127,6 +129,49 @@ public class MeasurementTableView extends Table<MeasurementTableDataSource> {
});
}
});
+ //add chart selected metric action
+ addTableAction(extendLocatorId("chartValues"), MSG.view_measureTable_chartMetricValues(), new TableAction() {
+ @Override
+ public boolean isEnabled(ListGridRecord[] selection) {
+ return selection != null && selection.length > 0;
+ }
+
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ if (selection == null || selection.length == 0) {
+ return;
+ }
+ // keyed on metric name - string[0] is the metric label, [1] is the units
+ final HashMap<String, String[]> scheduleNamesAndUnits = new HashMap<String, String[]>();
+ int[] definitionIds = new int[selection.length];
+ int i = 0;
+ for (ListGridRecord record : selection) {
+ Integer defId = record.getAttributeAsInt(MeasurementTableDataSource.FIELD_METRIC_DEF_ID);
+ definitionIds[i++] = defId.intValue();
+
+ String name = record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_NAME);
+ String label = record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_LABEL);
+ String units = record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_UNITS);
+ if (units == null || units.length() < 1) {
+ units = MeasurementUnits.NONE.name();
+ }
+
+ scheduleNamesAndUnits.put(name, new String[] { label, units });
+ }
+
+ //build portal.war chart page to iFrame
+ String destination = "/resource/common/monitor/Visibility.do?mode=chartMultiMetricSingleResource&id="
+ + resourceId;
+ for (int mId : definitionIds) {
+ destination += "&m=" + mId;
+ }
+ ChartViewWindow window = new ChartViewWindow(extendLocatorId("ChartWindow"), "");
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(extendLocatorId("View"), destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
}
private void showLiveData(ArrayList<ListGridRecord> records) {
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 8764f1f..e51c083 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
@@ -1362,6 +1362,7 @@ view_bundle_deployWizard_title = Bundle Deployment Wizard
# =================== Measurement Views =====================
+view_measureTable_chartMetricValues = Chart Selected Metrics
view_measureTable_getLive = Get Live Value
view_measureTable_getLive_failure = Cannot get live values for those metrics. Make sure the agent is running and the managed resource is up.
view_measureTable_live_title = Live Data
commit 39a50b7c6e5466c241cf158a3b1424512e3b03d4
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Apr 26 07:53:13 2011 -0400
some links cleanup and removal of traliing colon.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index e25b70a..7198004 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -391,7 +391,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
graphContainer.setCanvas(graph);
//Link/title element
- final String title = md.getDisplayName() + ":";
+ final String title = md.getDisplayName();
// String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
// + resourceId + "&m=" + md.getId();
final String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId="
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index 16a591e..69ee7ee 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -220,7 +220,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
.getScheduleName()));
row.setNumCols(2);
- final String title = oob.getScheduleName() + ":";
+ final String title = oob.getScheduleName();
final String destination = "/resource/common/monitor/Visibility.do?m="
// + oob.getDefinitionId() + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
+ oob.getDefinitionId() + "&groupId=" + groupId
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
index 2b33dfb..a6c8005 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
@@ -108,7 +108,7 @@ public class ResourceOobsPortlet extends GroupOobsPortlet {
.getScheduleName()));
row.setNumCols(2);
- final String title = oob.getScheduleName() + ":";
+ final String title = oob.getScheduleName();
final String destination = "/resource/common/monitor/Visibility.do?m="
+ oob.getDefinitionId() + "&id=" + resourceId + "&mode=chartSingleMetricSingleResource";
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
commit 16eea2da6c4daf19992f735278c530197f861526
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Apr 26 07:05:24 2011 -0400
i)Disable parent & resource links in portal.war for display in coregui
ii)re-enable ChartLegend.jsp as needed to distinguish between graph data in SMMR
iii)fix problem with GroupOobs portlet links.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 1acb948..e25b70a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -408,6 +408,8 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
FullHTMLPane iframe = new FullHTMLPane(
recentMeasurementsContent
.extendLocatorId("View"), destination);
+ // .extendLocatorId("View"),
+ // AbstractActivityView.iframeLink(destination));
window.addItem(iframe);
window.show();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index 5ec50f9..16a591e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -222,7 +222,9 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
final String title = oob.getScheduleName() + ":";
final String destination = "/resource/common/monitor/Visibility.do?m="
- + oob.getDefinitionId() + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
+ // + oob.getDefinitionId() + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
+ + oob.getDefinitionId() + "&groupId=" + groupId
+ + "&mode=chartSingleMetricSingleResource";
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
link.addClickHandler(new ClickHandler() {
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 5554bde..6e7415f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -682,4 +682,12 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
});
}
}
+
+ public static String iframeLink(String destination) {
+ String link = destination;
+ if (destination != null) {
+ link += "&iframe=true";
+ }
+ return link;
+ }
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartLegend.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartLegend.jsp
index 2034298..87b624a 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartLegend.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartLegend.jsp
@@ -19,18 +19,18 @@
<fmt:formatNumber var="imgidx" pattern="00" value="${resStatus.index + 1}"/>
<p><b><fmt:message key="resource.common.monitor.visibility.chart.ResourceLabel"/></b>
<html:img page="/images/icon_resource_${imgidx}.gif" width="11" height="11" border="0"/>
- <html:link href="${parentResourceUrl}">
+ <%--<html:link href="${parentResourceUrl}">--%>
<c:out value="${resource.parentResource.name}"/>
- </html:link>
+ <%--</html:link>--%>
<br>
<html:img page="/images/hierarchy.gif" width="16" height="16" alt="" border="0"/>
- <html:link href="${resourceUrl}">
+ <%--<html:link href="${resourceUrl}">--%>
<c:out value="${resource.name}"/>
- </html:link>
+ <%--</html:link>--%>
<br>
</c:forEach>
</td>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
index 37a66b2..31b557f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
@@ -69,6 +69,11 @@
height="1" border="0"/></td>
</tr>
<tr>
+ <td class="MonitorChartCell">
+ <tiles:insert definition=".resource.common.monitor.visibility.charts.metric.chartlegend"/>
+ </td>
+ </tr>
+ <tr>
<td class="MonitorChartBlock" colspan="3">
<tiles:insert page="/resource/common/monitor/visibility/ChartTimeIntervalToolbar.jsp">
<tiles:put name="rangeNow" beanName="ViewChartForm" beanProperty="rangeNow"/>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
index 67bf63c..e1bb7d3 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
@@ -155,14 +155,14 @@
"
</c:if>
class="<c:out value='${resCellClass}'/>" valign="top">
- <html:link href="${parentResourceUrl}">
+ <%--<html:link href="${parentResourceUrl}">--%>
<c:out value="${resource.parentResource.name}"/>
- </html:link>
+ <%--</html:link>--%>
<br>
<html:img page="/images/hierarchy.gif" width="16" height="16" alt="" border="0"/>
- <html:link href="${resourceUrl}">
+ <%--<html:link href="${resourceUrl}">--%>
<c:out value="${resource.name}"/>
- </html:link>
+ <%--</html:link>--%>
</td>
</c:if>
<%--
commit f91a12454a88e0a211853e4de92811b1ddf17b27
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 20 16:29:10 2011 -0400
inital commit for iframing metrics/charting:
- Grp/Res metrics and Grp/Res Oobs portets updated to iframe metric chart views in modal.
- modified struts backing pages to comment or remove link/label content still referring to portal.war
- removed lines from MetricChart because commenting was not respected in jsp and corrupted jsp display.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 7ebddfe..1acb948 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -38,6 +38,8 @@ import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.configuration.Configuration;
@@ -52,6 +54,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
@@ -63,6 +66,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigura
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
@@ -387,14 +391,27 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
graphContainer.setCanvas(graph);
//Link/title element
- //TODO: spinder, change link whenever portal.war/graphing is removed.
- String title = md.getDisplayName() + ":";
+ final String title = md.getDisplayName() + ":";
// String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
// + resourceId + "&m=" + md.getId();
- String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId="
+ final String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId="
+ groupId + "&m=" + md.getId();
LinkItem link = AbstractActivityView.newLinkItem(title,
destination);
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ ChartViewWindow window = new ChartViewWindow(
+ recentMeasurementsContent
+ .extendLocatorId("ChartWindow"), title);
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(
+ recentMeasurementsContent
+ .extendLocatorId("View"), destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
//Value
String convertedValue = lastValue + " " + md.getUnits();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index 0428f93..5ec50f9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -33,6 +33,8 @@ import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.configuration.Configuration;
@@ -40,6 +42,7 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
@@ -50,6 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigura
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableCanvas;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -216,10 +220,23 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
.getScheduleName()));
row.setNumCols(2);
- String title = oob.getScheduleName() + ":";
- String destination = "/resource/common/monitor/Visibility.do?m=" + oob.getDefinitionId()
- + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
+ final String title = oob.getScheduleName() + ":";
+ final String destination = "/resource/common/monitor/Visibility.do?m="
+ + oob.getDefinitionId() + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ ChartViewWindow window = new ChartViewWindow(recentOobContent
+ .extendLocatorId("ChartWindow"), title);
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(recentOobContent.extendLocatorId("View"),
+ destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(oob.getTimestamp()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index f046afc..1adc6f3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -34,6 +34,8 @@ import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -45,12 +47,14 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
@@ -257,14 +261,27 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
graphContainer.setCanvas(graph);
//Link/title element
- //TODO: spinder, change link whenever portal.war/graphing is removed.
- String title = md.getDisplayName() + ":";
- // String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
- // + resourceId + "&m=" + md.getId();
- String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
+ final String title = md.getDisplayName();
+ final String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
+ resourceId + "&m=" + md.getId();
+
+ //have link launch modal window on click
LinkItem link = AbstractActivityView.newLinkItem(title,
destination);
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ ChartViewWindow window = new ChartViewWindow(
+ recentMeasurementsContent
+ .extendLocatorId("ChartWindow"), title);
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(
+ recentMeasurementsContent.extendLocatorId("View"),
+ destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
//Value
String convertedValue = lastValue + " " + md.getUnits();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
index a1d0301..2b33dfb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
@@ -24,17 +24,21 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOobsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -104,10 +108,23 @@ public class ResourceOobsPortlet extends GroupOobsPortlet {
.getScheduleName()));
row.setNumCols(2);
- String title = oob.getScheduleName() + ":";
- String destination = "/resource/common/monitor/Visibility.do?m=" + oob.getDefinitionId()
- + "&id=" + resourceId + "&mode=chartSingleMetricSingleResource";
+ final String title = oob.getScheduleName() + ":";
+ final String destination = "/resource/common/monitor/Visibility.do?m="
+ + oob.getDefinitionId() + "&id=" + resourceId + "&mode=chartSingleMetricSingleResource";
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ ChartViewWindow window = new ChartViewWindow(recentOobContent
+ .extendLocatorId("ChartWindow"), title);
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(recentOobContent.extendLocatorId("View"),
+ destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(oob.getTimestamp()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 0ee3647..5554bde 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -28,6 +28,8 @@ import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.FormItemIcon;
@@ -66,6 +68,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
@@ -108,6 +111,7 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
public static String RECENT_BUNDLE_DEPLOY_NONE = MSG.view_resource_inventory_activity_no_recent_bundle_deploy();
public static String SEE_MORE = MSG.common_msg_see_more();
public static String RECENT_CRITERIA_EVENTS_NONE = MSG.view_resource_inventory_activity_criteria_no_recent_events();
+ public static final String CHART_TITLE = MSG.common_title_metric_chart();
private ResourceGroupComposite groupComposite = null;
private ResourceComposite resourceComposite = null;
@@ -649,4 +653,33 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
}
return groupBasePath;
}
+
+ public static class ChartViewWindow extends LocatableWindow {
+
+ public ChartViewWindow(String locatorId, String title) {
+ super(locatorId);
+ setTitle(CHART_TITLE + ": " + title);
+ setShowMinimizeButton(true);
+ setShowMaximizeButton(true);
+ setShowCloseButton(true);
+ setIsModal(true);
+ setShowModalMask(true);
+ setWidth(850);
+ setHeight(650);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ try {
+ hide();
+ } catch (Throwable e) {
+ Log.warn("Cannot destroy chart display window.", e);
+ }
+ }
+ });
+ }
+ }
}
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 b09c159..8764f1f 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
@@ -144,6 +144,7 @@ common_title_ldapGroups = LDAP Groups
common_title_mashup = Mashup
common_title_message = Message
common_title_metric = Metric
+common_title_metric_chart = Metric Chart
common_title_mixedGroups = Mixed Groups
common_title_mixedGroups_total = Mixed Group Total
common_title_name = Name
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portal/MainLayout.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portal/MainLayout.jsp
index d3df96a..2e85aaa 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portal/MainLayout.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portal/MainLayout.jsp
@@ -56,17 +56,19 @@
-->
</head>
<body>
- <tiles:insert attribute="header">
+
+ <!--spinder 4/20/11: commenting for better iframing for coregui. Portal.war full view with menus no longer maintained. -->
+ <!--<tiles:insert attribute="header">
<tiles:put name="breadcrumb" beanName="breadcrumb"/>
<tiles:put name="location" beanName="location"/>
- </tiles:insert>
+ </tiles:insert>-->
<div id="content-full">
- <div id="Breadcrumb">
+ <!--<div id="Breadcrumb">
<tiles:insert attribute="breadcrumb">
<tiles:put name="location" beanName="location"/>
</tiles:insert>
- </div>
+ </div>-->
<tiles:insert attribute='body'/>
</div>
</body>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartParams.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartParams.jsp
index 6e9a712..deca40f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartParams.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ChartParams.jsp
@@ -81,7 +81,8 @@
<td rowspan="4">
<html:img page="/images/spacer.gif" width="30" height="1" border="0"/>
</td>
- <td rowspan="4" valign="top">
+ <!-- commenting for iframe display in coregui.-->
+ <!--<td rowspan="4" valign="top">
<table border="0">
<tr>
@@ -120,7 +121,7 @@
</tr>
</table>
- </td>
+ </td>-->
</tr>
<tr>
<td>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
index 31b557f..37a66b2 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricChart.jsp
@@ -69,11 +69,6 @@
height="1" border="0"/></td>
</tr>
<tr>
- <td class="MonitorChartCell">
- <tiles:insert definition=".resource.common.monitor.visibility.charts.metric.chartlegend"/>
- </td>
- </tr>
- <tr>
<td class="MonitorChartBlock" colspan="3">
<tiles:insert page="/resource/common/monitor/visibility/ChartTimeIntervalToolbar.jsp">
<tiles:put name="rangeNow" beanName="ViewChartForm" beanProperty="rangeNow"/>
commit 0adce27b74ca16adaa58fe278e02c63492d58976
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Apr 25 17:22:53 2011 -0400
Moving surefire plugin configuration outside of profiles
I accidentally added the surefire plugin to the dev profile when it
should have been added to the <build> section outside of any profiles.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 85a2df7..7ea2401 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -143,6 +143,19 @@
<finalName>rhq-installer</finalName>
<plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <rhq.test.ds.server-name>${rhq.test.ds.server-name}</rhq.test.ds.server-name>
+ <rhq.test.ds.connection-url>${rhq.test.ds.connection-url}</rhq.test.ds.connection-url>
+ <rhq.db.admin.username>${rhq.db.admin.username}</rhq.db.admin.username>
+ <rhq.db.admin.password>${rhq.db.admin.password}</rhq.db.admin.password>
+ <rhq.test.ds.user-name>${rhq.test.ds.user-name}</rhq.test.ds.user-name>
+ <rhq.test.ds.password>${rhq.test.ds.password}</rhq.test.ds.password>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
@@ -239,19 +252,6 @@
<build>
<plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemPropertyVariables>
- <rhq.test.ds.server-name>${rhq.test.ds.server-name}</rhq.test.ds.server-name>
- <rhq.test.ds.connection-url>${rhq.test.ds.connection-url}</rhq.test.ds.connection-url>
- <rhq.db.admin.username>${rhq.db.admin.username}</rhq.db.admin.username>
- <rhq.db.admin.password>${rhq.db.admin.password}</rhq.db.admin.password>
- <rhq.test.ds.user-name>${rhq.test.ds.user-name}</rhq.test.ds.user-name>
- <rhq.test.ds.password>${rhq.test.ds.password}</rhq.test.ds.password>
- </systemPropertyVariables>
- </configuration>
- </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
commit e90ce5a4f73a91215ad4736d8954af79a7ed96fc
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Apr 25 16:18:05 2011 -0400
Parameterizing tests so they can be run on hudson
DBInstallationTest previously used hard coded values that assumed
default developer setting in which the database is running on localhost.
The new hudson server uses a database on a different machine, making
necessary the changes to be able to specify different database settings
via system properties.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index c36a444..85a2df7 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -239,6 +239,19 @@
<build>
<plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <rhq.test.ds.server-name>${rhq.test.ds.server-name}</rhq.test.ds.server-name>
+ <rhq.test.ds.connection-url>${rhq.test.ds.connection-url}</rhq.test.ds.connection-url>
+ <rhq.db.admin.username>${rhq.db.admin.username}</rhq.db.admin.username>
+ <rhq.db.admin.password>${rhq.db.admin.password}</rhq.db.admin.password>
+ <rhq.test.ds.user-name>${rhq.test.ds.user-name}</rhq.test.ds.user-name>
+ <rhq.test.ds.password>${rhq.test.ds.password}</rhq.test.ds.password>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
diff --git a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallatonTest.java b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallatonTest.java
index 12f4ac6..354d651 100644
--- a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallatonTest.java
+++ b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallatonTest.java
@@ -45,9 +45,9 @@ import java.util.Properties;
*/
public class DBInstallatonTest {
- final String TEST_DB = "installer_test_db";
- final String USERNAME = "rhqadmin";
- final String PASSWORD = "rhqadmin";
+ final String TEST_DB = "rhq_installer_test_db";
+ final String USERNAME = System.getProperty("rhq.test.ds.user-name", "rhqadmin");
+ final String PASSWORD = System.getProperty("rhq.test.ds.password", "rhqadmin");
ServerInformation installer = new ServerInformation();
@@ -98,9 +98,13 @@ public class DBInstallatonTest {
Statement createDB = null;
try {
- String dbUrl = "jdbc:postgresql://127.0.0.1:5432/postgres";
+ String server = System.getProperty("rhq.test.ds.server-name", "127.0.0.1");
+ String adminUsername = System.getProperty("rhq.db.admin.username", "postgres");
+ String adminPassword = System.getProperty("rhq.db.admin.password", "postgres");
- connection = DbUtil.getConnection(dbUrl, "postgres", "postgres");
+ String dbUrl = "jdbc:postgresql://" + server + ":5432/postgres";
+
+ connection = DbUtil.getConnection(dbUrl, adminUsername, adminPassword);
dropDB = connection.createStatement();
createDB = connection.createStatement();
@@ -161,7 +165,8 @@ public class DBInstallatonTest {
}
private String getTestDbUrl() {
- return "jdbc:postgresql://127.0.0.1:5432/" + TEST_DB;
+ String server = System.getProperty("rhq.test.ds.server-name", "127.0.0.1");
+ return "jdbc:postgresql://" + server + ":5432/" + TEST_DB;
}
commit 4341ebff99fc3af9a7d176229f5c9c9aa6f996ce
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Apr 25 18:17:31 2011 +0200
BZ 697858 - include the resource type resolution in the package type list on the repo details page.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java
index 17ada7a..1e067be 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java
@@ -311,6 +311,14 @@ public class CreateNewPackageUIBean {
}
public SelectItem[] getPackageTypes() {
+ return getPackageTypes(false);
+ }
+
+ public SelectItem[] getPackageTypesWithResourceTypeNames() {
+ return getPackageTypes(true);
+ }
+
+ private SelectItem[] getPackageTypes(boolean includeResourceTypeResolution) {
Resource resource = EnterpriseFacesContextUtility.getResourceIfExists();
List<PackageType> packageTypes = null;
@@ -324,13 +332,18 @@ public class CreateNewPackageUIBean {
SelectItem[] items = new SelectItem[packageTypes.size()];
int itemCounter = 0;
for (PackageType packageType : packageTypes) {
- SelectItem item = new SelectItem(packageType.getId(), packageType.getDisplayName());
+ String displayName = packageType.getDisplayName();
+ if (includeResourceTypeResolution && packageType.getResourceType() != null) {
+ ResourceType rt = packageType.getResourceType();
+ displayName += " [" + rt.getName() + ":" + rt.getPlugin() + "]";
+ }
+ SelectItem item = new SelectItem(packageType.getId(), displayName);
items[itemCounter++] = item;
}
return items;
}
-
+
public SelectItem[] getSubscribedRepos() {
Resource resource = EnterpriseFacesContextUtility.getResource();
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
index 4f8c7c1..b45e738 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
@@ -673,7 +673,7 @@
</h:panelGroup>
<h:panelGroup style="clear: both">
<h:selectOneMenu value="#{CreateNewPackageUIBean.selectedPackageTypeId}">
- <f:selectItems value="#{CreateNewPackageUIBean.packageTypes}"/>
+ <f:selectItems value="#{CreateNewPackageUIBean.packageTypesWithResourceTypeNames}"/>
</h:selectOneMenu>
</h:panelGroup>
commit 3a7c9f5b22134a353e4d7fd6f5cb7a89d26d3b25
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Apr 25 18:03:33 2011 +0200
BZ 698767 - only show the sync button in the repo list page if the user is a repo manager.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListReposUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListReposUIBean.java
index b2b2ed7..0fcbf27 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListReposUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListReposUIBean.java
@@ -25,6 +25,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.content.Repo;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -58,6 +59,11 @@ public class ListReposUIBean extends PagedDataTableUIBean {
return "importRepos";
}
+ public boolean isRepositoryManager() {
+ Subject subject = EnterpriseFacesContextUtility.getSubject();
+ return LookupUtil.getAuthorizationManager().hasGlobalPermission(subject, Permission.MANAGE_REPOSITORIES);
+ }
+
public String syncSelectedRepos() {
Subject subject = EnterpriseFacesContextUtility.getSubject();
String[] selected = getSelectedRepos();
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/listRepos-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/listRepos-plain.xhtml
index 70a4837..ed07a6d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/listRepos-plain.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/listRepos-plain.xhtml
@@ -128,7 +128,7 @@
<onc:selectCommandButton action="#{ListReposUIBean.deleteSelectedRepos}"
value="DELETE SELECTED" target="selectedRepos" styleClass="on-pager-button buttonsmall"/>
- <onc:selectCommandButton action="#{ListReposUIBean.syncSelectedRepos}"
+ <onc:selectCommandButton action="#{ListReposUIBean.syncSelectedRepos}" rendered="#{ListReposUIBean.repositoryManager}"
value="SYNC SELECTED" target="selectedRepos" styleClass="on-pager-button buttonsmall"/>
<ui:param name="paginationDataTableName" value="reposDataTable"/>
commit 75d48dacc84f2d0020f93f6849367e267588b020
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Apr 25 17:55:08 2011 +0200
BZ 698760, BZ 698756 - polishing the repo details page.
Edit mode wasn't functioning due to missed out parameter definitions during conversion from repo.xhtml to repo-plain.xhtml.
The "private" toggle in edit mode wasn't working due to usage of wrong UI bean (a copy&paste bug)
The user with repo manager privs can view any repo now even if s/he isn't an inventory manager - wrong perm check used in the UI.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
index 7b7c974..4f8c7c1 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo-plain.xhtml
@@ -17,6 +17,12 @@
<ui:composition template="/rhq/resource/layout/main-plain.xhtml">
+ <ui:param name="id" value="${param.id}" />
+ <ui:param name="mode" value="${param.mode}" />
+ <ui:param name="pageTitle"
+ value="Repo '#{RepoDetailsUIBean.repo.name}'" />
+ <ui:param name="item" value="#{RepoDetailsUIBean.repo}" />
+
<ui:define name="content">
<h:form id="repoDetailsForm">
@@ -45,7 +51,7 @@
<tr>
<td align="right"><b>Private:</b></td>
<td align="left"><h:selectBooleanCheckbox
- rendered="${mode eq 'edit'}" value="#{CreateRepoUIBean.repo.private}"/>
+ rendered="${mode eq 'edit'}" value="#{RepoDetailsUIBean.repo.private}"/>
<h:outputText rendered="${mode ne 'edit'}" value="#{RepoDetailsUIBean.repo.private}" />
</td>
</tr>
@@ -358,7 +364,7 @@
<!-- SUBSCRIBER RESOURCE LIST -->
- <h:form id="repoResourcesListForm" rendered="#{RepoDetailsUIBean.repositoryManager}">
+ <h:form id="repoResourcesListForm" rendered="#{RepoDetailsUIBean.inventoryManager}">
<input type="hidden" name="id" value="${param.id}" />
<input type="hidden" name="mode" value="${param.mode}" />
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml
index e5b20a2..e03c1f8 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml
@@ -68,7 +68,7 @@
<tr>
<td align="right"><b>Private:</b></td>
<td align="left"><h:selectBooleanCheckbox
- rendered="${mode eq 'edit'}" value="#{CreateRepoUIBean.repo.private}"/>
+ rendered="${mode eq 'edit'}" value="#{RepoDetailsUIBean.repo.private}"/>
<h:outputText rendered="${mode ne 'edit'}" value="#{RepoDetailsUIBean.repo.private}" />
</td>
</tr>
@@ -381,7 +381,7 @@
<!-- SUBSCRIBER RESOURCE LIST -->
- <h:form id="repoResourcesListForm" rendered="#{RepoDetailsUIBean.repositoryManager}">
+ <h:form id="repoResourcesListForm" rendered="#{RepoDetailsUIBean.inventoryManager}">
<input type="hidden" name="id" value="${param.id}" />
<input type="hidden" name="mode" value="${param.mode}" />
commit 6fbf997eafe746e2a493fe020b22f81c3fd48b78
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Apr 25 11:46:19 2011 -0400
More work on column sorting problems [BZ https://bugzilla.redhat.com/show_bug.cgi?id=697484]
- completes all of the columns listed in the bz.
- also, remove the setCanSortClientOnly(true) calls added in the previous
commit for this stuff, it's overly restrictive.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
index b804ad7..7e29d82 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
@@ -56,6 +56,7 @@ public class ResourceOperationHistoryCriteria extends OperationHistoryCriteria {
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
filterOverrides.put("groupOperationHistoryId", "groupOperationHistory.id = ?");
+ sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.id");
sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.name");
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
index 748e6be..9136e35 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
@@ -356,4 +356,15 @@ public class UsersDataSource extends RPCDataSource<Subject, SubjectCriteria> {
return criteria;
}
+ @Override
+ protected String getSortFieldForColumn(String columnName) {
+
+ // this is a calculated field, can't perform server-side sort
+ if (Field.LDAP.equals(columnName)) {
+ return null;
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 85027d2..6475640 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -119,8 +119,6 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
fields.add(nameField);
ListGridField conditionField = new ListGridField("conditionText", MSG.view_alerts_field_condition_text());
- // the cell value is formatted giventhe actual conditions. It can't be sorted server-side.
- conditionField.setCanSortClientOnly(true);
fields.add(conditionField);
ListGridField priorityField = new ListGridField("priority", MSG.view_alerts_field_priority());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java
index e523cad..b122b53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java
@@ -52,7 +52,7 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment,
public static final String FIELD_NAME = "name";
public static final String FIELD_DEPLOY_DIR = "deployDir";
public static final String FIELD_DESCRIPTION = "description";
- public static final String FIELD_DEPLOY_TIME = "deploymentTime";
+ public static final String FIELD_DEPLOY_TIME = "ctime";
public static final String FIELD_ERROR_MESSAGE = "errorMessage";
public static final String FIELD_CONFIG = "configuration";
public static final String FIELD_STATUS = "status";
@@ -146,6 +146,15 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment,
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (FIELD_BUNDLE_VERSION_VERSION.equals(columnName)) {
+ return "bundleVersion.version";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
public BundleDeployment copyValues(Record from) {
return (BundleDeployment) from.getAttributeAsObject("object");
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java
index 094571e..0dab73f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java
@@ -174,6 +174,21 @@ public class BundleDestinationDataSource extends RPCDataSource<BundleDestination
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (FIELD_LATEST_DEPLOY_DATE.equals(columnName)) {
+ return null;
+ }
+ if (FIELD_LATEST_DEPLOY_STATUS.equals(columnName)) {
+ return null;
+ }
+ if (FIELD_LATEST_DEPLOY_VERSION.equals(columnName)) {
+ return null;
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
public BundleDestination copyValues(Record from) {
return (BundleDestination) from.getAttributeAsObject("object");
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java
index 5cfabd6..56d092f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleVersionDataSource.java
@@ -126,6 +126,15 @@ public class BundleVersionDataSource extends RPCDataSource<BundleVersion, Bundle
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (FIELD_FILECOUNT.equals(columnName)) {
+ return null;
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
public BundleVersion copyValues(Record from) {
return (BundleVersion) from.getAttributeAsObject("object");
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
index ea25046..bf9db3e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
@@ -108,14 +108,12 @@ public class BundlesListView extends Table<BundlesWithLatestVersionDataSource> {
MSG.view_bundle_latestVersion());
latestVersionField.setWidth("20%");
latestVersionField.setAlign(Alignment.CENTER);
- latestVersionField.setCanSort(false); // need to figure out how we can sort on this projection field of the composite
ListGridField versionsCountField = new ListGridField(BundlesWithLatestVersionDataSource.FIELD_VERSIONS_COUNT,
MSG.view_bundle_list_versionsCount());
versionsCountField.setType(ListGridFieldType.INTEGER);
versionsCountField.setWidth("*");
versionsCountField.setAlign(Alignment.CENTER);
- versionsCountField.setCanSort(false); // need to figure out how we can sort on this projection field of the composite
setListGridFields(idField, nameField, descField, latestVersionField, versionsCountField);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java
index fc16c70..2b800fb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java
@@ -93,6 +93,18 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (FIELD_LATEST_VERSION.equals(columnName)) {
+ return null;
+ }
+ if (FIELD_VERSIONS_COUNT.equals(columnName)) {
+ return null;
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
public BundleWithLatestVersionComposite copyValues(Record from) {
return (BundleWithLatestVersionComposite) from.getAttributeAsObject("object");
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
index ec486fb..26a99ca 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
@@ -51,7 +51,7 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
public static final String STARTED_TIME = "startedTime";
public static final String CREATED_TIME = "createdTime";
public static final String DURATION = "duration";
- public static final String SUBJECT = "subject";
+ public static final String SUBJECT = "subjectName";
public static final String OPERATION_DEFINITION = "operationDefinition";
public static final String ERROR_MESSAGE = "errorMessage";
public static final String PARAMETERS = "parameters";
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
index 2c426e5..d12c4fa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
@@ -80,7 +80,7 @@ public class EventCompositeDatasource extends RPCDataSource<EventComposite, Even
DataSourceTextField severity = new DataSourceTextField("severity", MSG.view_inventory_eventHistory_severity());
fields.add(severity);
- DataSourceTextField details = new HighlightingDatasourceTextField("details", MSG
+ DataSourceTextField details = new HighlightingDatasourceTextField("detail", MSG
.view_inventory_eventHistory_details());
fields.add(details);
@@ -102,7 +102,7 @@ public class EventCompositeDatasource extends RPCDataSource<EventComposite, Even
record.setAttribute("id", from.getEventId());
record.setAttribute("timestamp", from.getTimestamp());
- record.setAttribute("details", from.getEventDetail());
+ record.setAttribute("detail", from.getEventDetail());
record.setAttribute("severity", from.getSeverity().name());
record.setAttribute("source", from.getSourceLocation());
@@ -157,7 +157,7 @@ public class EventCompositeDatasource extends RPCDataSource<EventComposite, Even
Map<String, Object> criteriaMap = request.getCriteria().getValues();
criteria.addFilterSourceName((String) criteriaMap.get("source"));
- criteria.addFilterDetail((String) criteriaMap.get("details"));
+ criteria.addFilterDetail((String) criteriaMap.get("detail"));
criteria.addFilterSeverities(severities);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
index ae99b68..0965096 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
@@ -108,7 +108,7 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
@Override
protected void configureTableFilters() {
final TextItem sourceFilter = new TextItem("source", MSG.view_inventory_eventHistory_sourceFilter());
- final TextItem detailsFilter = new TextItem("details", MSG.view_inventory_eventHistory_detailsFilter());
+ final TextItem detailsFilter = new TextItem("detail", MSG.view_inventory_eventHistory_detailsFilter());
LinkedHashMap<String, String> severities = new LinkedHashMap<String, String>(5);
severities.put(EventSeverity.DEBUG.name(), MSG.common_severity_debug());
@@ -162,11 +162,13 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
}
});
- ListGridField detailsField = new ListGridField("details-highlight", MSG.view_inventory_eventHistory_details());
- detailsField.setCellFormatter(new CellFormatter() {
+ ListGridField detailField = new ListGridField("detail", MSG.view_inventory_eventHistory_details());
+ detailField.setCellFormatter(new CellFormatter() {
@Override
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
- if (((String) value).length() <= 200) {
+ if (null == value) {
+ return "";
+ } else if (((String) value).length() <= 200) {
return (String) value;
} else {
return ((String) value).substring(0, 200); // first 200 chars
@@ -196,10 +198,10 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
timestampField.setWidth(155);
severityField.setWidth(55);
- detailsField.setWidth("*");
+ detailField.setWidth("*");
sourceField.setWidth(220);
- setListGridFields(timestampField, severityField, detailsField, sourceField);
+ setListGridFields(timestampField, severityField, detailField, sourceField);
setupTableInteractions();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
index 1376976..ab8b819 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
@@ -32,10 +32,10 @@ public class GroupResourceConfigurationDataSource extends
public class Field {
public static final String ID = "id";
- public static final String DATECREATED = "dateCreated";
- public static final String LASTUPDATED = "lastUpdated";
+ public static final String DATECREATED = "createdTime";
+ public static final String LASTUPDATED = "modifiedTime";
public static final String STATUS = "status";
- public static final String USER = "user";
+ public static final String USER = "subjectName";
public static final String OBJECT = "object";
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationTable.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationTable.java
index 9dcd1c5..483a854 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationTable.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationTable.java
@@ -222,10 +222,10 @@ public class HistoryGroupPluginConfigurationTable extends Table<HistoryGroupPlug
public class Field {
public static final String ID = "id";
- public static final String DATECREATED = "dateCreated";
- public static final String LASTUPDATED = "lastUpdated";
+ public static final String DATECREATED = "createdTime";
+ public static final String LASTUPDATED = "modifiedTime";
public static final String STATUS = "status";
- public static final String USER = "user";
+ public static final String USER = "subjectName";
public static final String OBJECT = "object";
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
index 1c772ac..d47b4f0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
@@ -77,7 +77,6 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
- resourceNameField.setCanSortClientOnly(true);
resourceNameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
@@ -94,26 +93,21 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
fields.add(resourceNameField);
ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
- ancestryField.setCanSortClientOnly(true);
fields.add(ancestryField);
ListGridField scheduleNameField = new ListGridField("scheduleName", MSG
.dataSource_measurementOob_field_scheduleName());
- scheduleNameField.setCanSortClientOnly(true);
fields.add(scheduleNameField);
ListGridField bandField = new ListGridField("formattedBaseband", MSG
.dataSource_measurementOob_field_formattedBaseband());
- bandField.setCanSortClientOnly(true);
fields.add(bandField);
ListGridField outlierField = new ListGridField("formattedOutlier", MSG
.dataSource_measurementOob_field_formattedOutlier());
- outlierField.setCanSortClientOnly(true);
fields.add(outlierField);
ListGridField factorField = new ListGridField("factor", MSG.dataSource_measurementOob_field_factor());
- factorField.setCanSortClientOnly(true);
fields.add(factorField);
resourceNameField.setWidth("20%");
commit fbcfc50f1cacdf993c5608c65101dd46b36cf880
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 22 15:55:27 2011 -0400
[BZ 697484 - Reports->Configuration History: Sorting on Ancestry column throws exception]
So actually, we're throwing exceptions all over the place on various column
sorting. This check-in fixes, I think, all columns for all of the report
views. Since several of those views use datasources common to other views
many of these fixes will apply in various places. So that is good.
But, I'm sure there are a lot of other places where we will still get hit.
The trick is that it's not always obvious that there is a problem because
if all of the data is held client-side (i.e. gwt has fetched all of the rows
and is holding them client-side then all rows will sort properly. It's only
when sorting is applied server-side that things blow up.
So, when testing you must first visit the view. Then, select a column for sorting
and *then* hit the refresh button. This will force a server-side fetch with
the sort applied.
Note that even setting ListGridField.setCanSortClientSideOnly(true) is not
solving the problem if applied to a field (although I think it should).
In certain places I've added the necessary fields to as Criteria sort fields
but this is not appropriate for every column. In other circumstances you
can now perform the column-to-sort-field mapping in the datasource by
overriding the new "getSortFieldForColumn(String columnName)" method. And
by returning null you can ensure inappropriate fields do not make it to the
server for sorting.
- I may take out the calls to setCanSortClientOnly() as I'm not sure it buys
us anything.
- Also, I removed unused datasource field definition in a few places.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertCriteria.java
index 86f31c3..8bc1887 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertCriteria.java
@@ -50,6 +50,7 @@ public class AlertCriteria extends Criteria {
public static final String SORT_FIELD_NAME = "name";
public static final String SORT_FIELD_PRIORITY = "priority";
public static final String SORT_FIELD_RESOURCE_ID = "resourceId";
+ public static final String SORT_FIELD_RESOURCE_NAME = "resourceName";
private Integer filterId;
private String filterTriggeredOperationName; // requires overrides
@@ -76,6 +77,7 @@ public class AlertCriteria extends Criteria {
private PageOrdering sortName; // requires sort override
private PageOrdering sortPriority; // requires sort override
private PageOrdering sortResourceId; // requires sort override
+ private PageOrdering sortResourceName; // requires sort override
public AlertCriteria() {
@@ -99,6 +101,7 @@ public class AlertCriteria extends Criteria {
sortOverrides.put(SORT_FIELD_NAME, "alertDefinition.name");
sortOverrides.put(SORT_FIELD_PRIORITY, "alertDefinition.priority");
sortOverrides.put(SORT_FIELD_RESOURCE_ID, "alertDefinition.resource.id");
+ sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "alertDefinition.resource.name");
}
@Override
@@ -207,4 +210,10 @@ public class AlertCriteria extends Criteria {
addSortField(SORT_FIELD_RESOURCE_ID);
this.sortResourceId = sortResourceId;
}
+
+ public void addSortResourceName(PageOrdering sortResourceName) {
+ addSortField(SORT_FIELD_RESOURCE_NAME);
+ this.sortResourceName = sortResourceName;
+ }
+
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
index 31f76a1..f029e7e 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
@@ -42,6 +42,9 @@ import org.rhq.core.domain.util.PageOrdering;
public class AlertDefinitionCriteria extends Criteria {
private static final long serialVersionUID = 1L;
+ public static final String SORT_FIELD_RESOURCE_ID = "resourceId";
+ public static final String SORT_FIELD_RESOURCE_NAME = "resourceName";
+
private Integer filterId;
private List<Integer> filterIds;
private String filterName;
@@ -67,6 +70,8 @@ public class AlertDefinitionCriteria extends Criteria {
private PageOrdering sortName;
private PageOrdering sortPriority;
+ private PageOrdering sortResourceId; // requires sort override
+ private PageOrdering sortResourceName; // requires sort override
public AlertDefinitionCriteria() {
filterOverrides.put("alertTemplateOnly", "resourceType IS NOT NULL");
@@ -79,6 +84,9 @@ public class AlertDefinitionCriteria extends Criteria {
filterOverrides.put("notificationSenderNames", "id IN ("
+ "SELECT notif.alertDefinition.id FROM AlertNotification notif " + "WHERE notif.senderName IN ( ? ))");
filterOverrides.put("filterIds", "id IN ( ? )");
+
+ sortOverrides.put(SORT_FIELD_RESOURCE_ID, "resource.id");
+ sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.name");
}
@Override
@@ -194,4 +202,14 @@ public class AlertDefinitionCriteria extends Criteria {
return null != filterResourceGroupIds;
}
+ public void addSortResourceId(PageOrdering sortResourceId) {
+ addSortField(SORT_FIELD_RESOURCE_ID);
+ this.sortResourceId = sortResourceId;
+ }
+
+ public void addSortResourceName(PageOrdering sortResourceName) {
+ addSortField(SORT_FIELD_RESOURCE_NAME);
+ this.sortResourceName = sortResourceName;
+ }
+
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
index da9ada3..b804ad7 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
@@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.core.domain.util.PageOrdering;
/**
* @author Joseph Marques
@@ -40,14 +41,22 @@ import org.rhq.core.domain.operation.ResourceOperationHistory;
public class ResourceOperationHistoryCriteria extends OperationHistoryCriteria {
private static final long serialVersionUID = 1L;
+ public static final String SORT_FIELD_RESOURCE_NAME = "resourceName";
+ public static final String SORT_FIELD_RESOURCE_ID = "resourceId";
+
private List<Integer> filterResourceIds; // requires override
private Integer filterGroupOperationHistoryId; // requires override
private boolean fetchResults;
+ private PageOrdering sortResourceName; // requires sort override
+ private PageOrdering sortResourceId; // requires sort override
+
public ResourceOperationHistoryCriteria() {
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
filterOverrides.put("groupOperationHistoryId", "groupOperationHistory.id = ?");
+
+ sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.name");
}
@Override
@@ -66,4 +75,15 @@ public class ResourceOperationHistoryCriteria extends OperationHistoryCriteria {
public void fetchResults(boolean fetchResults) {
this.fetchResults = fetchResults;
}
+
+ public void addSortResourceName(PageOrdering sortName) {
+ addSortField(SORT_FIELD_RESOURCE_NAME);
+ this.sortResourceName = sortName;
+ }
+
+ public void addSortResourceId(PageOrdering sortResourceId) {
+ addSortField(SORT_FIELD_RESOURCE_ID);
+ this.sortResourceId = sortResourceId;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 3ba8166..85027d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -21,7 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.alert;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,9 +30,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.DataClass;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
-import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
@@ -94,15 +91,6 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
addDataSourceFields();
}
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- // for some reason, the client seems to crash if you don't specify any data source fields
- // even though we know we defined override ListGridFields for all columns.
- List<DataSourceField> fields = super.addDataSourceFields();
- fields.add(new DataSourceTextField("name"));
- return fields;
- }
-
/**
* The view that contains the list grid which will display this datasource's data will call this
* method to get the field information which is used to control the display of the data.
@@ -131,6 +119,8 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
fields.add(nameField);
ListGridField conditionField = new ListGridField("conditionText", MSG.view_alerts_field_condition_text());
+ // the cell value is formatted giventhe actual conditions. It can't be sorted server-side.
+ conditionField.setCanSortClientOnly(true);
fields.add(conditionField);
ListGridField priorityField = new ListGridField("priority", MSG.view_alerts_field_priority());
@@ -324,6 +314,24 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "alertDefinition.resource.ancestry";
+ }
+ if ("status".equals(columnName)) {
+ return "acknowledgeTime";
+ }
+ if ("conditionText".equals(columnName)) {
+ // Note: I don't think this should even be getting called, but it is. We already setCanSortClientOnly(true)
+ // on this ListGridField. To me that should mean any sorting done client side on this field should
+ // not be passed in on the Request, but it seems to be...
+ return null;
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
public Alert copyValues(Record from) {
return null; // TODO: Implement this method.
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
index de1ec1f..e1332e9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
@@ -42,6 +42,7 @@ import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageControl;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
/**
* @author John Mazzitelli
@@ -144,6 +145,18 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "resource.ancestry";
+ }
+ if (FIELD_PARENT.equals(columnName)) {
+ return "parentId";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
protected AlertDefinitionCriteria getSimpleCriteriaForAll() {
AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
criteria.addFilterResourceIds(Integer.valueOf(this.resource.getId()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
index 75c4bc4..b92fb94 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
@@ -63,7 +63,7 @@ public abstract class AbstractConfigurationHistoryDataSource<T extends AbstractR
public static final String ID = "id";
public static final String CREATED_TIME = "createdTime";
public static final String STATUS = "status";
- public static final String SUBJECT = "subject";
+ public static final String SUBJECT = "subjectName";
public static final String CONFIGURATION = "configuration";
public static final String GROUP_CONFIG_UPDATE_ID = "groupConfigUpdateId";
public static final String GROUP_ID = "groupId"; // will only be non-null if group config update id is non-null
@@ -297,6 +297,18 @@ public abstract class AbstractConfigurationHistoryDataSource<T extends AbstractR
return record;
}
+ @Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (Field.GROUP_CONFIG_UPDATE_ID.equals(columnName)) {
+ return "groupConfigurationUpdate.id";
+ }
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "resource.ancestry";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
protected abstract String getConfigurationUpdateStatusIcon(ConfigurationUpdateStatus status);
protected abstract String getGroupConfigurationUpdateHistoryLink(Integer groupId, Number value);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index 200c3a0..0735310 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -101,6 +101,15 @@ public class ResourceOperationHistoryDataSource extends
return criteria;
}
+ @Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "resource.ancestry";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
protected void dataRetrieved(final PageList<ResourceOperationHistory> result, final DSResponse response,
final DSRequest request) {
HashSet<Integer> typesSet = new HashSet<Integer>();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
index 43365fc..93a59a8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
@@ -21,16 +21,13 @@ package org.rhq.enterprise.gui.coregui.client.operation;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
-import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
@@ -84,7 +81,7 @@ public class OperationHistoryDataSource extends
public static final String STARTED_TIME = "startedTime";
public static final String CREATED_TIME = "createdTime";
public static final String DURATION = "duration";
- public static final String SUBJECT = "subject";
+ public static final String SUBJECT = "subjectName";
public static final String OPERATION_DEFINITION = "operationDefinition";
public static final String ERROR_MESSAGE = "errorMessage";
public static final String PARAMETERS = "parameters";
@@ -103,17 +100,6 @@ public class OperationHistoryDataSource extends
addDataSourceFields();
}
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- // for some reason, the client seems to crash if you don't specify any data source fields
- // even though we know we defined override ListGridFields for all columns.
- List<DataSourceField> fields = super.addDataSourceFields();
- DataSourceTextField idField = new DataSourceTextField(Field.ID);
- idField.setPrimaryKey(true);
- fields.add(idField);
- return fields;
- }
-
/**
* The view that contains the list grid which will display this datasource's data will call this
* method to get the field information which is used to control the display of the data.
@@ -123,9 +109,6 @@ public class OperationHistoryDataSource extends
public ArrayList<ListGridField> getListGridFields() {
ArrayList<ListGridField> fields = new ArrayList<ListGridField>(7);
- ListGridField idField = new ListGridField(Field.ID, MSG.common_title_id());
- fields.add(idField);
-
ListGridField startTimeField = createStartedTimeField();
fields.add(startTimeField);
@@ -211,18 +194,18 @@ public class OperationHistoryDataSource extends
String statusStr = record.getAttribute(Field.STATUS);
OperationRequestStatus status = OperationRequestStatus.valueOf(statusStr);
switch (status) {
- case SUCCESS: {
- return MSG.common_status_success();
- }
- case FAILURE: {
- return MSG.common_status_failed();
- }
- case INPROGRESS: {
- return MSG.common_status_inprogress();
- }
- case CANCELED: {
- return MSG.common_status_canceled();
- }
+ case SUCCESS: {
+ return MSG.common_status_success();
+ }
+ case FAILURE: {
+ return MSG.common_status_failed();
+ }
+ case INPROGRESS: {
+ return MSG.common_status_inprogress();
+ }
+ case CANCELED: {
+ return MSG.common_status_canceled();
+ }
}
// should never get here
return MSG.common_status_unknown();
@@ -293,22 +276,22 @@ public class OperationHistoryDataSource extends
final long start = System.currentTimeMillis();
this.operationService.findResourceOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceOperationHistory>>() {
+ new AsyncCallback<PageList<ResourceOperationHistory>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler()
- .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler()
+ .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
- public void onSuccess(PageList<ResourceOperationHistory> result) {
- long fetchTime = System.currentTimeMillis() - start;
- Log.info(result.size() + " operation histories fetched in: " + fetchTime + "ms");
+ public void onSuccess(PageList<ResourceOperationHistory> result) {
+ long fetchTime = System.currentTimeMillis() - start;
+ Log.info(result.size() + " operation histories fetched in: " + fetchTime + "ms");
- dataRetrieved(result, response, request);
- }
- });
+ dataRetrieved(result, response, request);
+ }
+ });
}
/**
@@ -408,6 +391,15 @@ public class OperationHistoryDataSource extends
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "resource.ancestry";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
final ResourceOperationHistory operationHistoryToRemove = copyValues(recordToRemove);
Boolean forceValue = request.getAttributeAsBoolean("force");
@@ -427,9 +419,9 @@ public class OperationHistoryDataSource extends
public ResourceOperationHistory copyValues(Record from) {
Resource resource = new Resource();
resource.setId(from.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
- ResourceOperationHistory resourceOperationHistory = new ResourceOperationHistory(null, null,
- from.getAttribute(Field.SUBJECT), (OperationDefinition)from.getAttributeAsObject(Field.OPERATION_DEFINITION),
- (Configuration)from.getAttributeAsObject(Field.PARAMETERS), resource, null);
+ ResourceOperationHistory resourceOperationHistory = new ResourceOperationHistory(null, null, from
+ .getAttribute(Field.SUBJECT), (OperationDefinition) from.getAttributeAsObject(Field.OPERATION_DEFINITION),
+ (Configuration) from.getAttributeAsObject(Field.PARAMETERS), resource, null);
resourceOperationHistory.setId(from.getAttributeAsInt(Field.ID));
return resourceOperationHistory;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
index f66b76e..fccff5b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
@@ -91,6 +91,18 @@ public class AlertDefinitionReportView extends Table<AlertDefinitionReportView.D
}
@Override
+ protected String getSortFieldForColumn(String columnName) {
+ if (AncestryUtil.RESOURCE_ANCESTRY.equals(columnName)) {
+ return "resource.ancestry";
+ }
+ if (FIELD_PARENT.equals(columnName)) {
+ return "parentId";
+ }
+
+ return super.getSortFieldForColumn(columnName);
+ }
+
+ @Override
protected AlertDefinitionCriteria getSimpleCriteriaForAll() {
AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
criteria.addFilterResourceOnly(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
index 49c05cf..1c772ac 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
@@ -77,6 +77,7 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
+ resourceNameField.setCanSortClientOnly(true);
resourceNameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
@@ -93,21 +94,26 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
fields.add(resourceNameField);
ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
+ ancestryField.setCanSortClientOnly(true);
fields.add(ancestryField);
ListGridField scheduleNameField = new ListGridField("scheduleName", MSG
.dataSource_measurementOob_field_scheduleName());
+ scheduleNameField.setCanSortClientOnly(true);
fields.add(scheduleNameField);
ListGridField bandField = new ListGridField("formattedBaseband", MSG
.dataSource_measurementOob_field_formattedBaseband());
+ bandField.setCanSortClientOnly(true);
fields.add(bandField);
ListGridField outlierField = new ListGridField("formattedOutlier", MSG
.dataSource_measurementOob_field_formattedOutlier());
+ outlierField.setCanSortClientOnly(true);
fields.add(outlierField);
ListGridField factorField = new ListGridField("factor", MSG.dataSource_measurementOob_field_factor());
+ factorField.setCanSortClientOnly(true);
fields.add(factorField);
resourceNameField.setWidth("20%");
@@ -175,6 +181,16 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
protected Criteria getFetchCriteria(DSRequest request) {
// we don't use criterias for this datasource, just return null
return null;
+
+ }
+
+ protected String getSortFieldForColumn(String columnName) {
+ // Note: I don't think this should even be getting called, but it is. We already setCanSortClientOnly(true)
+ // on all of the ListGridFields. To me that should mean any sorting done client side on those fields should
+ // not be passed in on the Request, but it seems to be...
+
+ // we don't use criterias for this datasource, just return null, don't try and apply any sort.
+ return null;
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 72f8c3d..2bd57d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -202,11 +202,28 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
for (String sort : sorts) {
PageOrdering ordering = (sort.startsWith("-")) ? PageOrdering.DESC : PageOrdering.ASC;
String columnName = (ordering == PageOrdering.DESC) ? sort.substring(1) : sort;
- pageControl.addDefaultOrderingField(columnName, ordering);
+ String sortField = getSortFieldForColumn(columnName);
+ if (null != sortField)
+ pageControl.addDefaultOrderingField(sortField, ordering);
}
}
}
+ /**
+ * By default, for a sortable column, the field name (usually a ListGridField name) is used as the
+ * OrderingField in the PageControl passed to the server. If for some reason the field name does not
+ * properly map to a sortable entity field, this method can be overrident to provide the proper maping.
+ * Note that certain columns may also leverage sort fields in the underlying (rhq) criteria class itself, but
+ * not every sortable column may be appropriate as a sort field in the criteria.
+ *
+ * @param columnName The column field name
+ * @return The entity field for the desired sort. By default just returns back the columnName. Can be null if
+ * there is no valid mapping.
+ */
+ protected String getSortFieldForColumn(String columnName) {
+ return columnName;
+ }
+
@Override
public void processResponse(String requestId, DSResponse responseProperties) {
super.processResponse(requestId, responseProperties);
@@ -564,8 +581,8 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return result;
}
- protected static DataSourceTextField createTextField(String name, String title, Integer minLength, Integer maxLength,
- Boolean required) {
+ protected static DataSourceTextField createTextField(String name, String title, Integer minLength,
+ Integer maxLength, Boolean required) {
DataSourceTextField textField = new DataSourceTextField(name, title);
textField.setLength(maxLength);
textField.setRequired(required);
@@ -589,8 +606,8 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return textField;
}
- protected static DataSourceIntegerField createIntegerField(String name, String title, Integer minValue, Integer maxValue,
- Boolean required) {
+ protected static DataSourceIntegerField createIntegerField(String name, String title, Integer minValue,
+ Integer maxValue, Boolean required) {
DataSourceIntegerField textField = new DataSourceIntegerField(name, title);
textField.setRequired(required);
if (minValue != null || maxValue != null) {
commit 7d22f710a2db0b89fe4fcce449ed7bed07558c17
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Apr 21 18:51:28 2011 -0400
BZ 698137: one more change necessary. The struts tag attempts to instantiate the class
which is now and interface. Changed MetricDisplayConstants back to class with public static access.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ui/MetricDisplayConstants.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ui/MetricDisplayConstants.java
index 56fb674..216689d 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ui/MetricDisplayConstants.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ui/MetricDisplayConstants.java
@@ -21,50 +21,50 @@ package org.rhq.core.domain.measurement.ui;
/**
* TODO we should convert this to an enum
*/
-public interface MetricDisplayConstants {
+public class MetricDisplayConstants {
/**
* the peak value per interval of the set of metrics of this type measured in the timeframe under question. The peak
* is the highest of the high values.
*/
- String MAX_KEY = "max";
+ public static final String MAX_KEY = "max";
/**
* the low value of the set of metrics of this type per interval measured in the timeframe under question. The low
* value is the lowest of the low values.
*/
- String MIN_KEY = "min";
+ public static final String MIN_KEY = "min";
/**
* the average value per interval of the set of metrics of this type measured in the timeframe under question. The
* average is the average of all the values.
*/
- String AVERAGE_KEY = "average";
+ public static final String AVERAGE_KEY = "average";
/**
* the last value per interval of the set of metrics of this type measured in the timeframe under question
*/
- String LAST_KEY = "last";
+ public static final String LAST_KEY = "last";
/**
* the user defined main baseline to compare against for this metric
*/
- String BASELINE_KEY = "baseline";
+ public static final String BASELINE_KEY = "baseline";
/**
* the user defined high range of values to compare against for this metric
*/
- String HIGH_RANGE_KEY = "high";
+ public static final String HIGH_RANGE_KEY = "high";
/**
* the user defined low range of values to compare against for this metric
*/
- String LOW_RANGE_KEY = "low";
+ public static final String LOW_RANGE_KEY = "low";
/**
* a summary value for groups
*/
- String SUMMARY_KEY = "summary";
+ public static final String SUMMARY_KEY = "summary";
- String[] attrKey = { MAX_KEY, MIN_KEY, AVERAGE_KEY, LAST_KEY, BASELINE_KEY, HIGH_RANGE_KEY, LOW_RANGE_KEY,
- SUMMARY_KEY };
+ public static final String[] attrKey = { MAX_KEY, MIN_KEY, AVERAGE_KEY, LAST_KEY, BASELINE_KEY, HIGH_RANGE_KEY,
+ LOW_RANGE_KEY, SUMMARY_KEY };
}
\ No newline at end of file
commit 4c31dfb49e85b3a38a757f82d605488bd1e77a70
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 21 17:27:18 2011 -0400
BZ 697001 - cancel all res. operations after a failure if the group op schedule has halt-on-error set.
this also fixes the missing status icon in the operation history details
it also cleans up the "submitted" details text item (if the op never started it was showing Dec 31, 1970 - now it shows "never")
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
index 260ed01..85bb9e9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
@@ -74,6 +74,9 @@ public class TimestampCellFormatter implements CellFormatter {
} else {
throw new IllegalArgumentException("value parameter is not a Date, Long, Integer, or a String.");
}
+ if (longValue == 0) {
+ return "";
+ }
date = new Date(longValue);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
index 236e994..ae7a365 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
@@ -151,7 +151,12 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
StaticTextItem submittedItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STARTED_TIME, MSG
.view_operationHistoryDetails_dateSubmitted());
- submittedItem.setValue(TimestampCellFormatter.format(operationHistory.getStartedTime()));
+ if (operationHistory.getStartedTime() == 0) {
+ // must have executed serially, halt-on-error was true and a previous resource op failed, thus this never even got submitted to the agent for invocation
+ submittedItem.setValue(MSG.common_val_never());
+ } else {
+ submittedItem.setValue(TimestampCellFormatter.format(operationHistory.getStartedTime()));
+ }
items.add(submittedItem);
StaticTextItem completedItem = new StaticTextItem("completed", MSG.view_operationHistoryDetails_dateCompleted());
@@ -176,12 +181,18 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
.view_operationHistoryDetails_status());
String icon = ImageManager.getFullImagePath(ImageManager.getOperationResultsIcon(status));
statusItem.setValue("<img src='" + icon + "'/>");
+ items.add(statusItem);
switch (status) {
case SUCCESS:
statusItem.setTooltip(MSG.common_status_success());
break;
+ case CANCELED:
case FAILURE:
- statusItem.setTooltip(MSG.common_status_failed());
+ if (status == OperationRequestStatus.CANCELED) {
+ statusItem.setTooltip(MSG.common_status_canceled());
+ } else {
+ statusItem.setTooltip(MSG.common_status_failed());
+ }
LinkItem errorLinkItem = new LinkItem("errorLink");
errorLinkItem.setTitle(MSG.common_title_error());
errorLinkItem.setLinkTitle(getShortErrorMessage(operationHistory));
@@ -227,9 +238,6 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
case INPROGRESS:
statusItem.setTooltip(MSG.common_status_inprogress());
break;
- case CANCELED:
- statusItem.setTooltip(MSG.common_status_canceled());
- break;
}
/*
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
index cbdd54e..18c35b9 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
@@ -151,6 +151,11 @@ public class GroupOperationJob extends OperationJob {
if (hadFailure) {
// there was a failure during execution of this group operation;
// thus, mark all remaining operation histories as cancelled
+ composite.history.setErrorMessage("This has been cancelled due to halt-on-error "
+ + "being set on the parent group operation schedule. "
+ + "A previous resource operation that executed prior "
+ + "to this resource operation failed, thus causing "
+ + "this resource operation to be cancelled.");
composite.history.setStatus(OperationRequestStatus.CANCELED);
composite.history = (ResourceOperationHistory) operationManager.updateOperationHistory(
getUserWithSession(user, true), composite.history);
@@ -189,7 +194,7 @@ public class GroupOperationJob extends OperationJob {
getUserWithSession(user, true), groupHistory);
if (schedule.isHaltOnFailure()) {
- throw e;
+ hadFailure = true;
}
}
}
@@ -208,6 +213,10 @@ public class GroupOperationJob extends OperationJob {
groupHistory = (GroupOperationHistory) operationManager.updateOperationHistory(
getUserWithSession(user, true), groupHistory);
+ // Note: in actuality - I don't think users have a way in the user interface to turn on halt-on-failure for parallel execution.
+ // So this isHaltOnFailure will probably always be false. But in case we want to support this, leave this here.
+ // What will happen is we will stop sending requests to the agents to invoke more resource operations. Any previous
+ // resource operations invoked, however, will still be running and allowed to finish on their respective agents.
if (schedule.isHaltOnFailure()) {
throw e;
}
commit a5c34018db9ff313f1a9bf01b5a0561b531afcf0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 17:09:15 2011 -0400
potential fix for https://bugzilla.redhat.com/show_bug.cgi?id=697590
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 70b0285..58fd490 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -124,21 +124,22 @@ public class MenuBarView extends LocatableVLayout {
}
private String setupLinks() {
+ // TODO: Replace the below HTML with SmartGWT widgets.
StringBuilder headerString = new StringBuilder(
"<table style=\"height: 34px;\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
headerString.append("<td style=\"width: 1px;\"><img src=\"images/header/header_bg_line.png\"/></td>");
- for (ViewName section : SECTIONS) {
+ for (ViewName sectionName : SECTIONS) {
String styleClass = "TopSectionLink";
- if (section.getName().equals(currentlySelectedSection)) {
+ if (sectionName.getName().equals(currentlySelectedSection)) {
styleClass = "TopSectionLinkSelected";
}
// Set explicit identifiers because the generated scLocator is not getting picked up by Selenium.
- headerString.append("<td style=\"vertical-align:middle\" id=\"").append(section).append("\" class=\"")
- .append(styleClass).append("\" onclick=\"document.location='#").append(section).append("'\" >");
- headerString.append(section.getTitle());
+ headerString.append("<td style=\"vertical-align:middle\" id=\"").append(sectionName).append("\" class=\"")
+ .append(styleClass).append("\" onclick=\"window.location.href='#").append(sectionName).append("'\" >");
+ headerString.append(sectionName.getTitle());
headerString.append("</td>\n");
headerString.append("<td style=\"width: 1px;\"><img src=\"images/header/header_bg_line.png\"/></td>");
commit 7f9458bd6a113b22d8ed8fac43d348dfa2f39c9e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 16:32:41 2011 -0400
fix ability to delete resource and group operation history items (https://bugzilla.redhat.com/show_bug.cgi?id=698720)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
index 15606f2..ec486fb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -35,6 +35,7 @@ import org.rhq.core.domain.operation.OperationHistory;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
@@ -43,8 +44,6 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
public abstract class AbstractOperationHistoryDataSource<T extends OperationHistory, C extends OperationHistoryCriteria>
extends RPCDataSource<T, C> {
- private T currentOperationHistory;
-
public static abstract class Field {
public static final String ID = "id";
public static final String OPERATION_NAME = "operationName";
@@ -58,6 +57,10 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
public static final String PARAMETERS = "parameters";
}
+ public static abstract class RequestAttribute {
+ public static final String FORCE = "force";
+ }
+
protected OperationGWTServiceAsync operationService = GWTServiceLookup.getOperationService();
public AbstractOperationHistoryDataSource() {
@@ -66,13 +69,13 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
}
@Override
- protected void executeRemove(Record recordToRemove, DSRequest request, DSResponse response) {
- final OperationHistory operationHistoryToRemove = copyValues(recordToRemove);
- Boolean forceValue = request.getAttributeAsBoolean("force");
+ protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
+ final T operationHistoryToRemove = copyValues(recordToRemove);
+ Boolean forceValue = request.getAttributeAsBoolean(RequestAttribute.FORCE);
boolean force = ((forceValue != null) && forceValue);
operationService.deleteOperationHistory(operationHistoryToRemove.getId(), force, new AsyncCallback<Void>() {
public void onSuccess(Void result) {
- return;
+ sendSuccessResponse(request, response, operationHistoryToRemove, new Message("success"));
}
public void onFailure(Throwable caught) {
@@ -113,13 +116,15 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
@Override
public T copyValues(Record from) {
- return this.currentOperationHistory;
+ T operationHistory = createOperationHistory();
+ operationHistory.setId(from.getAttributeAsInt(Field.ID));
+ return operationHistory;
}
+ protected abstract T createOperationHistory();
+
@Override
public ListGridRecord copyValues(T from) {
- this.currentOperationHistory = from;
-
ListGridRecord record = new ListGridRecord();
record.setAttribute(Field.ID, from.getId());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
index 5433940..48fea33 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.
import java.util.ArrayList;
import java.util.List;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.Record;
@@ -39,13 +40,19 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
+import org.rhq.core.domain.operation.OperationHistory;
import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.operation.OperationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
@@ -79,9 +86,9 @@ public abstract class AbstractOperationHistoryListView<T extends AbstractOperati
setListGridFields(fields.toArray(new ListGridField[fields.size()]));
// explicitly sort on started time so the user can see the last operation at the top and is sorted descendingly
- SortSpecifier sortspec = new SortSpecifier(AbstractOperationHistoryDataSource.Field.STARTED_TIME,
+ SortSpecifier sortSpec = new SortSpecifier(AbstractOperationHistoryDataSource.Field.STARTED_TIME,
SortDirection.DESCENDING);
- getListGrid().setSort(new SortSpecifier[] { sortspec });
+ getListGrid().setSort(new SortSpecifier[] { sortSpec });
addTableAction(extendLocatorId("Delete"), MSG.common_button_delete(), getDeleteConfirmMessage(),
new TableAction() {
@@ -95,7 +102,6 @@ public abstract class AbstractOperationHistoryListView<T extends AbstractOperati
}
});
- // TODO: i18n
addTableAction(extendLocatorId("ForceDelete"), MSG.view_operationHistoryList_button_forceDelete(),
getDeleteConfirmMessage(), new TableAction() {
public boolean isEnabled(ListGridRecord[] selection) {
@@ -267,6 +273,48 @@ public abstract class AbstractOperationHistoryListView<T extends AbstractOperati
}
@Override
+ protected void deleteSelectedRecords(DSRequest requestProperties) {
+ final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelection();
+ final int numberOfRecordsToBeDeleted = recordsToBeDeleted.length;
+ Boolean forceValue = (requestProperties != null &&
+ requestProperties.getAttributeAsBoolean(AbstractOperationHistoryDataSource.RequestAttribute.FORCE));
+ boolean force = ((forceValue != null) && forceValue);
+ final List<Integer> successIds = new ArrayList<Integer>();
+ final List<Integer> failureIds = new ArrayList<Integer>();
+ for (ListGridRecord record : recordsToBeDeleted) {
+ final OperationHistory operationHistoryToRemove = getDataSource().copyValues(record);
+ GWTServiceLookup.getOperationService().deleteOperationHistory(operationHistoryToRemove.getId(), force,
+ new AsyncCallback<Void>() {
+ public void onSuccess(Void result) {
+ successIds.add(operationHistoryToRemove.getId());
+ handleCompletion(successIds, failureIds, numberOfRecordsToBeDeleted);
+ }
+
+ public void onFailure(Throwable caught) {
+ // TODO: i18n
+ CoreGUI.getErrorHandler().handleError("Failed to delete " + operationHistoryToRemove + ".",
+ caught);
+ failureIds.add(operationHistoryToRemove.getId());
+ handleCompletion(successIds, failureIds, numberOfRecordsToBeDeleted);
+ }
+ });
+ }
+ }
+
+ private void handleCompletion(List<Integer> successIds, List<Integer> failureIds, int numberOfRecordsToBeDeleted) {
+ if ((successIds.size() + failureIds.size()) == numberOfRecordsToBeDeleted) {
+ // TODO: i18n
+ if (successIds.size() == numberOfRecordsToBeDeleted) {
+ CoreGUI.getMessageCenter().notify(new Message("Deleted " + numberOfRecordsToBeDeleted + " operation history items."));
+ } else {
+ CoreGUI.getMessageCenter().notify(new Message("Deleted " + successIds.size()
+ + " operation history items, but failed to delete the items with the following IDs: " + failureIds));
+ }
+ refresh();
+ }
+ }
+
+ @Override
protected String getDetailsLinkColumnName() {
return AbstractOperationHistoryDataSource.Field.OPERATION_NAME;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
index b9b78ba..37e93ce 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDataSource.java
@@ -26,8 +26,11 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
import org.rhq.core.domain.operation.GroupOperationHistory;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
@@ -76,6 +79,11 @@ public class GroupOperationHistoryDataSource extends
}
@Override
+ protected GroupOperationHistory createOperationHistory() {
+ return new GroupOperationHistory(null, null, null, null, null, null);
+ }
+
+ @Override
public ListGridRecord copyValues(GroupOperationHistory from) {
ListGridRecord record = super.copyValues(from);
record.setAttribute(Field.GROUP, from.getGroup());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index acd46aa..200c3a0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -140,6 +140,11 @@ public class ResourceOperationHistoryDataSource extends
}
@Override
+ protected ResourceOperationHistory createOperationHistory() {
+ return new ResourceOperationHistory(null, null, null, null, null, null, null);
+ }
+
+ @Override
public ListGridRecord copyValues(ResourceOperationHistory from) {
ListGridRecord record = super.copyValues(from);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
index f321d07..43365fc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -46,8 +46,9 @@ import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
-import org.rhq.core.domain.operation.OperationHistory;
+import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.resource.Resource;
@@ -76,8 +77,6 @@ public class OperationHistoryDataSource extends
private EntityContext entityContext;
- private ResourceOperationHistory currentOperationHistory;
-
public static abstract class Field {
public static final String ID = "id";
public static final String OPERATION_NAME = "operationName";
@@ -109,7 +108,9 @@ public class OperationHistoryDataSource extends
// for some reason, the client seems to crash if you don't specify any data source fields
// even though we know we defined override ListGridFields for all columns.
List<DataSourceField> fields = super.addDataSourceFields();
- fields.add(new DataSourceTextField(Field.OPERATION_NAME));
+ DataSourceTextField idField = new DataSourceTextField(Field.ID);
+ idField.setPrimaryKey(true);
+ fields.add(idField);
return fields;
}
@@ -120,7 +121,10 @@ public class OperationHistoryDataSource extends
* @return list grid fields used to display the datasource data
*/
public ArrayList<ListGridField> getListGridFields() {
- ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(7);
+
+ ListGridField idField = new ListGridField(Field.ID, MSG.common_title_id());
+ fields.add(idField);
ListGridField startTimeField = createStartedTimeField();
fields.add(startTimeField);
@@ -207,18 +211,18 @@ public class OperationHistoryDataSource extends
String statusStr = record.getAttribute(Field.STATUS);
OperationRequestStatus status = OperationRequestStatus.valueOf(statusStr);
switch (status) {
- case SUCCESS: {
- return MSG.common_status_success();
- }
- case FAILURE: {
- return MSG.common_status_failed();
- }
- case INPROGRESS: {
- return MSG.common_status_inprogress();
- }
- case CANCELED: {
- return MSG.common_status_canceled();
- }
+ case SUCCESS: {
+ return MSG.common_status_success();
+ }
+ case FAILURE: {
+ return MSG.common_status_failed();
+ }
+ case INPROGRESS: {
+ return MSG.common_status_inprogress();
+ }
+ case CANCELED: {
+ return MSG.common_status_canceled();
+ }
}
// should never get here
return MSG.common_status_unknown();
@@ -289,22 +293,22 @@ public class OperationHistoryDataSource extends
final long start = System.currentTimeMillis();
this.operationService.findResourceOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceOperationHistory>>() {
+ new AsyncCallback<PageList<ResourceOperationHistory>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler()
- .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler()
+ .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
- public void onSuccess(PageList<ResourceOperationHistory> result) {
- long fetchTime = System.currentTimeMillis() - start;
- Log.info(result.size() + " operation histories fetched in: " + fetchTime + "ms");
+ public void onSuccess(PageList<ResourceOperationHistory> result) {
+ long fetchTime = System.currentTimeMillis() - start;
+ Log.info(result.size() + " operation histories fetched in: " + fetchTime + "ms");
- dataRetrieved(result, response, request);
- }
- });
+ dataRetrieved(result, response, request);
+ }
+ });
}
/**
@@ -404,13 +408,13 @@ public class OperationHistoryDataSource extends
}
@Override
- protected void executeRemove(Record recordToRemove, DSRequest request, DSResponse response) {
- final OperationHistory operationHistoryToRemove = copyValues(recordToRemove);
+ protected void executeRemove(Record recordToRemove, final DSRequest request, final DSResponse response) {
+ final ResourceOperationHistory operationHistoryToRemove = copyValues(recordToRemove);
Boolean forceValue = request.getAttributeAsBoolean("force");
boolean force = ((forceValue != null) && forceValue);
operationService.deleteOperationHistory(operationHistoryToRemove.getId(), force, new AsyncCallback<Void>() {
public void onSuccess(Void result) {
- return;
+ sendSuccessResponse(request, response, operationHistoryToRemove, null);
}
public void onFailure(Throwable caught) {
@@ -421,13 +425,17 @@ public class OperationHistoryDataSource extends
@Override
public ResourceOperationHistory copyValues(Record from) {
- return this.currentOperationHistory;
+ Resource resource = new Resource();
+ resource.setId(from.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ ResourceOperationHistory resourceOperationHistory = new ResourceOperationHistory(null, null,
+ from.getAttribute(Field.SUBJECT), (OperationDefinition)from.getAttributeAsObject(Field.OPERATION_DEFINITION),
+ (Configuration)from.getAttributeAsObject(Field.PARAMETERS), resource, null);
+ resourceOperationHistory.setId(from.getAttributeAsInt(Field.ID));
+ return resourceOperationHistory;
}
@Override
public ListGridRecord copyValues(ResourceOperationHistory from) {
- this.currentOperationHistory = from;
-
ListGridRecord record = new ListGridRecord();
record.setAttribute(Field.ID, from.getId());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
index b19104e..70a5ff9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
@@ -21,9 +21,15 @@ package org.rhq.enterprise.gui.coregui.client.operation;
import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSCallback;
import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
@@ -33,12 +39,16 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDetailsView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* A view that displays a paginated table of operation history. Support exists of subsystem and resource contexts.
@@ -172,6 +182,47 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
});
}
+ @Override
+ protected void deleteSelectedRecords(DSRequest requestProperties) {
+ final ListGridRecord[] recordsToBeDeleted = getListGrid().getSelection();
+ final int numberOfRecordsToBeDeleted = recordsToBeDeleted.length;
+ Boolean forceValue = (requestProperties != null && requestProperties.getAttributeAsBoolean("force"));
+ boolean force = ((forceValue != null) && forceValue);
+ final List<Integer> successIds = new ArrayList<Integer>();
+ final List<Integer> failureIds = new ArrayList<Integer>();
+ for (ListGridRecord record : recordsToBeDeleted) {
+ final ResourceOperationHistory operationHistoryToRemove = new OperationHistoryDataSource().copyValues(record);
+ GWTServiceLookup.getOperationService().deleteOperationHistory(operationHistoryToRemove.getId(), force,
+ new AsyncCallback<Void>() {
+ public void onSuccess(Void result) {
+ successIds.add(operationHistoryToRemove.getId());
+ handleCompletion(successIds, failureIds, numberOfRecordsToBeDeleted);
+ }
+
+ public void onFailure(Throwable caught) {
+ // TODO: i18n
+ CoreGUI.getErrorHandler().handleError("Failed to delete " + operationHistoryToRemove + ".",
+ caught);
+ failureIds.add(operationHistoryToRemove.getId());
+ handleCompletion(successIds, failureIds, numberOfRecordsToBeDeleted);
+ }
+ });
+ }
+ }
+
+ private void handleCompletion(List<Integer> successIds, List<Integer> failureIds, int numberOfRecordsToBeDeleted) {
+ if ((successIds.size() + failureIds.size()) == numberOfRecordsToBeDeleted) {
+ // TODO: i18n
+ if (successIds.size() == numberOfRecordsToBeDeleted) {
+ CoreGUI.getMessageCenter().notify(new Message("Deleted " + numberOfRecordsToBeDeleted + " operation history items."));
+ } else {
+ CoreGUI.getMessageCenter().notify(new Message("Deleted " + successIds.size()
+ + " operation history items, but failed to delete the items with the following IDs: " + failureIds));
+ }
+ refresh();
+ }
+ }
+
public EntityContext getContext() {
return context;
}
@@ -181,4 +232,10 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
return new ResourceOperationHistoryDetailsView(extendLocatorId("Detail"));
}
+ @Override
+ protected String getTitleFieldName() {
+ return OperationHistoryDataSource.Field.OPERATION_NAME;
+ }
+
+
}
commit a68b7c0667c207c1c01cb34d375b6ab3b412cc70
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 21 16:17:12 2011 -0400
BZ 697001 - make sure we re-attach related resource histories when updating group history. without this a hibernate transient object exception occurs.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
index 8e56a35..778838f 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
@@ -100,8 +100,10 @@ public abstract class OperationJob implements Job {
schedule.getResource(), groupHistory);
// persist the results of the initial create
- history = (ResourceOperationHistory) operationManager.updateOperationHistory(schedule.getSubject(), history);
+ ResourceOperationHistory persisted;
+ persisted = (ResourceOperationHistory) operationManager.updateOperationHistory(schedule.getSubject(), history);
+ history.setId(persisted.getId()); // we need this - this enables the server to successfully update the group history later
- return history;
+ return persisted;
}
}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
index c81ba37..d6e97b3 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
@@ -848,6 +848,19 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
history.setParameters(parameters);
}
+ // to avoid TransientObjectExceptions during the merge, we need to attach all resource operation histories, if there are any
+ if (history instanceof GroupOperationHistory) {
+ GroupOperationHistory groupHistory = (GroupOperationHistory) history;
+ List<ResourceOperationHistory> roh = groupHistory.getResourceOperationHistories();
+ if (roh != null && roh.size() > 0) {
+ List<ResourceOperationHistory> attached = new ArrayList<ResourceOperationHistory>(roh.size());
+ for (ResourceOperationHistory unattachedHistory : roh) {
+ attached.add(entityManager.getReference(ResourceOperationHistory.class, unattachedHistory.getId()));
+ }
+ groupHistory.setResourceOperationHistories(attached);
+ }
+ }
+
history = entityManager.merge(history); // merge will persist if it doesn't exist yet
if (history.getParameters() != null) {
commit 6875cae9c51bfafaf9b139c58640d78247597262
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 13:37:50 2011 -0400
in perm editor, don't allow deselection of CONFIGURE_READ if CONFIGURE_WRITE is selected (https://bugzilla.redhat.com/show_bug.cgi?id=698475)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index 46fc5d2..29eb9c7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -339,11 +339,17 @@ public class PermissionsEditor extends LocatableVStack {
if (permission == Permission.VIEW_RESOURCE) {
String messageString = MSG.view_adminRoles_permissions_readAccessImplied(permissionDisplayName);
handleIllegalPermissionSelection(event, messageString);
- } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_SECURITY) && permission != Permission.MANAGE_SECURITY) {
- String messageString = MSG.view_adminRoles_permissions_illegal_deselection_due_to_manageSecurity_selection(permissionDisplayName);
+ } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_SECURITY) &&
+ permission != Permission.MANAGE_SECURITY) {
+ String messageString = MSG.view_adminRoles_permissions_illegalDeselectionDueToManageSecuritySelection(permissionDisplayName);
handleIllegalPermissionSelection(event, messageString);
- } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_INVENTORY) && permission.getTarget() == Permission.Target.RESOURCE) {
- String messageString = MSG.view_adminRoles_permissions_illegal_deselection_due_to_manageInventory_selection(permissionDisplayName);
+ } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_INVENTORY) &&
+ permission.getTarget() == Permission.Target.RESOURCE) {
+ String messageString = MSG.view_adminRoles_permissions_illegalDeselectionDueToManageInventorySelection(permissionDisplayName);
+ handleIllegalPermissionSelection(event, messageString);
+ } else if (!authorized && selectedPermissions.contains(Permission.CONFIGURE_WRITE) &&
+ permission == Permission.CONFIGURE_READ) {
+ String messageString = MSG.view_adminRoles_permissions_illegalDeselectionDueToCorrespondingWritePermSelection(permissionDisplayName);
handleIllegalPermissionSelection(event, messageString);
} else {
updatePermissions(authorized, permission);
@@ -391,13 +397,6 @@ public class PermissionsEditor extends LocatableVStack {
}
} else {
this.selectedPermissions.remove(permission);
- if (permission == Permission.CONFIGURE_READ) {
- // Lack of CONFIGURE_READ implies lack of CONFIGURE_WRITE.
- if (this.selectedPermissions.remove(Permission.CONFIGURE_WRITE)) {
- messageString = MSG.view_adminRoles_permissions_autoselecting_configureRead_implied();
- redrawRequired = true;
- }
- }
}
ListGridRecord[] permissionRecords = RolesDataSource.toRecordArray(this.selectedPermissions);
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 a345046..b09c159 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
@@ -736,8 +736,9 @@ view_adminRoles_permissions_autoselecting_manageSecurity_implied = Autoselected
view_adminRoles_permissions_autoselecting_manageInventory_implied = Autoselected unselected Resource permissions, since MANAGE_INVENTORY implies all Resource permissions...
view_adminRoles_permissions_autoselecting_configureWrite_implied = Autoselected CONFIGURE_READ permission, since CONFIGURE_WRITE implies it...
view_adminRoles_permissions_autoselecting_configureRead_implied = Autodeselected CONFIGURE_WRITE permission, since lack of CONFIGURE_READ implies lack of it...
-view_adminRoles_permissions_illegal_deselection_due_to_manageSecurity_selection = {0} permission cannot be deselected, unless Manage Security, which implies all other permissions, is deselected first.
-view_adminRoles_permissions_illegal_deselection_due_to_manageInventory_selection = {0} permission cannot be deselected, unless Manage Inventory, which implies all Resource permissions, is deselected first.
+view_adminRoles_permissions_illegalDeselectionDueToManageSecuritySelection = {0} permission cannot be deselected, unless the Manage Security permission, which implies all other permissions, is deselected first.
+view_adminRoles_permissions_illegalDeselectionDueToManageInventorySelection = {0} permission cannot be deselected, unless Manage Inventory, which implies all Resource permissions, is deselected first.
+view_adminRoles_permissions_illegalDeselectionDueToCorrespondingWritePermSelection = {0} read permission cannot be deselected, unless the {0} write permission, which implies the read permission, is deselected first.
# Administration/Topology/RemoteAgentInstall/#
#--------------------------------
commit 7f4f22446b9d692e191415f612a40f0f23d42b89
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 21 13:30:44 2011 -0400
part of BZ 697001 - this corrects some edge cases around timing out group and resource operation histories that are in inprogress state that need to be flipped to failed state.
this also should address BZ 535401.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/GroupOperationHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/GroupOperationHistory.java
index f6a32bb..fea0130 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/GroupOperationHistory.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/GroupOperationHistory.java
@@ -55,11 +55,11 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
+ "SELECT h " //
+ " FROM GroupOperationHistory h " //
+ " WHERE h.status = :status " //
- + " AND EXISTS " //
+ + " AND NOT EXISTS " //
+ " ( SELECT roh.id " //
+ " FROM ResourceOperationHistory roh " //
+ " WHERE roh.groupOperationHistory.id = h.id " //
- + " AND roh.status <> :status ) "),
+ + " AND roh.status = :status ) "),
// should always pass INPROGRESS for status
@NamedQuery(name = GroupOperationHistory.QUERY_FIND_MEMBERLESS_IN_PROGRESS, query = "" //
+ "SELECT h " //
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
index 746b723..c81ba37 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
@@ -66,7 +66,6 @@ import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.operation.ResourceOperationScheduleEntity;
import org.rhq.core.domain.operation.ScheduleJobId;
import org.rhq.core.domain.operation.bean.GroupOperationSchedule;
-import org.rhq.core.domain.operation.bean.OperationSchedule;
import org.rhq.core.domain.operation.bean.ResourceOperationSchedule;
import org.rhq.core.domain.operation.composite.GroupOperationLastCompletedComposite;
import org.rhq.core.domain.operation.composite.GroupOperationScheduleComposite;
@@ -195,9 +194,9 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
executionOrderResourceIds[i] = executionOrderResource.getId();
}
}
- GroupOperationSchedule groupOperationSchedule = scheduleGroupOperation(subject, schedule
- .getGroup().getId(), executionOrderResourceIds, schedule.getHaltOnFailure(),
- schedule.getOperationName(), schedule.getParameters(), trigger, schedule.getDescription());
+ GroupOperationSchedule groupOperationSchedule = scheduleGroupOperation(subject,
+ schedule.getGroup().getId(), executionOrderResourceIds, schedule.getHaltOnFailure(), schedule
+ .getOperationName(), schedule.getParameters(), trigger, schedule.getDescription());
return groupOperationSchedule.getId();
} catch (SchedulerException e) {
throw new ScheduleException(e);
@@ -470,7 +469,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
public ResourceOperationSchedule getResourceOperationSchedule(Subject whoami, int scheduleId) {
OperationScheduleEntity operationScheduleEntity = entityManager.find(OperationScheduleEntity.class, scheduleId);
try {
- ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(whoami, operationScheduleEntity.getJobId().toString());
+ ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(whoami,
+ operationScheduleEntity.getJobId().toString());
return resourceOperationSchedule;
} catch (SchedulerException e) {
throw new RuntimeException("Failed to retrieve ResourceOperationSchedule with id [" + scheduleId + "].", e);
@@ -480,7 +480,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
public GroupOperationSchedule getGroupOperationSchedule(Subject whoami, int scheduleId) {
OperationScheduleEntity operationScheduleEntity = entityManager.find(OperationScheduleEntity.class, scheduleId);
try {
- GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(whoami, operationScheduleEntity.getJobId().toString());
+ GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(whoami, operationScheduleEntity
+ .getJobId().toString());
return groupOperationSchedule;
} catch (SchedulerException e) {
throw new RuntimeException("Failed to retrieve GroupOperationSchedule with id [" + scheduleId + "].", e);
@@ -1281,11 +1282,24 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
for (ResourceOperationHistory history : histories) {
long timeout = getOperationTimeout(history.getOperationDefinition(), history.getParameters());
+ // there are two cases we need to check. First, did the resource history start but it took too long? (aka timed out?)
+ // Or, second, did the resource history not even start yet, but its been a very long time (1 day) since it was created?
+ // In either case, we can't wait forever, so we'll mark them as failed with an appropriate error message.
long duration = history.getDuration();
- if (duration > timeout) {
- LOG.info("Operation execution seems to have been orphaned - timing it out: " + history);
- history.setErrorMessage("Timed out : did not complete after " + duration + " ms"
- + " (the timeout period was " + timeout + " ms)");
+ long createdTime = history.getCreatedTime();
+ boolean timedOut = (duration > timeout);
+ boolean neverStarted = ((System.currentTimeMillis() - createdTime) > (1000 * 60 * 60 * 24));
+ if (timedOut || neverStarted) {
+ if (timedOut) {
+ // the operation started, but the agent never told us how it finished prior to exceeding the timeout
+ LOG.info("Operation execution seems to have been orphaned - timing it out: " + history);
+ history.setErrorMessage("Timed out : did not complete after " + duration + " ms"
+ + " (the timeout period was " + timeout + " ms)");
+ } else {
+ // the operation never even started, but its been at least a day since it was created
+ LOG.info("Operation execution seems to have never started - timing it out: " + history);
+ history.setErrorMessage("Failed to start : operation never started");
+ }
history.setStatus(OperationRequestStatus.FAILURE);
notifyAlertConditionCacheManager("checkForTimedOutOperations", history);
@@ -1355,7 +1369,6 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
* where sent to the remaining INPROGRESS elements).
*/
cancelOperationHistory(subject, resourceHistory.getId(), true);
- break;
}
}
@@ -2021,12 +2034,12 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
SimpleTrigger simpleTrigger = new SimpleTrigger();
Date startTime = null;
switch (jobTrigger.getStartType()) {
- case NOW:
- startTime = new Date();
- break;
- case DATETIME:
- startTime = jobTrigger.getStartDate();
- break;
+ case NOW:
+ startTime = new Date();
+ break;
+ case DATETIME:
+ startTime = jobTrigger.getStartDate();
+ break;
}
simpleTrigger.setStartTime(startTime);
if (jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.REPEAT_INTERVAL) {
commit 10f31a7acda68fe7be44cc3a29fa27588e29af71
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Apr 21 18:27:51 2011 +0200
Make the apache vhost resource upgrade process as robust as possible:
1) if the resource has snmpWwwServiceIndex property in plugin config,
use that to deterime which vhost the resource is
2) if id doesn't have that property, build a mapping of all the possible
resource keys the vhosts could have had assigned in the old versions
of the plugin and if the "old" resource uniquely maps to a new one,
upgrade it. If the mapping is ambiguous, permanently stop the resource
and inform the user that the only way forward is to uninventory the old
one and start using a newly discovered one.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index 1f355a1..ed610c1 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -77,7 +77,8 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
public static final String URL_CONFIG_PROP = "url";
public static final String MAIN_SERVER_RESOURCE_KEY = "MainServer";
-
+ public static final String FAILED_UPGRADE_RESOURCE_KEY_PREFIX = "FailedUpgrade";
+
public static final String RESPONSE_TIME_LOG_FILE_CONFIG_PROP = ResponseTimeConfiguration.RESPONSE_TIME_LOG_FILE_CONFIG_PROP;
public static final String RESPONSE_TIME_URL_EXCLUDES_CONFIG_PROP = ResponseTimeConfiguration.RESPONSE_TIME_URL_EXCLUDES_CONFIG_PROP;
public static final String RESPONSE_TIME_URL_TRANSFORMS_CONFIG_PROP = ResponseTimeConfiguration.RESPONSE_TIME_URL_TRANSFORMS_CONFIG_PROP;
@@ -98,6 +99,14 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
public static final String RESOURCE_TYPE_NAME = "Apache Virtual Host";
public void start(ResourceContext<ApacheServerComponent> resourceContext) throws Exception {
+ if (resourceContext.getResourceKey().startsWith(FAILED_UPGRADE_RESOURCE_KEY_PREFIX)) {
+ throw new IllegalStateException(
+ "The apache plugin failed to upgrade this virtual host from a previous version. "
+ + "A new virtual host resource will be (or has been) discovered that corresponds to this resource but it was not possible to "
+ + "safely and deterministically find a match between these two (due to ambiguous identification of virtual hosts "
+ + "in the previous version of the plugin). This resource is now defunct and you can uninventory it.");
+ }
+
this.resourceContext = resourceContext;
Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
String url = pluginConfig.getSimple(URL_CONFIG_PROP).getStringValue();
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
index 09d6a78..9477e95 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
@@ -26,9 +26,13 @@ import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -67,6 +71,8 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
private static final String RT_LOG_FILE_NAME_SUFFIX = "_rt.log";
+ private static final String LEGACY_SNMP_SERVICE_INDEX_CONFIG_PROP = "snmpWwwServiceIndex";
+
private static final Log log = LogFactory.getLog(ApacheVirtualHostServiceDiscoveryComponent.class);
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ApacheServerComponent> context)
@@ -148,72 +154,113 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
public ResourceUpgradeReport upgrade(ResourceUpgradeContext<ApacheServerComponent> inventoriedResource) {
String resourceKey = inventoriedResource.getResourceKey();
-
- if (ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY.equals(resourceKey) ||
- resourceKey.contains("|")) {
+
+ if (ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY.equals(resourceKey) || resourceKey.contains("|")) {
//a new style resource key. we're done.
return null;
}
-
+
String newResourceKey = null;
-
+
ApacheServerComponent serverComponent = inventoriedResource.getParentResourceComponent();
-
+
ApacheDirectiveTree tree = serverComponent.loadParser();
- tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(), serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames());
-
+ tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(),
+ serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames());
+
List<VHostSpec> vhosts = VHostSpec.detect(tree);
- for (VHostSpec vhost : vhosts) {
- String[] legacyResourceKeys = createLegacyResourceKeys(serverComponent, tree, vhost.serverName, vhost.hosts);
- if (Arrays.asList(legacyResourceKeys).contains(resourceKey)) {
- newResourceKey = createResourceKey(vhost.serverName, vhost.hosts);
- break;
+ //first, let's see if the inventoried resource has the snmpWwwServiceIndex property set
+ //if it does, use that to determine what vhost this corresponds to.
+ String snmpServiceIndexString = inventoriedResource.getPluginConfiguration().getSimpleValue(
+ LEGACY_SNMP_SERVICE_INDEX_CONFIG_PROP, null);
+ if (snmpServiceIndexString != null) {
+ Integer snmpServiceIndex = null;
+ try {
+ snmpServiceIndex = Integer.parseInt(snmpServiceIndexString);
+ } catch (NumberFormatException e) {
+ log.warn("Invalid format of the " + LEGACY_SNMP_SERVICE_INDEX_CONFIG_PROP
+ + " property value. It should be an integer but is '" + snmpServiceIndexString
+ + "'. The upgrade will continue using the resource key matching.", e);
}
- }
-
- if (newResourceKey == null) {
- //the last thing to check is whether the inventoried vhost isn't in fact the main server
- //The main server resource key could have had the following values:
- //1) a value from SNMP
- //2) the server url as defined by the parent component
-
- String serverUrl = serverComponent.getServerUrl();
-
- if (serverUrl != null) {
- try {
- URI mainServerUri = new URI(serverUrl);
- String host = mainServerUri.getHost();
- int port = mainServerUri.getPort();
- if (port == -1) {
- port = 80;
+
+ if (snmpServiceIndex != null) {
+ if (snmpServiceIndex > 0) {
+ //yay, we can use the snmpService index to determine which vhost we're dealing with
+ if (snmpServiceIndex == 1) {
+ newResourceKey = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY;
+ } else {
+ if (vhosts.size() + 1 < snmpServiceIndex) {
+ log.warn("The "
+ + LEGACY_SNMP_SERVICE_INDEX_CONFIG_PROP
+ + " property contains incorrect value ("
+ + snmpServiceIndex
+ + "), which is larger than the total number of active virtual hosts in the configuration files ("
+ + (vhosts.size() + 1) + ". The upgrade will continue using the resource key matching.");
+ } else {
+ //k, this seems to be a correct value
+ //the SNMP indices are in the reverse order of the definitions in the config files
+ //+1, where the main server is always on index 1.
+ VHostSpec vhost = vhosts.get(vhosts.size() - snmpServiceIndex + 1);
+ newResourceKey = createResourceKey(vhost.serverName, vhost.hosts);
+ }
}
-
- serverUrl = host + ":" + port;
- } catch (URISyntaxException e) {
- log.warn("Incorrect main server URL defined in the apache resource [" + inventoriedResource.getParentResourceContext().getResourceKey() + "].");
- serverUrl = null;
+ } else {
+ log.warn("The " + LEGACY_SNMP_SERVICE_INDEX_CONFIG_PROP
+ + " property should be a positive integer greater than zero but is " + snmpServiceIndex
+ + " instead. The upgrade will continue using the resource key matching.");
}
}
-
- HttpdAddressUtility.Address addr = serverComponent.getAddressUtility().getHttpdInternalMainServerAddressRepresentation(tree);
- String snmpUrl = addr.host + ":" + addr.port;
-
- if (resourceKey.equals(serverUrl) || resourceKey.equals(snmpUrl)) {
- newResourceKey = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY;
- }
}
-
+
if (newResourceKey != null) {
ResourceUpgradeReport report = new ResourceUpgradeReport();
report.setNewResourceKey(newResourceKey);
-
+
return report;
+ }
+
+ Map<String, Set<VHostSpec>> possibleMatchesPerRK = new HashMap<String, Set<VHostSpec>>();
+ for (VHostSpec vhost : vhosts) {
+ String[] legacyResourceKeys = createLegacyResourceKeys(serverComponent, tree, vhost.serverName, vhost.hosts);
+
+ addPossibleRKMatch(legacyResourceKeys[0], vhost, possibleMatchesPerRK);
+ addPossibleRKMatch(legacyResourceKeys[1], vhost, possibleMatchesPerRK);
+ }
+
+ String[] mainServerRKs = createLegacyMainServerResourceKey(serverComponent, tree);
+ if (mainServerRKs[0] != null) {
+ addPossibleRKMatch(mainServerRKs[0], null, possibleMatchesPerRK);
+ }
+ addPossibleRKMatch(mainServerRKs[1], null, possibleMatchesPerRK);
+
+ Set<VHostSpec> matchingVhosts = possibleMatchesPerRK.get(resourceKey);
+ if (matchingVhosts == null || matchingVhosts.size() != 1) {
+ newResourceKey = ApacheVirtualHostServiceComponent.FAILED_UPGRADE_RESOURCE_KEY_PREFIX + "_" + resourceKey
+ + "_" + UUID.randomUUID().toString();
+ log.info("Failed to uniquely identify the vhost from the old-style resource key. The old resource key is '"
+ + resourceKey
+ + "' which can be matched with the following new-style resource keys: "
+ + matchingVhosts
+ + ". The match could not be established and the resource key was reset to '"
+ + newResourceKey
+ + "' so that this vhost resource never starts up again. This is to prevent collisions with the discoveries made "
+ + "by this version of the plugin.");
} else {
- return null;
+ VHostSpec vhost = matchingVhosts.iterator().next();
+ if (vhost == null) {
+ newResourceKey = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY;
+ } else {
+ newResourceKey = createResourceKey(vhost.serverName, vhost.hosts);
+ }
}
+
+ ResourceUpgradeReport report = new ResourceUpgradeReport();
+ report.setNewResourceKey(newResourceKey);
+
+ return report;
}
-
+
private void discoverMainServer(ResourceDiscoveryContext<ApacheServerComponent> context,
Set<DiscoveredResourceDetails> discoveredResources) throws Exception {
@@ -309,6 +356,41 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
return ret;
}
+ /**
+ * This returns the 2 possible legacy resource keys for the main server:
+ *
+ * 1) The URL as specified in the parent component (this can be null)
+ * 2) The host:port as would be returned from the SNMP module
+ * ( 3) MainServer could be returned as well, but this is handled otherwise in the upgrade method )
+ *
+ * @param serverComponent
+ * @return
+ */
+ private static String[] createLegacyMainServerResourceKey(ApacheServerComponent serverComponent, ApacheDirectiveTree runtimeConfig) {
+ String[] ret = new String[2];
+
+ ret[0] = serverComponent.getServerUrl();
+
+ if (serverComponent.getServerUrl() != null) {
+ try {
+ URI mainServerUri = new URI(serverComponent.getServerUrl());
+ String host = mainServerUri.getHost();
+ int port = mainServerUri.getPort();
+ if (port == -1) {
+ port = 80;
+ }
+
+ ret[0] = host + ":" + port;
+ } catch (URISyntaxException e) {
+ }
+ }
+
+ HttpdAddressUtility.Address addr = serverComponent.getAddressUtility().getHttpdInternalMainServerAddressRepresentation(runtimeConfig);
+ ret[1] = addr.host + ":" + addr.port;
+
+ return ret;
+ }
+
private static class VHostSpec {
public String serverName;
public List<String> hosts;
@@ -334,5 +416,20 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
serverName = serverNames.get(serverNames.size() - 1).getValuesAsString();
}
}
+
+ @Override
+ public String toString() {
+ return createResourceKey(serverName, hosts);
+ }
+ }
+
+ private static void addPossibleRKMatch(String resourceKey, VHostSpec vhost, Map<String, Set<VHostSpec>> possibleMatches) {
+ Set<VHostSpec> matches = possibleMatches.get(resourceKey);
+ if (matches == null) {
+ matches = new HashSet<VHostSpec>();
+ possibleMatches.put(resourceKey, matches);
+ }
+
+ matches.add(vhost);
}
}
\ No newline at end of file
commit 0438f1d28c7daf1ed2dd930dac25a9293e3dff19
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Apr 21 18:16:38 2011 +0200
Be more robust when determining the apache server version. Use either the resource context or directly the binary info if the version is unavailable in the resource context.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index 360e75c..ca89fea 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -901,7 +901,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
}
public HttpdAddressUtility getAddressUtility() {
- String version = resourceContext.getVersion();
+ String version = getVersion();
return HttpdAddressUtility.get(version);
}
@@ -954,7 +954,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
log.error("Augeas is enabled in configuration but was not found on the system.");
throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
}
- String version = resourceContext.getVersion();
+ String version = getVersion();
if (!version.startsWith("2.")) {
log.error(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
@@ -965,4 +965,18 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
return false;
}
}
+
+ private String getVersion() {
+ String ret = resourceContext.getVersion();
+ if (ret == null) {
+ //strange, but this happens sometimes when
+ //the resource is synced with the server for the first
+ //time after data purge on the agent side
+
+ //let's determine the version from the binary info
+ ret = binaryInfo.getVersion();
+ }
+
+ return ret;
+ }
}
commit 0a348a28cd62fdd58d5a25a60fd237b0468cf4cf
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Apr 21 18:15:12 2011 +0200
The process info can be null if the apache process cannot be found. Check for that fact during runtime info extraction.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 38b79ef..894dd11 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -70,31 +70,33 @@ public class RuntimeApacheConfiguration {
List<String> defines = new ArrayList<String>(httpdBinaryInfo.getCompiledInDefines());
- String[] args = httpdProcessInfo.getCommandLine();
- for(int i = 1; i < args.length; ++i) {
- String define = null;
- if (args[i] != null && args[i].startsWith("-D")) {
- define = args[i].substring(2).trim();
- }
-
- if (define != null && define.isEmpty()) {
- //this means we saw an empty -D arg. This can happen if there is a space between -D and the value.
- //That is legal though, so we have to accomodate for that.
- if (i < args.length - 1) {
- define = args[i + 1].trim();
- if (define.startsWith("-")) {
- //this would be another option
- define = null;
+ if (httpdProcessInfo != null) {
+ String[] args = httpdProcessInfo.getCommandLine();
+ for(int i = 1; i < args.length; ++i) {
+ String define = null;
+ if (args[i] != null && args[i].startsWith("-D")) {
+ define = args[i].substring(2).trim();
+ }
+
+ if (define != null && define.isEmpty()) {
+ //this means we saw an empty -D arg. This can happen if there is a space between -D and the value.
+ //That is legal though, so we have to accomodate for that.
+ if (i < args.length - 1) {
+ define = args[i + 1].trim();
+ if (define.startsWith("-")) {
+ //this would be another option
+ define = null;
+ } else {
+ ++i; //we can skip the next arg
+ }
} else {
- ++i; //we can skip the next arg
+ define = null; //well -D is the last argument
}
- } else {
- define = null; //well -D is the last argument
}
- }
-
- if (define != null) {
- defines.add(define);
+
+ if (define != null) {
+ defines.add(define);
+ }
}
}
commit 0b9a6b6ab1130ea4896cf78283225fe286d9f7cc
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Apr 21 18:11:10 2011 +0200
Including the resource version in the data sent from the server to the agent during inventory sync. This will make sure that the version is set at all times a resource component is started.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java
index 9160eb4..4e739aa 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java
@@ -206,6 +206,8 @@ public class DiscoveryServerServiceImpl implements DiscoveryServerService {
pojoResource.setName(resource.getName());
pojoResource.setDescription(resource.getDescription());
pojoResource.setLocation(resource.getLocation());
+ pojoResource.setVersion(resource.getVersion());
+
if (resource.getParentResource() != null) {
pojoResource.setParentResource(convertToPojoResource(resource.getParentResource(), false));
}
commit f9361b2b56ed9beca70d834cb02a2d5cd65eb7e6
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 12:01:59 2011 -0400
don't allow deselection of perms whose selection is implied by existing selection of MANAGE_SECURITY or MANAGE_INVENTORY (rest of fix for https://bugzilla.redhat.com/show_bug.cgi?id=698475)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index d51ad59..46fc5d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -335,19 +335,22 @@ public class PermissionsEditor extends LocatableVStack {
ListGridRecord record = grid.getRecord(recordNum);
String permissionName = record.getAttribute(nameField);
Permission permission = Permission.valueOf(permissionName);
+ String permissionDisplayName = record.getAttribute("displayName");
if (permission == Permission.VIEW_RESOURCE) {
- event.getItem().setValue(true);
- String permissionDisplayName = record.getAttribute("displayName");
- Message message = new Message(
- MSG.view_adminRoles_permissions_readAccessImplied(permissionDisplayName),
- Message.Severity.Warning);
- CoreGUI.getMessageCenter().notify(message);
+ String messageString = MSG.view_adminRoles_permissions_readAccessImplied(permissionDisplayName);
+ handleIllegalPermissionSelection(event, messageString);
+ } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_SECURITY) && permission != Permission.MANAGE_SECURITY) {
+ String messageString = MSG.view_adminRoles_permissions_illegal_deselection_due_to_manageSecurity_selection(permissionDisplayName);
+ handleIllegalPermissionSelection(event, messageString);
+ } else if (!authorized && selectedPermissions.contains(Permission.MANAGE_INVENTORY) && permission.getTarget() == Permission.Target.RESOURCE) {
+ String messageString = MSG.view_adminRoles_permissions_illegal_deselection_due_to_manageInventory_selection(permissionDisplayName);
+ handleIllegalPermissionSelection(event, messageString);
} else {
updatePermissions(authorized, permission);
// Let our parent role editor know the permissions have been changed, so it can update the
// enablement of its Save and Reset buttons.
- org.rhq.enterprise.gui.coregui.client.admin.roles.PermissionsEditor.this.roleEditView.onItemChanged();
+ PermissionsEditor.this.roleEditView.onItemChanged();
}
}
});
@@ -356,6 +359,12 @@ public class PermissionsEditor extends LocatableVStack {
return authorizedField;
}
+ private static void handleIllegalPermissionSelection(ChangedEvent event, String messageString) {
+ event.getItem().setValue(true);
+ Message message = new Message(messageString, Message.Severity.Warning, EnumSet.of(Message.Option.Transient));
+ CoreGUI.getMessageCenter().notify(message);
+ }
+
private void updatePermissions(Boolean authorized, Permission permission) {
String messageString = null;
boolean redrawRequired = false;
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 baa3979..a345046 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
@@ -736,6 +736,8 @@ view_adminRoles_permissions_autoselecting_manageSecurity_implied = Autoselected
view_adminRoles_permissions_autoselecting_manageInventory_implied = Autoselected unselected Resource permissions, since MANAGE_INVENTORY implies all Resource permissions...
view_adminRoles_permissions_autoselecting_configureWrite_implied = Autoselected CONFIGURE_READ permission, since CONFIGURE_WRITE implies it...
view_adminRoles_permissions_autoselecting_configureRead_implied = Autodeselected CONFIGURE_WRITE permission, since lack of CONFIGURE_READ implies lack of it...
+view_adminRoles_permissions_illegal_deselection_due_to_manageSecurity_selection = {0} permission cannot be deselected, unless Manage Security, which implies all other permissions, is deselected first.
+view_adminRoles_permissions_illegal_deselection_due_to_manageInventory_selection = {0} permission cannot be deselected, unless Manage Inventory, which implies all Resource permissions, is deselected first.
# Administration/Topology/RemoteAgentInstall/#
#--------------------------------
commit 0ace0ca6b3df107403ea9437ef5f44ad7bf64c1b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 10:53:58 2011 -0400
display a transient message to inform the user when auto-selecting perms implied by a perm the user has just selected (https://bugzilla.redhat.com/show_bug.cgi?id=698475)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index 506850a..d51ad59 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -357,37 +357,51 @@ public class PermissionsEditor extends LocatableVStack {
}
private void updatePermissions(Boolean authorized, Permission permission) {
+ String messageString = null;
boolean redrawRequired = false;
if (authorized) {
this.selectedPermissions.add(permission);
if (permission == Permission.MANAGE_SECURITY) {
// MANAGE_SECURITY implies all other perms.
- this.selectedPermissions.addAll(EnumSet.allOf(Permission.class));
- redrawRequired = true;
+ if (this.selectedPermissions.addAll(EnumSet.allOf(Permission.class))) {
+ messageString = MSG.view_adminRoles_permissions_autoselecting_manageSecurity_implied();
+ redrawRequired = true;
+ }
} else if (permission == Permission.MANAGE_INVENTORY) {
// MANAGE_INVENTORY implies all Resource perms.
- this.selectedPermissions.addAll(Permission.RESOURCE_ALL);
- redrawRequired = true;
+ if (this.selectedPermissions.addAll(Permission.RESOURCE_ALL)) {
+ messageString = MSG.view_adminRoles_permissions_autoselecting_manageInventory_implied();
+ redrawRequired = true;
+ }
} else if (permission == Permission.CONFIGURE_WRITE) {
// CONFIGURE_WRITE implies CONFIGURE_READ.
- this.selectedPermissions.add(Permission.CONFIGURE_READ);
- redrawRequired = true;
+ if (this.selectedPermissions.add(Permission.CONFIGURE_READ)) {
+ messageString = MSG.view_adminRoles_permissions_autoselecting_configureWrite_implied();
+ redrawRequired = true;
+ }
}
} else {
this.selectedPermissions.remove(permission);
if (permission == Permission.CONFIGURE_READ) {
// Lack of CONFIGURE_READ implies lack of CONFIGURE_WRITE.
- this.selectedPermissions.remove(Permission.CONFIGURE_WRITE);
- redrawRequired = true;
+ if (this.selectedPermissions.remove(Permission.CONFIGURE_WRITE)) {
+ messageString = MSG.view_adminRoles_permissions_autoselecting_configureRead_implied();
+ redrawRequired = true;
+ }
}
}
-
+
ListGridRecord[] permissionRecords = RolesDataSource.toRecordArray(this.selectedPermissions);
this.roleEditView.getForm().setValue(RolesDataSource.Field.PERMISSIONS, permissionRecords);
if (redrawRequired) {
redraw();
}
+
+ if (messageString != null) {
+ Message message = new Message(messageString, EnumSet.of(Message.Option.Transient));
+ CoreGUI.getMessageCenter().notify(message);
+ }
}
private ListGridRecord createGlobalPermissionRecord(String displayName, String icon, Permission globalPermission,
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 f5f96bf..baa3979 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
@@ -732,6 +732,10 @@ view_adminRoles_permissions_permWriteDesc_createChildResources = create new chil
view_adminRoles_permissions_perm_deleteChildResources = Delete Child Resources
view_adminRoles_permissions_permReadDesc_deleteChildResources = (IMPLIED) view child Resource deletion history
view_adminRoles_permissions_permWriteDesc_deleteChildResources = uninventory resources; delete Resources (for Resources of types that are deletable)
+view_adminRoles_permissions_autoselecting_manageSecurity_implied = Autoselected unselected permissions, since MANAGE_SECURITY implies all other permissions...
+view_adminRoles_permissions_autoselecting_manageInventory_implied = Autoselected unselected Resource permissions, since MANAGE_INVENTORY implies all Resource permissions...
+view_adminRoles_permissions_autoselecting_configureWrite_implied = Autoselected CONFIGURE_READ permission, since CONFIGURE_WRITE implies it...
+view_adminRoles_permissions_autoselecting_configureRead_implied = Autodeselected CONFIGURE_WRITE permission, since lack of CONFIGURE_READ implies lack of it...
# Administration/Topology/RemoteAgentInstall/#
#--------------------------------
commit 36b2ef40a3b59aed521cb268da1cf56acc7a6d55
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 21 10:53:30 2011 -0400
cancel the message clearing timer if it's not null at top of MessageBar.onMessage() to prevent the timer from clearing the newly fired message prematurely (https://bugzilla.redhat.com/show_bug.cgi?id=698704)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
index 1b27eee..5d48055 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2010-2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -45,6 +45,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
* @author Jay Shaughnessy
*/
public class MessageBar extends LocatableHLayout implements MessageCenter.MessageListener {
+
private static final String LOCATOR_ID = "MessageBar";
private static final int AUTO_HIDE_DELAY_MILLIS = 30000;
private static final String NON_BREAKING_SPACE = " ";
@@ -53,6 +54,7 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
private Message currentMessage;
private Message stickyMessage; // this message will always be shown until dismissed by user.
private Menu showDetailsMenu;
+ private Timer messageClearingTimer;
public MessageBar() {
super(LOCATOR_ID);
@@ -108,6 +110,10 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
@Override
public void onMessage(Message message) {
if (!message.isBackgroundJobResult()) {
+ if (this.messageClearingTimer != null) {
+ this.messageClearingTimer.cancel();
+ }
+
this.currentMessage = message;
updateLabel(message);
@@ -115,8 +121,7 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
if (message.isSticky()) {
this.stickyMessage = message;
} else {
- new Timer() {
- @Override
+ this.messageClearingTimer = new Timer() {
public void run() {
clearMessage(false);
// if we had a sticky message before, show it again, now that our more recent message has gone away
@@ -124,7 +129,8 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
updateLabel(stickyMessage);
}
}
- }.schedule(AUTO_HIDE_DELAY_MILLIS);
+ };
+ this.messageClearingTimer.schedule(AUTO_HIDE_DELAY_MILLIS);
}
}
}
@@ -157,4 +163,5 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
markForRedraw();
}
+
}
commit 57b0e0603cc1ac454698e76862a9827fd3eb3185
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 21 10:37:41 2011 -0400
make sure SNAPSHOT < Beta1 < Release/GA
diff --git a/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java b/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
index 8d44c54..6d02842 100644
--- a/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
+++ b/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
@@ -45,8 +45,12 @@ public class ComparableVersionTest {
compareVersions("1.1.0.GA", "1.1.1.RC1"); // ver2 version number is still after ver1 version number, although ver2 is not production ready
compareVersions("4.0.0-SNAPSHOT", "4.0.0.CR2"); // CR is an alias for RC
compareVersions("4.0.0-SNAPSHOT", "4.0.0.CR"); // CR is an alias for RC
- compareVersions("4.0.0-SNAPSHOT", "4.0.0");
+ }
+
+ public void testSnapshotBetaGACompare() {
+ compareVersions("4.0.0-SNAPSHOT", "4.0.0.Beta1");
compareVersions("4.0.0.Beta1", "4.0.0");
+ compareVersions("4.0.0.Beta1", "4.0.0.GA");
}
private void compareVersions(String ver1String, String ver2String) {
commit fa754ea4218e8b41a011545953bff355ca2f519c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 21 10:23:15 2011 -0400
add new version tests to ensure 4.0.0 comes after Beta1 and Snapshot
diff --git a/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java b/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
index dfee3a5..8d44c54 100644
--- a/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
+++ b/modules/core/util/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
@@ -23,152 +23,41 @@ import org.testng.annotations.Test;
@Test
public class ComparableVersionTest {
public void testSimpleVersionCompare() {
- ComparableVersion ver1;
- ComparableVersion ver2;
-
- ver1 = new ComparableVersion("1.0");
- ver2 = new ComparableVersion("1.1");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.0");
- ver2 = new ComparableVersion("2.0");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.0.0");
- ver2 = new ComparableVersion("1.0.1");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
+ compareVersions("1.0", "1.1");
+ compareVersions("1.0", "2.0");
+ compareVersions("1.0.0", "1.0.1");
}
public void testSnapshotVersionCompare() {
- ComparableVersion ver1;
- ComparableVersion ver2;
-
- ver1 = new ComparableVersion("1.0-SNAPSHOT");
- ver2 = new ComparableVersion("1.1-SNAPSHOT");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1-SNAPSHOT");
- ver2 = new ComparableVersion("1.1.0.RC1");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1-SNAPSHOT");
- ver2 = new ComparableVersion("1.1.0.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1-SNAPSHOT");
- ver2 = new ComparableVersion("1.1.0.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1.1-SNAPSHOT");
- ver2 = new ComparableVersion("1.1.1.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1.1-SNAPSHOT");
- ver2 = new ComparableVersion("1.1.0.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) > 0; // ver1 is after ver2!
- assert ver2.compareTo(ver1) < 0; // ver1 is after ver2!
+ compareVersions("1.0-SNAPSHOT", "1.1-SNAPSHOT");
+ compareVersions("1.1-SNAPSHOT", "1.1.0.RC1");
+ compareVersions("1.1-SNAPSHOT", "1.1.0.GA");
+ compareVersions("1.1-SNAPSHOT", "1.1.0.GA");
+ compareVersions("1.1.1-SNAPSHOT", "1.1.1.GA");
+ compareVersions("1.1.0.GA", "1.1.1-SNAPSHOT"); // ver2 version number is still after ver1 version number, although ver2 is not production ready
}
public void testRCVersionCompare() {
- ComparableVersion ver1;
- ComparableVersion ver2;
-
- ver1 = new ComparableVersion("1.0.0.RC1");
- ver2 = new ComparableVersion("1.1.0.RC1");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1.0.RC1");
- ver2 = new ComparableVersion("1.1.0.RC2");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1.0.RC1");
- ver2 = new ComparableVersion("1.1.0.RC10");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
-
- ver1 = new ComparableVersion("1.1.0.RC1");
- ver2 = new ComparableVersion("1.1.0.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
+ compareVersions("1.0.0.RC1", "1.1.0.RC1");
+ compareVersions("1.1.0.RC1", "1.1.0.RC2");
+ compareVersions("1.1.0.RC1", "1.1.0.RC10");
+ compareVersions("1.1.0.RC1", "1.1.0.GA");
+ compareVersions("1.1.0.GA", "1.1.1.RC1"); // ver2 version number is still after ver1 version number, although ver2 is not production ready
+ compareVersions("4.0.0-SNAPSHOT", "4.0.0.CR2"); // CR is an alias for RC
+ compareVersions("4.0.0-SNAPSHOT", "4.0.0.CR"); // CR is an alias for RC
+ compareVersions("4.0.0-SNAPSHOT", "4.0.0");
+ compareVersions("4.0.0.Beta1", "4.0.0");
+ }
- ver1 = new ComparableVersion("1.1.1.RC1");
- ver2 = new ComparableVersion("1.1.0.GA");
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) > 0; // ver1 is after ver2!
- assert ver2.compareTo(ver1) < 0; // ver1 is after ver2!
+ private void compareVersions(String ver1String, String ver2String) {
+ ComparableVersion ver1 = new ComparableVersion(ver1String);
+ ComparableVersion ver2 = new ComparableVersion(ver2String);
- ver1 = new ComparableVersion("4.0.0-SNAPSHOT");
- ver2 = new ComparableVersion("4.0.0.CR2"); // CR is an alias for RC
- assert !ver1.equals(ver2);
- assert !ver2.equals(ver1);
- assert ver1.compareTo(ver1) == 0;
- assert ver2.compareTo(ver2) == 0;
- assert ver1.compareTo(ver2) < 0;
- assert ver2.compareTo(ver1) > 0;
+ assert !ver1.equals(ver2) : "Should not be equal 1=[" + ver1String + "]; 2=[" + ver2String + "]";
+ assert !ver2.equals(ver1) : "Should not be equal 1=[" + ver1String + "]; 2=[" + ver2String + "]";
+ assert ver1.compareTo(ver1) == 0 : "Identity compare failed 1=[" + ver1String + "]; 2=[" + ver2String + "]";
+ assert ver2.compareTo(ver2) == 0 : "Identity compare failed 1=[" + ver1String + "]; 2=[" + ver2String + "]";
+ assert ver1.compareTo(ver2) < 0 : "1 should be before 2: 1=[" + ver1String + "]; 2=[" + ver2String + "]";
+ assert ver2.compareTo(ver1) > 0 : "2 should be after 1: 1=[" + ver1String + "]; 2=[" + ver2String + "]";
}
}
commit 73c089cea2df5f4bcb4820dd0a831636cc9c4d5e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Apr 21 09:59:45 2011 -0400
[BZ 698314 - need to hit refresh button to see recent operations]
An async issue that could result in the totalRows of a fetch not being
initialized (and therefore set to 0). The fetch itself was successful, but
the Response was wrong.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
index 7535cf7..7b0cb59 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
@@ -301,16 +301,16 @@ public abstract class AbstractOperationHistoryPortlet extends OperationHistoryVi
}
/* (non-Javadoc)
- * This override allows us to set the total rows to the number of recent op histpry configured for
+ * This override allows us to set the total rows to the number of recent op history configured for
* the portlet. This sets the counter appropriately and stops further queries to the server.
*
- * @see org.rhq.enterprise.gui.coregui.client.operation.OperationHistoryDataSource#dataRetrieved(org.rhq.core.domain.util.PageList, com.smartgwt.client.data.DSResponse, com.smartgwt.client.data.DSRequest)
+ * @see org.rhq.enterprise.gui.coregui.client.operation.OperationHistoryDataSource#getTotalRows(org.rhq.core.domain.util.PageList, com.smartgwt.client.data.DSResponse, com.smartgwt.client.data.DSRequest)
*/
@Override
- protected void dataRetrieved(PageList<ResourceOperationHistory> result, DSResponse response, DSRequest request) {
- super.dataRetrieved(result, response, request);
+ protected int getTotalRows(final PageList<ResourceOperationHistory> result, final DSResponse response,
+ final DSRequest request) {
- response.setTotalRows(result.size());
+ return result.size();
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
index 118b1e3..f321d07 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
@@ -303,15 +303,30 @@ public class OperationHistoryDataSource extends
Log.info(result.size() + " operation histories fetched in: " + fetchTime + "ms");
dataRetrieved(result, response, request);
- processResponse(request.getRequestId(), response);
}
});
}
/**
+ * Sub-classes can override this to add fine-grained control over the result set size. By default the
+ * total rows are set to the total result set for the query, allowing proper paging. But some views (portlets)
+ * may want to limit results to a small set (like most recent).
+ * @param result
+ * @param response
+ * @param request
+ *
+ * @return should not exceed result.getTotalSize().
+ */
+ protected int getTotalRows(final PageList<ResourceOperationHistory> result, final DSResponse response,
+ final DSRequest request) {
+
+ return result.getTotalSize();
+ }
+
+ /**
* Additional processing to support entity-specific or cross-resource views, and something that can be overidden.
*/
- protected void dataRetrieved(final PageList<ResourceOperationHistory> result, final DSResponse response,
+ private void dataRetrieved(final PageList<ResourceOperationHistory> result, final DSResponse response,
final DSRequest request) {
switch (entityContext.type) {
@@ -319,7 +334,8 @@ public class OperationHistoryDataSource extends
case Resource:
response.setData(buildRecords(result));
// for paging to work we have to specify size of full result set
- response.setTotalRows(result.getTotalSize());
+ response.setTotalRows(getTotalRows(result, response, request));
+ processResponse(request.getRequestId(), response);
break;
// disambiguate as the results could be cross-resource
@@ -354,7 +370,8 @@ public class OperationHistoryDataSource extends
}
response.setData(records);
// for paging to work we have to specify size of full result set
- response.setTotalRows(result.getTotalSize());
+ response.setTotalRows(getTotalRows(result, response, request));
+ processResponse(request.getRequestId(), response);
}
});
}
commit a90faf9262bc09ebf856f3699674def86b3e55c1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 20 18:43:28 2011 -0400
get operations menu items working off tree group context menus (https://bugzilla.redhat.com/show_bug.cgi?id=698465)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 0c15872..26fe3d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -22,6 +22,7 @@
*/
package org.rhq.enterprise.gui.coregui.client;
+import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView;
import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
@@ -83,6 +84,21 @@ public class LinkManager {
}
}
+ public static String getResourceGroupTabLink(ResourceGroup group, String tabName, String subTabName) {
+ String link;
+ if (group.getSubject() != null) {
+ // autogroup
+ link = getAutoGroupTabLink(group.getId(), tabName, subTabName);
+ } else if (group.getClusterResourceGroup() != null) {
+ // autocluster
+ link = getAutoClusterTabLink(group.getId(), tabName, subTabName);
+ } else {
+ // regular group
+ link = getResourceGroupTabLink(group.getId(), tabName, subTabName);
+ }
+ return link;
+ }
+
public static String getResourcePluginConfigurationUpdateHistoryLink(int groupId) {
return getResourceLink(groupId) + "/Inventory/ConnectionSettingsHistory";
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
index 38edb6e..bc2da4f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -46,6 +46,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph.ResourceGroupGraphPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceDetailView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
@@ -116,8 +117,8 @@ public class ResourceGroupContextMenu extends LocatableMenu {
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
- groupMemberType = type;
+ groupMemberType = type;
buildResourceGroupContextMenu(group, type);
showContextMenu();
}
@@ -136,27 +137,31 @@ public class ResourceGroupContextMenu extends LocatableMenu {
// plugin config
MenuItem pluginConfiguration = new MenuItem(MSG.view_tabs_common_connectionSettings());
- pluginConfiguration.addClickHandler(new ClickHandler() {
- public void onClick(MenuItemClickEvent event) {
- if (isAutoGroup) {
- CoreGUI.goToView(LinkManager.getAutoGroupTabLink(group.getId(), "Inventory", "ConnectionSettings"));
- } else if (isAutoCluster) {
- CoreGUI.goToView(LinkManager
- .getAutoClusterTabLink(group.getId(), "Inventory", "ConnectionSettings"));
- } else {
- CoreGUI.goToView(LinkManager.getResourceGroupTabLink(group.getId(), "Inventory",
- "ConnectionSettings"));
+ boolean pluginConfigEnabled = resourceType.getPluginConfigurationDefinition() != null;
+ pluginConfiguration.setEnabled(pluginConfigEnabled);
+ if (pluginConfigEnabled) {
+ pluginConfiguration.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ if (isAutoGroup) {
+ CoreGUI.goToView(LinkManager.getAutoGroupTabLink(group.getId(), "Inventory", "ConnectionSettings"));
+ } else if (isAutoCluster) {
+ CoreGUI.goToView(LinkManager
+ .getAutoClusterTabLink(group.getId(), "Inventory", "ConnectionSettings"));
+ } else {
+ CoreGUI.goToView(LinkManager.getResourceGroupTabLink(group.getId(), "Inventory",
+ "ConnectionSettings"));
+ }
}
- }
- });
- pluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() != null);
+ });
+ }
addItem(pluginConfiguration);
+ // resource config
MenuItem resourceConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_resourceConfiguration());
- boolean enabled = groupComposite.getResourcePermission().isConfigureRead()
+ boolean resourceConfigEnabled = groupComposite.getResourcePermission().isConfigureRead()
&& resourceType.getResourceConfigurationDefinition() != null;
- resourceConfiguration.setEnabled(enabled);
- if (enabled) {
+ resourceConfiguration.setEnabled(resourceConfigEnabled);
+ if (resourceConfigEnabled) {
resourceConfiguration.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
if (isAutoGroup) {
@@ -177,16 +182,19 @@ public class ResourceGroupContextMenu extends LocatableMenu {
// Operations Menu
MenuItem operations = new MenuItem(MSG.view_tree_common_contextMenu_operations());
- enabled = (groupComposite.getResourcePermission().isControl() && null != resourceType.getOperationDefinitions() && !resourceType
+ boolean operationsEnabled = (groupComposite.getResourcePermission().isControl() && null != resourceType.getOperationDefinitions() && !resourceType
.getOperationDefinitions().isEmpty());
- operations.setEnabled(enabled);
- if (enabled) {
+ operations.setEnabled(operationsEnabled);
+ if (operationsEnabled) {
Menu opSubMenu = new Menu();
for (final OperationDefinition operationDefinition : resourceType.getOperationDefinitions()) {
MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName());
operationItem.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
- // TODO Group version, wizard invoke or tab nav?
+ String viewPath = LinkManager.getResourceGroupTabLink(group,
+ ResourceDetailView.Tab.OPERATIONS, ResourceDetailView.OperationsSubTab.SCHEDULES)
+ + "/0/" + operationDefinition.getId();
+ CoreGUI.goToView(viewPath);
}
});
opSubMenu.addItem(operationItem);
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 0ff7934..ceb74c1 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
@@ -98,8 +98,6 @@ public class ResourceTreeView extends LocatableVLayout {
private Resource rootResource;
- private ViewId currentViewId;
-
private Menu resourceContextMenu;
private ResourceGroupContextMenu autoGroupContextMenu;
@@ -401,21 +399,24 @@ public class ResourceTreeView extends LocatableVLayout {
// plugin config
MenuItem pluginConfiguration = new MenuItem(MSG.view_tabs_common_connectionSettings());
- pluginConfiguration.addClickHandler(new ClickHandler() {
+ boolean pluginConfigEnabled = resourceType.getPluginConfigurationDefinition() != null;
+ pluginConfiguration.setEnabled(pluginConfigEnabled);
+ if (pluginConfigEnabled) {
+ pluginConfiguration.addClickHandler(new ClickHandler() {
- public void onClick(MenuItemClickEvent event) {
- CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(), "Inventory", "ConnectionSettings"));
- }
- });
- pluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() != null);
+ public void onClick(MenuItemClickEvent event) {
+ CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(), "Inventory", "ConnectionSettings"));
+ }
+ });
+ }
resourceContextMenu.addItem(pluginConfiguration);
// resource config
MenuItem resourceConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_resourceConfiguration());
- boolean enabled = resourcePermission.isConfigureRead()
+ boolean resourceConfigEnabled = resourcePermission.isConfigureRead()
&& resourceType.getResourceConfigurationDefinition() != null;
- resourceConfiguration.setEnabled(enabled);
- if (enabled) {
+ resourceConfiguration.setEnabled(resourceConfigEnabled);
+ if (resourceConfigEnabled) {
resourceConfiguration.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
@@ -430,19 +431,20 @@ public class ResourceTreeView extends LocatableVLayout {
// Operations Menu
MenuItem operations = new MenuItem(MSG.view_tree_common_contextMenu_operations());
- enabled = (resourcePermission.isControl() && (resourceType.getOperationDefinitions() != null) && !resourceType
+ boolean operationsEnabled = (resourcePermission.isControl() && (resourceType.getOperationDefinitions() != null) && !resourceType
.getOperationDefinitions().isEmpty());
- operations.setEnabled(enabled);
- if (enabled) {
+ operations.setEnabled(operationsEnabled);
+ if (operationsEnabled) {
Menu opSubMenu = new Menu();
for (final OperationDefinition operationDefinition : resourceType.getOperationDefinitions()) {
MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName());
operationItem.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
- CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(),
- ResourceDetailView.Tab.OPERATIONS, ResourceDetailView.OperationsSubTab.SCHEDULES)
- + "/0/" + operationDefinition.getId());
+ String viewPath = LinkManager.getResourceTabLink(resource.getId(),
+ ResourceDetailView.Tab.OPERATIONS, ResourceDetailView.OperationsSubTab.SCHEDULES)
+ + "/0/" + operationDefinition.getId();
+ CoreGUI.goToView(viewPath);
}
});
opSubMenu.addItem(operationItem);
@@ -456,8 +458,8 @@ public class ResourceTreeView extends LocatableVLayout {
// Create Child Menu
MenuItem createChildMenu = new MenuItem(MSG.common_button_create_child());
- enabled = resourcePermission.isCreateChildResources();
- if (enabled) {
+ boolean createChildResourcesEnabled = resourcePermission.isCreateChildResources();
+ if (createChildResourcesEnabled) {
Menu createChildSubMenu = new Menu();
for (final ResourceType childType : resourceType.getChildResourceTypes()) {
if (childType.isCreatable()) {
@@ -475,15 +477,15 @@ public class ResourceTreeView extends LocatableVLayout {
}
}
createChildMenu.setSubmenu(createChildSubMenu);
- enabled = createChildSubMenu.getItems().length > 0;
+ createChildResourcesEnabled = createChildSubMenu.getItems().length > 0;
}
- createChildMenu.setEnabled(enabled);
+ createChildMenu.setEnabled(createChildResourcesEnabled);
resourceContextMenu.addItem(createChildMenu);
// Manual Import Menu
MenuItem importChildMenu = new MenuItem(MSG.common_button_import());
- enabled = resourcePermission.isCreateChildResources();
- if (enabled) {
+ boolean manualImportEnabled = resourcePermission.isCreateChildResources();
+ if (manualImportEnabled) {
Menu importChildSubMenu = new Menu();
for (final ResourceType childType : resourceType.getChildResourceTypes()) {
if (childType.isSupportsManualAdd()) {
@@ -505,9 +507,9 @@ public class ResourceTreeView extends LocatableVLayout {
}
importChildMenu.setSubmenu(importChildSubMenu);
- enabled = importChildSubMenu.getItems().length > 0;
+ manualImportEnabled = importChildSubMenu.getItems().length > 0;
}
- importChildMenu.setEnabled(enabled);
+ importChildMenu.setEnabled(manualImportEnabled);
resourceContextMenu.addItem(importChildMenu);
}
@@ -808,7 +810,7 @@ public class ResourceTreeView extends LocatableVLayout {
*/
public void renderView(ViewPath viewPath) {
- currentViewId = viewPath.getCurrent();
+ ViewId currentViewId = viewPath.getCurrent();
String currentViewIdPath = currentViewId.getPath();
if ("AutoGroup".equals(currentViewIdPath)) {
// Move the currentViewId to the ID portion to play better with other code
commit 8067be4a926ae924669cad9a7619882ac5d35c3d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 20 17:51:37 2011 -0400
[BZ 697581 - Discovery Queue view is missing a Refresh button]
Added refresh button
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
index 31732c1..a1d1403 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
@@ -43,6 +43,7 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeGridField;
@@ -181,6 +182,16 @@ public class ResourceAutodiscoveryView extends LocatableVLayout {
});
footer.addMember(form);
+ footer.addMember(new LayoutSpacer());
+
+ IButton refreshButton = new LocatableIButton(extendLocatorId("Refresh"), MSG.common_button_refresh());
+ refreshButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ refresh();
+ }
+ });
+ footer.addMember(refreshButton);
+
treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
// use this to ignore selection changes we initiate from within this handler
private boolean selectionChangedHandlerDisabled = false;
commit 408e97fa9a72e770ef7f16c94e28b6c9bca52fc5
Merge: 9b4df95 97c1b8b
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Apr 20 14:48:28 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 9b4df95b0d1ea8e8f5cd05f5a9dba51ffbc0d2d1
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Apr 20 14:47:37 2011 -0400
Further parameterizeing dbreset script
Parameterizing the script to make it usable with databases running on machines
other than localhost.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 270adec..50ad317 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -102,30 +102,37 @@
db = project.properties.db
if (db == 'dev') {
database = project.properties['rhq.dev.ds.db-name']
- }
+ server = project.properties['rhq.dev.ds.server-name'] ?: '127.0.0.1'
+ rhqUser = project.properties['rhq.dev.ds.user-name'] ?: 'rhqadmin'
+ }
// This is a bit of a temporary hack to work around
// https://cvs.codehaus.org/browse/GMAVEN-46 which results in
// groovy scripts not being able to get the correct values of
// build properties that are overridden on the command line.
// This is being done in support of the hudson job which is
// trying to use a database named rhqupgrade.
- else if (project.properties['upgrade.db']) {
- database = 'rhqupgrade'
- }
- else {
+ else if (project.properties['upgrade.db']) {
+ database = 'rhqupgrade'
+ }
+ else {
database = project.properties['rhq.test.ds.db-name']
+ server = project.properties['rhq.test.ds.server-name'] ?: '127.0.0.1'
+ rhqUser = project.properties['rhq.test.ds.user-name'] ?: 'rhqadmin'
}
+
+ adminUsername = project.properties['rhq.db.admin.username'] ?: 'postgres'
+ adminPassword = project.properties['rhq.db.admin.password'] ?: 'postgres'
project.properties.dbsetup = 'true'
sql = Sql.newInstance(
- "jdbc:postgresql://127.0.0.1:5432/postgres",
- "postgres",
- "postgres",
+ "jdbc:postgresql://${server}:5432/postgres",
+ adminUsername,
+ adminPassword,
"org.postgresql.Driver")
sql.execute("drop database if exists ${Sql.expand(database)};")
log.info("dropped database $database")
- sql.execute("create database ${Sql.expand(database)} with owner rhqadmin;")
+ sql.execute("create database ${Sql.expand(database)} with owner ${Sql.expand(rhqUser)};")
log.info("created database $database")
</source>
</configuration>
commit 97c1b8bd0b21c209b3acccc5f9dcfc78b168a006
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 20 12:43:48 2011 -0400
[BZ 697699 - Firefox pegs CPU at 100% for > 20 seconds]
This looks to be attributed to improper overrides of redraw() in the portlet
refresh mechanism. Avoid using redraw() overrides to a customizable
refresh() method implemented by all refreshable portlets (which, for Table
derived portlets gains a default impl in the Table class).
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortlet.java
index 897c1b4..e577230 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortlet.java
@@ -22,6 +22,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
+
/**
* @author Simeon Pinder
*/
@@ -38,4 +39,10 @@ public interface AutoRefreshPortlet extends Portlet {
* to ignore refresh requests until a prior request is completed.
*/
boolean isRefreshing();
+
+ /**
+ * Refresh this portlet, reload data, redraw widgets, whatever is needed to refresh the portlet
+ */
+ void refresh();
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortletUtil.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortletUtil.java
index 4977de6..00e51ac 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortletUtil.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/AutoRefreshPortletUtil.java
@@ -30,8 +30,8 @@ import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
*/
public class AutoRefreshPortletUtil {
- public static Timer startRefreshCycle(final AutoRefreshPortlet portlet, final Canvas autoRefreshPortletCanvas,
- Timer refreshTimer) {
+ public static Timer startRefreshCycle(final AutoRefreshPortlet autoRefreshPortlet,
+ final Canvas autoRefreshPortletCanvas, Timer refreshTimer) {
final int refreshInterval = UserSessionManager.getUserPreferences().getPageRefreshInterval();
@@ -48,8 +48,8 @@ public class AutoRefreshPortletUtil {
// if the portlet is already refreshing or if the portlet is not currently on screen then
// don't bother doing the work. this protects against unnecessary or unwanted db queries
// being performed in the background.
- if (!portlet.isRefreshing() && autoRefreshPortletCanvas.isVisible()) {
- autoRefreshPortletCanvas.redraw();
+ if (!autoRefreshPortlet.isRefreshing() && autoRefreshPortletCanvas.isVisible()) {
+ autoRefreshPortlet.refresh();
}
}
};
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
index 0f166ed..f54ea54 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
@@ -278,8 +278,7 @@ public class GroupBundleDeploymentsPortlet extends LocatableVLayout implements C
}
@Override
- public void redraw() {
- super.redraw();
+ public void refresh() {
if (!isRefreshing()) {
loadData();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 7a21081..c36b320 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -49,9 +49,9 @@ import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
@@ -262,31 +262,12 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
@Override
public void startRefreshCycle() {
- //current setting
- final int refreshInterval = UserSessionManager.getUserPreferences().getPageRefreshInterval();
-
- //cancel any existing timer
- if (refreshTimer != null) {
- refreshTimer.cancel();
- }
-
- if (refreshInterval >= MeasurementUtility.MINUTES) {
-
- refreshTimer = new Timer() {
- public void run() {
- redraw();
- }
- };
-
- refreshTimer.scheduleRepeating(refreshInterval);
- }
+ refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
}
@Override
protected void onDestroy() {
- if (refreshTimer != null) {
- refreshTimer.cancel();
- }
+ AutoRefreshPortletUtil.onDestroy(this, refreshTimer);
super.onDestroy();
}
@@ -309,8 +290,7 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
}
@Override
- public void redraw() {
- super.redraw();
+ public void refresh() {
if (!isRefreshing()) {
loadData();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
index 0192b9f..0624311 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
@@ -295,7 +295,6 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
public void startRefreshCycle() {
refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
- markForRedraw();
}
@Override
@@ -311,9 +310,10 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
}
@Override
- public void redraw() {
- super.redraw();
- loadData();
+ public void refresh() {
+ if (!isRefreshing()) {
+ loadData();
+ }
}
protected void setCurrentlyRefreshing(boolean currentlyRefreshing) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 2602e6b..7ebddfe 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -461,6 +461,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
@Override
public void startRefreshCycle() {
refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
+
//call out to 3rd party javascript lib
BrowserUtility.graphSparkLines();
recentMeasurementsContent.markForRedraw();
@@ -479,8 +480,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
}
@Override
- public void redraw() {
- super.redraw();
+ public void refresh() {
if (!isRefreshing()) {
loadData();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index d19a301..0428f93 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -262,9 +262,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
}
@Override
- public void redraw() {
- super.redraw();
- //spinder 4/3/11: although screen does not flash autorefresh is being called on time. Too fast for user to notice.
+ public void refresh() {
if (!isRefreshing()) {
loadData();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 211f459..196b55d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -314,6 +314,15 @@ public class GroupOperationsPortlet extends LocatableVLayout implements CustomSe
return currentlyRefreshing;
}
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ if (groupOperations != null) {
+ groupOperations.refresh();
+ }
+ }
+ }
+
private boolean isAutoGroup() {
return ResourceGroupDetailView.AUTO_GROUP_VIEW.equals(getBaseViewPath());
}
@@ -326,16 +335,6 @@ public class GroupOperationsPortlet extends LocatableVLayout implements CustomSe
return baseViewPath;
}
- @Override
- public void redraw() {
- super.redraw();
- if (!isRefreshing()) {
- if (groupOperations != null) {
- groupOperations.refresh();
- }
- }
- }
-
protected void setCurrentlyRefreshing(boolean currentlyRefreshing) {
this.currentlyRefreshing = currentlyRefreshing;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
index 36258fb..83f047b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
@@ -276,11 +276,9 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
}
@Override
- public void redraw() {
- super.redraw();
+ public void refresh() {
if (!isRefreshing()) {
loadData();
}
}
-
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
index 37d57df..e5631ca 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
@@ -211,4 +211,13 @@ public class AutodiscoveryPortlet extends ResourceAutodiscoveryView implements C
return false;
}
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ if (null != dataSource) {
+ dataSource.invalidateCache();
+ }
+ markForRedraw();
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
index 556ee6f..2e01daf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
@@ -142,4 +142,11 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Auto
return false;
}
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ super.refresh();
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 4519b95..b2d1d84 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -262,7 +262,6 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
}
public boolean isRefreshing() {
- // TODO: actually keep track of when the portlet is refreshing data
return false;
}
@@ -274,9 +273,10 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
}
@Override
- public void redraw() {
- super.refresh();
- markForRedraw();
+ public void refresh() {
+ if (!isRefreshing()) {
+ super.refresh();
+ }
}
static public class AlertsPortletDataSource extends AlertDataSource {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
index c4685da..d6b61d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
@@ -237,17 +237,6 @@ public class RecentlyAddedResourcesPortlet extends LocatableVLayout implements C
}
}
- /** Custom refresh operation as we cannot directly extend Table because it
- * contains a TreeGrid which is not a Table.
- */
- @Override
- public void redraw() {
- super.redraw();
- //now reload the table data
- this.treeGrid.invalidateCache();
- this.treeGrid.markForRedraw();
- }
-
public RecentlyAddedResourceDS getDataSource() {
return dataSource;
}
@@ -266,4 +255,18 @@ public class RecentlyAddedResourcesPortlet extends LocatableVLayout implements C
public boolean isRefreshing() {
return false;
}
+
+ // Custom refresh operation as we cannot directly extend Table because it
+ // contains a TreeGrid which is not a Table.
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ if (null != treeGrid) {
+ //now reload the table data
+ treeGrid.invalidateCache();
+ }
+ markForRedraw();
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
index 77b8af8..7535cf7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
@@ -263,23 +263,23 @@ public abstract class AbstractOperationHistoryPortlet extends OperationHistoryVi
}
public boolean isRefreshing() {
- // TODO: actually keep track of when the portlet is refreshing data
return false;
}
@Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ super.refresh();
+ }
+ }
+
+ @Override
protected void onDestroy() {
AutoRefreshPortletUtil.onDestroy(this, refreshTimer);
super.onDestroy();
}
- @Override
- public void redraw() {
- super.refresh();
- markForRedraw();
- }
-
static public class OperationHistoryPortletDataSource extends OperationHistoryDataSource {
private Configuration configuration;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java
index 252f6d2..3d7521d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java
@@ -308,17 +308,6 @@ public class OperationSchedulePortlet extends LocatableVLayout implements Custom
}
}
- /** Custom refresh operation as we cannot directly extend Table because it only
- * contains one ListGrid while the OperationsPortlet displays two tables.
- */
- @Override
- public void redraw() {
- super.redraw();
- //now reload the table data
- this.scheduledOperationsGrid.invalidateCache();
- this.scheduledOperationsGrid.markForRedraw();
- }
-
public ConfigurationDefinition getConfigurationDefinition() {
ConfigurationDefinition definition = new ConfigurationDefinition(MSG.view_portlet_configure_definitionTitle(),
MSG.view_portlet_configure_definitionDesc());
@@ -353,4 +342,17 @@ public class OperationSchedulePortlet extends LocatableVLayout implements Custom
public boolean isRefreshing() {
return false;
}
+
+ // Custom refresh operation as we cannot directly extend Table because it only
+ // contains one ListGrid while the OperationsPortlet displays two tables.
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ if (null != this.scheduledOperationsGrid) {
+ this.scheduledOperationsGrid.invalidateCache();
+ }
+ markForRedraw();
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
index e739098..f3738d4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
@@ -28,8 +28,6 @@ import java.util.Date;
import java.util.List;
import com.google.gwt.user.client.Timer;
-import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
@@ -354,10 +352,12 @@ public class ProblemResourcesPortlet extends Table<ProblemResourcesDataSource> i
}
@Override
- public void redraw() {
- super.refresh();
- markForRedraw();
+ public void refresh() {
+ if (!isRefreshing()) {
+ super.refresh();
+ }
}
+
}
/**Construct table widget Label to display timerange settings used with latest datasource query.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
index 3466bb6..823c7d8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
@@ -153,24 +153,6 @@ public class InventorySummaryPortlet extends LocatableVLayout implements AutoRef
return new HTMLFlow(MSG.view_portlet_help_inventorySummary());
}
- /** Custom refresh operation as we are not directly extending Table
- */
- @Override
- public void redraw() {
- super.redraw();
-
- //now reload the data
- loadInventoryViewData();
- }
-
- public static final class Factory implements PortletViewFactory {
- public static PortletViewFactory INSTANCE = new Factory();
-
- public final Portlet getInstance(String locatorId) {
- return new InventorySummaryPortlet(locatorId);
- }
- }
-
public void startRefreshCycle() {
refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
}
@@ -185,4 +167,21 @@ public class InventorySummaryPortlet extends LocatableVLayout implements AutoRef
public boolean isRefreshing() {
return false;
}
+
+ //Custom refresh operation as we are not directly extending Table
+ @Override
+ public void refresh() {
+ if (!isRefreshing()) {
+ loadInventoryViewData();
+ }
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ public final Portlet getInstance(String locatorId) {
+ return new InventorySummaryPortlet(locatorId);
+ }
+ }
+
}
commit c8f7388581b8d3c00c17ecf4732f77481c83a86e
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Apr 20 15:01:33 2011 +0200
BZ 694476 - Adding support for the IfVersion directive in detecting the runtime configuration.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 8fa448f..38b79ef 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -25,10 +25,12 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.util.OSGiVersionComparator;
import org.rhq.core.system.ProcessInfo;
import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
@@ -40,6 +42,10 @@ public class RuntimeApacheConfiguration {
private static final Log LOG = LogFactory.getLog(RuntimeApacheConfiguration.class);
+ private enum ModuleLoadedState {
+ LOADED, NOT_LOADED, UNKNOWN
+ }
+
private RuntimeApacheConfiguration() {
}
@@ -101,12 +107,12 @@ public class RuntimeApacheConfiguration {
moduleFiles.put(e.getValue(), e.getKey());
}
- transform(ret.getRootNode(), loadedModules, defines, moduleNames, moduleFiles);
+ transform(ret.getRootNode(), loadedModules, defines, moduleNames, moduleFiles, httpdBinaryInfo.getVersion());
return ret;
}
- private static void transform(ApacheDirective parentNode, Set<String> currentlyLoadedModules, List<String> defines, Map<String, String> moduleNames, Map<String, String> moduleFiles) {
+ private static void transform(ApacheDirective parentNode, Set<String> currentlyLoadedModules, List<String> defines, Map<String, String> moduleNames, Map<String, String> moduleFiles, String httpdVersion) {
if (parentNode.getChildDirectives().isEmpty()) {
return;
}
@@ -125,29 +131,16 @@ public class RuntimeApacheConfiguration {
moduleFile = moduleFile.substring(1);
}
- String moduleName = moduleNames.get(moduleFile);
- if (moduleName == null) {
- //as of apache 2.1 module files and module names can both be used in IfModule
- moduleName = moduleFile;
- moduleFile = moduleFiles.get(moduleName);
-
- if (moduleFile == null) {
- //reverse lookup failed - there is no such module in the mappings
- //the last attempt is to see if the modulename wasn't used one of the previous
- //load module directives
- if (!currentlyLoadedModules.contains(moduleName)) {
- LOG.warn("Encountered unknown module name in an IfModule directive: " + moduleFile);
- continue;
- }
- }
+ boolean result = false;
+
+ switch(isModuleLoaded(moduleFile, currentlyLoadedModules, moduleNames, moduleFiles)) {
+ case LOADED : result = true; break;
+ case NOT_LOADED : result = false; break;
+ case UNKNOWN :
+ LOG.warn("Encountered unknown module name in an IfModule directive: " + moduleFile);
+ continue;
}
-
- //the compiled in modules are being reported by apache using their source file
- //and the on-demand loaded modules are identified by their
- //module name - consistent, huh?
- boolean result = currentlyLoadedModules.contains(moduleFile)
- || currentlyLoadedModules.contains(moduleName);
-
+
if (result != negate) {
nodesToPromote.add(node);
} else {
@@ -168,9 +161,96 @@ public class RuntimeApacheConfiguration {
} else {
nodesToRemove.add(node);
}
+ } else if (node.getName().equalsIgnoreCase("<IfVersion")) {
+ //<IfVersion [[!]operator] version> ... </IfVersion>
+ //operator: =, ==, >, >=, <, <=, ~
+ //version major[.minor[.patch]] or /regex/
+ //if operator is ~, the version is assumed regex
+ //if operator is omitted, = is assumed
+
+ if (isModuleLoaded("mod_version.c", currentlyLoadedModules, moduleNames, moduleFiles) != ModuleLoadedState.LOADED) {
+ LOG.debug("mod_version not loaded and IfVersion directive encountered. Skipping it.");
+ continue;
+ }
+
+ List<String> values = node.getValues();
+ String operator = null;
+ String version = null;
+ boolean negate = false;
+ boolean regex = false;
+
+ if (values.size() == 0) {
+ LOG.warn("Invalid IfVersion directive.");
+ continue;
+ }
+
+ if (values.size() == 1) {
+ operator = "=";
+ version = values.get(0);
+ } else if (values.size() == 2) {
+ operator = values.get(0);
+ version = values.get(1);
+ } else {
+ LOG.warn("Too many arguments to a IfVersion directive: " + values);
+ continue;
+ }
+
+ if (operator == null || version == null) {
+ LOG.warn("Invalid IfVersion with parameters: " + values);
+ continue;
+ }
+
+ if (operator.charAt(0) == '!') {
+ negate = true;
+ operator = operator.substring(1);
+ }
+
+ if ("==".equals(operator)) {
+ operator = "=";
+ }
+
+ if (version.charAt(0) == '/') {
+ if ("=".equals(operator) || "~".equals(operator)) {
+ regex = true;
+ version = version.substring(1, version.length() - 1);
+ } else {
+ LOG.warn("Unsupported operator " + operator + " with regex version comparison in IfVersion directive.");
+ continue;
+ }
+ }
+
+ OSGiVersionComparator comp = new OSGiVersionComparator();
+
+ boolean result = false;
+ if ("=".equals(operator)) {
+ if (regex) {
+ result = Pattern.matches(version, httpdVersion);
+ } else {
+ result = comp.compare(version, httpdVersion) == 0;
+ }
+ } else if ("~".equals(operator)) {
+ result = Pattern.matches(version, httpdVersion);
+ } else if (">".equals(operator)) {
+ result = comp.compare(httpdVersion, version) > 0;
+ } else if (">=".equals(operator)) {
+ result = comp.compare(httpdVersion, version) >= 0;
+ } else if ("<".equals(operator)) {
+ result = comp.compare(httpdVersion, version) < 0;
+ } else if ("<=".equals(operator)) {
+ result = comp.compare(httpdVersion, version) <= 0;
+ } else {
+ LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
+ continue;
+ }
+
+ if (negate != result) {
+ nodesToPromote.add(node);
+ } else {
+ nodesToRemove.add(node);
+ }
}
- transform(node, currentlyLoadedModules, defines, moduleNames, moduleFiles);
+ transform(node, currentlyLoadedModules, defines, moduleNames, moduleFiles, httpdVersion);
}
for(ApacheDirective node : nodesToRemove) {
@@ -193,4 +273,30 @@ public class RuntimeApacheConfiguration {
parentNode.getChildDirectives().remove(nodeIdx + childNodes.size());
}
}
+
+ private static ModuleLoadedState isModuleLoaded(String moduleIdentifier, Set<String> currentlyLoadedModules, Map<String, String> moduleNames, Map<String, String> moduleFiles) {
+ String moduleName = moduleNames.get(moduleIdentifier);
+ if (moduleName == null) {
+ //as of apache 2.1 module files and module names can both be used in IfModule
+ moduleName = moduleIdentifier;
+ moduleIdentifier = moduleFiles.get(moduleName);
+
+ if (moduleIdentifier == null) {
+ //reverse lookup failed - there is no such module in the mappings
+ //the last attempt is to see if the modulename wasn't used one of the previous
+ //load module directives
+ if (!currentlyLoadedModules.contains(moduleName)) {
+ return ModuleLoadedState.UNKNOWN;
+ }
+ }
+ }
+
+ //the compiled in modules are being reported by apache using their source file
+ //and the on-demand loaded modules are identified by their
+ //module name - consistent, huh?
+ boolean result = currentlyLoadedModules.contains(moduleIdentifier)
+ || currentlyLoadedModules.contains(moduleName);
+
+ return result ? ModuleLoadedState.LOADED : ModuleLoadedState.NOT_LOADED;
+ }
}
commit 3fb0fa858e94f3443afe021d55b5e47a334230bc
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 20 08:36:39 2011 -0400
BZ 698137 - correct some places I missed during last refactor of some legacy code
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
index c4e99cf..379c720 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
@@ -52,19 +52,19 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
classname="org.rhq.enterprise.server.legacy.measurement.MeasurementConstants"
symbol="CAT_UTILIZATION" var="utilization" />
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MAX_KEY"
var="max"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MIN_KEY"
var="min"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="AVERAGE_KEY"
var="average"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="LAST_KEY"
var="last"/>
<!-- COMPARE METRICS TITLE Need to bring this back once we get the groupname in the params-->
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/DashCharts.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/DashCharts.jsp
index d4174d6..9760f0a 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/DashCharts.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/DashCharts.jsp
@@ -11,11 +11,11 @@
<c:set var="parent" value="${param.parent}"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="HIGH_RANGE_KEY"
var="high"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="LOW_RANGE_KEY"
var="low"/>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricsDisplayRows.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricsDisplayRows.jsp
index 187073e..28dc824 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricsDisplayRows.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/MetricsDisplayRows.jsp
@@ -29,31 +29,31 @@
var="MODE_MON_CHART_MMSR"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MAX_KEY"
var="max"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MIN_KEY"
var="min"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="AVERAGE_KEY"
var="average"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="LAST_KEY"
var="last"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="BASELINE_KEY"
var="baseline"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="HIGH_RANGE_KEY"
var="high"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="LOW_RANGE_KEY"
var="low"/>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
index e5e72a1..67bf63c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/ParticipatingResources.jsp
@@ -8,19 +8,19 @@
<tiles:importAttribute name="multiResource" ignore="true"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MAX_KEY"
var="max"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="MIN_KEY"
var="min"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="AVERAGE_KEY"
var="average"/>
<hq:constant
- classname="org.rhq.enterprise.server.measurement.uibean.MetricDisplayConstants"
+ classname="org.rhq.core.domain.measurement.ui.MetricDisplayConstants"
symbol="LAST_KEY"
var="last"/>
commit 8889b7e262efba9537bc1df237e8d1aef812e85f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 20 09:54:21 2011 +0200
Put resource context into a local variable for later use.
diff --git a/modules/helpers/pluginGen/src/main/resources/component.ftl b/modules/helpers/pluginGen/src/main/resources/component.ftl
index 56effd8..1b3dda1 100644
--- a/modules/helpers/pluginGen/src/main/resources/component.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/component.ftl
@@ -98,6 +98,8 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
private static final int CHANGEME = 1; // TODO remove or change this
+ private ResourceContext<#if props.parentType??><${props.parentType}></#if> context;
+
<#if props.events>
public static final String DUMMY_EVENT = "${props.name}DummyEvent"; // Same as in Plugin-Descriptor
@@ -139,6 +141,7 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
*/
public void start(ResourceContext<#if props.parentType??><${props.parentType}></#if> context) throws InvalidPluginConfigurationException, Exception {
+ this.context = context;
Configuration conf = context.getPluginConfiguration();
// TODO add code to start the resource / connection to it
commit 0559cb7526a5804a39c9883f750dc217d3d096ca
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 20 08:58:28 2011 +0200
Add generating of <metric> elements.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java
new file mode 100644
index 0000000..599f61c
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java
@@ -0,0 +1,247 @@
+/*
+ * 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.modules.plugins.jbossas7;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
+
+/**
+ * Generate properties from a domain dump
+ * @author Heiko W. Rupp
+ */
+public class Domain2Descriptor {
+
+ public static void main(String[] args) throws Exception {
+
+ if (args.length<1) {
+ usage();
+ System.exit(1);
+ }
+
+ Domain2Descriptor d2d = new Domain2Descriptor();
+ d2d.run(args);
+
+
+ }
+
+ private void run(String[] args) {
+
+ boolean doMetrcis = false;
+ int pos = 0;
+ if (args[0].startsWith("-")) {
+ if (args[0].equals("-m"))
+ doMetrcis = true;
+ else if (args[0].equals("-p"))
+ doMetrcis = false;
+ else {
+ usage();
+ return;
+ }
+ pos++;
+ }
+
+ String path = args[pos];
+ String childType = null;
+ if (args.length>pos+1)
+ childType = args[pos+1];
+
+ ASConnection conn = new ASConnection("localhost",9990);
+
+ List<PROPERTY_VALUE> address = pathToAddress(path);
+ Operation op = new Operation("read-resource-description",address); // ,"operations",true);
+ op.addAdditionalProperty("recursive","true");
+ if (doMetrcis)
+ op.addAdditionalProperty("include-runtime",true);
+ ComplexResult res = (ComplexResult) conn.execute(op,true);
+ if (!res.isSuccess()) {
+ System.err.println("Failure: " + res.getFailureDescription());
+ return;
+ }
+
+ Map<String,Object> attributesMap;
+
+ Map<String,Object> resMap = res.getResult();
+ if (childType!=null) {
+ Map childMap = (Map) resMap.get("children");
+ Map <String,Object> typeMap = (Map<String, Object>) childMap.get(childType);
+ Map descriptionMap = (Map) typeMap.get("model-description");
+ Map starMap = (Map) descriptionMap.get("*");
+ attributesMap = (Map<String, Object>) starMap.get("attributes");
+ }
+ else {
+ attributesMap = (Map<String, Object>) resMap.get("attributes");
+ }
+
+
+
+ for (Map.Entry<String,Object> entry : attributesMap.entrySet()) {
+
+ Map<String,Object> props = (Map<String, Object>) entry.getValue();
+
+
+ Type ptype = getTypeFromProps(props);
+ String typeString;
+
+ switch (ptype) {
+ case INT:
+ typeString = "integer"; break;
+ case STRING:
+ typeString = "string"; break;
+ case BOOLEAN:
+ typeString = "boolean"; break;
+ case LONG:
+ typeString = "long"; break;
+ case BIG_DECIMAL:
+ typeString = "long"; break; // TODO better float or double?
+ case LIST:
+ typeString = "-list-";
+ break; // Handled below
+ default:
+ typeString = "- unknown -";
+ System.err.println("Unknown type " + ptype + " for " + entry.getKey());
+ }
+
+ if (ptype==Type.LIST && !doMetrcis) {
+
+ System.out.println("<c:list-property name=\"" + entry.getKey() +"\" >");
+ System.out.println(" <c:simple-property name=\"" + entry.getKey() + "\" />");
+ System.out.println("</c:list-property>");
+
+
+
+ continue;
+ }
+
+ if (doMetrcis) {
+ if (!props.get("access-type").equals("metric"))
+ continue;
+
+ StringBuilder sb = new StringBuilder("<metric property=\"");
+ sb.append(entry.getKey()).append('"');
+ sb.append(" type=\"").append(typeString).append("\"");
+ if (ptype==Type.STRING)
+ sb.append(" dataType=\"trait\"");
+
+ String description = (String) props.get("description");
+ if (description!=null) {
+ if (sb.length()+description.length() > 120)
+ sb.append("\n ");
+ sb.append(" description=\"").append(description).append('"');
+ }
+ sb.append("/>");
+ System.out.println(sb.toString());
+
+ }
+ else {
+
+ StringBuilder sb = new StringBuilder("<c:simple-property name=\"");
+ sb.append(entry.getKey()).append('"');
+
+ Object required = props.get("required");
+ if (required != null && (Boolean) required) {
+ sb.append(" required=\"true\"");
+ }
+
+ sb.append(" type=\"").append(typeString).append("\"");
+ sb.append(" readOnly=\"");
+ if (props.get("access-type").equals("read-only"))
+ sb.append("true");
+ else
+ sb.append("false");
+ sb.append('"');
+
+ String description = (String) props.get("description");
+ if (description!=null) {
+ if (sb.length()+description.length() > 120)
+ sb.append("\n ");
+ sb.append(" description=\"").append(description).append('"');
+ }
+ sb.append("/>");
+
+ System.out.println(sb.toString());
+ }
+ }
+
+
+ }
+
+ private Type getTypeFromProps(Map<String, Object> props) {
+ Map<String,String> tMap = (Map<String, String>) props.get("type");
+ String type = tMap.get("TYPE_MODEL_VALUE");
+ Type ret = Type.valueOf(type);
+
+ return ret;
+ }
+
+ /**
+ * Convert a path in the form key=value,key=value... to a List of properties.
+ * @param path Path to translate
+ * @return List of properties
+ */
+ public List<PROPERTY_VALUE> pathToAddress(String path) {
+ if (path==null || path.isEmpty())
+ return Collections.emptyList();
+
+ List<PROPERTY_VALUE> result = new ArrayList<PROPERTY_VALUE>();
+ String[] components = path.split(",");
+ for (String component : components) {
+ String tmp = component.trim();
+
+ if (tmp.contains("=")) {
+ // strip / from the start of the key if it happens to be there
+ if (tmp.startsWith("/"))
+ tmp = tmp.substring(1);
+
+ String[] pair = tmp.split("=");
+ PROPERTY_VALUE valuePair = new PROPERTY_VALUE(pair[0], pair[1]);
+ result.add(valuePair);
+ }
+ }
+
+ return result;
+ }
+
+
+
+ private static void usage() {
+ System.out.println("Domain2Properties [-p|-m] path type");
+ System.out.println(" path is of kind 'key=value[,key=value]+");
+ System.out.println(" -p create properties (default)");
+ System.out.println(" -m create metrics");
+ }
+
+ public enum Type {
+ STRING,
+ INT,
+ BOOLEAN,
+ LONG,
+ BIG_DECIMAL,
+ OBJECT,
+ LIST
+
+ ;
+ }
+
+}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java
deleted file mode 100644
index 0b8b38e..0000000
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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.modules.plugins.jbossas7;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import com.apple.java.Usage;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
-import org.rhq.modules.plugins.jbossas7.json.Operation;
-import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
-
-/**
- * Generate properties from a domain dump
- * @author Heiko W. Rupp
- */
-public class Domain2Properties {
-
- public static void main(String[] args) throws Exception {
-
- if (args.length<2) {
- usage();
- System.exit(1);
- }
-
- Domain2Properties dp = new Domain2Properties();
- dp.run(args);
-
-
- }
-
- private void run(String[] args) {
-
- String path = args[0];
- String type = args[1];
-
- ASConnection conn = new ASConnection("localhost",9990);
-
- List<PROPERTY_VALUE> address = pathToAddress(path);
- Operation op = new Operation("read-resource-description",address,"operations",true);
- op.addAdditionalProperty("recursive","true");
- ComplexResult res = (ComplexResult) conn.execute(op,true);
- if (!res.isSuccess()) {
- System.err.println("Failure: " + res.getFailureDescription());
- return;
- }
-
-
- Map<String,Object> resMap = res.getResult();
- Map childMap = (Map) resMap.get("children");
- Map <String,Object> typeMap = (Map<String, Object>) childMap.get(type);
- Map descriptionMap = (Map) typeMap.get("model-description");
- Map starMap = (Map) descriptionMap.get("*");
- Map<String,Object> attributesMap = (Map<String, Object>) starMap.get("attributes");
-
-
-
- for (Map.Entry<String,Object> entry : attributesMap.entrySet()) {
-
- Map<String,Object> props = (Map<String, Object>) entry.getValue();
-
-
- Type ptype = getTypeFromProps(props);
- String typeString;
-
- switch (ptype) {
- case INT:
- typeString = "integer"; break;
- case STRING:
- typeString = "string"; break;
- case BOOLEAN:
- typeString = "boolean"; break;
- case LONG:
- typeString = "long"; break;
- case BIG_DECIMAL:
- typeString = "long"; break; // TODO bettter float or double?
- case LIST:
- typeString = "-list-";
- break; // Handled below
- default:
- typeString = "- unknown -";
- System.err.println("Unknown type " + ptype + " for " + entry.getKey());
- }
-
- if (ptype==Type.LIST) {
-
- System.out.println("<c:list-property name=\"" + entry.getKey() +"\" >");
- System.out.println(" <c:simple-property name=\"" + entry.getKey() + "\" />");
- System.out.println("</c:list-property>");
-
-
-
- continue;
- }
-
- StringBuilder sb = new StringBuilder("<c:simple-property name=\"");
- sb.append(entry.getKey()).append('"');
-
- if ((Boolean) props.get("required")) {
- sb.append(" required=\"true\"");
- }
-
- sb.append(" type=\"").append(typeString).append("\"");
- sb.append(" readOnly=\"");
- if (props.get("access-type").equals("read-only"))
- sb.append("true");
- else
- sb.append("false");
- sb.append('"');
-
- String description = (String) props.get("description");
- if (sb.length()+description.length() > 120)
- sb.append("\n ");
- sb.append(" description=\"").append(description).append('"');
- sb.append("/>");
-
- System.out.println(sb.toString());
- }
-
-
- }
-
- private Type getTypeFromProps(Map<String, Object> props) {
- Map<String,String> tMap = (Map<String, String>) props.get("type");
- String type = tMap.get("TYPE_MODEL_VALUE");
- Type ret = Type.valueOf(type);
-
- return ret;
- }
-
- /**
- * Convert a path in the form key=value,key=value... to a List of properties.
- * @param path Path to translate
- * @return List of properties
- */
- public List<PROPERTY_VALUE> pathToAddress(String path) {
- if (path==null || path.isEmpty())
- return Collections.emptyList();
-
- List<PROPERTY_VALUE> result = new ArrayList<PROPERTY_VALUE>();
- String[] components = path.split(",");
- for (String component : components) {
- String tmp = component.trim();
-
- if (tmp.contains("=")) {
- // strip / from the start of the key if it happens to be there
- if (tmp.startsWith("/"))
- tmp = tmp.substring(1);
-
- String[] pair = tmp.split("=");
- PROPERTY_VALUE valuePair = new PROPERTY_VALUE(pair[0], pair[1]);
- result.add(valuePair);
- }
- }
-
- return result;
- }
-
-
-
- private static void usage() {
- System.out.println("Domain2Properties path type");
- System.out.println(" path is of kind 'key=value[,key=value]+");
- }
-
- public enum Type {
- STRING,
- INT,
- BOOLEAN,
- LONG,
- BIG_DECIMAL,
- OBJECT,
- LIST
-
- ;
- }
-
-}
commit 0a7854c893ac1a949fa72c64382df19e6a42e034
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 19 17:04:09 2011 -0400
[BZ 697665 - need to disambiguate Reports>SuspectMetrics table]
This required some additions to the underlying MeasurementOOBComposite.
- Added the necessary composite fields.
- Updated view to use ListGridFields for more control
note - it no longer seems necessary to define any datasource fields
- Change column order slightly and defined widths
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementOOB.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementOOB.java
index 192b854..2aa212a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementOOB.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementOOB.java
@@ -30,28 +30,29 @@ import javax.persistence.Table;
*
* @author Heiko W. Rupp
*/
-@NamedQueries( { @NamedQuery(name = MeasurementOOB.GET_SCHEDULES_WITH_OOB_AGGREGATE, query = "" //
- + " SELECT new org.rhq.core.domain.measurement.composite.MeasurementOOBComposite" //
- + " ( res.name, res.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
- + " bal.baselineMin, bal.baselineMax, def.units, parent.name, parent.id) " //
- + " FROM MeasurementOOB o, MeasurementSchedule sched " //
- + "LEFT JOIN sched.definition def " //
- + "LEFT JOIN sched.resource res " //
- + "LEFT JOIN sched.baseline bal " //
- + "LEFT JOIN res.parentResource parent " //
- + " WHERE o.id = sched.id " //
- + " AND sched.definition = def " //
- + " AND sched.resource = res " //
- + " AND bal.schedule = sched " //
- + " AND res.id IN ( SELECT rr.id FROM Resource rr " //
- + " JOIN rr.implicitGroups g JOIN g.roles r JOIN r.subjects s " //
- + " WHERE s.id = :subjectId ) " //
- + " AND (UPPER(def.displayName ) LIKE :metricName ESCAPE :escapeChar OR :metricName is null ) " //
- + " AND (UPPER(res.name) LIKE :resourceName ESCAPE :escapeChar OR :resourceName is null ) " //
- + " AND (UPPER(parent.name) LIKE :parentName ESCAPE :escapeChar OR :parentName is null ) "), //
+@NamedQueries( {
+ @NamedQuery(name = MeasurementOOB.GET_SCHEDULES_WITH_OOB_AGGREGATE, query = "" //
+ + " SELECT new org.rhq.core.domain.measurement.composite.MeasurementOOBComposite" //
+ + " ( res.name, res.id, res.ancestry, res.resourceType.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ + " bal.baselineMin, bal.baselineMax, def.units, parent.name, parent.id) " //
+ + " FROM MeasurementOOB o, MeasurementSchedule sched " //
+ + "LEFT JOIN sched.definition def " //
+ + "LEFT JOIN sched.resource res " //
+ + "LEFT JOIN sched.baseline bal " //
+ + "LEFT JOIN res.parentResource parent " //
+ + " WHERE o.id = sched.id " //
+ + " AND sched.definition = def " //
+ + " AND sched.resource = res " //
+ + " AND bal.schedule = sched " //
+ + " AND res.id IN ( SELECT rr.id FROM Resource rr " //
+ + " JOIN rr.implicitGroups g JOIN g.roles r JOIN r.subjects s " //
+ + " WHERE s.id = :subjectId ) " //
+ + " AND (UPPER(def.displayName ) LIKE :metricName ESCAPE :escapeChar OR :metricName is null ) " //
+ + " AND (UPPER(res.name) LIKE :resourceName ESCAPE :escapeChar OR :resourceName is null ) " //
+ + " AND (UPPER(parent.name) LIKE :parentName ESCAPE :escapeChar OR :parentName is null ) "), //
@NamedQuery(name = MeasurementOOB.GET_SCHEDULES_WITH_OOB_AGGREGATE_ADMIN, query = "" //
+ " SELECT new org.rhq.core.domain.measurement.composite.MeasurementOOBComposite" //
- + " ( res.name, res.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ + " ( res.name, res.id, res.ancestry, res.resourceType.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ " bal.baselineMin, bal.baselineMax, def.units, parent.name, parent.id) " //
+ " FROM MeasurementOOB o, MeasurementSchedule sched " //
+ "LEFT JOIN sched.definition def " //
@@ -104,7 +105,7 @@ import javax.persistence.Table;
+ " WHERE ms.resource.id IN ( :resourceIds ) )"), //
@NamedQuery(name = MeasurementOOB.GET_HIGHEST_FACTORS_FOR_RESOURCE, query = "" //
+ " SELECT new org.rhq.core.domain.measurement.composite.MeasurementOOBComposite" //
- + " ( res.name, res.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ + " ( res.name, res.id, res.ancestry, res.resourceType.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ " bal.baselineMin , bal.baselineMax, def.units ) " //
+ " FROM MeasurementOOB o, MeasurementSchedule sched " //
+ "LEFT JOIN sched.definition def " //
@@ -117,7 +118,7 @@ import javax.persistence.Table;
+ " AND :resourceId = res.id "), //
@NamedQuery(name = MeasurementOOB.GET_HIGHEST_FACTORS_FOR_GROUP, query = "" //
+ " SELECT new org.rhq.core.domain.measurement.composite.MeasurementOOBComposite" //
- + " ( res.name, res.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ + " ( res.name, res.id, res.ancestry, res.resourceType.id, def.displayName, sched.id, o.timestamp, def.id, o.oobFactor, " //
+ " bal.baselineMin , bal.baselineMax, def.units ) " //
+ " FROM MeasurementOOB o, MeasurementSchedule sched " //
+ "LEFT JOIN sched.definition def " //
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java
index d7cdcef..d37e8d5 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java
@@ -32,8 +32,10 @@ public class MeasurementOOBComposite implements Serializable {
private static final long serialVersionUID = 1L;
- private String resourceName;
private int resourceId;
+ private String resourceName;
+ private String resourceAncestry;
+ private int resourceTypeId;
private String scheduleName;
private int scheduleId;
private long timestamp;
@@ -53,11 +55,13 @@ public class MeasurementOOBComposite implements Serializable {
public MeasurementOOBComposite() {
}
- public MeasurementOOBComposite(String resourceName, int resourceId, String scheduleName, int scheduleId,
- long timestamp, int definitionId, int factor, double blMin, double blMax, MeasurementUnits units,
- String parentName, Integer parentId) {
+ public MeasurementOOBComposite(String resourceName, int resourceId, String resourceAncestry, int resourceTypeId,
+ String scheduleName, int scheduleId, long timestamp, int definitionId, int factor, double blMin, double blMax,
+ MeasurementUnits units, String parentName, Integer parentId) {
this.resourceName = resourceName;
this.resourceId = resourceId;
+ this.resourceAncestry = resourceAncestry;
+ this.resourceTypeId = resourceTypeId;
this.scheduleName = scheduleName;
this.scheduleId = scheduleId;
this.definitionId = definitionId;
@@ -70,10 +74,13 @@ public class MeasurementOOBComposite implements Serializable {
this.parentName = parentName;
}
- public MeasurementOOBComposite(String resourceName, int resourceId, String scheduleName, int scheduleId,
- long timestamp, int definitionId, int factor, double blMin, double blMax, MeasurementUnits unit) {
+ public MeasurementOOBComposite(String resourceName, int resourceId, String resourceAncestry, int resourceTypeId,
+ String scheduleName, int scheduleId, long timestamp, int definitionId, int factor, double blMin, double blMax,
+ MeasurementUnits unit) {
this.resourceName = resourceName;
this.resourceId = resourceId;
+ this.resourceAncestry = resourceAncestry;
+ this.resourceTypeId = resourceTypeId;
this.scheduleName = scheduleName;
this.scheduleId = scheduleId;
this.definitionId = definitionId;
@@ -92,6 +99,14 @@ public class MeasurementOOBComposite implements Serializable {
return resourceId;
}
+ public String getResourceAncestry() {
+ return resourceAncestry;
+ }
+
+ public int getResourceTypeId() {
+ return resourceTypeId;
+ }
+
public String getScheduleName() {
return scheduleName;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
index 9fb110c..49c05cf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
@@ -22,26 +22,38 @@
*/
package org.rhq.enterprise.gui.coregui.client.report.measurement;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.criteria.Criteria;
import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository.TypesLoadedCallback;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* @author Greg Hinkle
@@ -55,36 +67,57 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
addFields(fields);
}
- @Override
- protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
+
+ ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
+ resourceNameField.setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
+ return SeleniumUtility.getLocatableHref(url, o.toString(), null);
+ }
+ });
+ resourceNameField.setShowHover(true);
+ resourceNameField.setHoverCustomizer(new HoverCustomizer() {
- DataSourceTextField metricField = new DataSourceTextField("scheduleName", MSG
- .dataSource_measurementOob_field_scheduleName());
- fields.add(metricField);
+ public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
+ return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
+ }
+ });
+ fields.add(resourceNameField);
- DataSourceTextField resourceField = new DataSourceTextField("resourceName", MSG
- .dataSource_measurementOob_field_resourceName());
- fields.add(resourceField);
+ ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
+ fields.add(ancestryField);
- DataSourceTextField parentField = new DataSourceTextField("parentName", MSG
- .dataSource_measurementOob_field_parentName());
- fields.add(parentField);
+ ListGridField scheduleNameField = new ListGridField("scheduleName", MSG
+ .dataSource_measurementOob_field_scheduleName());
+ fields.add(scheduleNameField);
- DataSourceTextField bandField = new DataSourceTextField("formattedBaseband", MSG
+ ListGridField bandField = new ListGridField("formattedBaseband", MSG
.dataSource_measurementOob_field_formattedBaseband());
fields.add(bandField);
- DataSourceTextField outlierField = new DataSourceTextField("formattedOutlier", MSG
+ ListGridField outlierField = new ListGridField("formattedOutlier", MSG
.dataSource_measurementOob_field_formattedOutlier());
fields.add(outlierField);
- DataSourceTextField factorField = new DataSourceTextField("factor", MSG
- .dataSource_measurementOob_field_factor());
+ ListGridField factorField = new ListGridField("factor", MSG.dataSource_measurementOob_field_factor());
fields.add(factorField);
- return fields;
+ resourceNameField.setWidth("20%");
+ ancestryField.setWidth("30%");
+ scheduleNameField.setWidth("20%");
+ bandField.setWidth("10%");
+ outlierField.setWidth("10%");
+ factorField.setWidth("10%");
+ return fields;
}
@Override
@@ -98,10 +131,41 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
CoreGUI.getErrorHandler().handleError(MSG.dataSource_measurementOob_error_fetchFailure(), caught);
}
- public void onSuccess(PageList<MeasurementOOBComposite> result) {
- response.setData(buildRecords(result));
- response.setTotalRows(result.getTotalSize());
- processResponse(request.getRequestId(), response);
+ public void onSuccess(final PageList<MeasurementOOBComposite> result) {
+ Set<Integer> typesSet = new HashSet<Integer>();
+ Set<String> ancestries = new HashSet<String>();
+ for (MeasurementOOBComposite composite : result) {
+ typesSet.add(composite.getResourceTypeId());
+ ancestries.add(composite.getResourceAncestry());
+ }
+
+ // In addition to the types of the result resources, get the types of their ancestry
+ typesSet.addAll(AncestryUtil.getAncestryTypeIds(ancestries));
+
+ ResourceTypeRepository typeRepo = ResourceTypeRepository.Cache.getInstance();
+ typeRepo.getResourceTypes(typesSet.toArray(new Integer[typesSet.size()]),
+ new TypesLoadedCallback() {
+ @Override
+ public void onTypesLoaded(Map<Integer, ResourceType> types) {
+ // Smartgwt has issues storing a Map as a ListGridRecord attribute. Wrap it in a pojo.
+ AncestryUtil.MapWrapper typesWrapper = new AncestryUtil.MapWrapper(types);
+
+ Record[] records = buildRecords(result);
+ for (Record record : records) {
+ // To avoid a lot of unnecessary String construction, be lazy about building ancestry hover text.
+ // Store the types map off the records so we can build a detailed hover string as needed.
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_TYPES, typesWrapper);
+
+ // Build the decoded ancestry Strings now for display
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE, AncestryUtil
+ .getAncestryValue(record));
+ }
+ response.setData(records);
+ // for paging to work we have to specify size of full result set
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ });
}
});
@@ -138,8 +202,6 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
record.setAttribute("scheduleId", from.getScheduleId());
record.setAttribute("scheduleName", from.getScheduleName());
record.setAttribute("definitionId", from.getDefinitionId());
- record.setAttribute("resourceId", from.getResourceId());
- record.setAttribute("resourceName", from.getResourceName());
record.setAttribute("factor", from.getFactor());
record.setAttribute("formattedBaseband", from.getFormattedBaseband());
@@ -149,6 +211,12 @@ public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBCompos
record.setAttribute("parentId", from.getParentId());
record.setAttribute("parentName", from.getParentName());
+ // for ancestry handling
+ record.setAttribute(AncestryUtil.RESOURCE_ID, from.getResourceId());
+ record.setAttribute(AncestryUtil.RESOURCE_NAME, from.getResourceName());
+ record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, from.getResourceAncestry());
+ record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, from.getResourceTypeId());
+
int factorRankingWidth = (int) (((double) from.getFactor()) / (double) maximumFactor * 100d);
record.setBackgroundComponent(new HTMLFlow("<div style=\"width: " + factorRankingWidth
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java
index ec37fcb..b3e5f86 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java
@@ -22,10 +22,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.report.measurement;
+import java.util.ArrayList;
+
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.widgets.grid.CellFormatter;
-import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.ListGridField;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
@@ -33,7 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
/**
* @author Greg Hinkle
*/
-public class MeasurementOOBView extends Table {
+public class MeasurementOOBView extends Table<MeasurementOOBDataSource> {
public static final ViewName VIEW_ID = new ViewName("SuspectMetrics", MSG.view_measurementOob_title());
@@ -45,15 +45,23 @@ public class MeasurementOOBView extends Table {
@Override
protected void configureTable() {
- ListGrid grid = getListGrid();
- grid.setAlternateRecordStyles(false);
- grid.getField("resourceName").setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- return "<a href=\"#Resource/" + listGridRecord.getAttribute("resourceId") + "\">" + o + "</a>";
- }
- });
+ ArrayList<ListGridField> dataSourceFields = getDataSource().getListGridFields();
+ getListGrid().setFields(dataSourceFields.toArray(new ListGridField[dataSourceFields.size()]));
+
+ super.configureTable();
}
+ /*
+ ListGrid grid = getListGrid();
+ grid.setAlternateRecordStyles(false);
+ grid.getField("resourceName").setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ return "<a href=\"#Resource/" + listGridRecord.getAttribute("resourceId") + "\">" + o + "</a>";
+ }
+ });
+ }
+ */
+
@Override
protected SelectionStyle getDefaultSelectionStyle() {
return SelectionStyle.NONE;
commit 9f4c5ba9c65c708a90b6c40916949c91c3262e40
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 19 14:55:10 2011 -0400
[BZ 697937 - alert definition view shows invalid alert defs]
The way the alert def list views were implemented no longer played well
with the Table mechanism with respect to refresh. The resource/group/type id
criteria was lost after the initial fetch.
Changed the impl to use fixed InitialCriteria.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
index aac1626..c49fc4f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
@@ -47,8 +47,8 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
*/
public abstract class AbstractAlertDefinitionsView extends TableSection<AbstractAlertDefinitionsDataSource> {
- public AbstractAlertDefinitionsView(String locatorId, String tableTitle) {
- super(locatorId, tableTitle);
+ public AbstractAlertDefinitionsView(String locatorId, String tableTitle, Criteria initialCriteria) {
+ super(locatorId, tableTitle, initialCriteria);
setEscapeHtmlInDetailsLinkColumn(true);
}
@@ -62,8 +62,6 @@ public abstract class AbstractAlertDefinitionsView extends TableSection<Abstract
listGrid.setDataSource(ds);
listGrid.setFields(ds.getListGridFields().toArray(new ListGridField[0]));
- Criteria criteria = getCriteria();
- listGrid.setCriteria(criteria);
listGrid.setUseAllDataSourceFields(true);
listGrid.setWrapCells(true);
listGrid.setFixedRecordHeights(false);
@@ -189,8 +187,6 @@ public abstract class AbstractAlertDefinitionsView extends TableSection<Abstract
protected abstract ResourceType getResourceType();
- protected abstract Criteria getCriteria();
-
protected abstract AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource();
protected abstract boolean isAuthorizedToModifyAlertDefinitions();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java
index dc75308..9fa9c31 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java
@@ -53,7 +53,7 @@ public class GroupAlertDefinitionsView extends AbstractAlertDefinitionsView {
private ResourcePermission permissions;
public GroupAlertDefinitionsView(String locatorId, ResourceGroupComposite groupComposite) {
- super(locatorId, MSG.view_alert_definitions_table_title_group());
+ super(locatorId, MSG.view_alert_definitions_table_title_group(), getCriteria(groupComposite));
this.group = groupComposite.getResourceGroup();
this.permissions = groupComposite.getResourcePermission();
@@ -81,10 +81,9 @@ public class GroupAlertDefinitionsView extends AbstractAlertDefinitionsView {
return group.getResourceType();
}
- @Override
- protected Criteria getCriteria() {
+ private static Criteria getCriteria(ResourceGroupComposite composite) {
Criteria criteria = new Criteria();
- criteria.addCriteria(CRITERIA_GROUP_ID, group.getId());
+ criteria.addCriteria(CRITERIA_GROUP_ID, composite.getResourceGroup().getId());
return criteria;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
index a6673e3..ea41bc2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
@@ -53,7 +53,7 @@ public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView {
private ResourcePermission permissions;
public ResourceAlertDefinitionsView(String locatorId, ResourceComposite resourceComposite) {
- super(locatorId, "Alert Definitions");
+ super(locatorId, "Alert Definitions", getCriteria(resourceComposite));
this.resource = resourceComposite.getResource();
this.permissions = resourceComposite.getResourcePermission();
@@ -81,10 +81,9 @@ public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView {
return resource.getResourceType();
}
- @Override
- protected Criteria getCriteria() {
+ private static Criteria getCriteria(ResourceComposite composite) {
Criteria criteria = new Criteria();
- criteria.addCriteria(CRITERIA_RESOURCE_ID, resource.getId());
+ criteria.addCriteria(CRITERIA_RESOURCE_ID, composite.getResource().getId());
return criteria;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java
index 337341a..688dea4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java
@@ -52,7 +52,7 @@ public class TemplateAlertDefinitionsView extends AbstractAlertDefinitionsView {
private Set<Permission> globalPermissions;
public TemplateAlertDefinitionsView(String locatorId, ResourceType resourceType, Set<Permission> globalPermissions) {
- super(locatorId, "Alert Templates");
+ super(locatorId, "Alert Templates", getCriteria(resourceType));
this.resourceType = resourceType;
this.globalPermissions = globalPermissions;
@@ -88,10 +88,9 @@ public class TemplateAlertDefinitionsView extends AbstractAlertDefinitionsView {
return resourceType;
}
- @Override
- protected Criteria getCriteria() {
+ private static Criteria getCriteria(ResourceType type) {
Criteria criteria = new Criteria();
- criteria.addCriteria(CRITERIA_RESOURCE_TYPE_ID, resourceType.getId());
+ criteria.addCriteria(CRITERIA_RESOURCE_TYPE_ID, type.getId());
return criteria;
}
commit ef4ec9e49c23375507606f44a8495a7d24b68363
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 19 12:45:04 2011 -0400
related to [BZ 697098]
Monitoring->Traits for a compat group was showing traits for explicit
and implicit members. Restrict to explicit.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
index 10cdcea..948dc9f 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
@@ -70,15 +70,15 @@ public class MeasurementDataTraitCriteria extends Criteria {
filterOverrides.put(FILTER_FIELD_GROUP_ID, "schedule.resource.id IN " //
+ "( SELECT res.id " //
+ " FROM Resource res " //
- + " JOIN res.implicitGroups ig " //
+ + " JOIN res.explicitGroups ig " //
+ " WHERE ig.id = ? )");
filterOverrides.put(FILTER_FIELD_DEFINITION_ID, "schedule.definition.id = ?");
filterOverrides.put(FILTER_FIELD_MAX_TIMESTAMP, "id.timestamp = " //
+ "( SELECT MAX(mdt.id.timestamp) "
+ " FROM MeasurementDataTrait mdt "
- + " WHERE mdt.id.scheduleId = " + getAlias() + ".id.scheduleId ) "
+ + " WHERE mdt.id.scheduleId = " + getAlias() + ".id.scheduleId ) " //
+ " AND 1 = ?");
-
+
sortOverrides.put(SORT_FIELD_TIMESTAMP, "id.timestamp");
sortOverrides.put(SORT_FIELD_DISPLAY_NAME, "schedule.definition.displayName");
sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "schedule.resource.name");
commit 700cea933c9b2352a9aa9d879f6dbffd296878bc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 19 11:57:11 2011 -0400
[BZ 695753 - Cannot view traits for any resource on monitoring tab]
This occured only for non-permissioned users. There were two problems
with the authz token handling. First, the authz fragment needed to be be
overriden (in SLSB) as the "resource" entity must be accessed through
the "schedule" entity on MeasurementData. Second, we should not be using
the GROUP authz token type regardless of the criteria, because MeasurementData
is at the resource level only. Meaning, we are not querying for "group-level"
data regardless of whether we are filtering on the group embership for the
target resource.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
index 347be14..d3bdcd3 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
@@ -837,13 +837,8 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
Map<String, Object> filterFields = generator.getFilterFields(criteria);
if (!this.authorizationManager.isInventoryManager(subject)) {
- if (filterFields.get(MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID) != null) {
- generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP, subject
- .getId());
- } else {
- generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
- subject.getId());
- }
+ generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
+ "schedule.resource", subject.getId());
}
CriteriaQueryRunner<MeasurementDataTrait> queryRunner = new CriteriaQueryRunner(criteria, generator,
commit 855afab8c7db488dd1690ae6bf81f0f0e16fe7e0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 19 14:48:34 2011 -0400
BZ 696995 - make sure events metadata is cached
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
index 2115a80..d1dce1f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
@@ -274,7 +274,7 @@ public class ResourceTypeRepository {
cachedType.setPackageTypes(type.getPackageTypes());
break;
case events:
- cachedType.setPackageTypes(type.getPackageTypes());
+ cachedType.setEventDefinitions(type.getEventDefinitions());
break;
case measurements:
cachedType.setMetricDefinitions(type.getMetricDefinitions());
commit 3856db3f363882af9aed326d47e8af47f5ae8fb2
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 19 11:37:51 2011 -0400
BZ 696778 - no need for this long label - the button itself tells you what it is.
this makes the dashboard edit mode more compact and less ugly - attractive to the eye and soothing to the smell, poppies...poppies will put them to sleep. sleeeeeeeep.
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 8deac66..33d8890 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
@@ -450,8 +450,7 @@ public class DashboardView extends LocatableVLayout {
refreshMenuButton.setIconOrientation("left");
CanvasItem refreshCanvas = new CanvasItem();
- refreshCanvas.setTitle(MSG.common_title_portlet_auto_refresh());
- refreshCanvas.setWrapTitle(false);
+ refreshCanvas.setShowTitle(false);
refreshCanvas.setCanvas(refreshMenuButton);
refreshCanvas.setStartRow(false);
refreshCanvas.setEndRow(false);
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 b809c1e..f5f96bf 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
@@ -160,7 +160,6 @@ common_title_platform = Platform
common_title_platform_total = Platform Total
common_title_plugin = Plugin
common_title_port = Port
-common_title_portlet_auto_refresh=Portlet Auto-Refresh Interval
common_title_providers = Providers
common_title_recent_alerts = Recent Alerts
common_title_recent_bundle_deployments = Recent Bundle Deployments
commit 36f7955cde61d7c306317e5b7fc8b7c93ee252a7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 19 11:06:17 2011 -0400
BZ: 697559 - make sure all GWT interfaces explicitly declare "throws RuntimeException"
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AgentGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AgentGWTService.java
index 7b55598..6cecb62 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AgentGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AgentGWTService.java
@@ -27,8 +27,8 @@ import org.rhq.core.domain.resource.Agent;
*/
public interface AgentGWTService extends RemoteService {
- Agent getAgentForResource(int resourceId);
+ Agent getAgentForResource(int resourceId) throws RuntimeException;
- Boolean pingAgentForResource(int resourceId);
+ Boolean pingAgentForResource(int resourceId) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
index f79fa9d..6b0b26b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
@@ -28,7 +28,7 @@ import org.rhq.core.domain.util.PageList;
public interface AlertDefinitionGWTService extends RemoteService {
- PageList<AlertDefinition> findAlertDefinitionsByCriteria(AlertDefinitionCriteria criteria);
+ PageList<AlertDefinition> findAlertDefinitionsByCriteria(AlertDefinitionCriteria criteria) throws RuntimeException;
int createAlertDefinition(AlertDefinition alertDefinition, Integer resourceId) throws RuntimeException;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
index 3d14c3a..fdcd01d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
@@ -84,6 +84,6 @@ public interface AuthorizationGWTService extends RemoteService {
*
* @return true if the current user possesses the specified resource permission for the specified resource
*/
- boolean hasResourcePermission(Permission permission, Collection<Integer> resourceIds);
+ boolean hasResourcePermission(Permission permission, Collection<Integer> resourceIds) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
index d6322a6..5ecff18 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
@@ -33,8 +33,8 @@ import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.PackageVersion;
import org.rhq.core.domain.content.composite.PackageAndLatestVersionComposite;
import org.rhq.core.domain.content.composite.PackageTypeAndVersionFormatComposite;
-import org.rhq.core.domain.criteria.PackageCriteria;
import org.rhq.core.domain.criteria.InstalledPackageHistoryCriteria;
+import org.rhq.core.domain.criteria.PackageCriteria;
import org.rhq.core.domain.criteria.PackageVersionCriteria;
import org.rhq.core.domain.util.PageList;
@@ -48,18 +48,22 @@ public interface ContentGWTService extends RemoteService {
PageList<PackageVersion> findPackageVersionsByCriteria(PackageVersionCriteria criteria) throws RuntimeException;
- PageList<Package> findPackagesByCriteria(PackageCriteria criteria);
-
- PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(PackageCriteria criteria);
-
- PageList<InstalledPackageHistory> getInstalledPackageHistoryForResource(int resourceId, int count);
+ PageList<Package> findPackagesByCriteria(PackageCriteria criteria) throws RuntimeException;;
+
+ PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(PackageCriteria criteria)
+ throws RuntimeException;;
- PageList<InstalledPackageHistory> findInstalledPackageHistoryByCriteria(InstalledPackageHistoryCriteria criteria);
+ PageList<InstalledPackageHistory> getInstalledPackageHistoryForResource(int resourceId, int count)
+ throws RuntimeException;;
+
+ PageList<InstalledPackageHistory> findInstalledPackageHistoryByCriteria(InstalledPackageHistoryCriteria criteria)
+ throws RuntimeException;;
List<Architecture> getArchitectures() throws RuntimeException;
PackageType getResourceCreationPackageType(int resourceTypeId) throws RuntimeException;
-
- PackageTypeAndVersionFormatComposite findPackageType(Integer resourceTypeId, String packageTypeName) throws RuntimeException;
-
+
+ PackageTypeAndVersionFormatComposite findPackageType(Integer resourceTypeId, String packageTypeName)
+ throws RuntimeException;
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
index b35d7d6..d809e2a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
@@ -56,7 +56,9 @@ public interface EventGWTService extends RemoteService {
int purgeEventsForContext(EntityContext context) throws RuntimeException;
- Map<EventSeverity, Integer> getEventCountsBySeverity(int resourceId, long startDate, long endDate);
+ Map<EventSeverity, Integer> getEventCountsBySeverity(int resourceId, long startDate, long endDate)
+ throws RuntimeException;
- Map<EventSeverity, Integer> getEventCountsBySeverityForGroup(int groupId, long startDate, long endDate);
+ Map<EventSeverity, Integer> getEventCountsBySeverityForGroup(int groupId, long startDate, long endDate)
+ throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
index 3e5b360..8e4640c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
@@ -138,12 +138,12 @@ public interface SubjectGWTService extends RemoteService {
* @return <code>true</code> if the user exists and has a {@link Principal}, <code>false</code> otherwise
*/
boolean isUserWithPrincipal(String username) throws RuntimeException;
-
+
/**
* Checks if the provided credentials are correct.
* @param username
* @param password
* @return
*/
- Subject checkAuthentication(String username, String password);
+ Subject checkAuthentication(String username, String password) throws RuntimeException;
}
commit f568329b9432679a38e0f15ab5be61628baf5d32
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 19 10:05:38 2011 -0400
Finish removal of legacy DisambiguationReport code from CoreGUI. Remove
ReportDecorator and migrate its link constants to use of LinkManager.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index e4ed6f0..0c15872 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -108,6 +108,22 @@ public class LinkManager {
return getResourceGroupLink(groupId) + "/Operations/History/" + groupOperationHistoryId;
}
+ public static String getResourceEventHistoryListLink(int resourceId) {
+ return "#Resource/" + resourceId + "/Events/History/";
+ }
+
+ public static String getGroupEventHistoryListLink(int groupId) {
+ return getResourceGroupLink(groupId) + "/Events/History/";
+ }
+
+ public static String getResourceMonitoringGraphsLink(int resourceId) {
+ return "#Resource/" + resourceId + "/Monitoring/Graphs/";
+ }
+
+ public static String getGroupMonitoringGraphsLink(int groupId) {
+ return getResourceGroupLink(groupId) + "/Monitoring/Graphs/";
+ }
+
public static String getGroupDefinitionLink(int groupDefinitionId) {
if (GWT) {
return "#Inventory/Groups/DynagroupDefinitions/" + groupDefinitionId;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
index 7c4a68b..0f166ed 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
@@ -43,6 +43,7 @@ import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
@@ -53,7 +54,6 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigura
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableCanvas;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -232,9 +232,8 @@ public class GroupBundleDeploymentsPortlet extends LocatableVLayout implements C
"subsystems/content/Content_16.png", null);
String title = deployment.getBundleVersion().getName() + "["
+ deployment.getBundleVersion().getVersion() + "]:";
- String destination = ReportDecorator.GWT_BUNDLE_URL
- + deployment.getBundleVersion().getBundle().getId() + "/destinations/"
- + deployment.getDestination().getId();
+ String destination = LinkManager.getBundleDestinationLink(deployment.getBundleVersion()
+ .getBundle().getId(), deployment.getDestination().getId());
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(deployment.getCtime()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
index 731ac31..0192b9f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
@@ -38,6 +38,7 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.event.EventSeverity;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
@@ -49,7 +50,6 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigura
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.GwtTuple;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableCanvas;
@@ -274,8 +274,8 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
//insert see more link
LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent.extendLocatorId(String
.valueOf(rowNum++)));
- AbstractActivityView.addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId
- + "/Events/History/", column);
+ String link = LinkManager.getGroupEventHistoryListLink(groupId);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
} else {
LocatableDynamicForm row = AbstractActivityView.createEmptyDisplayRow(recentEventsContent
.extendLocatorId("None"), AbstractActivityView.RECENT_CRITERIA_EVENTS_NONE);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 700de52..2602e6b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -51,6 +51,7 @@ import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortletUtil;
@@ -64,7 +65,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableCanvas;
@@ -422,9 +422,9 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
LocatableDynamicForm row = new LocatableDynamicForm(
recentMeasurementsContent
.extendLocatorId("RecentMeasurementsContentSeeMore"));
- AbstractActivityView.addSeeMoreLink(row,
- ReportDecorator.GWT_GROUP_URL + groupId
- + "/Monitoring/Graphs/", column);
+ String link = LinkManager
+ .getGroupMonitoringGraphsLink(groupId);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
}
//call out to 3rd party javascript lib
BrowserUtility.graphSparkLines();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
index 763b8fc..72a2449 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
@@ -32,13 +32,13 @@ import org.rhq.core.domain.criteria.ResourceBundleDeploymentCriteria;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupBundleDeploymentsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -121,9 +121,8 @@ public class ResourceBundleDeploymentsPortlet extends GroupBundleDeploymentsPort
"subsystems/content/Content_16.png", null);
String title = deployment.getBundleVersion().getName() + "["
+ deployment.getBundleVersion().getVersion() + "]:";
- String destination = ReportDecorator.GWT_BUNDLE_URL
- + deployment.getBundleVersion().getBundle().getId() + "/destinations/"
- + deployment.getDestination().getId();
+ String destination = LinkManager.getBundleDestinationLink(deployment.getBundleVersion()
+ .getBundle().getId(), deployment.getDestination().getId());
LinkItem link = AbstractActivityView.newLinkItem(title, destination);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(deployment.getCtime()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
index dfde6d9..7ceef8c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
@@ -31,13 +31,13 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.event.EventSeverity;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupEventsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.GwtTuple;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -158,8 +158,9 @@ public class ResourceEventsPortlet extends GroupEventsPortlet {
//insert see more link
LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent.extendLocatorId(String
.valueOf(rowNum++)));
- AbstractActivityView.addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId
- + "/Events/History/", column);
+
+ String link = LinkManager.getResourceEventHistoryListLink(resourceId);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
} else {
LocatableDynamicForm row = AbstractActivityView.createEmptyDisplayRow(recentEventsContent
.extendLocatorId("None"), AbstractActivityView.RECENT_CRITERIA_EVENTS_NONE);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index 735fba8..f046afc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -44,6 +44,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
@@ -51,7 +52,6 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetr
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -292,9 +292,9 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
LocatableDynamicForm row = new LocatableDynamicForm(
recentMeasurementsContent
.extendLocatorId("RecentMeasurementsContentSeeMore"));
- AbstractActivityView.addSeeMoreLink(row,
- ReportDecorator.GWT_RESOURCE_URL + resourceId
- + "/Monitoring/Graphs/", column);
+ String link = LinkManager
+ .getResourceMonitoringGraphsLink(resourceId);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
}
//call out to 3rd party javascript lib
BrowserUtility.graphSparkLines();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView3.java
deleted file mode 100644
index d8ef22f..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView3.java
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- * 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.inventory.groups.detail.summary;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.ContentsType;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-import org.rhq.core.domain.alert.Alert;
-import org.rhq.core.domain.bundle.BundleDeployment;
-import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
-import org.rhq.core.domain.content.InstalledPackageHistory;
-import org.rhq.core.domain.criteria.AlertCriteria;
-import org.rhq.core.domain.criteria.GroupBundleDeploymentCriteria;
-import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
-import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
-import org.rhq.core.domain.criteria.InstalledPackageHistoryCriteria;
-import org.rhq.core.domain.event.EventSeverity;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
-import org.rhq.core.domain.operation.GroupOperationHistory;
-import org.rhq.core.domain.resource.ResourceTypeFacet;
-import org.rhq.core.domain.resource.group.GroupCategory;
-import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
-import org.rhq.core.domain.util.PageControl;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.core.domain.util.PageOrdering;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
-import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
-import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
-import org.rhq.enterprise.gui.coregui.client.util.GwtTuple;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
-
-/**
- * The content pane for the group Summary>Activity subtab.
- *
- * @author Simeon Pinder
- */
-public class ActivityView3 extends AbstractActivityView {
-
- private ResourceGroupComposite groupComposite;
-
- public ActivityView3(String locatorId, ResourceGroupComposite groupComposite) {
- super(locatorId, groupComposite, null);
- this.groupComposite = groupComposite;
- }
-
- @Override
- protected void onInit() {
- super.onInit();
- loadData();
- }
-
- /**Initiates data request.
- */
- protected void loadData() {
- ResourceGroup group = null;
- GroupCategory groupCategory = null;
- Set<ResourceTypeFacet> facets = null;
- if ((groupComposite != null) && (groupComposite.getResourceGroup() != null)) {
- group = groupComposite.getResourceGroup();
- groupCategory = groupComposite.getResourceGroup().getGroupCategory();
- //Load Facets to conditionally display relevant tabs
- facets = groupComposite.getResourceFacets().getFacets();
-
- getRecentAlerts();
- //events
- if (displayGroupEvents(groupCategory, facets)) {
- getRecentEventUpdates();
- }
- //operations
- if (displayGroupOperations(groupCategory, facets)) {
- getRecentOperations();
- }
- //Config updates
- if (displayGroupConfigurationUpdates(groupCategory, facets)) {
- getRecentConfigurationUpdates();
- }
- //recentMetrics,oobs,pkghistory
- if (groupCategory == GroupCategory.COMPATIBLE) {
- getRecentOobs();
- getRecentPkgHistory();
- getRecentMetrics();
- }
-
- //conditionally display Bundle deployments for groups of platforms only
- displayBundleDeploymentsForPlatformGroups(group);
- }
- }
-
- /** Fetches alerts and updates the DynamicForm instance with the latest
- * alert information.
- */
- private void getRecentAlerts() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
- //fetches last five alerts for this resource
- AlertCriteria criteria = new AlertCriteria();
- PageControl pageControl = new PageControl(0, 5);
- pageControl.initDefaultOrderingField("ctime", PageOrdering.DESC);
- criteria.setPageControl(pageControl);
- criteria.addFilterResourceGroupIds(groupId);
- GWTServiceLookup.getAlertService().findAlertsByCriteria(criteria, new AsyncCallback<PageList<Alert>>() {
- @Override
- public void onSuccess(PageList<Alert> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (Alert alert : result) {
- // alert history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentAlertsContent.extendLocatorId(String
- .valueOf(rowNum++)));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getAlertIcon(alert.getAlertDefinition()
- .getPriority()), alert.getAlertDefinition().getPriority().getDisplayName());
- LinkItem link = newLinkItem(alert.getAlertDefinition().getName() + ": ",
- ReportDecorator.GWT_GROUP_URL + groupId + "/Alerts/History/" + alert.getId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(alert.getCtime()));
- row.setItems(iconItem, link, time);
-
- column.addMember(row);
- }
- //link to more details
- LocatableDynamicForm row = new LocatableDynamicForm(recentAlertsContent.extendLocatorId(String
- .valueOf(rowNum++)));
- addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId + "/Alerts/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentAlertsContent.extendLocatorId("None"),
- RECENT_ALERTS_NONE);
- column.addMember(row);
- }
- for (Canvas child : recentAlertsContent.getChildren()) {
- child.destroy();
- }
- recentAlertsContent.addChild(column);
- recentAlertsContent.markForRedraw();
- }
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent alerts for group [" + groupId + "]:" + caught.getMessage());
- }
- });
- }
-
- /** Fetches operations and updates the DynamicForm instance with the latest
- * operation information.
- */
- private void getRecentOperations() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
- //fetches five most recent operations.
- PageControl pageControl = new PageControl(0, 5);
-
- GroupOperationHistoryCriteria criteria = new GroupOperationHistoryCriteria();
- List<Integer> filterResourceGroupIds = new ArrayList<Integer>();
- filterResourceGroupIds.add(groupId);
- criteria.addFilterResourceGroupIds(filterResourceGroupIds);
- criteria.setPageControl(pageControl);
- criteria.addSortStatus(PageOrdering.DESC);
-
- GWTServiceLookup.getOperationService().findGroupOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<GroupOperationHistory>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent operations for group [" + groupId + "]:" + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<GroupOperationHistory> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (GroupOperationHistory report : result) {
- // operation history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentOperationsContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getOperationResultsIcon(report
- .getStatus()), report.getStatus().getDisplayName());
- LinkItem link = newLinkItem(report.getOperationDefinition().getDisplayName() + ": ",
- ReportDecorator.GWT_GROUP_URL + groupId + "/Operations/History/" + report.getId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(report
- .getStartedTime()));
- row.setItems(iconItem, link, time);
-
- column.addMember(row);
- }
- //insert see more link
- LocatableDynamicForm row = new LocatableDynamicForm(recentOperationsContent
- .extendLocatorId(String.valueOf(rowNum)));
- addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId + "/Operations/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentOperationsContent
- .extendLocatorId("None"), RECENT_OPERATIONS_NONE);
- column.addMember(row);
- }
- for (Canvas child : recentOperationsContent.getChildren()) {
- child.destroy();
- }
- recentOperationsContent.addChild(column);
- recentOperationsContent.markForRedraw();
- }
- });
- }
-
- /** Fetches configuration updates and updates the DynamicForm instance with the latest
- * config change information.
- */
- private void getRecentConfigurationUpdates() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
-
- PageControl lastFive = new PageControl(0, 5);
- GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
- criteria.setPageControl(lastFive);
- criteria.addSortStatus(PageOrdering.DESC);
- List<Integer> filterResourceGroupIds = new ArrayList<Integer>();
- filterResourceGroupIds.add(groupId);
- criteria.addFilterResourceGroupIds(filterResourceGroupIds);
-
- GWTServiceLookup.getConfigurationService().findGroupResourceConfigurationUpdatesByCriteria(criteria,
- new AsyncCallback<PageList<GroupResourceConfigurationUpdate>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent configuration updates for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<GroupResourceConfigurationUpdate> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (GroupResourceConfigurationUpdate update : result) {
- // config update history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentConfigurationContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getResourceConfigurationIcon(update
- .getStatus()), null);
- String linkTitle = MSG.view_resource_inventory_activity_changed_by() + " "
- + update.getSubjectName() + ":";
- if ((update.getSubjectName() == null) || (update.getSubjectName().trim().isEmpty())) {
- linkTitle = MSG.common_msg_changeAutoDetected();
- }
- LinkItem link = newLinkItem(linkTitle, ReportDecorator.GWT_GROUP_URL + groupId
- + "/Configuration/History/" + update.getId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(update
- .getCreatedTime()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- //insert see more link
- LocatableDynamicForm row = new LocatableDynamicForm(recentConfigurationContent
- .extendLocatorId(String.valueOf(rowNum)));
- addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId + "/Configuration/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentConfigurationContent
- .extendLocatorId("None"), RECENT_CONFIGURATIONS_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentConfigurationContent.getChildren()) {
- child.destroy();
- }
- recentConfigurationContent.addChild(column);
- recentConfigurationContent.markForRedraw();
-
- }
- });
- }
-
- /** Fetches recent events and updates the DynamicForm instance with the latest
- * event information over last 24hrs.
- */
- private void getRecentEventUpdates() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
- long now = System.currentTimeMillis();
- long nowMinus24Hours = now - (24 * 60 * 60 * 1000);
- GWTServiceLookup.getEventService().getEventCountsBySeverityForGroup(groupId, nowMinus24Hours, now,
- new AsyncCallback<Map<EventSeverity, Integer>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log
- .debug("Error retrieving recent event counts for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(Map<EventSeverity, Integer> eventCounts) {
- //Now populated Tuples
- List<GwtTuple<EventSeverity, Integer>> results = new ArrayList<GwtTuple<EventSeverity, Integer>>();
- for (EventSeverity severity : eventCounts.keySet()) {
- int count = eventCounts.get(severity);
- if (count > 0) {
- results.add(new GwtTuple<EventSeverity, Integer>(severity, count));
- }
- }
- //build display
- VLayout column = new VLayout();
- column.setHeight(10);
-
- if (!results.isEmpty()) {
- int rowNum = 0;
- for (GwtTuple<EventSeverity, Integer> tuple : results) {
- // event history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(2);
- row.setWidth(10);//pack.
-
- //icon
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getEventSeverityIcon(tuple
- .getLefty()), tuple.getLefty().name());
- //count
- StaticTextItem count = newTextItem(String.valueOf(tuple.righty));
- row.setItems(iconItem, count);
-
- column.addMember(row);
- }
- //insert see more link
- LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent.extendLocatorId(String
- .valueOf(rowNum)));
- addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId + "/Events/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentEventsContent.extendLocatorId("None"),
- RECENT_EVENTS_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentEventsContent.getChildren()) {
- child.destroy();
- }
- recentEventsContent.addChild(column);
- recentEventsContent.markForRedraw();
- }
- });
- }
-
- /** Fetches OOB measurements and updates the DynamicForm instance with the latest 5
- * oob change details.
- */
- private void getRecentOobs() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
-
- GWTServiceLookup.getMeasurementDataService().getHighestNOOBsForGroup(groupId, 5,
- new AsyncCallback<PageList<MeasurementOOBComposite>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent out of bound metrics for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<MeasurementOOBComposite> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (MeasurementOOBComposite oob : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentOobContent.extendLocatorId(oob
- .getScheduleName()));
- row.setNumCols(2);
-
- String title = oob.getScheduleName() + ":";
- String destination = "/resource/common/monitor/Visibility.do?m=" + oob.getDefinitionId()
- + "&id=" + groupId + "&mode=chartSingleMetricSingleResource";
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(oob.getTimestamp()));
-
- row.setItems(link, time);
- column.addMember(row);
- }
- //insert see more link spinder(2/24/11): no page that displays all oobs... See More not possible.
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentOobContent.extendLocatorId("None"),
- RECENT_OOB_NONE);
- column.addMember(row);
- }
- recentOobContent.setContents("");
- for (Canvas child : recentOobContent.getChildren()) {
- child.destroy();
- }
- recentOobContent.addChild(column);
- recentOobContent.markForRedraw();
- }
- });
- }
-
- /** Fetches recent package history information and updates the DynamicForm instance with details.
- */
- private void getRecentPkgHistory() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
- InstalledPackageHistoryCriteria criteria = new InstalledPackageHistoryCriteria();
- PageControl pageControl = new PageControl(0, 5);
- criteria.setPageControl(pageControl);
- criteria.addFilterResourceGroupIds(groupId);
- criteria.addSortStatus(PageOrdering.DESC);
-
- GWTServiceLookup.getContentService().findInstalledPackageHistoryByCriteria(criteria,
-
- new AsyncCallback<PageList<InstalledPackageHistory>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving installed package history for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<InstalledPackageHistory> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (InstalledPackageHistory history : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentPkgHistoryContent
- .extendLocatorId(history.getPackageVersion().getFileName()
- + history.getPackageVersion().getVersion()));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon("subsystems/content/Package_16.png", null);
- String title = history.getPackageVersion().getFileName() + ":";
- String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + groupId
- + "&selectedHistoryId=" + history.getId();
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(history.getTimestamp()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- // //insert see more link
- // LocatableDynamicForm row = new LocatableDynamicForm(recentPkgHistoryContent
- // .extendLocatorId("PkgHistoryContentSeeMore"));
- // String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + groupId;
- // addSeeMoreLink(row, destination, column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentPkgHistoryContent.extendLocatorId("None"),
- RECENT_PKG_HISTORY_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentPkgHistoryContent.getChildren()) {
- child.destroy();
- }
- recentPkgHistoryContent.addChild(column);
- recentPkgHistoryContent.markForRedraw();
- }
- });
- }
-
- /** Fetches recent metric information and updates the DynamicForm instance with i)sparkline information,
- * ii) link to recent metric graph for more details and iii) last metric value formatted to show significant
- * digits.
- */
- private void getRecentMetrics() {
-
- //display container
- final VLayout column = new VLayout();
- column.setHeight(10);//pack
- final int groupId = this.groupComposite.getResourceGroup().getId();
-
- //retrieve all relevant measurement definition ids.
- Set<MeasurementDefinition> definitions = this.groupComposite.getResourceGroup().getResourceType()
- .getMetricDefinitions();
-
- //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
- final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
- for (MeasurementDefinition definition : definitions) {
- measurementDefMap.put(definition.getDisplayName(), definition);
- }
- //bundle definition ids for asynch call.
- int[] definitionArrayIds = new int[definitions.size()];
- final String[] displayOrder = new String[definitions.size()];
- measurementDefMap.keySet().toArray(displayOrder);
- //sort the charting data ex. Free Memory, Free Swap Space,..System Load
- Arrays.sort(displayOrder);
-
- //organize definitionArrayIds for ordered request on server.
- int index = 0;
- for (String definitionToDisplay : displayOrder) {
- definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay).getId();
- }
-
- //make the asynchronous call for all the measurement data
- GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroup(groupId, definitionArrayIds,
- System.currentTimeMillis() - (1000L * 60 * 60 * 8), System.currentTimeMillis(), 60,
- new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent metrics charting data for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> results) {
- if (!results.isEmpty()) {
- boolean someChartedData = false;
- //iterate over the retrieved charting data
- for (int index = 0; index < displayOrder.length; index++) {
- //retrieve the correct measurement definition
- MeasurementDefinition md = measurementDefMap.get(displayOrder[index]);
-
- //load the data results for the given metric definition
- List<MeasurementDataNumericHighLowComposite> data = results.get(index);
-
- //locate last and minimum values.
- double lastValue = -1;
- double minValue = Double.MAX_VALUE;//
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- if (d.getValue() < minValue) {
- minValue = d.getValue();
- }
- lastValue = d.getValue();
- }
- }
-
- //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
- String commaDelimitedList = "";
-
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- commaDelimitedList += d.getValue() + ",";
- }
- }
- LocatableDynamicForm row = new LocatableDynamicForm(recentMeasurementsContent
- .extendLocatorId(md.getName()));
- row.setNumCols(3);
- HTMLFlow graph = new HTMLFlow();
- // String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0'>"
- // + commaDelimitedList + "</span>";
- String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0' "
- + "values='" + commaDelimitedList + "'>...</span>";
- graph.setContents(contents);
- graph.setContentsType(ContentsType.PAGE);
- //diable scrollbars on span
- graph.setScrollbarSize(0);
-
- CanvasItem graphContainer = new CanvasItem();
- graphContainer.setShowTitle(false);
- graphContainer.setHeight(16);
- graphContainer.setWidth(60);
- graphContainer.setCanvas(graph);
-
- //Link/title element
- //TODO: spinder, change link whenever portal.war/graphing is removed.
- String title = md.getDisplayName() + ":";
- // String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
- // + resourceId + "&m=" + md.getId();
- String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId="
- + groupId + "&m=" + md.getId();
- LinkItem link = newLinkItem(title, destination);
-
- //Value
- String convertedValue = lastValue + " " + md.getUnits();
- convertedValue = convertLastValueForDisplay(lastValue, md);
- StaticTextItem value = newTextItem(convertedValue);
-
- row.setItems(graphContainer, link, value);
- //if graph content returned
- if ((md.getName().trim().indexOf("Trait.") == -1) && (lastValue != -1)) {
- column.addMember(row);
- someChartedData = true;
- }
- }
- if (!someChartedData) {// when there are results but no chartable entries.
- LocatableDynamicForm row = createEmptyDisplayRow(recentMeasurementsContent
- .extendLocatorId("None"), RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
- } else {
- //insert see more link
- LocatableDynamicForm row = new LocatableDynamicForm(recentMeasurementsContent
- .extendLocatorId("RecentMeasurementsContentSeeMore"));
- addSeeMoreLink(row, ReportDecorator.GWT_GROUP_URL + groupId + "/Monitoring/Graphs/", column);
- }
- //call out to 3rd party javascript lib
- BrowserUtility.graphSparkLines();
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentMeasurementsContent
- .extendLocatorId("None"), RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
- }
- }
- });
-
- //cleanup
- for (Canvas child : recentMeasurementsContent.getChildren()) {
- child.destroy();
- }
- recentMeasurementsContent.addChild(column);
- recentMeasurementsContent.markForRedraw();
- }
-
- /** Fetches recent bundle deployment information and updates the DynamicForm instance with details.
- */
- protected void getRecentBundleDeployments() {
- final int groupId = this.groupComposite.getResourceGroup().getId();
- GroupBundleDeploymentCriteria criteria = new GroupBundleDeploymentCriteria();
- PageControl pageControl = new PageControl(0, 5);
- criteria.setPageControl(pageControl);
- criteria.addFilterResourceGroupIds(groupId);
- criteria.addSortStatus(PageOrdering.DESC);
- criteria.fetchDestination(true);
- criteria.fetchBundleVersion(true);
-
- GWTServiceLookup.getBundleService().findBundleDeploymentsByCriteria(criteria,
- new AsyncCallback<PageList<BundleDeployment>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving installed bundle deployments for group [" + groupId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<BundleDeployment> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (BundleDeployment deployment : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentBundleDeployContent
- .extendLocatorId(deployment.getBundleVersion().getName()
- + deployment.getBundleVersion().getVersion()));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon("subsystems/content/Content_16.png", null);
- String title = deployment.getBundleVersion().getName() + "["
- + deployment.getBundleVersion().getVersion() + "]:";
- String destination = ReportDecorator.GWT_BUNDLE_URL
- + deployment.getBundleVersion().getBundle().getId() + "/destinations/"
- + deployment.getDestination().getId();
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter
- .format(deployment.getCtime()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- //insert see more link
- //TODO: spinder:2/25/11 (add this later) no current view for seeing all bundle deployments
- // LocatableDynamicForm row = new LocatableDynamicForm(recentBundleDeployContent.extendLocatorId("RecentBundleContentSeeMore"));
- // addSeeMoreLink(row, LinkManager.getResourceGroupLink(groupId) + "/Events/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentBundleDeployContent
- .extendLocatorId("None"), RECENT_BUNDLE_DEPLOY_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentBundleDeployContent.getChildren()) {
- child.destroy();
- }
- recentBundleDeployContent.addChild(column);
- recentBundleDeployContent.markForRedraw();
- }
- });
- }
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView3.java
deleted file mode 100644
index 355a19a..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView3.java
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-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.inventory.resource.detail.summary;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.ContentsType;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-import org.rhq.core.domain.alert.Alert;
-import org.rhq.core.domain.bundle.BundleDeployment;
-import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
-import org.rhq.core.domain.content.InstalledPackageHistory;
-import org.rhq.core.domain.criteria.AlertCriteria;
-import org.rhq.core.domain.criteria.InstalledPackageCriteria;
-import org.rhq.core.domain.criteria.ResourceBundleDeploymentCriteria;
-import org.rhq.core.domain.event.EventSeverity;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
-import org.rhq.core.domain.operation.composite.ResourceOperationLastCompletedComposite;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.ResourceTypeFacet;
-import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.core.domain.util.PageControl;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.core.domain.util.PageOrdering;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
-import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
-import org.rhq.enterprise.gui.coregui.client.util.GwtRelativeDurationConverter;
-import org.rhq.enterprise.gui.coregui.client.util.GwtTuple;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
-
-/**
- * The content pane of the Resource Summary>Activity tab.
- *
- * @author Simeon Pinder
- */
-public class ActivityView3 extends AbstractActivityView {
-
- private ResourceComposite resourceComposite;
-
- public ActivityView3(String locatorId, ResourceComposite resourceComposite) {
- super(locatorId, null, resourceComposite);
- this.resourceComposite = resourceComposite;
- }
-
- @Override
- protected void onInit() {
- super.onInit();
- loadData();
- }
-
- /**Initiates data request.
- */
- protected void loadData() {
-
- ResourceType type = null;
- Resource resource = null;
- Set<ResourceTypeFacet> facets = null;
-
- if ((resourceComposite != null) && (resourceComposite.getResource() != null)) {
- resource = resourceComposite.getResource();
- type = this.resourceComposite.getResource().getResourceType();
- facets = this.resourceComposite.getResourceFacets().getFacets();
-
- //alerts
- getRecentAlerts();
- //operations
- if (facets.contains(ResourceTypeFacet.OPERATION)) {
- getRecentOperations();
- }
- //config updates
- if (facets.contains(ResourceTypeFacet.CONFIGURATION)) {
- getRecentConfigurationUpdates();
- }
- //events
- if (facets.contains(ResourceTypeFacet.EVENT)) {
- getRecentEventUpdates();
- }
- //measurements
- getRecentOobs();
- getRecentPkgHistory();
- getRecentMetrics();
-
- //conditionally display Bundle Deployments region.
- if (displayBundlesForResource(resource)) {
- getRecentBundleDeployments();
- }
- }
- }
-
- /** Fetches alerts and updates the DynamicForm instance with the latest
- * alert information.
- */
- private void getRecentAlerts() {
- final int resourceId = this.resourceComposite.getResource().getId();
- //fetches last five alerts for this resource
- AlertCriteria criteria = new AlertCriteria();
- PageControl pageControl = new PageControl(0, 5);
- pageControl.initDefaultOrderingField("ctime", PageOrdering.DESC);
- criteria.setPageControl(pageControl);
- criteria.addFilterResourceIds(resourceId);
- GWTServiceLookup.getAlertService().findAlertsByCriteria(criteria, new AsyncCallback<PageList<Alert>>() {
- @Override
- public void onSuccess(PageList<Alert> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (Alert alert : result) {
- // alert history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentAlertsContent.extendLocatorId(String
- .valueOf(rowNum++)));
- row.setNumCols(3);
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getAlertIcon(alert.getAlertDefinition()
- .getPriority()), alert.getAlertDefinition().getPriority().getDisplayName());
- LinkItem link = newLinkItem(alert.getAlertDefinition().getName() + ": ",
- ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Alerts/History/" + alert.getId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(alert.getCtime()));
- row.setItems(iconItem, link, time);
-
- column.addMember(row);
- }
- //link to more details
- LocatableDynamicForm row = new LocatableDynamicForm(recentAlertsContent.extendLocatorId(String
- .valueOf(rowNum++)));
- addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Alerts/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentAlertsContent.extendLocatorId("None"),
- RECENT_ALERTS_NONE);
- column.addMember(row);
- }
- for (Canvas child : recentAlertsContent.getChildren()) {
- child.destroy();
- }
- recentAlertsContent.addChild(column);
- recentAlertsContent.markForRedraw();
- }
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent alerts for resource [" + resourceId + "]:" + caught.getMessage());
- }
- });
- }
-
- /** Fetches operations and updates the DynamicForm instance with the latest
- * operation information.
- */
- private void getRecentOperations() {
- final int resourceId = this.resourceComposite.getResource().getId();
- //fetches five most recent operations.
- PageControl pageControl = new PageControl(0, 5);
- pageControl.initDefaultOrderingField("ro.createdTime", PageOrdering.DESC);
- GWTServiceLookup.getOperationService().findRecentCompletedOperations(resourceId, pageControl,
- new AsyncCallback<PageList<ResourceOperationLastCompletedComposite>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent operations for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<ResourceOperationLastCompletedComposite> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (ResourceOperationLastCompletedComposite report : result) {
- // operation history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentOperationsContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getOperationResultsIcon(report
- .getOperationStatus()), report.getOperationStatus().getDisplayName());
- LinkItem link = newLinkItem(report.getOperationName() + ": ", LinkManager
- .getResourceLink(resourceId)
- + "/Operations/History/" + report.getOperationHistoryId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(report
- .getOperationStartTime()));
- row.setItems(iconItem, link, time);
-
- column.addMember(row);
- }
- //link to more details
- LocatableDynamicForm row = new LocatableDynamicForm(recentOperationsContent
- .extendLocatorId(String.valueOf(rowNum++)));
- addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Operations/History/",
- column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentOperationsContent
- .extendLocatorId("None"), RECENT_OPERATIONS_NONE);
- column.addMember(row);
- }
- for (Canvas child : recentOperationsContent.getChildren()) {
- child.destroy();
- }
- recentOperationsContent.addChild(column);
- recentOperationsContent.markForRedraw();
- }
- });
- }
-
- /** Fetches configuration updates and updates the DynamicForm instance with the latest
- * config change information.
- */
- private void getRecentConfigurationUpdates() {
- final int resourceId = this.resourceComposite.getResource().getId();
-
- PageControl lastFive = new PageControl(0, 5);
- lastFive.initDefaultOrderingField("cu.createdTime", PageOrdering.DESC);
-
- GWTServiceLookup.getConfigurationService().findResourceConfigurationUpdates(resourceId, null, null, true,
- lastFive, new AsyncCallback<PageList<ResourceConfigurationUpdate>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent configuration updates for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<ResourceConfigurationUpdate> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- int rowNum = 0;
- for (ResourceConfigurationUpdate update : result) {
- // config update history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentConfigurationContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getResourceConfigurationIcon(update
- .getStatus()), null);
- String linkTitle = MSG.view_resource_inventory_activity_changed_by() + " "
- + update.getSubjectName() + ":";
- if ((update.getSubjectName() == null) || (update.getSubjectName().trim().isEmpty())) {
- linkTitle = MSG.common_msg_changeAutoDetected();
- }
- LinkItem link = newLinkItem(linkTitle, LinkManager.getResourceLink(resourceId)
- + "/Configuration/History/" + update.getId());
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(update
- .getCreatedTime()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- //link to more details
- LocatableDynamicForm row = new LocatableDynamicForm(recentConfigurationContent
- .extendLocatorId(String.valueOf(rowNum++)));
- addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Configuration/History/",
- column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentConfigurationContent
- .extendLocatorId("None"), RECENT_CONFIGURATIONS_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentConfigurationContent.getChildren()) {
- child.destroy();
- }
- recentConfigurationContent.addChild(column);
- recentConfigurationContent.markForRedraw();
- }
- });
- }
-
- /** Fetches recent events and updates the DynamicForm instance with the latest
- * event information over last 24hrs.
- */
- private void getRecentEventUpdates() {
-
- final int resourceId = this.resourceComposite.getResource().getId();
- long now = System.currentTimeMillis();
- long nowMinus24Hours = now - (24 * 60 * 60 * 1000);
-
- GWTServiceLookup.getEventService().getEventCountsBySeverity(resourceId, nowMinus24Hours, now,
- new AsyncCallback<Map<EventSeverity, Integer>>() {
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent event counts for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(Map<EventSeverity, Integer> eventCounts) {
- //Now populated Tuples
- List<GwtTuple<EventSeverity, Integer>> results = new ArrayList<GwtTuple<EventSeverity, Integer>>();
- for (EventSeverity severity : eventCounts.keySet()) {
- int count = eventCounts.get(severity);
- if (count > 0) {
- results.add(new GwtTuple<EventSeverity, Integer>(severity, count));
- }
- }
- //build display
- VLayout column = new VLayout();
- column.setHeight(10);
-
- if (!results.isEmpty()) {
- int rowNum = 0;
- for (GwtTuple<EventSeverity, Integer> tuple : results) {
- // event history records do not have a usable locatorId, we'll use rownum, which is unique and
- // may be repeatable.
- LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent
- .extendLocatorId(String.valueOf(rowNum)));
- row.setNumCols(2);
- row.setWidth(10);//pack.
-
- //icon
- StaticTextItem iconItem = newTextItemIcon(ImageManager.getEventSeverityIcon(tuple
- .getLefty()), tuple.getLefty().name());
- //count
- StaticTextItem count = newTextItem(String.valueOf(tuple.righty));
- row.setItems(iconItem, count);
-
- column.addMember(row);
- }
- LocatableDynamicForm row = new LocatableDynamicForm(recentEventsContent.extendLocatorId(String
- .valueOf(rowNum++)));
- addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Events/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentEventsContent.extendLocatorId("None"),
- RECENT_EVENTS_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentEventsContent.getChildren()) {
- child.destroy();
- }
- recentEventsContent.addChild(column);
- recentEventsContent.markForRedraw();
- }
- });
- }
-
- /** Fetches OOB measurements and updates the DynamicForm instance with the latest 5
- * oob change details.
- */
- private void getRecentOobs() {
- final int resourceId = this.resourceComposite.getResource().getId();
- GWTServiceLookup.getMeasurementDataService().getHighestNOOBsForResource(resourceId, 5,
- new AsyncCallback<PageList<MeasurementOOBComposite>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent out of bound metrics for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<MeasurementOOBComposite> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (MeasurementOOBComposite oob : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentOobContent.extendLocatorId(oob
- .getScheduleName()));
- row.setNumCols(2);
-
- String title = oob.getScheduleName() + ":";
- String destination = "/resource/common/monitor/Visibility.do?m=" + oob.getDefinitionId()
- + "&id=" + resourceId + "&mode=chartSingleMetricSingleResource";
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(oob.getTimestamp()));
-
- row.setItems(link, time);
- column.addMember(row);
- }
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentOobContent.extendLocatorId("None"),
- RECENT_OOB_NONE);
- column.addMember(row);
- }
- recentOobContent.setContents("");
- for (Canvas child : recentOobContent.getChildren()) {
- child.destroy();
- }
- recentOobContent.addChild(column);
- recentOobContent.markForRedraw();
- }
- });
- }
-
- /** Fetches recent package history information and updates the DynamicForm instance with details.
- */
- private void getRecentPkgHistory() {
- final int resourceId = this.resourceComposite.getResource().getId();
- InstalledPackageCriteria criteria = new InstalledPackageCriteria();
- criteria.addFilterResourceId(resourceId);
- PageControl pageControl = new PageControl(0, 5);
- criteria.setPageControl(pageControl);
-
- GWTServiceLookup.getContentService().getInstalledPackageHistoryForResource(resourceId, 5,
- new AsyncCallback<PageList<InstalledPackageHistory>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving installed package history for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<InstalledPackageHistory> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (InstalledPackageHistory history : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentPkgHistoryContent
- .extendLocatorId(history.getPackageVersion().getFileName()
- + history.getPackageVersion().getVersion()));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon("subsystems/content/Package_16.png", null);
- String title = history.getPackageVersion().getFileName() + ":";
- String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + resourceId
- + "&selectedHistoryId=" + history.getId();
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter.format(history
- .getTimestamp()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- // //insert see more link
- // LocatableDynamicForm row = new LocatableDynamicForm(recentPkgHistoryContent
- // .extendLocatorId("RecentPkgHistorySeeMore"));
- // String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + resourceId;
- // addSeeMoreLink(row, destination, column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentPkgHistoryContent
- .extendLocatorId("None"), RECENT_PKG_HISTORY_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentPkgHistoryContent.getChildren()) {
- child.destroy();
- }
- recentPkgHistoryContent.addChild(column);
- recentPkgHistoryContent.markForRedraw();
- }
- });
- }
-
- /** Fetches recent metric information and updates the DynamicForm instance with i)sparkline information,
- * ii) link to recent metric graph for more details and iii) last metric value formatted to show significant
- * digits.
- */
- private void getRecentMetrics() {
- //display container
- final VLayout column = new VLayout();
- column.setHeight(10);//pack
- final int resourceId = this.resourceComposite.getResource().getId();
-
- //retrieve all relevant measurement definition ids.
- Set<MeasurementDefinition> definitions = this.resourceComposite.getResource().getResourceType()
- .getMetricDefinitions();
-
- //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
- final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
- for (MeasurementDefinition definition : definitions) {
- measurementDefMap.put(definition.getDisplayName(), definition);
- }
-
- //bundle definition ids for asynch call.
- int[] definitionArrayIds = new int[definitions.size()];
- final String[] displayOrder = new String[definitions.size()];
- measurementDefMap.keySet().toArray(displayOrder);
- //sort the charting data ex. Free Memory, Free Swap Space,..System Load
- Arrays.sort(displayOrder);
-
- //organize definitionArrayIds for ordered request on server.
- int index = 0;
- for (String definitionToDisplay : displayOrder) {
- definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay).getId();
- }
- //make the asynchronous call for all the measurement data
- GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId, definitionArrayIds,
- System.currentTimeMillis() - (1000L * 60 * 60 * 8), System.currentTimeMillis(), 60,
- new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent metrics charting data for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> results) {
- if (!results.isEmpty()) {
- boolean someChartedData = false;
- //iterate over the retrieved charting data
- for (int index = 0; index < displayOrder.length; index++) {
-
- //retrieve the correct measurement definition
- MeasurementDefinition md = measurementDefMap.get(displayOrder[index]);
-
- //load the data results for the given metric definition
- List<MeasurementDataNumericHighLowComposite> data = results.get(index);
-
- //locate last and minimum values.
- double lastValue = -1;
- double minValue = Double.MAX_VALUE;//
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- if (d.getValue() < minValue) {
- minValue = d.getValue();
- }
- lastValue = d.getValue();
- }
- }
-
- //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
- String commaDelimitedList = "";
-
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- commaDelimitedList += d.getValue() + ",";
- }
- }
- LocatableDynamicForm row = new LocatableDynamicForm(recentMeasurementsContent
- .extendLocatorId(md.getName()));
- row.setNumCols(3);
- HTMLFlow graph = new HTMLFlow();
- // String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0'>"
- // + commaDelimitedList + "</span>";
- String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0' "
- + "values='" + commaDelimitedList + "'>...</span>";
- graph.setContents(contents);
- graph.setContentsType(ContentsType.PAGE);
- //diable scrollbars on span
- graph.setScrollbarSize(0);
-
- CanvasItem graphContainer = new CanvasItem();
- graphContainer.setShowTitle(false);
- graphContainer.setHeight(16);
- graphContainer.setWidth(60);
- graphContainer.setCanvas(graph);
-
- //Link/title element
- //TODO: spinder, change link whenever portal.war/graphing is removed.
- String title = md.getDisplayName() + ":";
- String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
- + resourceId + "&m=" + md.getId();
- LinkItem link = newLinkItem(title, destination);
-
- //Value
- String convertedValue = lastValue + " " + md.getUnits();
- convertedValue = convertLastValueForDisplay(lastValue, md);
- StaticTextItem value = newTextItem(convertedValue);
-
- row.setItems(graphContainer, link, value);
- //if graph content returned
- if ((md.getName().trim().indexOf("Trait.") == -1) && (lastValue != -1)) {
- column.addMember(row);
- someChartedData = true;
- }
- }
- if (!someChartedData) {// when there are results but no chartable entries.
- LocatableDynamicForm row = createEmptyDisplayRow(recentMeasurementsContent
- .extendLocatorId("None"), RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
- } else {
- //insert see more link
- LocatableDynamicForm row = new LocatableDynamicForm(recentMeasurementsContent
- .extendLocatorId("RecentMeasurementsContentSeeMore"));
- addSeeMoreLink(row, ReportDecorator.GWT_RESOURCE_URL + resourceId + "/Monitoring/Graphs/",
- column);
- }
- //call out to 3rd party javascript lib
- BrowserUtility.graphSparkLines();
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentMeasurementsContent
- .extendLocatorId("None"), RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
- }
- }
- });
-
- //cleanup
- for (Canvas child : recentMeasurementsContent.getChildren()) {
- child.destroy();
- }
- recentMeasurementsContent.addChild(column);
- recentMeasurementsContent.markForRedraw();
- }
-
- /** Fetches recent bundle deployment information and updates the DynamicForm instance with details.
- */
- protected void getRecentBundleDeployments() {
- final int resourceId = this.resourceComposite.getResource().getId();
- ResourceBundleDeploymentCriteria criteria = new ResourceBundleDeploymentCriteria();
- PageControl pageControl = new PageControl(0, 5);
- criteria.setPageControl(pageControl);
- criteria.addFilterResourceIds(resourceId);
- criteria.addSortStatus(PageOrdering.DESC);
- criteria.fetchDestination(true);
- criteria.fetchBundleVersion(true);
- criteria.fetchResourceDeployments(true);
-
- GWTServiceLookup.getBundleService().findBundleDeploymentsByCriteria(criteria,
- new AsyncCallback<PageList<BundleDeployment>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving installed bundle deployments for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
-
- @Override
- public void onSuccess(PageList<BundleDeployment> result) {
- VLayout column = new VLayout();
- column.setHeight(10);
- if (!result.isEmpty()) {
- for (BundleDeployment deployment : result) {
- LocatableDynamicForm row = new LocatableDynamicForm(recentBundleDeployContent
- .extendLocatorId(deployment.getBundleVersion().getName()
- + deployment.getBundleVersion().getVersion()));
- row.setNumCols(3);
-
- StaticTextItem iconItem = newTextItemIcon("subsystems/content/Content_16.png", null);
- String title = deployment.getBundleVersion().getName() + "["
- + deployment.getBundleVersion().getVersion() + "]:";
-
- String destination = ReportDecorator.GWT_BUNDLE_URL
- + deployment.getBundleVersion().getBundle().getId() + "/destinations/"
- + deployment.getDestination().getId();
- LinkItem link = newLinkItem(title, destination);
- StaticTextItem time = newTextItem(GwtRelativeDurationConverter
- .format(deployment.getCtime()));
-
- row.setItems(iconItem, link, time);
- column.addMember(row);
- }
- //insert see more link
- //TODO: spinder:2/25/11 (add this later) no current view for seeing all bundle deployments
- // LocatableDynamicForm row = new LocatableDynamicForm(recentBundleDeployContent.extendLocatorId("RecentBundleContentSeeMore"));
- // addSeeMoreLink(row, LinkManager.getResourceGroupLink(groupId) + "/Events/History/", column);
- } else {
- LocatableDynamicForm row = createEmptyDisplayRow(recentBundleDeployContent
- .extendLocatorId("None"), RECENT_BUNDLE_DEPLOY_NONE);
- column.addMember(row);
- }
- //cleanup
- for (Canvas child : recentBundleDeployContent.getChildren()) {
- child.destroy();
- }
- recentBundleDeployContent.addChild(column);
- recentBundleDeployContent.markForRedraw();
- }
- });
- }
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/disambiguation/ReportDecorator.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/disambiguation/ReportDecorator.java
deleted file mode 100644
index 4e40077..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/disambiguation/ReportDecorator.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.rhq.enterprise.gui.coregui.client.resource.disambiguation;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.DisambiguationReport.Resource;
-import org.rhq.core.domain.resource.composite.DisambiguationReport.ResourceType;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.Messages;
-
-/**
- * Class handles some of the data decoration that used to be done for legacy struts
- * tags. See org.rhq.enterprise.gui.legacy.taglib.display.DisambiguatedResourceLineageDecorator and
- * org.rhq.enterprise.gui.legacy.taglib.display.DisambiguatedResourceLineageTag
- * for original functionality.
- *
- * @author Simeon Pinder
- */
-public class ReportDecorator {
-
- private static final Messages MSG = CoreGUI.getMessages();
-
- //TODO: pull value from more bookmarking/history definition
- public final static String GWT_RESOURCE_URL = "#Resource/";
- public final static String GWT_GROUP_URL = "#ResourceGroup/";
- public final static String GWT_BUNDLE_URL = "#Bundles/Bundle/";
- public static final String DEFAULT_SEPARATOR = " > ";
-
- /**
- * Generates HTML label that includes hyperlinks to each of the Resources in the linage from a DisambiguationReport.
- *
- * @param disambiguationReport a disambiguation report
- * @param resourceId the id of the Resource to which the disambiguation report corresponds
- * @param makeLink if true, the Resource name will be made into a link to go the Resource
- *
- * @return the HTML label
- */
- public static String decorateDisambiguationReport(DisambiguationReport disambiguationReport, int resourceId,
- boolean makeLink) {
- String parentsHtml = decorateResourceLineage(disambiguationReport.getParents(), true);
- String resourceHtml = ReportDecorator.decorateResourceName(ReportDecorator.GWT_RESOURCE_URL,
- disambiguationReport.getResourceType(), disambiguationReport.getName(), resourceId, makeLink);
- String label;
- if (parentsHtml.length() >= 1) {
- label = parentsHtml + ReportDecorator.DEFAULT_SEPARATOR + resourceHtml;
- } else {
- label = resourceHtml;
- }
- return label;
- }
-
- /**
- * Generates HTML label from DisambiguationReport data.
- *
- * @param type ResourceType - If !null, the ResourceType name is prepended to result.
- * @param resourceName Name of the element from report
- * @param resourceId Id for resource
- * @param makeLink if true, the Resource name will be made into a link to go the Resource
- *
- * @return String of generated html for a ResourceName.
- */
- public static String decorateResourceName(String specificUrl, ResourceType type, String resourceName,
- int resourceId, boolean makeLink) {
- String decorated = "";
- if (type != null) {
- decorated += type.getName();
- if (type.getPlugin() != null) {
- decorated += " " + MSG.util_disambiguationReportDecorator_pluginSuffix(type.getPlugin());
- }
- decorated += " ";
- }
-
- if (makeLink) {
- decorated += "<a href=\"" + specificUrl + resourceId + "\">";
- }
- decorated += resourceName;
- if (makeLink) {
- decorated += "</a>";
- }
-
- return decorated;
- }
-
- /**
- * Generates HTML label of Resource Lineage for disambiguation.
- *
- * @param parents ResourceLineage provided by DisambiguationReport.
- * @param makeLink if true, the Resource name will be made into a link to go the Resource
- *
- * @return String of generated html for ResourceLineage.
- */
- public static String decorateResourceLineage(List<Resource> parents, boolean makeLink) {
- StringBuilder decorated = new StringBuilder();
- if (parents != null && parents.size() > 0) {
-
- Iterator<DisambiguationReport.Resource> it = parents.iterator();
- DisambiguationReport.Resource parent = it.next();
- //generate first link
- String parentUrl = ReportDecorator.decorateResourceName(GWT_RESOURCE_URL, null, parent.getName(), parent
- .getId(), true);
- decorated = writeResource(decorated, parentUrl, parent.getType());
- while (it.hasNext()) {
- decorated.append(DEFAULT_SEPARATOR);
- parent = it.next();
- decorated = writeResource(decorated, ReportDecorator.decorateResourceName(GWT_RESOURCE_URL, null,
- parent.getName(), parent.getId(), makeLink), parent.getType());
-
- }
- }
- return decorated.toString();
- }
-
- /**
- * Appends resource lineage details with HTML anchors.
- *
- * @param existing
- * @param url
- * @param resourceType
- * @return
- */
- private static StringBuilder writeResource(StringBuilder existing, String url, ResourceType resourceType) {
- if (!resourceType.isSingleton()) {
- existing.append(resourceType.getName()).append(" ");
-
- if (resourceType.getPlugin() != null) {
- existing.append(MSG.util_disambiguationReportDecorator_pluginSuffix(resourceType.getPlugin()));
- }
- }
-
- if (url != null) {
- existing.append(url);
- }
-
- if (resourceType.isSingleton() && resourceType.getPlugin() != null) {
- existing.append(" ").append(MSG.util_disambiguationReportDecorator_pluginSuffix(resourceType.getPlugin()));
- }
- return existing;
- }
-
-}
commit 47863657731b18878a50252743504ac825299636
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Apr 19 15:08:41 2011 +0200
Put the Domain below the DomainController node and remove the separate domain node. Also add some more properties.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
index f03f62c..72ab4dd 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
@@ -67,6 +67,7 @@ import org.rhq.modules.plugins.jbossas7.json.Result;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -316,13 +317,16 @@ public class BaseComponent implements ResourceComponent, MeasurementFacet, Confi
} // end List of ..
else if (propDef instanceof PropertyDefinitionMap) {
PropertyDefinitionMap mapDef = (PropertyDefinitionMap) propDef;
+ PropertyMap pm = new PropertyMap(mapDef.getName());
+
Map<String,PropertyDefinition> memberDefMap = mapDef.getPropertyDefinitions();
for (Map.Entry<String,PropertyDefinition> maEntry : memberDefMap.entrySet()) {
JsonNode valueNode = json.findValue(maEntry.getKey());
- System.out.println(valueNode);
PropertySimple p = putProperty(valueNode,maEntry.getValue());
- ret.put(p);
+ System.out.println(p);
+ pm.put(p);
}
+ ret.put(pm);
}
}
@@ -496,6 +500,99 @@ public class BaseComponent implements ResourceComponent, MeasurementFacet, Confi
@Override
public OperationResult invokeOperation(String name,
Configuration parameters) throws InterruptedException, Exception {
- return null; // TODO: Customise this generated block
+
+ if (!name.contains(":")) {
+ OperationResult badName = new OperationResult("Operation name did not contain a ':'");
+ badName.setErrorMessage("Operation name did not contain a ':'");
+ return badName;
+ }
+
+ int colonPos = name.indexOf(':');
+ String what = name.substring(0, colonPos);
+ String op = name.substring(colonPos+1);
+ Operation operation=null;
+
+ List<PROPERTY_VALUE> address = new ArrayList<PROPERTY_VALUE>();
+
+ if (what.equals("server-group")) {
+ String groupName = parameters.getSimpleValue("name",null);
+ String profile = parameters.getSimpleValue("profile","default");
+
+ address.add(new PROPERTY_VALUE("server-group",groupName));
+
+ operation = new Operation(op,address,"profile",profile);
+ } else if (what.equals("server")) {
+
+ if (context.getResourceType().getName().equals("JBossAS-Managed")) {
+ String host = conf.getSimpleValue("domainHost","local");
+ address.add(new PROPERTY_VALUE("host",host));
+ address.add(new PROPERTY_VALUE("server-config",myServerName));
+ operation = new Operation(op,address);
+ }
+ else if (context.getResourceType().getName().equals("Host")) {
+ address.addAll(pathToAddress(getPath()));
+ String serverName = parameters.getSimpleValue("name",null);
+ address.add(new PROPERTY_VALUE("server-config",serverName));
+ Map<String,Object> props = new HashMap<String, Object>();
+ String serverGroup = parameters.getSimpleValue("group",null);
+ props.put("group",serverGroup);
+ if (op.equals("add")) {
+ props.put("name",serverName);
+ boolean autoStart = parameters.getSimple("auto-start").getBooleanValue();
+ props.put("auto-start",autoStart);
+ // TODO put more properties in
+ }
+
+ operation = new Operation(op,address,props);
+ }
+ } else if (what.equals("destination")) {
+ address.addAll(pathToAddress(getPath()));
+ String newName = parameters.getSimpleValue("name","");
+// String type = parameters.getSimpleValue("type","Queue").toLowerCase();
+// address.add(new PROPERTY_VALUE(type,newName));
+ String queueName = parameters.getSimpleValue("queue-address","");
+ Map<String,Object> props = new HashMap<String, Object>();
+ props.put("queue-address",queueName);
+ operation = new Operation(op,address);
+ } else if (what.equals("managed-server")) {
+ String chost = parameters.getSimpleValue("hostname","");
+ String serverName = parameters.getSimpleValue("servername","");
+ String serverGroup = parameters.getSimpleValue("server-group","");
+ String socketBindings = parameters.getSimpleValue("socket-bindings","");
+ String portS = parameters.getSimpleValue("port-offset","0");
+ int port = Integer.parseInt(portS);
+ String autostartS = parameters.getSimpleValue("auto-start","false");
+ boolean autoStart = Boolean.getBoolean(autostartS);
+
+ address.add(new PROPERTY_VALUE("host", chost));
+ address.add(new PROPERTY_VALUE("server-config",serverName));
+ Map<String,Object> props = new HashMap<String, Object>();
+ props.put("name",serverName);
+ props.put("group",serverGroup);
+ props.put("socket-binding-group",socketBindings);
+ props.put("socket-binding-port-offset",port);
+ props.put("auto-start",autoStart);
+
+ operation = new Operation(op,address,props);
+ } else if (what.equals("domain")) {
+ operation = new Operation(op,Collections.<PROPERTY_VALUE>emptyList());
+ }
+
+ OperationResult operationResult = new OperationResult();
+ if (operation!=null) {
+ JsonNode result = connection.executeRaw(operation);
+
+ if (ASConnection.isErrorReply(result)) {
+ operationResult.setErrorMessage(ASConnection.getFailureDescription(result));
+ }
+ else {
+ operationResult.setSimpleResult(ASConnection.getSuccessDescription(result));
+ }
+ }
+ else {
+ operationResult.setErrorMessage("No valid operation was given");
+ }
+ // TODO throw an exception if the operation failed?
+ return operationResult;
}
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index 8d9ff0f..2f71edb 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -76,6 +76,7 @@ public class BaseProcessDiscovery extends AbstractBaseDiscovery implements Resou
String serverNameFull;
String serverName;
String psName = psr.getProcessScan().getName();
+ String description = discoveryContext.getResourceType().getDescription();
if (psName.equals("ProcessController")) {
serverNameFull = "ProcessController";
serverName = "ProcessController";
@@ -85,6 +86,7 @@ public class BaseProcessDiscovery extends AbstractBaseDiscovery implements Resou
if (hp.isLocal) {
serverName = "DomainController";
serverNameFull = "DomainController";
+ description = "Domain controller for an AS7 domain";
}
else {
serverName = "HostController";
@@ -138,7 +140,7 @@ public class BaseProcessDiscovery extends AbstractBaseDiscovery implements Resou
serverNameFull, // key TODO distinguish per domain?
serverName, // Name
null, // TODO real version ?
- discoveryContext.getResourceType().getDescription(), // Description
+ description, // Description
config,
psr.getProcessInfo()
);
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
index 1d73822..35425e3 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
@@ -68,100 +68,4 @@ public class DomainComponent extends BaseComponent implements OperationFacet{
return super.getAvailability(); // TODO: Customise this generated block
}
- @Override
- public OperationResult invokeOperation(String name,
- Configuration parameters) throws InterruptedException, Exception {
-
- if (!name.contains(":")) {
- OperationResult badName = new OperationResult("Operation name did not contain a ':'");
- badName.setErrorMessage("Operation name did not contain a ':'");
- return badName;
- }
-
- int colonPos = name.indexOf(':');
- String what = name.substring(0, colonPos);
- String op = name.substring(colonPos+1);
- Operation operation=null;
-
- List<PROPERTY_VALUE> address = new ArrayList<PROPERTY_VALUE>();
-
- if (what.equals("server-group")) {
- String groupName = parameters.getSimpleValue("name",null);
- String profile = parameters.getSimpleValue("profile","default");
-
- address.add(new PROPERTY_VALUE("server-group",groupName));
-
- operation = new Operation(op,address,"profile",profile);
- } else if (what.equals("server")) {
-
- if (context.getResourceType().getName().equals("JBossAS-Managed")) {
- String host = conf.getSimpleValue("domainHost","local");
- address.add(new PROPERTY_VALUE("host",host));
- address.add(new PROPERTY_VALUE("server-config",myServerName));
- operation = new Operation(op,address);
- }
- else if (context.getResourceType().getName().equals("Host")) {
- address.addAll(pathToAddress(getPath()));
- String serverName = parameters.getSimpleValue("name",null);
- address.add(new PROPERTY_VALUE("server-config",serverName));
- Map<String,Object> props = new HashMap<String, Object>();
- String serverGroup = parameters.getSimpleValue("group",null);
- props.put("group",serverGroup);
- if (op.equals("add")) {
- props.put("name",serverName);
- boolean autoStart = parameters.getSimple("auto-start").getBooleanValue();
- props.put("auto-start",autoStart);
- // TODO put more properties in
- }
-
- operation = new Operation(op,address,props);
- }
- } else if (what.equals("destination")) {
- address.addAll(pathToAddress(getPath()));
- String newName = parameters.getSimpleValue("name","");
-// String type = parameters.getSimpleValue("type","Queue").toLowerCase();
-// address.add(new PROPERTY_VALUE(type,newName));
- String queueName = parameters.getSimpleValue("queue-address","");
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("queue-address",queueName);
- operation = new Operation(op,address);
- } else if (what.equals("managed-server")) {
- String chost = parameters.getSimpleValue("hostname","");
- String serverName = parameters.getSimpleValue("servername","");
- String serverGroup = parameters.getSimpleValue("server-group","");
- String socketBindings = parameters.getSimpleValue("socket-bindings","");
- String portS = parameters.getSimpleValue("port-offset","0");
- int port = Integer.parseInt(portS);
- String autostartS = parameters.getSimpleValue("auto-start","false");
- boolean autoStart = Boolean.getBoolean(autostartS);
-
- address.add(new PROPERTY_VALUE("host", chost));
- address.add(new PROPERTY_VALUE("server-config",serverName));
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("name",serverName);
- props.put("group",serverGroup);
- props.put("socket-binding-group",socketBindings);
- props.put("socket-binding-port-offset",port);
- props.put("auto-start",autoStart);
-
- operation = new Operation(op,address,props);
- }
-
- OperationResult operationResult = new OperationResult();
- if (operation!=null) {
- JsonNode result = connection.executeRaw(operation);
-
- if (ASConnection.isErrorReply(result)) {
- operationResult.setErrorMessage(ASConnection.getFailureDescription(result));
- }
- else {
- operationResult.setSimpleResult(ASConnection.getSuccessDescription(result));
- }
- }
- else {
- operationResult.setErrorMessage("No valid operation was given");
- }
- // TODO throw an exception if the operation failed?
- return operationResult;
- }
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java
deleted file mode 100644
index a8b1058..0000000
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.modules.plugins.jbossas7;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ProcessScanResult;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.core.system.ProcessInfo;
-
-/**
- * Discover the domain. This is done by scanning for host controllers.
- * If they are also DC, the domain-controller element points to local.
- *
- * @author Heiko W. Rupp
- */
-@SuppressWarnings("unused")
-public class DomainDiscovery extends AbstractBaseDiscovery<BaseComponent> {
-
- private final Log log = LogFactory.getLog(this.getClass());
-
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<BaseComponent> context)
- throws Exception {
-
- Set<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>(1);
-
-
- List<ProcessScanResult> scans = context.getAutoDiscoveredProcesses();
-
- for (ProcessScanResult psr : scans) {
-
- // get the HostController, to find host.xml
- String psName = psr.getProcessScan().getName();
- if (!psName.equals("HostController"))
- continue;
-
- // Now we have the host controller, lets get the host.xml file
- // and obtain the domain controller info from there
- ProcessInfo processInfo = psr.getProcessInfo();
- readHostXml(processInfo,true);
- HostPort dcHp = getDomainControllerFromHostXml();
-
- if (!dcHp.isLocal) {
- log.info("Domain controller is not local, but at " + dcHp);
- continue;
- }
-
- // Ok, this is a domain controller, so we can return a Domain resource.
-
- // Get the management port and save for later use
- HostPort managementHostPort = getManagementPortFromHostXml();
- Configuration config = context.getDefaultPluginConfiguration();
- config.put(new PropertySimple("port",managementHostPort.port));
- config.put(new PropertySimple("hostname",managementHostPort.host));
-
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
- context.getResourceType(), // DataType
- "Domain", // Key
- "Domain", // Name
- null, // Version
- context.getResourceType().getDescription(), // Description
- config,
- null);
- details.add(detail);
- }
- return details;
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 80df496..04686c4 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -96,32 +96,9 @@
<process-scan name="HostController" query="process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*"/>
- <operation name="shutdown" description="Shut this Host-/Domaincontroller down with all managed servers.">
+ <operation name="domain:shutdown" displayName="Shutdown Domain" description="Shut this Host-/Domaincontroller down with all managed servers.">
</operation>
-
- </server>
-
- <server name="Domain"
- discovery="DomainDiscovery"
- class="DomainComponent"
- description="An AS7 management profile">
-
- <subcategories>
- <subcategory name="Integration" />
- <subcategory name="Core"/>
- <subcategory name="Web"/>
- </subcategories>
-
- <plugin-configuration>
- <c:simple-property name="hostname" default="localhost" displayName="Management host" required="true"/>
- <c:simple-property name="port" default="9990" type="integer" displayName="Management port" required="true"/>
- </plugin-configuration>
-
- <!-- Scan for host controller is intentional -->
- <process-scan name="HostController" query="process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*"/>
-
-
<operation name="server-group:add" displayName="Add ServerGroup" description="Add a server group to the Domain.">
<parameters>
<c:simple-property name="name" description="Name of Group to add"/>
@@ -556,18 +533,75 @@
</plugin-configuration>
<resource-configuration>
- <c:map-property name="configuration">
- <c:simple-property name="connection-url"/>
- <c:simple-property name="driver-class"/>
- <c:simple-property name="jndi-name"/>
- <c:simple-property name="driver"/>
- <c:simple-property name="pool-name"/>
- <c:simple-property name="use-java-context" type="boolean"/>
- <c:simple-property name="enabled" type="boolean"/>
- <c:simple-property name="user-name"/>
- <c:simple-property name="password"/>
- <!-- TODO more when they become available in the AS -->
- </c:map-property>
+ <c:simple-property name="connection-url" required="true" type="string" readOnly="true" description="The JDBC driver connection URL"/>
+ <c:simple-property name="driver-class" required="true" type="string" readOnly="true"
+ description="The fully qualifed name of the JDBC driver class"/>
+ <c:simple-property name="jndi-name" required="true" type="string" readOnly="true"
+ description="Specifies the JNDI name for the datasource"/>
+ <c:simple-property name="driver" required="true" type="string" readOnly="true"
+ description="Defines the JDBC driver the datasource should use with this format: <driver-name>#<major-version>.<minor-version> where <driver-name> is the fully qualifed name of the JDBC driver class"/>
+ <c:simple-property name="new-connection-sql" type="string" readOnly="true"
+ description="Specifies an SQL statement to execute whenever a connection is added to the connection pool."/>
+ <c:simple-property name="pool-name" type="string" readOnly="true"
+ description="Specifies the pool name for the datasource used for management"/>
+ <c:simple-property name="url-delimiter" type="string" readOnly="true"
+ description="Specifies the delimeter for URLs in connection-url for HA datasources"/>
+ <c:simple-property name="url-selector-strategy-class-name" type="string" readOnly="true"
+ description="A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy"/>
+ <c:simple-property name="use-java-context" type="boolean" readOnly="true"
+ description="Setting this to false will bind the DataSource into global JNDI;"/>
+ <c:simple-property name="enabled" type="string" readOnly="true" description="Specifies if the datasource should be enabled"/>
+ <c:simple-property name="max-pool-size" type="integer" readOnly="false"
+ description="The max-pool-size element indicates the maximum number of connections for a pool. No more connections will be created in each sub-pool."/>
+ <c:simple-property name="min-pool-size" type="integer" readOnly="false"
+ description="The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection."/>
+ <c:simple-property name="pool-prefill" type="boolean" readOnly="false"
+ description="Whether to attempt to prefill the connection pool. Changing this value require a server restart."/>
+ <c:simple-property name="pool-use-strict-min" type="boolean" readOnly="false"
+ description="Define if the min-pool-size should be considered a strictly."/>
+ <c:simple-property name="user-name" type="string" readOnly="true"
+ description="Specify the username used when creating a new connection."/>
+ <c:simple-property name="password" type="password" readOnly="true"
+ description="Specify the passwprd used when creating a new connection."/>
+ <c:simple-property name="prepared-statements-cacheSize" type="long" readOnly="true"
+ description="The number of prepared statements per connection in an LRU cache"/>
+ <c:simple-property name="share-prepared-statements" type="boolean" readOnly="true"
+ description="Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement"/>
+ <c:simple-property name="track-statements" type="string" readOnly="true"
+ description="Whether to check for unclosed statements when a connection is returned to the pool and result sets are closed when a statement is closed/return to the prepared statement cache. valid values are: false - do not track statements and results true - track statements and result sets and warn when they are not closed nowarn - track statements but do no warn about them being unclosed"/>
+ <c:simple-property name="allocation-retry" type="integer" readOnly="true"
+ description="The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception."/>
+ <c:simple-property name="allocation-retry-wait-millis" type="long" readOnly="true"
+ description="Indicates the time in milliseconds to wait between retrying to allocate a connection."/>
+ <c:simple-property name="blocking-timeout-wait-millis" type="long" readOnly="false"
+ description="The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time."/>
+ <c:simple-property name="idle-timeout-minutes" type="long" readOnly="false"
+ description="The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool. Changing this value require a server restart."/>
+ <c:simple-property name="query-timeout" type="long" readOnly="true"
+ description="Any configured query timeout in seconds The default is no timeout"/>
+ <c:simple-property name="use-try-lock" type="long" readOnly="true"
+ description="Any configured timeout for internal locks on the resource adapter objects in seconds"/>
+ <c:simple-property name="set-tx-query-timeout" type="boolean" readOnly="true"
+ description="Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction."/>
+ <c:simple-property name="transaction-isolation" type="string" readOnly="true"
+ description="Set java.sql.Connection transaction isolation level to use. The constants defined by transaction-isolation-values are the possible transaction isolation levels and include: TRANSACTION_READ_UNCOMMITTED TRANSACTION_READ_COMMITTED TRANSACTION_REPEATABLE_READ TRANSACTION_SERIALIZABLE TRANSACTION_NONE"/>
+ <c:simple-property name="check-valid-connection-sql" type="string" readOnly="true"
+ description="Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is taken from pool for use."/>
+ <c:simple-property name="exception-sorter-class-name" type="string" readOnly="true"
+ description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides a boolean isExceptionFatal(SQLException e) method to validate is an exception should be broadcast to all javax.resource.spi.ConnectionEventListener as a connectionErrorOccurred"/>
+ <c:simple-property name="stale-connection-checker-class-name" type="string" readOnly="true"
+ description="An org.jboss.jca.adapters.jdbc.StaleConnectionChecker that provides a boolean isStaleConnection(SQLException e) method which if it it returns true will wrap the exception in an org.jboss.jca.adapters.jdbc.StaleConnectionException"/>
+ <c:simple-property name="valid-connection-checker-class-name" type="string" readOnly="true"
+ description="An org.jboss.jca.adapters.jdbc.ValidConnectionChecker that provides a SQLException isValidConnection(Connection e) method to validate is a connection is valid. An exception means the connection is destroyed. This overrides the check-valid-connection-sql when present."/>
+ <c:simple-property name="background-validation-minutes" type="long" readOnly="false"
+ description="The background-validation-minutes element specifies the amount of time, in minutes, that background validation will run. Changing this value require a server restart."/>
+ <c:simple-property name="background-validation" type="boolean" readOnly="false"
+ description="An element to specify that connections should be validated on a background thread versus being validated prior to use. Changing this value require a server restart."/>
+ <c:simple-property name="use-fast-fail" type="boolean" readOnly="false"
+ description="Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false)"/>
+ <c:simple-property name="validate-on-match" type="boolean" readOnly="true"
+ description="The validate-on-match element indicates whether or not connection level validation should be done when a connection factory attempts to match a managed connection for a given set. This is typically exclusive to the use of background validation"/>
+ <c:simple-property name="spy" type="boolean" readOnly="true" description="whatever spy or not the jdbc connection"/>
</resource-configuration>
</service>
@@ -595,13 +629,73 @@
</server>
+ <server name="Threads"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <runs-inside>
+ <parent-resource-type name="Profile" plugin="jboss-as-7"/>
+ <parent-resource-type name="JBossAS7-Standalone" plugin="jboss-as-7"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="subsystem=threads"/>
+ </plugin-configuration>
+
+ <service name="ThreadFactory"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="thread-factory"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="name" required="true" type="string" readOnly="true" description="The bean name of the created thread factory."/>
+ <c:simple-property name="group-name" type="string" readOnly="false"
+ description="Specifies the name of a the thread group to create for this thread factory."/>
+ <c:simple-property name="thread-name-pattern" type="string" readOnly="false"
+ description="The template used to create names for threads. The following patterns may be used:
+ %% - emit a percent sign
+ %t - emit the per-factory thread sequence number
+ %g - emit the global thread sequence number
+ %f - emit the factory sequence number
+ %i - emit the thread ID."/>
+ <c:simple-property name="priority" type="integer" readOnly="false"
+ description="May be used to specify the thread priority of created threads."/>
+ <c:list-property name="properties" >
+ <c:simple-property name="properties" /> <!-- TODO list of maps ? -->
+ </c:list-property>
+ </resource-configuration>
+ </service>
+
+ <service name="ThreadPool"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="bounded-queue-thread-pool|queueless-thread-pool|scheduled-thread-pool|unbounded-queue-thread-pool"/>
+ </plugin-configuration>
+ </service>
+
+
+
+
+ </server>
+
<service name="NetworkInterface"
discovery="SubsystemDiscovery"
class="BaseComponent"
description="A named network interface, along with required criteria for determining the IP address to associate with that interface">
<runs-inside>
- <parent-resource-type name="Domain" plugin="jboss-as-7"/>
+ <parent-resource-type name="HostController" plugin="jboss-as-7"/>
<parent-resource-type name="Host" plugin="jboss-as-7"/>
<parent-resource-type name="JBossAS7-Standalone" plugin="jboss-as-7"/>
</runs-inside>
@@ -616,7 +710,7 @@
class="BaseComponent"
>
<runs-inside>
- <parent-resource-type name="Domain" plugin="jboss-as-7"/>
+ <parent-resource-type name="HostController" plugin="jboss-as-7"/>
<parent-resource-type name="JBossAS7-Standalone" plugin="jboss-as-7"/>
</runs-inside>
commit 1836aaeb25e1390dfe55c2248f96c685c9d8f7c2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 18 18:21:31 2011 -0400
reverse sort config updates by id on group config history view (https://bugzilla.redhat.com/show_bug.cgi?id=697691)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
index 770753a..1376976 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
@@ -11,7 +11,9 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -89,9 +91,16 @@ public class GroupResourceConfigurationDataSource extends
@Override
protected GroupResourceConfigurationUpdateCriteria getFetchCriteria(final DSRequest request) {
GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
- ArrayList<Integer> groupList = new ArrayList<Integer>(1);
- groupList.add(this.groupId);
- criteria.addFilterResourceGroupIds(groupList);
+
+ ArrayList<Integer> groupIds = new ArrayList<Integer>(1);
+ groupIds.add(this.groupId);
+ criteria.addFilterResourceGroupIds(groupIds);
+
+ PageControl pageControl = getPageControl(request);
+ pageControl.addDefaultOrderingField(Field.ID, PageOrdering.DESC);
+ criteria.setPageControl(pageControl);
+
return criteria;
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
index f797849..6e7af45 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
@@ -163,9 +163,9 @@ public class ConfigurationHistoryDataSource extends
criteria.fetchResource(true);
criteria.fetchGroupConfigurationUpdate(true);
- PageControl pc = getPageControl(request);
- pc.addDefaultOrderingField(Field.ID, PageOrdering.DESC);
- criteria.setPageControl(pc);
+ PageControl pageControl = getPageControl(request);
+ pageControl.addDefaultOrderingField(Field.ID, PageOrdering.DESC);
+ criteria.setPageControl(pageControl);
final Integer resourceId = (Integer) request.getCriteria().getValues().get(CriteriaField.RESOURCE_ID);
if (resourceId != null) {
commit 724d528792b2585ed8a198e63b7d3c77125e1e2c
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 18 18:01:38 2011 -0400
for exceptions that are caught during attempts to schedule system jobs, log e.toString(), rather than e.getMessage(), so the exception class name is included in the log message
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java
index 0799f70..3ad7c7c 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java
@@ -159,7 +159,7 @@ public class StartupServlet extends HttpServlet {
if (ServerCommunicationsServiceUtil.getService().getMaintenanceModeAtStartup()) {
log("Server is configured to start up in MAINTENANCE mode");
Server server = serverManager.getServer();
- Integer[] serverId = new Integer[] { new Integer(server.getId()) };
+ Integer[] serverId = new Integer[] { server.getId() };
LookupUtil.getCloudManager().updateServerMode(serverId, OperationMode.MAINTENANCE);
}
@@ -190,7 +190,7 @@ public class StartupServlet extends HttpServlet {
server = new Server();
server.setName(identity);
- String address = "localhost";
+ String address;
try {
address = InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException e) {
@@ -308,10 +308,11 @@ public class StartupServlet extends HttpServlet {
// agents will not realize the server has bounced and will not know to re-connect. When this
// happens the server's caches will not be refreshed and bad things will happen (e.g. alerts not firing).
// make sure we are down for a certain amount of time to ensure the agent's know the server was down.
- long ensureDownTimeSecs = 70;
+ long ensureDownTimeSecs;
try {
ensureDownTimeSecs = Long.parseLong(System.getProperty("rhq.server.ensure-down-time-secs", "70"));
} catch (Exception e) {
+ ensureDownTimeSecs = 70;
}
long elapsed = getElapsedTimeSinceStartup();
long sleepTime = (ensureDownTimeSecs * 1000L) - elapsed;
@@ -363,7 +364,7 @@ public class StartupServlet extends HttpServlet {
scheduler.scheduleSimpleRepeatingJob(SavedSearchResultCountRecalculationJob.class, true, false,
initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule asynchronous resource deletion job: " + e.getMessage());
+ log("Cannot schedule asynchronous resource deletion job: " + e);
}
try {
@@ -372,7 +373,7 @@ public class StartupServlet extends HttpServlet {
final long interval = 1000L * 60 * 5;
scheduler.scheduleSimpleRepeatingJob(AsyncResourceDeleteJob.class, true, false, initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule asynchronous resource deletion job: " + e.getMessage());
+ log("Cannot schedule asynchronous resource deletion job: " + e);
}
try {
@@ -381,7 +382,7 @@ public class StartupServlet extends HttpServlet {
final long interval = 1000L * 60 * 5;
scheduler.scheduleSimpleRepeatingJob(PurgeResourceTypesJob.class, true, false, initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule purge resource types job: " + e.getMessage());
+ log("Cannot schedule purge resource types job: " + e);
}
try {
@@ -390,7 +391,7 @@ public class StartupServlet extends HttpServlet {
final long interval = 1000L * 60 * 5;
scheduler.scheduleSimpleRepeatingJob(PurgePluginsJob.class, true, false, initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule purge plugins job: " + e.getMessage());
+ log("Cannot schedule purge plugins job: " + e);
}
// DynaGroup Auto-Recalculation Job
@@ -401,7 +402,7 @@ public class StartupServlet extends HttpServlet {
scheduler.scheduleSimpleRepeatingJob(DynaGroupAutoRecalculationJob.class, true, false, initialDelay,
interval);
} catch (Exception e) {
- log("Cannot schedule DynaGroup auto-recalculation job: " + e.getMessage());
+ log("Cannot schedule DynaGroup auto-recalculation job: " + e);
}
// Cluster Manager Job
@@ -419,7 +420,7 @@ public class StartupServlet extends HttpServlet {
final long interval = 1000L * 30; // 30 secs
scheduler.scheduleSimpleRepeatingJob(CloudManagerJob.class, true, false, initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule cloud management job: " + e.getMessage());
+ log("Cannot schedule cloud management job: " + e);
}
// Suspected Agents Job
@@ -429,7 +430,7 @@ public class StartupServlet extends HttpServlet {
final long interval = 1000L * 60; // 60 secs
scheduler.scheduleSimpleRepeatingJob(CheckForSuspectedAgentsJob.class, true, false, initialDelay, interval);
} catch (Exception e) {
- log("Cannot schedule suspected Agents job: " + e.getMessage());
+ log("Cannot schedule suspected Agents job: " + e);
}
// Timed Out Operations Job
@@ -439,7 +440,7 @@ public class StartupServlet extends HttpServlet {
scheduler.scheduleSimpleRepeatingJob(CheckForTimedOutOperationsJob.class, true, false, initialDelay,
interval);
} catch (Exception e) {
- log("Cannot schedule check-for-timed-out-operations job: " + e.getMessage());
+ log("Cannot schedule check-for-timed-out-operations job: " + e);
}
// Timed Out Resource Configuration Update Requests Job
@@ -450,7 +451,7 @@ public class StartupServlet extends HttpServlet {
scheduler.scheduleSimpleRepeatingJob(CheckForTimedOutConfigUpdatesJob.class, true, false, initialDelay,
interval);
} catch (Exception e) {
- log("Cannot schedule check-for-timed-out-configuration-update-requests job: " + e.getMessage());
+ log("Cannot schedule check-for-timed-out-configuration-update-requests job: " + e);
}
// Timed Out Content Requests Job
@@ -460,7 +461,7 @@ public class StartupServlet extends HttpServlet {
scheduler.scheduleSimpleRepeatingJob(CheckForTimedOutContentRequestsJob.class, true, false, initialDelay,
interval);
} catch (Exception e) {
- log("Cannot schedule check-for-timed-out-artifact-requests job: " + e.getMessage());
+ log("Cannot schedule check-for-timed-out-artifact-requests job: " + e);
}
// Data Purge Job
@@ -473,7 +474,7 @@ public class StartupServlet extends HttpServlet {
String cronString = "0 0 * * * ?"; // every hour, on the hour
scheduler.scheduleSimpleCronJob(DataPurgeJob.class, true, false, cronString);
} catch (Exception e) {
- log("Cannot schedule data purge job: " + e.getMessage());
+ log("Cannot schedule data purge job: " + e);
}
// Server Plugin Jobs
@@ -482,7 +483,7 @@ public class StartupServlet extends HttpServlet {
MasterServerPluginContainer masterPC = mbean.getMasterPluginContainer();
masterPC.scheduleAllPluginJobs();
} catch (Exception e) {
- log("Cannot schedule server plugin jobs: " + e.getMessage());
+ log("Cannot schedule server plugin jobs: " + e);
}
return;
commit 0017b13a9847e29c9140cbcd13fd00506a808d68
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 18 17:37:38 2011 -0400
update the group resource config job so that is updates the group update status from in-progress to success or failure once all member updates have completed (https://bugzilla.redhat.com/show_bug.cgi?id=697061)
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java
index f7f4bee..c2d4767 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java
@@ -95,6 +95,11 @@ import org.rhq.core.domain.resource.Resource;
+ "SELECT cu.id " //
+ " FROM ResourceConfigurationUpdate cu " //
+ " WHERE cu.groupConfigurationUpdate.id = :groupConfigurationUpdateId"),
+ @NamedQuery(name = ResourceConfigurationUpdate.QUERY_FIND_STATUS_BY_PARENT_UPDATE_ID, query = "" //
+ + "SELECT cu.status " //
+ + " FROM ResourceConfigurationUpdate cu " //
+ + " WHERE cu.groupConfigurationUpdate.id = :groupConfigurationUpdateId " //
+ + " GROUP BY cu.status"), //
@NamedQuery(name = ResourceConfigurationUpdate.QUERY_FIND_ALL_COMPOSITES_ADMIN, query = "" //
+ " SELECT new org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite" //
+ " ( cu.id, cu.status, cu.errorMessage, cu.subjectName, cu.createdTime, cu.modifiedTime, " // update w/o config
@@ -178,6 +183,7 @@ public class ResourceConfigurationUpdate extends AbstractResourceConfigurationUp
public static final String QUERY_FIND_BY_PARENT_UPDATE_ID_AND_STATUS = "ResourceConfigurationUpdate.findByParentUpdateIdAndStatus";
public static final String QUERY_FIND_COMPOSITE_BY_PARENT_UPDATE_ID = "ResourceConfigurationUpdate.findCompositeByParentUpdateId";
public static final String QUERY_FIND_BY_PARENT_UPDATE_ID = "ResourceConfigurationUpdate.findByParentUpdateId";
+ public static final String QUERY_FIND_STATUS_BY_PARENT_UPDATE_ID = "ResourceConfigurationUpdate.findStatusByParentUpdateId";
// for subsystem views
public static final String QUERY_FIND_ALL_COMPOSITES = "ResourceConfigurationUpdate.findAllComposites";
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
index 41c2a58..eab8623 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -1903,29 +1903,47 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
}
@SuppressWarnings("unchecked")
- public ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupConfigurationUpdateId,
+ public ConfigurationUpdateStatus updateGroupResourceConfigurationUpdateStatus(int groupResourceConfigurationUpdateId,
String errorMessages) {
+ GroupResourceConfigurationUpdate groupResourceConfigUpdate = configurationManager
+ .getGroupResourceConfigurationById(groupResourceConfigurationUpdateId);
- GroupPluginConfigurationUpdate groupUpdate = configurationManager
- .getGroupPluginConfigurationById(groupConfigurationUpdateId);
+ // NOTE: None of the individual updates should still be INPROGRESS at the time this method is called!
+ Query query = entityManager.createNamedQuery(ResourceConfigurationUpdate.QUERY_FIND_STATUS_BY_PARENT_UPDATE_ID);
+ query.setParameter("groupConfigurationUpdateId", groupResourceConfigUpdate.getId());
+ List<ConfigurationUpdateStatus> updateStatusTuples = query.getResultList();
- Query query = entityManager.createNamedQuery(PluginConfigurationUpdate.QUERY_FIND_STATUS_BY_PARENT_UPDATE_ID);
- query.setParameter("groupConfigurationUpdateId", groupConfigurationUpdateId);
+ return completeGroupConfigurationUpdate(groupResourceConfigUpdate, updateStatusTuples, errorMessages);
+ }
+
+ @SuppressWarnings("unchecked")
+ public ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId,
+ String errorMessages) {
+ GroupPluginConfigurationUpdate groupPluginConfigUpdate = configurationManager
+ .getGroupPluginConfigurationById(groupPluginConfigurationUpdateId);
// NOTE: None of the individual updates should still be INPROGRESS at the time this method is called!
- ConfigurationUpdateStatus groupUpdateStatus;
+ Query query = entityManager.createNamedQuery(PluginConfigurationUpdate.QUERY_FIND_STATUS_BY_PARENT_UPDATE_ID);
+ query.setParameter("groupConfigurationUpdateId", groupPluginConfigUpdate.getId());
List<ConfigurationUpdateStatus> updateStatusTuples = query.getResultList();
- if (updateStatusTuples.contains(ConfigurationUpdateStatus.FAILURE) || errorMessages != null) {
- groupUpdateStatus = ConfigurationUpdateStatus.FAILURE;
+
+ return completeGroupConfigurationUpdate(groupPluginConfigUpdate, updateStatusTuples, errorMessages);
+ }
+
+ private ConfigurationUpdateStatus completeGroupConfigurationUpdate(AbstractGroupConfigurationUpdate groupConfigUpdate,
+ List<ConfigurationUpdateStatus> memberConfigUpdateStatusTuples,
+ String errorMessages) {
+ ConfigurationUpdateStatus groupConfigUpdateStatus;
+ if (memberConfigUpdateStatusTuples.contains(ConfigurationUpdateStatus.FAILURE) || errorMessages != null) {
+ groupConfigUpdateStatus = ConfigurationUpdateStatus.FAILURE;
} else {
- groupUpdateStatus = ConfigurationUpdateStatus.SUCCESS;
+ groupConfigUpdateStatus = ConfigurationUpdateStatus.SUCCESS;
}
+ groupConfigUpdate.setStatus(groupConfigUpdateStatus);
+ groupConfigUpdate.setErrorMessage(errorMessages);
+ configurationManager.updateGroupConfigurationUpdate(groupConfigUpdate);
- groupUpdate.setStatus(groupUpdateStatus);
- groupUpdate.setErrorMessage(errorMessages);
- configurationManager.updateGroupConfigurationUpdate(groupUpdate);
-
- return groupUpdateStatus; // if the caller wants to know what the new status was
+ return groupConfigUpdateStatus; // if the caller wants to know what the new status was
}
public int deleteGroupPluginConfigurationUpdates(Subject subject, Integer resourceGroupId,
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
index 29e1cb1..c36e403 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
@@ -371,6 +371,9 @@ public interface ConfigurationManagerLocal {
PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(Subject subject, int groupId,
PageControl pc);
+ ConfigurationUpdateStatus updateGroupResourceConfigurationUpdateStatus(int groupResourceConfigurationUpdateId,
+ String errorMessages);
+
ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId,
String errorMessages);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupPluginConfigurationUpdateJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupPluginConfigurationUpdateJob.java
index 0fc0661..3380727 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupPluginConfigurationUpdateJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupPluginConfigurationUpdateJob.java
@@ -20,6 +20,8 @@ package org.rhq.enterprise.server.configuration.job;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
@@ -34,6 +36,8 @@ public class GroupPluginConfigurationUpdateJob extends AbstractGroupConfiguratio
*/
private static final String JOB_NAME_PREFIX = "rhq-apcu-";
+ private final Log log = LogFactory.getLog(GroupPluginConfigurationUpdateJob.class);
+
public static JobDetail getJobDetail(ResourceGroup group, Subject subject, JobDataMap jobDataMap) {
return AbstractGroupConfigurationUpdateJob.getJobDetail(group, subject, jobDataMap,
GroupPluginConfigurationUpdateJob.class, JOB_NAME_PREFIX);
@@ -60,6 +64,10 @@ public class GroupPluginConfigurationUpdateJob extends AbstractGroupConfiguratio
protected void completeGroupConfigurationUpdate(ConfigurationManagerLocal configurationManager,
Integer groupConfigurationUpdateId, String errorMessages) {
+ if (errorMessages != null) {
+ log.error("Failed to execute one or more plugin Configuration updates that were part of a group update - details: "
+ + errorMessages);
+ }
configurationManager.updateGroupPluginConfigurationUpdateStatus(groupConfigurationUpdateId, errorMessages);
}
}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupResourceConfigurationUpdateJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupResourceConfigurationUpdateJob.java
index aee27fa..f294055 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupResourceConfigurationUpdateJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/GroupResourceConfigurationUpdateJob.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -64,10 +64,10 @@ public class GroupResourceConfigurationUpdateJob extends AbstractGroupConfigurat
protected void completeGroupConfigurationUpdate(ConfigurationManagerLocal configurationManager,
Integer groupConfigurationUpdateId, String errorMessages) {
- if (errorMessages != null)
- log
- .error("Failed to execute one or more Resource Configuration updates that were part of a group update - details: "
+ if (errorMessages != null) {
+ log.error("Failed to execute one or more Resource Configuration updates that were part of a group update - details: "
+ errorMessages);
- // TODO: Stick the errors in the individual updates?
+ }
+ configurationManager.updateGroupResourceConfigurationUpdateStatus(groupConfigurationUpdateId, errorMessages);
}
}
\ No newline at end of file
commit 5d1d00ad19750612e86e6fc86a66bf4ae99c201a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Apr 18 17:20:52 2011 -0400
[BZ 697610 - plugin and resource group config views still use old Resource disambiguation mechanism]
Added ancestry based disambiguation to the necessary config editing. It's
a bit different than the typical ListGrid approach as this is not a datasource
based table but rather a form. So, instead, grab the display values via an SLSB
call. No hover is available, if we feel we need that we may be able to
add it later.
- Added new EXPANDED Ancestry format, which prepends the actual resource
name.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceAncestryFormat.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceAncestryFormat.java
index 503f729..4626bc3 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceAncestryFormat.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceAncestryFormat.java
@@ -39,9 +39,11 @@ public enum ResourceAncestryFormat {
* <li>RAW: The raw, encoded value. This is already provided by the Resource.ancestry field.
*
* <li>SIMPLE: Short, name only format: (eg. parentName < grandParentName < etc...)
+ *
+ * <li>EXTENDED: Prepends resource name to SIMPLE format: (eg. resourceName < parentName < grandParentName < etc...)
*
* <li>VERBOSE: Verbose, MultiLine format incorporating name, type and indentation.
* </ul>
*/
- RAW, SIMPLE, VERBOSE
+ RAW, SIMPLE, EXTENDED, VERBOSE
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
index 62f9655..bdb5a7d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
@@ -1,6 +1,7 @@
package org.rhq.enterprise.gui.coregui.client.gwt;
import java.util.List;
+import java.util.Map;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@@ -16,7 +17,6 @@ import org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -67,17 +67,13 @@ public interface ConfigurationGWTService extends RemoteService {
PageList<GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdatesByCriteria(
GroupPluginConfigurationUpdateCriteria criteria) throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroup(int groupId)
- throws RuntimeException;
+ Map<Integer, Configuration> findResourceConfigurationsForGroup(int groupId) throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroup(int groupId)
- throws RuntimeException;
+ Map<Integer, Configuration> findPluginConfigurationsForGroup(int groupId) throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroupUpdate(
- int groupUpdateId) throws RuntimeException;
+ Map<Integer, Configuration> findResourceConfigurationsForGroupUpdate(int groupUpdateId) throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroupUpdate(int groupUpdateId)
- throws RuntimeException;
+ Map<Integer, Configuration> findPluginConfigurationsForGroupUpdate(int groupUpdateId) throws RuntimeException;
void updateResourceConfigurationsForGroup(int groupId, List<ResourceConfigurationComposite> resourceConfigurations)
throws RuntimeException;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
index e7fb10e..38ca06f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
@@ -30,6 +30,7 @@ import org.rhq.core.domain.resource.CreateResourceHistory;
import org.rhq.core.domain.resource.DeleteResourceHistory;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.ProblemResourceComposite;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
@@ -75,6 +76,9 @@ public interface ResourceGWTService extends RemoteService {
Map<Resource, List<Resource>> getQueuedPlatformsAndServers(HashSet<InventoryStatus> statuses, PageControl pc)
throws RuntimeException;
+ Map<Integer, String> getResourcesAncestry(Integer[] resourceIds, ResourceAncestryFormat format)
+ throws RuntimeException;
+
List<ResourceLineageComposite> getResourceLineageAndSiblings(int resourceId) throws RuntimeException;
void ignoreResources(int[] resourceIds) throws RuntimeException;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
index 208d669..7759f93 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
@@ -33,8 +33,8 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.composite.ResourceConfigurationComposite;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
@@ -48,7 +48,6 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.PropertyVa
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
@@ -159,32 +158,46 @@ public class GroupResourceConfigurationEditView extends LocatableVLayout impleme
private void loadConfigurations() {
this.memberConfigurations = null;
this.configurationService.findResourceConfigurationsForGroup(group.getId(),
- new AsyncCallback<List<DisambiguationReport<ResourceConfigurationComposite>>>() {
+ new AsyncCallback<Map<Integer, Configuration>>() {
+
public void onFailure(Throwable caught) {
- refreshing = false;
- CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_edit_loadFail(group.toString()),
- caught);
+ handleLoadFailure(caught);
}
- public void onSuccess(List<DisambiguationReport<ResourceConfigurationComposite>> results) {
- memberConfigurations = new ArrayList<GroupMemberConfiguration>(results.size());
- for (DisambiguationReport<ResourceConfigurationComposite> result : results) {
- int resourceId = result.getOriginal().getResourceId();
- String label = ReportDecorator.decorateDisambiguationReport(result, resourceId, false);
- Configuration configuration = result.getOriginal().getConfiguration();
- GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(resourceId, label,
- configuration);
- if (configuration == null || configuration.getProperties().isEmpty()) {
- throw new RuntimeException(
- "One or more null or empty member Resource configuration was returned by the Server.");
- }
- memberConfigurations.add(memberConfiguration);
- }
- initEditor();
+ public void onSuccess(final Map<Integer, Configuration> configMap) {
+ final Integer[] resourceIds = configMap.keySet().toArray(new Integer[configMap.size()]);
+ GWTServiceLookup.getResourceService().getResourcesAncestry(resourceIds,
+ ResourceAncestryFormat.EXTENDED, new AsyncCallback<Map<Integer, String>>() {
+
+ public void onFailure(Throwable caught) {
+ handleLoadFailure(caught);
+ }
+
+ public void onSuccess(Map<Integer, String> labelMap) {
+ memberConfigurations = new ArrayList<GroupMemberConfiguration>(configMap.size());
+ for (Integer resourceId : resourceIds) {
+ String label = labelMap.get(resourceId);
+ Configuration configuration = configMap.get(resourceId);
+ GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(
+ resourceId, label, configuration);
+ if (configuration == null || configuration.getProperties().isEmpty()) {
+ throw new RuntimeException(
+ "One or more null or empty member connection settings was returned by the Server.");
+ }
+ memberConfigurations.add(memberConfiguration);
+ }
+ initEditor();
+ }
+ });
}
});
}
+ private void handleLoadFailure(Throwable caught) {
+ refreshing = false;
+ CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_edit_loadFail(group.toString()), caught);
+ }
+
private void save() {
List<ResourceConfigurationComposite> resourceConfigurations = convertToCompositeList();
GWTServiceLookup.getConfigurationService().updateResourceConfigurationsForGroup(this.group.getId(),
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java
index 375183a..37c0965 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java
@@ -27,10 +27,9 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.composite.ResourceConfigurationComposite;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
@@ -41,7 +40,6 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupConfi
import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupMemberConfiguration;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -117,34 +115,48 @@ public class HistoryGroupResourceConfigurationSettings extends LocatableVLayout
private void loadConfigurations() {
this.memberConfigurations = null;
GWTServiceLookup.getConfigurationService().findResourceConfigurationsForGroupUpdate(groupUpdateId,
- new AsyncCallback<List<DisambiguationReport<ResourceConfigurationComposite>>>() {
+ new AsyncCallback<Map<Integer, Configuration>>() {
+
public void onFailure(Throwable caught) {
- if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_group_resConfig_members_fetchFailureConfigInProgress(), caught,
- Severity.Info));
- } else {
- CoreGUI.getErrorHandler().handleError(
- MSG.view_group_resConfig_members_fetchFailureConfig(group.toString()), caught);
- }
+ handleLoadFailure(caught);
}
- public void onSuccess(List<DisambiguationReport<ResourceConfigurationComposite>> results) {
- memberConfigurations = new ArrayList<GroupMemberConfiguration>(results.size());
- for (DisambiguationReport<ResourceConfigurationComposite> result : results) {
- int resourceId = result.getOriginal().getResourceId();
- String label = ReportDecorator.decorateDisambiguationReport(result, resourceId, false);
- Configuration configuration = result.getOriginal().getConfiguration();
- GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(resourceId, label,
- configuration);
- if (configuration == null || configuration.getProperties().isEmpty()) {
- throw new RuntimeException(
- "One or more null or empty member resource configurations was returned by the Server.");
- }
- memberConfigurations.add(memberConfiguration);
- }
- initEditor();
+ public void onSuccess(final Map<Integer, Configuration> configMap) {
+ final Integer[] resourceIds = configMap.keySet().toArray(new Integer[configMap.size()]);
+ GWTServiceLookup.getResourceService().getResourcesAncestry(resourceIds,
+ ResourceAncestryFormat.EXTENDED, new AsyncCallback<Map<Integer, String>>() {
+
+ public void onFailure(Throwable caught) {
+ handleLoadFailure(caught);
+ }
+
+ public void onSuccess(Map<Integer, String> labelMap) {
+ memberConfigurations = new ArrayList<GroupMemberConfiguration>(configMap.size());
+ for (Integer resourceId : resourceIds) {
+ String label = labelMap.get(resourceId);
+ Configuration configuration = configMap.get(resourceId);
+ GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(
+ resourceId, label, configuration);
+ if (configuration == null || configuration.getProperties().isEmpty()) {
+ throw new RuntimeException(
+ "One or more null or empty member connection settings was returned by the Server.");
+ }
+ memberConfigurations.add(memberConfiguration);
+ }
+ initEditor();
+ }
+ });
}
});
}
+
+ private void handleLoadFailure(Throwable caught) {
+ if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_group_resConfig_members_fetchFailureConfigInProgress(), caught, Severity.Info));
+ } else {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.view_group_resConfig_members_fetchFailureConfig(group.toString()), caught);
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
index 98b785f..2850187 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
@@ -33,8 +33,8 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.composite.ResourceConfigurationComposite;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
@@ -47,8 +47,8 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.PropertyVa
import org.rhq.enterprise.gui.coregui.client.components.configuration.PropertyValueChangeListener;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
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.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
@@ -64,6 +64,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
public class GroupPluginConfigurationEditView extends LocatableVLayout implements PropertyValueChangeListener,
RefreshableView {
private final ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+ private final ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
private ResourceGroup group;
private ResourcePermission resourcePermission;
@@ -163,38 +164,52 @@ public class GroupPluginConfigurationEditView extends LocatableVLayout implement
private void loadConfigurations() {
this.memberConfigurations = null;
this.configurationService.findPluginConfigurationsForGroup(group.getId(),
- new AsyncCallback<List<DisambiguationReport<ResourceConfigurationComposite>>>() {
+ new AsyncCallback<Map<Integer, Configuration>>() {
+
public void onFailure(Throwable caught) {
- refreshing = false;
- if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_group_pluginConfig_members_fetchFailureConnInProgress(), caught,
- Severity.Info));
- } else {
- CoreGUI.getErrorHandler().handleError(
- MSG.view_group_pluginConfig_members_fetchFailureConn(group.toString()), caught);
- }
+ handleLoadFailure(caught);
}
- public void onSuccess(List<DisambiguationReport<ResourceConfigurationComposite>> results) {
- memberConfigurations = new ArrayList<GroupMemberConfiguration>(results.size());
- for (DisambiguationReport<ResourceConfigurationComposite> result : results) {
- int resourceId = result.getOriginal().getResourceId();
- String label = ReportDecorator.decorateDisambiguationReport(result, resourceId, false);
- Configuration configuration = result.getOriginal().getConfiguration();
- GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(resourceId, label,
- configuration);
- if (configuration == null || configuration.getProperties().isEmpty()) {
- throw new RuntimeException(
- "One or more null or empty member connection settings was returned by the Server.");
- }
- memberConfigurations.add(memberConfiguration);
- }
- initEditor();
+ public void onSuccess(final Map<Integer, Configuration> configMap) {
+ final Integer[] resourceIds = configMap.keySet().toArray(new Integer[configMap.size()]);
+ resourceService.getResourcesAncestry(resourceIds, ResourceAncestryFormat.EXTENDED,
+ new AsyncCallback<Map<Integer, String>>() {
+
+ public void onFailure(Throwable caught) {
+ handleLoadFailure(caught);
+ }
+
+ public void onSuccess(Map<Integer, String> labelMap) {
+ memberConfigurations = new ArrayList<GroupMemberConfiguration>(configMap.size());
+ for (Integer resourceId : resourceIds) {
+ String label = labelMap.get(resourceId);
+ Configuration configuration = configMap.get(resourceId);
+ GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(
+ resourceId, label, configuration);
+ if (configuration == null || configuration.getProperties().isEmpty()) {
+ throw new RuntimeException(
+ "One or more null or empty member connection settings was returned by the Server.");
+ }
+ memberConfigurations.add(memberConfiguration);
+ }
+ initEditor();
+ }
+ });
}
});
}
+ private void handleLoadFailure(Throwable caught) {
+ refreshing = false;
+ if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_group_pluginConfig_members_fetchFailureConnInProgress(), caught, Severity.Info));
+ } else {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.view_group_pluginConfig_members_fetchFailureConn(group.toString()), caught);
+ }
+ }
+
private void save() {
List<ResourceConfigurationComposite> resourceConfigurations = convertToCompositeList();
GWTServiceLookup.getConfigurationService().updatePluginConfigurationsForGroup(this.group.getId(),
@@ -237,7 +252,8 @@ public class GroupPluginConfigurationEditView extends LocatableVLayout implement
Message.Option.Transient, Message.Option.Sticky));
} else {
this.saveButton.disable();
- message = new Message(MSG.view_group_pluginConfig_edit_invalid(invalidPropertyNames.values().toString()),
+ message = new Message(MSG
+ .view_group_pluginConfig_edit_invalid(invalidPropertyNames.values().toString()),
Message.Severity.Error, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java
index 00af8dc..7496928 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java
@@ -27,10 +27,9 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.composite.ResourceConfigurationComposite;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
@@ -41,7 +40,6 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupConfi
import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupMemberConfiguration;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -116,34 +114,49 @@ public class HistoryGroupPluginConfigurationSettings extends LocatableVLayout {
private void loadConfigurations() {
this.memberConfigurations = null;
GWTServiceLookup.getConfigurationService().findPluginConfigurationsForGroupUpdate(groupUpdateId,
- new AsyncCallback<List<DisambiguationReport<ResourceConfigurationComposite>>>() {
+ new AsyncCallback<Map<Integer, Configuration>>() {
+
public void onFailure(Throwable caught) {
- if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_group_pluginConfig_members_fetchFailureConnInProgress(), caught,
- Severity.Info));
- } else {
- CoreGUI.getErrorHandler().handleError(
- MSG.view_group_pluginConfig_members_fetchFailureConn(group.toString()), caught);
- }
+ handleLoadFailure(caught);
}
- public void onSuccess(List<DisambiguationReport<ResourceConfigurationComposite>> results) {
- memberConfigurations = new ArrayList<GroupMemberConfiguration>(results.size());
- for (DisambiguationReport<ResourceConfigurationComposite> result : results) {
- int resourceId = result.getOriginal().getResourceId();
- String label = ReportDecorator.decorateDisambiguationReport(result, resourceId, false);
- Configuration configuration = result.getOriginal().getConfiguration();
- GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(resourceId, label,
- configuration);
- if (configuration == null || configuration.getProperties().isEmpty()) {
- throw new RuntimeException(
- "One or more null or empty member connection settings was returned by the Server.");
- }
- memberConfigurations.add(memberConfiguration);
- }
- initEditor();
+ public void onSuccess(final Map<Integer, Configuration> configMap) {
+ final Integer[] resourceIds = configMap.keySet().toArray(new Integer[configMap.size()]);
+ GWTServiceLookup.getResourceService().getResourcesAncestry(resourceIds,
+ ResourceAncestryFormat.EXTENDED, new AsyncCallback<Map<Integer, String>>() {
+
+ public void onFailure(Throwable caught) {
+ handleLoadFailure(caught);
+ }
+
+ public void onSuccess(Map<Integer, String> labelMap) {
+ memberConfigurations = new ArrayList<GroupMemberConfiguration>(configMap.size());
+ for (Integer resourceId : resourceIds) {
+ String label = labelMap.get(resourceId);
+ Configuration configuration = configMap.get(resourceId);
+ GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(
+ resourceId, label, configuration);
+ if (configuration == null || configuration.getProperties().isEmpty()) {
+ throw new RuntimeException(
+ "One or more null or empty member connection settings was returned by the Server.");
+ }
+ memberConfigurations.add(memberConfiguration);
+ }
+ initEditor();
+ }
+ });
}
});
}
-}
+
+ private void handleLoadFailure(Throwable caught) {
+ if (caught.getMessage().contains("ConfigurationUpdateStillInProgressException")) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_group_pluginConfig_members_fetchFailureConnInProgress(), caught, Severity.Info));
+ } else {
+ CoreGUI.getErrorHandler().handleError(
+ MSG.view_group_pluginConfig_members_fetchFailureConn(group.toString()), caught);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
index 22aadb6..e1eac94 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
@@ -17,17 +17,13 @@ import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
-import org.rhq.core.util.IntExtractor;
-import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.resource.disambiguation.DefaultDisambiguationUpdateStrategies;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -38,12 +34,6 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
private static final long serialVersionUID = 1L;
- private static final IntExtractor<ResourceConfigurationComposite> RESOURCE_CONFIGURATION_COMPOSITE_RESOURCE_ID_EXTRACTOR = new IntExtractor<ResourceConfigurationComposite>() {
- public int extract(ResourceConfigurationComposite configurationComposite) {
- return configurationComposite.getResourceId();
- }
- };
-
private ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
private ResourceGroupManagerLocal groupManager = LookupUtil.getResourceGroupManager();
@@ -271,60 +261,38 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
}
@Override
- public List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroup(int groupId)
- throws RuntimeException {
+ public Map<Integer, Configuration> findResourceConfigurationsForGroup(int groupId) throws RuntimeException {
try {
ResourceGroup group = this.groupManager.getResourceGroup(getSessionSubject(), groupId);
Map<Integer, Configuration> configurations = this.configurationManager
.getResourceConfigurationMapForCompatibleGroup(group);
- List<ResourceConfigurationComposite> configurationComposites = convertToCompositesList(configurations);
- // Disambiguate - i.e. generate unambiguous Resource names for each of the Resource id's.
- List<DisambiguationReport<ResourceConfigurationComposite>> disambiguatedConfigurationComposites = resourceManager
- .disambiguate(configurationComposites, RESOURCE_CONFIGURATION_COMPOSITE_RESOURCE_ID_EXTRACTOR,
- DefaultDisambiguationUpdateStrategies.getDefault());
-
- return SerialUtility.prepare(disambiguatedConfigurationComposites,
- "ConfigurationService.findResourceConfigurationsForGroup");
+ return SerialUtility.prepare(configurations, "ConfigurationService.findResourceConfigurationsForGroup");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
}
@Override
- public List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroup(int groupId)
- throws RuntimeException {
+ public Map<Integer, Configuration> findPluginConfigurationsForGroup(int groupId) throws RuntimeException {
try {
Map<Integer, Configuration> configurations = this.configurationManager
.getPluginConfigurationsForCompatibleGroup(getSessionSubject(), groupId);
- List<ResourceConfigurationComposite> configurationComposites = convertToCompositesList(configurations);
- // Disambiguate - i.e. generate unambiguous Resource names for each of the Resource id's.
- List<DisambiguationReport<ResourceConfigurationComposite>> disambiguatedConfigurationComposites = resourceManager
- .disambiguate(configurationComposites, RESOURCE_CONFIGURATION_COMPOSITE_RESOURCE_ID_EXTRACTOR,
- DefaultDisambiguationUpdateStrategies.getDefault());
-
- return SerialUtility.prepare(disambiguatedConfigurationComposites,
- "ConfigurationService.findPluginConfigurationsForGroup");
+ return SerialUtility.prepare(configurations, "ConfigurationService.findPluginConfigurationsForGroup");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
}
@Override
- public List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroupUpdate(
- int groupUpdateId) throws RuntimeException {
+ public Map<Integer, Configuration> findResourceConfigurationsForGroupUpdate(int groupUpdateId)
+ throws RuntimeException {
try {
Map<Integer, Configuration> configurations = this.configurationManager
.getResourceConfigurationMapForGroupUpdate(getSessionSubject(), groupUpdateId);
- List<ResourceConfigurationComposite> configurationComposites = convertToCompositesList(configurations);
-
- // Disambiguate - i.e. generate unambiguous Resource names for each of the Resource id's.
- List<DisambiguationReport<ResourceConfigurationComposite>> disambiguatedConfigurationComposites = resourceManager
- .disambiguate(configurationComposites, RESOURCE_CONFIGURATION_COMPOSITE_RESOURCE_ID_EXTRACTOR,
- DefaultDisambiguationUpdateStrategies.getDefault());
- return SerialUtility.prepare(disambiguatedConfigurationComposites,
+ return SerialUtility.prepare(configurations,
"ConfigurationService.findResourceConfigurationsForGroupUpdate");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -332,20 +300,13 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen
}
@Override
- public List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroupUpdate(
- int groupUpdateId) throws RuntimeException {
+ public Map<Integer, Configuration> findPluginConfigurationsForGroupUpdate(int groupUpdateId)
+ throws RuntimeException {
try {
Map<Integer, Configuration> configurations = this.configurationManager
.getPluginConfigurationMapForGroupUpdate(getSessionSubject(), groupUpdateId);
- List<ResourceConfigurationComposite> configurationComposites = convertToCompositesList(configurations);
-
- // Disambiguate - i.e. generate unambiguous Resource names for each of the Resource id's.
- List<DisambiguationReport<ResourceConfigurationComposite>> disambiguatedConfigurationComposites = resourceManager
- .disambiguate(configurationComposites, RESOURCE_CONFIGURATION_COMPOSITE_RESOURCE_ID_EXTRACTOR,
- DefaultDisambiguationUpdateStrategies.getDefault());
- return SerialUtility.prepare(disambiguatedConfigurationComposites,
- "ConfigurationService.findPluginConfigurationsForGroupUpdate");
+ return SerialUtility.prepare(configurations, "ConfigurationService.findPluginConfigurationsForGroupUpdate");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index cb28499..6098f53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
@@ -37,6 +37,7 @@ import org.rhq.core.domain.resource.CreateResourceHistory;
import org.rhq.core.domain.resource.DeleteResourceHistory;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.ProblemResourceComposite;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
@@ -175,6 +176,15 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re
}
}
+ public Map<Integer, String> getResourcesAncestry(Integer[] resourceIds, ResourceAncestryFormat format)
+ throws RuntimeException {
+ try {
+ return resourceManager.getResourcesAncestry(getSessionSubject(), resourceIds, format);
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
public Resource getPlatformForResource(int resourceId) throws RuntimeException {
try {
return SerialUtility.prepare(resourceManager.getRootResourceForResource(resourceId),
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
index fdfb2d1..cda6d22 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
@@ -903,23 +903,32 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
}
private String getDecodedAncestry(Resource resource, List<ResourceType> typeList, ResourceAncestryFormat format) {
+
String ancestry = resource.getAncestry();
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder("");
if (ResourceAncestryFormat.VERBOSE != format) {
- if (null == ancestry) {
- sb.append("");
+
+ if (ResourceAncestryFormat.EXTENDED == format) {
+ sb.append(resource.getName());
}
- String[] ancestryEntries = ancestry.split(Resource.ANCESTRY_DELIM);
- for (int i = 0; i < ancestryEntries.length; ++i) {
- String[] entryTokens = ancestryEntries[i].split(Resource.ANCESTRY_ENTRY_DELIM);
- String ancestorName = entryTokens[2];
+ if (null != ancestry) {
+ if (ResourceAncestryFormat.EXTENDED == format) {
+ sb.append(" < ");
+ }
- sb.append((i > 0) ? " < " : "");
- sb.append(ancestorName);
+ String[] ancestryEntries = ancestry.split(Resource.ANCESTRY_DELIM);
+ for (int i = 0; i < ancestryEntries.length; ++i) {
+ String[] entryTokens = ancestryEntries[i].split(Resource.ANCESTRY_ENTRY_DELIM);
+ String ancestorName = entryTokens[2];
+
+ sb.append((i > 0) ? " < " : "");
+ sb.append(ancestorName);
+ }
}
} else {
+
Map<Integer, ResourceType> types = new HashMap<Integer, ResourceType>(typeList.size());
for (ResourceType type : typeList) {
types.put(type.getId(), type);
commit 3e47bb8de230a2e71e876fe298413d2f7d9d66ac
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Apr 18 13:34:55 2011 -0400
BZ 69758 - set the alert condition option to min/max/avg for baseline alerts
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
index df8d130..2fd9400 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
@@ -303,7 +303,7 @@ public class NewConditionEditor extends LocatableDynamicForm {
newCondition.setName(measDef.getDisplayName()); // TODO should not use display name
newCondition.setThreshold(Double.valueOf(getValueAsString(BASELINE_PERCENTAGE_ITEMNAME)) / 100.0);
newCondition.setComparator(getValueAsString(BASELINE_COMPARATOR_ITEMNAME));
- newCondition.setOption(null);
+ newCondition.setOption(getValueAsString(BASELINE_SELECTION_ITEMNAME));
newCondition.setMeasurementDefinition(measDef);
break;
}
commit f6ddef335e62357f940563ce931af0ccb9067ffc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Apr 18 12:34:53 2011 -0400
[BZ 685015 - group operation history details throws exception]
The group op history embeds a list view for the member resources. Double
click here does not follow the usual master detail pattern, Instead, navigate
to the resource op history view.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java
index 87c8b14..b9eb6bb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java
@@ -11,6 +11,7 @@ import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryListView;
@@ -83,4 +84,22 @@ public class GroupMemberResourceOperationHistoryListView extends
return new ResourceOperationHistoryDetailsView(extendLocatorId("DetailsView"), true);
}
+ @Override
+ public void showDetails(ListGridRecord record) {
+ if (record == null) {
+ throw new IllegalArgumentException("'record' parameter is null.");
+ }
+
+ int resourceId = record.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
+ int opHistoryId = record.getAttributeAsInt(ResourceOperationHistoryDataSource.Field.ID);
+
+ if (resourceId > 0 && opHistoryId > 0) {
+ CoreGUI.goToView(LinkManager.getSubsystemResourceOperationHistoryLink(resourceId, opHistoryId));
+ } else {
+ String msg = MSG.view_tableSection_error_badId(this.getClass().toString(), Integer.toString(resourceId)
+ + "," + Integer.toString(opHistoryId));
+ CoreGUI.getErrorHandler().handleError(msg);
+ throw new IllegalArgumentException(msg);
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index e2ab1d2..acd46aa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -78,9 +78,6 @@ public class ResourceOperationHistoryDataSource extends
}
public void onSuccess(PageList<ResourceOperationHistory> result) {
- //ListGridRecord[] resourceOperationHistoryRecords = buildRecordsFromDisambiguationReports(result);
- //response.setData(resourceOperationHistoryRecords);
- //processResponse(request.getRequestId(), response);
dataRetrieved(result, response, request);
}
});
commit 92e81c2b9607a0f58ca23d9695316cb6025b2a68
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Apr 18 17:55:59 2011 +0200
Allow for multiple types to be separated by a bar ( | ).
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
index 18ba3ba..50dd55c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
@@ -26,6 +26,8 @@ import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.ReadChildrenNames;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@@ -62,119 +64,129 @@ public class SubsystemDiscovery implements ResourceDiscoveryComponent<BaseCompon
Configuration config = context.getDefaultPluginConfiguration();
- String cpath = config.getSimpleValue("path", null);
- if (cpath==null) {
+ String confPath = config.getSimpleValue("path", null);
+ if (confPath==null) {
log.error("Path plugin config is null for ResourceType [" + context.getResourceType().getName() +"].");
return details;
}
+ List<String> subTypes = new ArrayList<String>();
+ if (confPath.contains("|")) {
+ subTypes.addAll(Arrays.asList(confPath.split("\\|")));
+ }
+ else
+ subTypes.add(confPath);
- boolean recursive = false;
- String parentPath = parentComponent.getPath();
+ for (String cpath : subTypes) {
- String path;
- String childType = null;
- if (!cpath.contains("=")) { // NO = -> no sub path, but a type
- recursive = true;
- childType = cpath;
- }
+ boolean recursive = false;
- if (parentPath==null || parentPath.isEmpty())
- path = "";
- else
- path = parentPath;
+ String parentPath = parentComponent.getPath();
+
+ String path;
+ String childType = null;
+ if (!cpath.contains("=")) { // NO = -> no sub path, but a type
+ recursive = true;
+ childType = cpath;
- if (cpath.contains("="))
- path += "," + cpath;
+ }
- System.out.println("total path: [" + path + "]");
+ if (parentPath==null || parentPath.isEmpty())
+ path = "";
+ else
+ path = parentPath;
+ if (cpath.contains("="))
+ path += "," + cpath;
- JsonNode json ;
- if (!recursive)
- json = connection.getLevelData(path,recursive, false);
- else {
- List<PROPERTY_VALUE> addr ;
- addr = parentComponent.pathToAddress(parentPath);
- json = connection.executeRaw(new ReadChildrenNames(addr, childType));
- }
- if (!ASConnection.isErrorReply(json)) {
- if (recursive) {
+ System.out.println("total path: [" + path + "]");
+
+
+ JsonNode json ;
+ if (!recursive)
+ json = connection.getLevelData(path,recursive, false);
+ else {
+ List<PROPERTY_VALUE> addr ;
+ addr = parentComponent.pathToAddress(parentPath);
+ json = connection.executeRaw(new ReadChildrenNames(addr, childType));
+ }
+ if (!ASConnection.isErrorReply(json)) {
+ if (recursive) {
- JsonNode subNode = json.findPath("result");
+ JsonNode subNode = json.findPath("result");
- if (subNode!=null && subNode.isContainerNode()){
+ if (subNode!=null && subNode.isContainerNode()){
- Iterator<JsonNode> iter = subNode.getElements();
- while (iter.hasNext()) {
+ Iterator<JsonNode> iter = subNode.getElements();
+ while (iter.hasNext()) {
- JsonNode node = iter.next();
- String val = node.getTextValue();
+ JsonNode node = iter.next();
+ String val = node.getTextValue();
- String newPath = cpath + "=" + val;
- Configuration config2 = context.getDefaultPluginConfiguration();
+ String newPath = cpath + "=" + val;
+ Configuration config2 = context.getDefaultPluginConfiguration();
- String resKey;
+ String resKey;
- if (path==null||path.isEmpty())
- resKey = newPath;
- else
- resKey = path + "," +childType + "=" + val;
+ if (path==null||path.isEmpty())
+ resKey = newPath;
+ else
+ resKey = path + "," +childType + "=" + val;
- PropertySimple pathProp = new PropertySimple("path",resKey);
- config2.put(pathProp);
+ PropertySimple pathProp = new PropertySimple("path",resKey);
+ config2.put(pathProp);
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
- context.getResourceType(), // DataType
- resKey, // Key
- val, // Name
- null, // Version
- "TODO", // subsystem.description, // TODO Description
- config2,
- null);
- details.add(detail);
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ context.getResourceType(), // DataType
+ resKey, // Key
+ val, // Name
+ null, // Version
+ "TODO", // subsystem.description, // TODO Description
+ config2,
+ null);
+ details.add(detail);
+ }
}
- }
- else {
+ else {
- if (subNode==null) {
- log.error("subNode was null for " + path + " and type " + context.getResourceType().getName());
+ if (subNode==null) {
+ log.error("subNode was null for " + path + " and type " + context.getResourceType().getName());
+ }
+ else if (!subNode.isNull())
+ log.info("subnode was no container");
}
- else if (!subNode.isNull())
- log.info("subnode was no container");
+
}
+ else {
- }
- else {
+ String resKey = path;
+ String name = resKey.substring(resKey.lastIndexOf("=") + 1);
+ Configuration config2 = context.getDefaultPluginConfiguration();
+ PropertySimple pathProp = new PropertySimple("path",path);
+ config2.put(pathProp);
- String resKey = path;
- String name = resKey.substring(resKey.lastIndexOf("=") + 1);
- Configuration config2 = context.getDefaultPluginConfiguration();
- PropertySimple pathProp = new PropertySimple("path",path);
- config2.put(pathProp);
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ context.getResourceType(), // DataType
+ path, // Key
+ name, // Name
+ null, // Version
+ path, // Description
+ config2,
+ null);
+ details.add(detail);
+ }
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
- context.getResourceType(), // DataType
- path, // Key
- name, // Name
- null, // Version
- path, // Description
- config2,
- null);
- details.add(detail);
}
- return details;
}
-
- return Collections.emptySet();
+ return details;
}
}
commit 8610a7a17abde176fb535f16375bb551a9f80f6b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Apr 18 11:32:11 2011 -0400
BZ 697559 - make sure our GWT interface declares "throws" clause
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
index 03f164c..e530b67 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
@@ -39,12 +39,12 @@ public interface SystemGWTService extends RemoteService {
HashMap<String, String> getSystemConfiguration() throws RuntimeException;
- void setSystemConfiguration(HashMap<String, String> properties, boolean skipValidation);
+ void setSystemConfiguration(HashMap<String, String> properties, boolean skipValidation) throws RuntimeException;
/**
* @return metadata properties about the agent download available on the server.
*/
- HashMap<String, String> getAgentVersionProperties();
+ HashMap<String, String> getAgentVersionProperties() throws RuntimeException;
/**
* Returns the name and download URL (key and value respectively) of all connector downloads
@@ -53,12 +53,12 @@ public interface SystemGWTService extends RemoteService {
*
* @return information about connectors that can be downloaded from the server
*/
- HashMap<String, String> getConnectorDownloads();
+ HashMap<String, String> getConnectorDownloads() throws RuntimeException;
/**
* @return metadata properties about the CLI download available on the server.
*/
- HashMap<String, String> getClientVersionProperties();
+ HashMap<String, String> getClientVersionProperties() throws RuntimeException;
/**
* Returns the name and download URL (key and value respectively) of the
@@ -71,5 +71,5 @@ public interface SystemGWTService extends RemoteService {
*
* @return information about the bundle deployer tool that can be downloaded from the server
*/
- HashMap<String, String> getBundleDeployerDownload();
+ HashMap<String, String> getBundleDeployerDownload() throws RuntimeException;
}
commit 3496a92b6fc1765c530141c84062dc1e106f9b71
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Apr 18 17:21:49 2011 +0200
(Yet) small helper to create the properties for resource configurations by reading the descriptions from the domain.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java
new file mode 100644
index 0000000..0b8b38e
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Properties.java
@@ -0,0 +1,200 @@
+/*
+ * 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.modules.plugins.jbossas7;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import com.apple.java.Usage;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
+
+/**
+ * Generate properties from a domain dump
+ * @author Heiko W. Rupp
+ */
+public class Domain2Properties {
+
+ public static void main(String[] args) throws Exception {
+
+ if (args.length<2) {
+ usage();
+ System.exit(1);
+ }
+
+ Domain2Properties dp = new Domain2Properties();
+ dp.run(args);
+
+
+ }
+
+ private void run(String[] args) {
+
+ String path = args[0];
+ String type = args[1];
+
+ ASConnection conn = new ASConnection("localhost",9990);
+
+ List<PROPERTY_VALUE> address = pathToAddress(path);
+ Operation op = new Operation("read-resource-description",address,"operations",true);
+ op.addAdditionalProperty("recursive","true");
+ ComplexResult res = (ComplexResult) conn.execute(op,true);
+ if (!res.isSuccess()) {
+ System.err.println("Failure: " + res.getFailureDescription());
+ return;
+ }
+
+
+ Map<String,Object> resMap = res.getResult();
+ Map childMap = (Map) resMap.get("children");
+ Map <String,Object> typeMap = (Map<String, Object>) childMap.get(type);
+ Map descriptionMap = (Map) typeMap.get("model-description");
+ Map starMap = (Map) descriptionMap.get("*");
+ Map<String,Object> attributesMap = (Map<String, Object>) starMap.get("attributes");
+
+
+
+ for (Map.Entry<String,Object> entry : attributesMap.entrySet()) {
+
+ Map<String,Object> props = (Map<String, Object>) entry.getValue();
+
+
+ Type ptype = getTypeFromProps(props);
+ String typeString;
+
+ switch (ptype) {
+ case INT:
+ typeString = "integer"; break;
+ case STRING:
+ typeString = "string"; break;
+ case BOOLEAN:
+ typeString = "boolean"; break;
+ case LONG:
+ typeString = "long"; break;
+ case BIG_DECIMAL:
+ typeString = "long"; break; // TODO bettter float or double?
+ case LIST:
+ typeString = "-list-";
+ break; // Handled below
+ default:
+ typeString = "- unknown -";
+ System.err.println("Unknown type " + ptype + " for " + entry.getKey());
+ }
+
+ if (ptype==Type.LIST) {
+
+ System.out.println("<c:list-property name=\"" + entry.getKey() +"\" >");
+ System.out.println(" <c:simple-property name=\"" + entry.getKey() + "\" />");
+ System.out.println("</c:list-property>");
+
+
+
+ continue;
+ }
+
+ StringBuilder sb = new StringBuilder("<c:simple-property name=\"");
+ sb.append(entry.getKey()).append('"');
+
+ if ((Boolean) props.get("required")) {
+ sb.append(" required=\"true\"");
+ }
+
+ sb.append(" type=\"").append(typeString).append("\"");
+ sb.append(" readOnly=\"");
+ if (props.get("access-type").equals("read-only"))
+ sb.append("true");
+ else
+ sb.append("false");
+ sb.append('"');
+
+ String description = (String) props.get("description");
+ if (sb.length()+description.length() > 120)
+ sb.append("\n ");
+ sb.append(" description=\"").append(description).append('"');
+ sb.append("/>");
+
+ System.out.println(sb.toString());
+ }
+
+
+ }
+
+ private Type getTypeFromProps(Map<String, Object> props) {
+ Map<String,String> tMap = (Map<String, String>) props.get("type");
+ String type = tMap.get("TYPE_MODEL_VALUE");
+ Type ret = Type.valueOf(type);
+
+ return ret;
+ }
+
+ /**
+ * Convert a path in the form key=value,key=value... to a List of properties.
+ * @param path Path to translate
+ * @return List of properties
+ */
+ public List<PROPERTY_VALUE> pathToAddress(String path) {
+ if (path==null || path.isEmpty())
+ return Collections.emptyList();
+
+ List<PROPERTY_VALUE> result = new ArrayList<PROPERTY_VALUE>();
+ String[] components = path.split(",");
+ for (String component : components) {
+ String tmp = component.trim();
+
+ if (tmp.contains("=")) {
+ // strip / from the start of the key if it happens to be there
+ if (tmp.startsWith("/"))
+ tmp = tmp.substring(1);
+
+ String[] pair = tmp.split("=");
+ PROPERTY_VALUE valuePair = new PROPERTY_VALUE(pair[0], pair[1]);
+ result.add(valuePair);
+ }
+ }
+
+ return result;
+ }
+
+
+
+ private static void usage() {
+ System.out.println("Domain2Properties path type");
+ System.out.println(" path is of kind 'key=value[,key=value]+");
+ }
+
+ public enum Type {
+ STRING,
+ INT,
+ BOOLEAN,
+ LONG,
+ BIG_DECIMAL,
+ OBJECT,
+ LIST
+
+ ;
+ }
+
+}
commit fda83a0ddb6b16fbda525ca1b14f7f01e17542f8
Merge: 2378d54 bd1cc47
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Apr 18 11:05:43 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 2378d5452826890b0c62b4b93e95b5c24e276be9
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Apr 18 11:01:21 2011 -0400
[BZ 691773] Make sure agent scanner always clears the scanned jar files
In registerAgentPlugins(), if an exception is thrown in the call to
ProductPluginDeployer.pluginDetected(), the exception propagates all the
way up the call stack, and AgentPluginScanner.scanned does not get
cleared. The call to scanned.clear() is now in a finally block to ensure
it is called even when an exception is thrown in ProductPluginDeployer.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/AgentPluginScanner.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/AgentPluginScanner.java
index 1329b63..c787943 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/AgentPluginScanner.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/AgentPluginScanner.java
@@ -92,18 +92,19 @@ public class AgentPluginScanner {
}
void registerAgentPlugins() throws Exception {
- for (DeploymentInfo di : this.scanned) {
- log.debug("Hot deploying agent plugin [" + di.url + "]...");
- this.agentPluginDeployer.pluginDetected(di);
- }
- this.scanned.clear();
-
- // Register all the new plugins.
- // Call this even if we don't have any update files this time, in case an error occurred last time
- // and we need to finish what we started before.
- this.agentPluginDeployer.registerPlugins();
+ try {
+ for (DeploymentInfo di : this.scanned) {
+ log.debug("Hot deploying agent plugin [" + di.url + "]...");
+ this.agentPluginDeployer.pluginDetected(di);
+ }
- return;
+ // Register all the new plugins.
+ // Call this even if we don't have any update files this time, in case an error occurred last time
+ // and we need to finish what we started before.
+ this.agentPluginDeployer.registerPlugins();
+ } finally {
+ scanned.clear();
+ }
}
void agentPluginScan() throws Exception {
commit bd1cc47f21edf559ff31be823153cb374689a489
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Apr 18 10:55:13 2011 -0400
make wizard message locatable for QE team
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
index 1a52e12..cdfd98b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
@@ -39,6 +39,7 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLFlow;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
@@ -122,7 +123,7 @@ public class WizardView extends LocatableVLayout {
messageBar.setHeight(20);
messageBar.setPadding(2);
messageBar.setBackgroundColor("#F0F0F0");
- messageLabel = new HTMLFlow();
+ messageLabel = new LocatableHTMLFlow(extendLocatorId("Message"));
messageLabel.setWidth("*");
messageLabel.setLeft(20);
messageBar.addMember(messageLabel);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHTMLFlow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHTMLFlow.java
new file mode 100644
index 0000000..801454a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHTMLFlow.java
@@ -0,0 +1,34 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.HTMLFlow;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.HTMLFlow that sets the ID for use with selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableHTMLFlow extends HTMLFlow implements Locatable {
+
+ private String locatorId;
+
+ /**
+ * <pre>
+ * ID Format: "simpleClassname_locatorId"
+ * </pre>
+ * @param locatorId not null or empty.
+ */
+ public LocatableHTMLFlow(String locatorId) {
+ super();
+ this.locatorId = locatorId;
+ SeleniumUtility.setID(this, locatorId);
+ }
+
+ public String getLocatorId() {
+ return locatorId;
+ }
+
+ public String extendLocatorId(String extension) {
+ return this.locatorId + "_" + extension;
+ }
+
+}
commit c5bf5859417926f2b7d6a0f993b67feae6593a26
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 18 10:45:07 2011 -0400
escape HTML in Notes column in op schedule list view (https://bugzilla.redhat.com/show_bug.cgi?id=697136)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleListView.java
index 60f9efc..54052a5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleListView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2010-2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -22,6 +22,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.SubjectRecordCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
@@ -56,6 +57,7 @@ public abstract class AbstractOperationScheduleListView extends TableSection<Abs
TimestampCellFormatter.prepareDateField(nextFireTimeField);
ListGridField descriptionField = new ListGridField(AbstractOperationScheduleDataSource.Field.DESCRIPTION);
+ descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
setListGridFields(true, idField, operationField, subjectField, nextFireTimeField, descriptionField);
commit e42f046825018fb8c74b6e33c3be401acf47acb4
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Apr 18 12:54:56 2011 +0200
If we detect the DC, name it so.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 0de50b8..12d3ec6 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -133,10 +133,6 @@ public class ASConnection {
outcome = outcomeNode.getTextValue();
if (outcome.equals("failed")) {
JsonNode reasonNode = in.findValue("failure-description");
- if (reasonNode==null)
- reasonNode = in.findValue("domain-failure-description");// TODO JBAS-9182
- if (reasonNode==null)
- reasonNode = in.findValue("host-failure-descriptions"); // TODO JBAS-9182
String reason = reasonNode.getTextValue();
// log.info(reason);
@@ -266,10 +262,6 @@ public class ASConnection {
if (jsonNode==null)
return "getFailureDescription: -input was null-";
JsonNode node = jsonNode.findValue("failure-description");
- if (node==null)
- node = jsonNode.findValue("domain-failure-description"); // TODO JBAS-9182
- if (node==null)
- node = jsonNode.findValue("host-failure-descriptions"); // TODO JBAS-9182
return node.getValueAsText();
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
index 7a648c9..63a4e45 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
@@ -48,8 +48,8 @@ public abstract class AbstractBaseDiscovery<T extends ResourceComponent> impleme
// private final Log log = LogFactory.getLog(AbstractBaseDiscovery.class);
- protected void readHostXml(ProcessInfo processInfo) {
- String hostXmlFile = getHostXmlFileLocation(processInfo);
+ protected void readHostXml(ProcessInfo processInfo,boolean isDomainMode) {
+ String hostXmlFile = getHostXmlFileLocation(processInfo,isDomainMode);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
@@ -61,23 +61,6 @@ public abstract class AbstractBaseDiscovery<T extends ResourceComponent> impleme
}
}
- /**
- * Get the location of the host definition file (host.xml in domain mode, standalone.xml
- * in standalone mode.
- *
- * @param processInfo ProcessInfo structure containing the ENV variables
- * @return The path to the definition file.
- */
- private String getHostXmlFileLocation(ProcessInfo processInfo) {
-
- String home = getHomeDirFromCommandLine(processInfo.getCommandLine());
- StringBuilder builder = new StringBuilder(home);
- builder.append("/domain");
- builder.append("/configuration");
- builder.append("/host.xml");
- return builder.toString();
-
- }
String getHomeDirFromCommandLine(String[] commandLine) {
for (String line: commandLine) {
@@ -202,6 +185,32 @@ public abstract class AbstractBaseDiscovery<T extends ResourceComponent> impleme
return new HostPort(false);
}
+ /**
+ * Get the location of the host definition file (host.xml in domain mode, standalone.xml
+ * in standalone mode.
+ * @param processInfo ProcessInfo structure containing the ENV variables
+ * @param isDomain Are we looking for host.xml (=isDomain) or not
+ * @return The path to the definition file.
+ */
+ protected String getHostXmlFileLocation(ProcessInfo processInfo, boolean isDomain) {
+
+ String home = processInfo.getEnvironmentVariable("jboss.home.dir");
+ if (home==null)
+ home = getHomeDirFromCommandLine(processInfo.getCommandLine());
+ StringBuilder builder = new StringBuilder(home);
+ if (isDomain)
+ builder.append("/domain");
+ else
+ builder.append("/standalone");
+ builder.append("/configuration");
+ if (isDomain)
+ builder.append("/host.xml");
+ else
+ builder.append("/standalone.xml");
+ return builder.toString();
+
+ }
+
protected static class HostPort {
String host;
int port;
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
index 3b77360..f03f62c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
@@ -53,6 +53,8 @@ import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
import org.rhq.modules.plugins.jbossas7.json.CompositeOperation;
import org.rhq.modules.plugins.jbossas7.json.NameValuePair;
@@ -71,7 +73,7 @@ import java.util.Map;
import java.util.Set;
public class BaseComponent implements ResourceComponent, MeasurementFacet, ConfigurationFacet, DeleteResourceFacet,
- CreateChildResourceFacet
+ CreateChildResourceFacet, OperationFacet
{
final Log log = LogFactory.getLog(this.getClass());
@@ -490,4 +492,10 @@ public class BaseComponent implements ResourceComponent, MeasurementFacet, Confi
return report;
}
+
+ @Override
+ public OperationResult invokeOperation(String name,
+ Configuration parameters) throws InterruptedException, Exception {
+ return null; // TODO: Customise this generated block
+ }
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index 9fa8396..8d9ff0f 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -49,7 +49,7 @@ import org.rhq.plugins.jmx.JMXDiscoveryComponent;
/**
* Discovery class
*/
-public class BaseProcessDiscovery implements ResourceDiscoveryComponent
+public class BaseProcessDiscovery extends AbstractBaseDiscovery implements ResourceDiscoveryComponent
{
@@ -80,8 +80,19 @@ public class BaseProcessDiscovery implements ResourceDiscoveryComponent
serverNameFull = "ProcessController";
serverName = "ProcessController";
} else if (psName.equals("HostController")) {
- serverName = "HostController";
- serverNameFull = "HostController";
+ readHostXml(psr.getProcessInfo(),true);
+ HostPort hp = getDomainControllerFromHostXml();
+ if (hp.isLocal) {
+ serverName = "DomainController";
+ serverNameFull = "DomainController";
+ }
+ else {
+ serverName = "HostController";
+ serverNameFull = "HostController";
+ }
+ config.put(new PropertySimple("homedir",getHomeDirFromCommandLine(psr.getProcessInfo().getCommandLine())));
+ // TODO add the start script
+
} else {
serverNameFull = getBaseDirFromCommandLine(commandLine);
if (serverNameFull==null || serverNameFull.isEmpty()) {
@@ -127,7 +138,7 @@ public class BaseProcessDiscovery implements ResourceDiscoveryComponent
serverNameFull, // key TODO distinguish per domain?
serverName, // Name
null, // TODO real version ?
- "TODO", // Description
+ discoveryContext.getResourceType().getDescription(), // Description
config,
psr.getProcessInfo()
);
@@ -160,30 +171,6 @@ public class BaseProcessDiscovery implements ResourceDiscoveryComponent
return hostName;
}
- /**
- * Get the location of the host definition file (host.xml in domain mode, standalone.xml
- * in standalone mode.
- * @param processInfo ProcessInfo structure containing the ENV variables
- * @param isDomain Are we looking for host.xml (=isDomain) or not
- * @return The path to the definition file.
- */
- private String getHostXmlFileLocation(ProcessInfo processInfo, boolean isDomain) {
-
- String home = processInfo.getEnvironmentVariable("jboss.home.dir");
- StringBuilder builder = new StringBuilder(home);
- if (isDomain)
- builder.append("/domain");
- else
- builder.append("/standalone");
- builder.append("/configuration");
- if (isDomain)
- builder.append("/host.xml");
- else
- builder.append("/standalone.xml");
- return builder.toString();
-
- }
-
String getBaseDirFromCommandLine(String[] commandLine) {
for (String line: commandLine) {
if (line.startsWith(DJBOSS_SERVER_BASE_DIR))
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java
index 667b3ee..a8b1058 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainDiscovery.java
@@ -61,7 +61,7 @@ public class DomainDiscovery extends AbstractBaseDiscovery<BaseComponent> {
// Now we have the host controller, lets get the host.xml file
// and obtain the domain controller info from there
ProcessInfo processInfo = psr.getProcessInfo();
- readHostXml(processInfo);
+ readHostXml(processInfo,true);
HostPort dcHp = getDomainControllerFromHostXml();
if (!dcHp.isLocal) {
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
index 7f39a9f..3f57a06 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
@@ -70,7 +70,7 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery
// Now we have the host controller, lets get the host.xml file
// and obtain the servers from there.
ProcessInfo processInfo = psr.getProcessInfo();
- readHostXml(processInfo);
+ readHostXml(processInfo,true);
String hostName = findHostName();
HostPort managementHostPort = getManagementPortFromHostXml();
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Result.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Result.java
index a87a6f8..ccc967b 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Result.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Result.java
@@ -37,10 +37,6 @@ public class Result {
private Operation compensatingOperation;
@JsonProperty("failure-description")
private List<Map<String, String>> failureDescription;
- @JsonProperty("host-failure-description") // TODO JBAS-9182
- private List<Map<String, String>> hostFailureDescription;
- @JsonProperty("domain-failure-description") // TODO JBAS-9182
- private List<Map<String, String>> domainFailureDescription;
@JsonIgnore
private boolean success = false;
@@ -86,19 +82,4 @@ public class Result {
this.failureDescription = failureDescription;
}
- public List<Map<String, String>> getHostFailureDescription() {
- return hostFailureDescription;
- }
-
- public void setHostFailureDescription(List<Map<String, String>> hostFailureDescription) {
- this.hostFailureDescription = hostFailureDescription;
- }
-
- public List<Map<String, String>> getDomainFailureDescription() {
- return domainFailureDescription;
- }
-
- public void setDomainFailureDescription(List<Map<String, String>> domainFailureDescription) {
- this.domainFailureDescription = domainFailureDescription;
- }
}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index b6600ab..80df496 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -83,7 +83,7 @@
<server name="HostController"
discovery="BaseProcessDiscovery"
class="BaseComponent"
- description="Domain controller delegate for this host"
+ description="Domain controller (delegate) for this host"
>
<plugin-configuration>
@@ -96,8 +96,7 @@
<process-scan name="HostController" query="process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*"/>
- <operation name="dummyOperation">
- <!-- TODO supply parameters and return values -->
+ <operation name="shutdown" description="Shut this Host-/Domaincontroller down with all managed servers.">
</operation>
commit ee1e41665da6cb0ef111bfba045117b777997371
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 15 21:40:45 2011 -0400
[BZ 697080 - ancestry hover throws exception in operation schedule resource list]
- Add the necessary info for successful hover. A bit of a pain, actually.
- Also, fix issue with null notes field for op schedule
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
index 9a7c87e..8573b4d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
@@ -279,7 +279,7 @@ public abstract class AbstractOperationScheduleDetailsView extends
.getField(AbstractOperationScheduleDataSource.Field.DESCRIPTION);
// Notes field is user-editable, so escape HTML to prevent an XSS attack. Unless empty, then don't to prevent
// displaying as the value.
- String notesValue = getForm().getValue(AbstractOperationScheduleDataSource.Field.DESCRIPTION).toString();
+ String notesValue = getForm().getValueAsString(AbstractOperationScheduleDataSource.Field.DESCRIPTION);
if (null != notesValue && !notesValue.isEmpty()) {
notesItem.setOutputAsHTML(true);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
index 843be1d..40615db 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
@@ -150,29 +150,58 @@ public class GroupOperationScheduleDetailsView extends AbstractOperationSchedule
return contentPane;
}
+ @SuppressWarnings("unchecked")
@Override
- protected void editExistingRecord(Record record) {
+ protected void editExistingRecord(final Record record) {
List<Resource> executionOrder = (List<Resource>) record
.getAttributeAsObject(GroupOperationScheduleDataSource.Field.EXECUTION_ORDER);
+
if (executionOrder != null) {
- this.executionModeForm.setValue(FIELD_EXECUTION_MODE, EXECUTION_ORDER_SEQUENTIAL);
+ Integer[] resourceIds = new Integer[executionOrder.size()];
+ int i = 0;
+ for (Resource resource : executionOrder) {
+ resourceIds[i++] = resource.getId();
+ }
ResourceDatasource resourceDatasource = new ResourceDatasource();
- ListGridRecord[] resourceRecords = resourceDatasource.buildRecords(executionOrder);
- this.memberExecutionOrderer.setRecords(resourceRecords);
- this.memberExecutionOrderer.show();
- FormItem haltOnFailureItem = executionModeForm
- .getField(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
- haltOnFailureItem.show();
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(ResourceDatasource.FILTER_RESOURCE_IDS, resourceIds);
+ resourceDatasource.fetchData(criteria, new DSCallback() {
+ public void execute(DSResponse response, Object rawData, DSRequest request) {
+ if (response.getStatus() != DSResponse.STATUS_SUCCESS) {
+ throw new RuntimeException(MSG.view_group_operationScheduleDetails_failedToLoadMembers());
+ }
+ Record[] data = response.getData();
+ ListGridRecord[] resourceRecords = new ListGridRecord[data.length];
+ for (int i = 0, dataLength = data.length; i < dataLength; i++) {
+ Record record = data[i];
+ ListGridRecord listGridRecord = (ListGridRecord) record;
+ resourceRecords[i] = listGridRecord;
+ }
+
+ executionModeForm.setValue(FIELD_EXECUTION_MODE, EXECUTION_ORDER_SEQUENTIAL);
+ memberExecutionOrderer.setRecords(resourceRecords);
+ memberExecutionOrderer.show();
+
+ FormItem haltOnFailureItem = executionModeForm
+ .getField(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
+ Object haltOnFailure = getForm().getValue(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
+ haltOnFailureItem.setValue(haltOnFailure);
+ haltOnFailureItem.show();
+
+ GroupOperationScheduleDetailsView.super.editExistingRecord(record);
+ }
+ });
} else {
this.executionModeForm.setValue(FIELD_EXECUTION_MODE, EXECUTION_ORDER_PARALLEL);
- }
- Object haltOnFailure = getForm().getValue(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
- FormItem haltOnFailureItem = this.executionModeForm
- .getField(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
- haltOnFailureItem.setValue(haltOnFailure);
+ Object haltOnFailure = getForm().getValue(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
+ FormItem haltOnFailureItem = this.executionModeForm
+ .getField(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE);
+ haltOnFailureItem.setValue(haltOnFailure);
+
+ super.editExistingRecord(record);
+ }
- super.editExistingRecord(record);
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index 722e37d..801e8fa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
@@ -67,6 +67,7 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria> {
public static final String FILTER_GROUP_ID = "groupId";
+ public static final String FILTER_RESOURCE_IDS = "resourceIds";
private static ResourceDatasource INSTANCE;
@@ -227,8 +228,8 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
criteria.addFilterParentResourceId(getFilter(request, "parentId", Integer.class));
criteria.addFilterCurrentAvailability(getFilter(request, AVAILABILITY.propertyName(), AvailabilityType.class));
criteria.addFilterResourceCategories(getArrayFilter(request, CATEGORY.propertyName(), ResourceCategory.class));
- criteria.addFilterIds(getArrayFilter(request, "resourceIds", Integer.class));
- criteria.addFilterExplicitGroupIds(getFilter(request, "groupId", Integer.class));
+ criteria.addFilterIds(getArrayFilter(request, FILTER_RESOURCE_IDS, Integer.class));
+ criteria.addFilterExplicitGroupIds(getFilter(request, FILTER_GROUP_ID, Integer.class));
criteria.addFilterName(getFilter(request, NAME.propertyName(), String.class));
criteria.addFilterResourceTypeId(getFilter(request, TYPE.propertyName(), Integer.class));
criteria.addFilterPluginName(getFilter(request, PLUGIN.propertyName(), String.class));
commit 80716f2527c396f13b97051c4c5c80fe1c7e8606
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 15 17:41:11 2011 -0400
[BZ 697098 - Several views show implicit members for compatible recursive groups]
For goupId filters, filter on explicit group membership as opposed to
implicit group membership. Group list views should not, in general,
present implicit members. Implicit members are used primarily to buld
tree views.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index 1f1b0bd..722e37d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
@@ -18,7 +18,19 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.*;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CTIME;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.ITIME;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.KEY;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.MODIFIER;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.MTIME;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
import java.util.HashSet;
import java.util.List;
@@ -29,7 +41,6 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.fields.DataSourceDateTimeField;
import com.smartgwt.client.data.fields.DataSourceImageField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
@@ -217,7 +228,7 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
criteria.addFilterCurrentAvailability(getFilter(request, AVAILABILITY.propertyName(), AvailabilityType.class));
criteria.addFilterResourceCategories(getArrayFilter(request, CATEGORY.propertyName(), ResourceCategory.class));
criteria.addFilterIds(getArrayFilter(request, "resourceIds", Integer.class));
- criteria.addFilterImplicitGroupIds(getFilter(request, "groupId", Integer.class));
+ criteria.addFilterExplicitGroupIds(getFilter(request, "groupId", Integer.class));
criteria.addFilterName(getFilter(request, NAME.propertyName(), String.class));
criteria.addFilterResourceTypeId(getFilter(request, TYPE.propertyName(), Integer.class));
criteria.addFilterPluginName(getFilter(request, PLUGIN.propertyName(), String.class));
commit c128e6a39b1e89e4239b39568dce60376abf8e49
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Apr 15 17:22:43 2011 -0400
BZ 696751: enable missing reload when saving system configuration settings.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index 7127eb0..052bf11 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -80,6 +80,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
try {
Properties props = convertToProperties(map);
systemManager.setSystemConfiguration(getSessionSubject(), props, skipValidation);
+ systemManager.reconfigureSystem(getSessionSubject());
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
commit 3ca6d583386bc620eaf22c42997ea6fa81903309
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 17:06:45 2011 -0400
ask for confirmation before deleting groupdefs (https://bugzilla.redhat.com/show_bug.cgi?id=697065)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
index 066b4a2..c0ae2d7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
@@ -172,7 +172,6 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
if (this.showDeleteButton) {
addTableAction(extendLocatorId("Delete"), MSG.common_button_delete(), MSG.common_msg_areYouSure(),
new AuthorizedTableAction(this, TableActionEnablement.ANY, Permission.MANAGE_INVENTORY) {
-
public void executeAction(ListGridRecord[] selections, Object actionValue) {
int[] groupIds = new int[selections.length];
int index = 0;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
index f5f7ba0..7e1d548 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
@@ -51,6 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
* @author Joseph Marques
*/
public class GroupDefinitionListView extends TableSection<GroupDefinitionDataSource> {
+
private static final String TITLE = MSG.view_dynagroup_definitions();
public GroupDefinitionListView(String locatorId, String headerIcon) {
@@ -126,8 +127,8 @@ public class GroupDefinitionListView extends TableSection<GroupDefinitionDataSou
setListGridFields(idField, nameField, descriptionField, expressionField, lastCalculationTimeField,
nextCalculationTimeField);
- addTableAction(extendLocatorId("Delete"), MSG.common_button_delete(), null, new AbstractTableAction(
- TableActionEnablement.ANY) {
+ addTableAction(extendLocatorId("Delete"), MSG.common_button_delete(), MSG.common_msg_areYouSure(),
+ new AbstractTableAction(TableActionEnablement.ANY) {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
final int[] groupDefinitionIds = TableUtility.getIds(selection);
ResourceGroupGWTServiceAsync groupManager = GWTServiceLookup.getResourceGroupService(60000);
@@ -204,4 +205,5 @@ public class GroupDefinitionListView extends TableSection<GroupDefinitionDataSou
}
});
}
+
}
\ No newline at end of file
commit d8e8b561c0d93e96c98a9eefecc778141cc8c808
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 16:54:01 2011 -0400
load alertdef desc in Alerts datasource so it can be displayed on the alert details view (https://bugzilla.redhat.com/show_bug.cgi?id=697060)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 64d2c9d..3ba8166 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -45,6 +45,7 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertConditionLog;
+import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.alert.notification.AlertNotificationLog;
import org.rhq.core.domain.common.EntityContext;
@@ -71,6 +72,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
* @author John Mazzitelli
*/
public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
+
public static final String PRIORITY_ICON_HIGH = ImageManager.getAlertIcon(AlertPriority.HIGH);
public static final String PRIORITY_ICON_MEDIUM = ImageManager.getAlertIcon(AlertPriority.MEDIUM);
public static final String PRIORITY_ICON_LOW = ImageManager.getAlertIcon(AlertPriority.LOW);
@@ -267,8 +269,8 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
// disambiguate as the results could be cross-resource
default:
- HashSet<Integer> typesSet = new HashSet<Integer>();
- HashSet<String> ancestries = new HashSet<String>();
+ Set<Integer> typesSet = new HashSet<Integer>();
+ Set<String> ancestries = new HashSet<String>();
for (Alert alert : result) {
Resource resource = alert.getAlertDefinition().getResource();
typesSet.add(resource.getResourceType().getId());
@@ -340,10 +342,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
}
record.setAttribute("acknowledgingSubject", from.getAcknowledgingSubject());
- record.setAttribute("definitionId", from.getAlertDefinition().getId());
- Resource resource = from.getAlertDefinition().getResource();
- record.setAttribute("name", from.getAlertDefinition().getName());
- record.setAttribute("priority", ImageManager.getAlertIcon(from.getAlertDefinition().getPriority()));
+ AlertDefinition alertDefinition = from.getAlertDefinition();
+
+ record.setAttribute("definitionId", alertDefinition.getId());
+ Resource resource = alertDefinition.getResource();
+ record.setAttribute("name", alertDefinition.getName());
+ record.setAttribute("description", alertDefinition.getDescription());
+ record.setAttribute("priority", ImageManager.getAlertIcon(alertDefinition.getPriority()));
// for ancestry handling
record.setAttribute(AncestryUtil.RESOURCE_ID, resource.getId());
@@ -389,7 +394,7 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
conditions[i++] = dc;
}
record.setAttribute("conditionLogs", conditions);
- record.setAttribute("conditionExpression", from.getAlertDefinition().getConditionExpression());
+ record.setAttribute("conditionExpression", alertDefinition.getConditionExpression());
String recoveryInfo = AlertFormatUtility.getAlertRecoveryInfo(from);
record.setAttribute("recoveryInfo", recoveryInfo);
@@ -425,4 +430,5 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
protected void setEntityContext(EntityContext entityContext) {
this.entityContext = entityContext;
}
+
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
index 1d64d92..ad272f7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
@@ -288,4 +288,5 @@ public class AlertDetailsView extends LocatableVLayout implements BookmarkableVi
show(alertId);
}
+
}
commit 245dd3652850d21efee5f876b5e2d1b8551da9b3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 16:29:48 2011 -0400
make all objectName, nameTemplate, and descriptionTemplate plugin config props readOnly in rhq-agent and rhq-server plugins, since we don't want to allow the user to edit those props
diff --git a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
index b6169f0..7d59954 100644
--- a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
@@ -4,7 +4,6 @@
displayName="RHQ Agent"
package="org.rhq.plugins.agent"
description="Management and monitoring of the RHQ Agent"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
@@ -645,9 +644,9 @@
singleton="true">
<plugin-configuration>
- <c:simple-property name="objectName" default="rhq.pc:type=MeasurementManager"/>
- <c:simple-property name="nameTemplate" default="Agent Measurement Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="information about this agent's measurement subsystem"/>
+ <c:simple-property name="objectName" default="rhq.pc:type=MeasurementManager" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Agent Measurement Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="information about this agent's measurement subsystem" readOnly="true"/>
</plugin-configuration>
<metric property="CurrentlyScheduleMeasurements" displayType="summary"
@@ -670,9 +669,9 @@
singleton="true">
<plugin-configuration>
- <c:simple-property name="objectName" default="rhq.pc:type=PluginContainer"/>
- <c:simple-property name="nameTemplate" default="Agent Plugin Container"/>
- <c:simple-property name="descriptionTemplate" default="information about this agent's plugin container"/>
+ <c:simple-property name="objectName" default="rhq.pc:type=PluginContainer" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Agent Plugin Container" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="information about this agent's plugin container" readOnly="true"/>
</plugin-configuration>
<operation name="retrievePluginDependencyGraph"
diff --git a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
index 2ad0785..cbcbf44 100644
--- a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
@@ -2,7 +2,6 @@
displayName="RHQ Server"
package="org.rhq.plugins.server"
description="Monitoring of RHQ Server features and performance"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
@@ -19,9 +18,9 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq:service=AlertConditionCacheMonitor"/>
- <c:simple-property name="nameTemplate" default="Alert Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Alerts Engine Subsystem."/>
+ <c:simple-property name="objectName" default="rhq:service=AlertConditionCacheMonitor" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Alert Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Alerts Engine Subsystem." readOnly="true"/>
</plugin-configuration>
<operation name="reloadCaches" description="Unloads then reloads all caches managed by the containing RHQ Server">
@@ -89,15 +88,15 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq:service=MeasurementMonitor"/>
- <c:simple-property name="nameTemplate" default="Measurement Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Measurement Subsystem."/>
+ <c:simple-property name="objectName" default="rhq:service=MeasurementMonitor" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Measurement Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Measurement Subsystem." readOnly="true"/>
</plugin-configuration>
<metric property="CalltimeValuesInserted" category="throughput" displayType="summary" measurementType="trendsup"
description="The total number of call time data records inserted into the database by this RHQ Server instance since it was started"/>
- <metric property="CallTimeInsertTime" units="milliseconds" displayType="summary" measurementType="trendsup"
- description="The total amount of time taken to insert call time data into the database by this RHQ Server instance since it was started"/>
+ <metric property="CallTimeInsertTime" units="milliseconds" displayType="summary" measurementType="trendsup"
+ description="The total amount of time taken to insert call time data into the database by this RHQ Server instance since it was started"/>
<metric property="MeasurementsInserted" category="throughput" displayType="summary" measurementType="trendsup"
description="The total number of measurement records (incl. Calltime data) inserted into the database by this RHQ Server instance since it was started"/>
@@ -151,9 +150,9 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq:service=GroupDefinitionRecalculationThreadMonitor"/>
- <c:simple-property name="nameTemplate" default="Group Definition Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Group Definition / DynaGroups Subsystem."/>
+ <c:simple-property name="objectName" default="rhq:service=GroupDefinitionRecalculationThreadMonitor" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Group Definition Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Group Definition / DynaGroups Subsystem." readOnly="true"/>
</plugin-configuration>
<operation name="clear" displayName="Clear Statistics" description="Clear the collected statistics, and start collecting anew"/>
@@ -197,9 +196,9 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq:service=ServerCommunications"/>
- <c:simple-property name="nameTemplate" default="Communications Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Details on communications with agents"/>
+ <c:simple-property name="objectName" default="rhq:service=ServerCommunications" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Communications Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Details on communications with agents" readOnly="true"/>
</plugin-configuration>
<operation name="clear" displayName="Clear Metrics" description="Clear the collected metric data and start collecting anew"/>
@@ -274,9 +273,9 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq.remoting:type=RemoteApiMetrics"/>
- <c:simple-property name="nameTemplate" default="Remote API Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Details on remote API communications with external clients, including the CLI"/>
+ <c:simple-property name="objectName" default="rhq.remoting:type=RemoteApiMetrics" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Remote API Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Details on remote API communications with external clients, including the CLI" readOnly="true"/>
</plugin-configuration>
<operation name="clear" displayName="Clear Metrics" description="Clear the collected metric data and start collecting anew"/>
@@ -319,9 +318,9 @@
</runs-inside>
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="rhq.serverplugin:service=ServerPluginService"/>
- <c:simple-property name="nameTemplate" default="Plugin Subsystem"/>
- <c:simple-property name="descriptionTemplate" default="Details on the server-side plugin container subsystem"/>
+ <c:simple-property name="objectName" default="rhq.serverplugin:service=ServerPluginService" readOnly="true"/>
+ <c:simple-property name="nameTemplate" default="Plugin Subsystem" readOnly="true"/>
+ <c:simple-property name="descriptionTemplate" default="Details on the server-side plugin container subsystem" readOnly="true"/>
</plugin-configuration>
<operation name="startMasterPluginContainer"
@@ -350,4 +349,4 @@
</service>
-</plugin>
\ No newline at end of file
+</plugin>
commit 21d13dabf085b0db9fd69516bcdaa90af7d86cf3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 16:06:06 2011 -0400
add various missing i18n; fix widths of columns on event list view; when loading TaggedView, look up global perms in order to pass them into subviews
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
index fd2a086..2561dd3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
@@ -91,7 +91,6 @@ public class RolesDataSource extends RPCDataSource<Role, RoleCriteria> {
addFields(fields);
}
- // TODO: i18n field titles
@Override
protected List<DataSourceField> addDataSourceFields() {
List<DataSourceField> fields = super.addDataSourceFields();
@@ -109,16 +108,19 @@ public class RolesDataSource extends RPCDataSource<Role, RoleCriteria> {
fields.add(descriptionField);
DataSourceField resourceGroupsField = new DataSourceField(Field.RESOURCE_GROUPS, FieldType.ANY,
- "Resource Groups");
+ MSG.datasource_roles_field_resourceGroups());
fields.add(resourceGroupsField);
- DataSourceField permissionsField = new DataSourceField(Field.PERMISSIONS, FieldType.ANY, "Permissions");
+ DataSourceField permissionsField = new DataSourceField(Field.PERMISSIONS, FieldType.ANY,
+ MSG.datasource_roles_field_permissions());
fields.add(permissionsField);
- DataSourceField subjectsField = new DataSourceField(Field.SUBJECTS, FieldType.ANY, "Subjects");
+ DataSourceField subjectsField = new DataSourceField(Field.SUBJECTS, FieldType.ANY,
+ MSG.datasource_roles_field_subjects());
fields.add(subjectsField);
- DataSourceField ldapGroupsField = new DataSourceField(Field.LDAP_GROUPS, FieldType.ANY, "LDAP Groups");
+ DataSourceField ldapGroupsField = new DataSourceField(Field.LDAP_GROUPS, FieldType.ANY,
+ MSG.datasource_roles_field_ldapGroups());
fields.add(ldapGroupsField);
return fields;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
index 6bdf6a5..748e6be 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
@@ -128,7 +128,7 @@ public class UsersDataSource extends RPCDataSource<Subject, SubjectCriteria> {
.dataSource_users_field_passwordVerify(), 100, true);
MatchesFieldValidator passwordsEqualValidator = new MatchesFieldValidator();
passwordsEqualValidator.setOtherField(Field.PASSWORD);
- passwordsEqualValidator.setErrorMessage("Passwords do not match.");
+ passwordsEqualValidator.setErrorMessage(MSG.dataSource_users_passwordsDoNotMatch());
passwordVerifyField.setValidators(passwordsEqualValidator);
fields.add(passwordVerifyField);
@@ -144,7 +144,7 @@ public class UsersDataSource extends RPCDataSource<Subject, SubjectCriteria> {
.dataSource_users_field_emailAddress(), null, 100, true);
fields.add(emailAddressField);
RegExpValidator emailAddressValidator = new RegExpValidator(EMAIL_ADDRESS_REGEXP);
- emailAddressValidator.setErrorMessage("Invalid email address.");
+ emailAddressValidator.setErrorMessage(MSG.dataSource_users_invalidEmailAddress());
emailAddressField.setValidators(emailAddressValidator);
DataSourceTextField phoneNumberField = createTextField(Field.PHONE_NUMBER, MSG
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
index 4a516e6..ae99b68 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
@@ -194,10 +194,10 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
}
});
- timestampField.setWidth("20%");
- severityField.setWidth("25");
+ timestampField.setWidth(155);
+ severityField.setWidth(55);
detailsField.setWidth("*");
- sourceField.setWidth("20%");
+ sourceField.setWidth(220);
setListGridFields(timestampField, severityField, detailsField, sourceField);
@@ -284,4 +284,5 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
public Canvas getDetailsView(int eventId) {
return EventCompositeDetailsView.getInstance();
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
index 2904a27..ba73f82 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
@@ -32,9 +32,9 @@ public enum ResourceDataSourceField {
DESCRIPTION("description", CoreGUI.getMessages().common_title_description()),
- LOCATION("location", "Location"), // TODO: i18n //
+ LOCATION("location", CoreGUI.getMessages().dataSource_resources_field_location()),
- KEY("resourceKey", "Key"),
+ KEY("resourceKey", CoreGUI.getMessages().dataSource_resources_field_key()),
TYPE("resourceType.name", CoreGUI.getMessages().common_title_type()),
@@ -46,13 +46,13 @@ public enum ResourceDataSourceField {
AVAILABILITY("currentAvailability", CoreGUI.getMessages().common_title_availability()),
- CTIME("ctime", "Discovery Time"),
+ CTIME("ctime", CoreGUI.getMessages().dataSource_resources_field_discoveryTime()),
- ITIME("itime", "Import Time"),
+ ITIME("itime", CoreGUI.getMessages().dataSource_resources_field_importTime()),
- MTIME("mtime", "Last Modified Time"),
+ MTIME("mtime", CoreGUI.getMessages().dataSource_resources_field_lastModifiedTime()),
- MODIFIER("modifiedBy", "Last Modifier");
+ MODIFIER("modifiedBy", CoreGUI.getMessages().dataSource_resources_field_lastModifier());
/**
* Corresponds to a property name of Resource (e.g. resourceType.name).
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
index 101bf32..0161c08 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
@@ -168,7 +168,7 @@ public class ResourceConfigurationEditView extends LocatableVLayout implements P
Message.Severity.Info);
} else {
// TODO: i18n
- message = new Message("Configuration was not updated, since the new configuration is equivalent to the current configuration.",
+ message = new Message(MSG.view_configurationDetails_configNotUpdatedDueToNoChange(),
Message.Severity.Warning);
}
String configHistoryUrl = LinkManager.getResourceTabLink(resource.getId(),
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
index c8256f1..6c21b83 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
@@ -145,8 +145,7 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
editor.setReadOnly(true);
resultsSection.addMember(editor);
} else {
- // TODO: i18n
- Label noResultsLabel = new Label("This operation does not return any results.");
+ Label noResultsLabel = new Label(MSG.view_operationHistoryDetails_noResults());
noResultsLabel.setHeight(17);
resultsSection.addMember(noResultsLabel);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java
index c84223e..2f9e505 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java
@@ -23,16 +23,20 @@
package org.rhq.enterprise.gui.coregui.client.report.tag;
import java.util.ArrayList;
+import java.util.Set;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
+import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.tagging.Tag;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentListView;
import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationListView;
@@ -61,6 +65,7 @@ public class TaggedView extends LocatableVLayout implements BookmarkableView {
private LocatableTabSet container;
private ArrayList<Table> viewsWithTags = new ArrayList<Table>();
private int selectedTabNum = 0;
+ private Set<Permission> globalPermissions;
public TaggedView(String locatorId) {
super(locatorId);
@@ -128,9 +133,9 @@ public class TaggedView extends LocatableVLayout implements BookmarkableView {
tab.setPane(bundleVersionListView);
container.addTab(tab);
- // TODO: get manage_bundle perm, if user has it pass true
BundleDeploymentListView bundleDeploymentListView = new BundleDeploymentListView(
- extendLocatorId("bundleDeploymentListView"), criteria, false);
+ extendLocatorId("bundleDeploymentListView"), criteria,
+ this.globalPermissions.contains(Permission.MANAGE_BUNDLE));
viewsWithTags.add(bundleDeploymentListView);
tab = new LocatableTab(extendLocatorId("bundleDeploymentsList"), MSG.view_bundle_bundleDeployments());
tab.setIcon("subsystems/bundle/BundleDeployment_16.png");
@@ -174,7 +179,17 @@ public class TaggedView extends LocatableVLayout implements BookmarkableView {
}
}
- public void renderView(ViewPath viewPath) {
+ public void renderView(final ViewPath viewPath) {
+ new PermissionsLoader().loadExplicitGlobalPermissions(new PermissionsLoadedListener() {
+ public void onPermissionsLoaded(Set<Permission> globalPermissions) {
+ TaggedView.this.globalPermissions = globalPermissions;
+ completeRenderView(viewPath);
+ }
+ });
+
+ }
+
+ private void completeRenderView(ViewPath viewPath) {
if (!viewPath.isEnd()) {
String tagString = viewPath.getCurrent().getPath();
viewTag(tagString);
@@ -183,4 +198,5 @@ public class TaggedView extends LocatableVLayout implements BookmarkableView {
tagCloudView.setSelectedTag(null);
}
}
+
}
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 c862f97..b809c1e 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
@@ -462,10 +462,18 @@ dataSource_users_field_department = Department
dataSource_users_field_factive = Login Enabled?
dataSource_users_delete = Deleted user [{0}]
dataSource_users_deleteFailed = Failed to delete user [{0}]
+dataSource_users_passwordsDoNotMatch = Passwords do not match.
+dataSource_users_invalidEmailAddress = Invalid email address.
+# Roles
+#------
+datasource_roles_field_resourceGroups = Resource Groups
+datasource_roles_field_permissions = Permissions
+datasource_roles_field_subjects = Subjects
+datasource_roles_field_ldapGroups = LDAP Groups
# Platforms
-#------
+#-----------
dataSource_platforms_field_cpu = CPU
dataSource_platforms_field_memory = Memory
dataSource_platforms_field_swap = Swap
@@ -518,6 +526,15 @@ dataSource_schedules_updateSuccessful_concise = A new collection interval of [{0
dataSource_schedules_updateSuccessful_full_resource = A new collection interval of [{0}] seconds has been set on [{1}] measurements for resource with ID [{2}]. The updated measurements are: [{3}]
dataSource_schedules_updateSuccessful_full_group = A new collection interval of [{0}] seconds has been set on [{1}] measurements for resource group with ID [{2}]. The updated measurements are: [{3}]
+# Resources
+#-----------------------
+dataSource_resources_field_location = Location
+dataSource_resources_field_key = Key
+dataSource_resources_field_discoveryTime = Discovery Time
+dataSource_resources_field_importTime = Import Time
+dataSource_resources_field_lastModifiedTime = Last Modified Time
+dataSource_resources_field_lastModifier = Last Modifier
+
# Resource Groups
#-----------------------
dataSource_resourceGroups_loadFailed = Failed to load Resource Groups
@@ -596,6 +613,7 @@ datasource_templateSchedules_updated = Updated collection intervals of selected
datasource_templateSchedules_updated_detail = Collection interval for metric [{0}] [{1}] by default for ResourceType with id [{2}] set to [{3}] seconds.
datasource_templateSchedules_updated_failed = Failed to set collection interval to [{0}] seconds for metric [{1}] [{2}] by default for ResourceType with id [{3}].
+
#********************************** VIEW-SPECIFIC *************************************
#================= Administration ==================
@@ -1929,6 +1947,7 @@ view_configurationDetails_messageConcise = Configuration updated - current versi
view_configurationDetails_messageDetailed = Configuration updated to version {0} for Resource [{1}].
view_configurationDetails_allPropertiesValid = All configuration properties have valid values, so the configuration can now be saved.
view_configurationDetails_somePropertiesInvalid = The following configuration properties have invalid values: {0}. The values must be corrected before the configuration can be saved.
+view_configurationDetails_configNotUpdatedDueToNoChange = Configuration was not updated, since the new configuration is equivalent to the current configuration.
# Resource Configuration History List
#-------------------------------
@@ -1997,6 +2016,7 @@ view_operationHistoryDetails_requestor = Requestor
view_operationHistoryDetails_status = Status
view_operationHistoryDetails_parameters = Parameters
view_operationHistoryDetails_results = Results
+view_operationHistoryDetails_noResults = This operation does not return any results.
# Summary Overview
commit 18a3a539ccb069162b0d6d69c9cbf0f055f59205
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 15 15:38:28 2011 -0400
Two Fixes to CriteriaQueryGenerator. Both affecting Non-permissioned user
queries.
[BZ 696323 - Recent Alerts portlet shows alerts for resources to which user does not have access]
- This one is a bit frightening as it looks like there was a subtle issue in
the authz token fragments we were generating. I think the "innerAlias"
query was selecting the wrong field. It seemed to expose itself in the
scenario in this bz, where the resource field was more than one level
deep from the target entity (i.e. alert.alertDefinition.resource as opposed
to something like resourceoperationhistory.resource).
I've tested the fix in a variety of scenarios but I wish we had a query guru
to inspect the change. JOE, you out there???
[BZ 697091 - Query generator grammar error for non-perm user (via resource config update history portlet)]
- This one is a flat out grammar exception fix.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
index 0ee5ad2..9b8c2ec 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
@@ -181,18 +181,18 @@ public final class CriteriaQueryGenerator {
List<Permission> requiredPerms = this.criteria.getRequiredPermissions();
if (!(null == requiredPerms || requiredPerms.isEmpty())) {
this.authorizationPermsFragment = "" //
- + "AND ( SELECT COUNT(DISTINCT p)" + NL //
- + " FROM Subject innerSubject" + NL //
- + " JOIN innerSubject.roles r" + NL //
- + " JOIN r.permissions p" + NL //
- + " WHERE innerSubject.id = " + this.authorizationSubjectId + NL //
- + " AND p IN ( :requiredPerms ) ) = :requiredPermsSize" + NL;
+ + "( SELECT COUNT(DISTINCT p)" + NL //
+ + " FROM Subject innerSubject" + NL //
+ + " JOIN innerSubject.roles r" + NL //
+ + " JOIN r.permissions p" + NL //
+ + " WHERE innerSubject.id = " + this.authorizationSubjectId + NL //
+ + " AND p IN ( :requiredPerms ) ) = :requiredPermsSize" + NL;
}
}
private String getEnhancedResourceAuthorizationWhereFragment(String fragment, int subjectId) {
String customAuthzFragment = "" //
- + "( %aliasWithFragment%.id IN ( SELECT %aliasWithFragment%.id " + NL //
+ + "( %aliasWithFragment%.id IN ( SELECT %innerAlias%.id " + NL //
+ " FROM %alias% innerAlias " + NL //
+ " JOIN %innerAlias%.implicitGroups g JOIN g.roles r JOIN r.subjects s " + NL //
+ " WHERE s.id = %subjectId% ) )" + NL; //
@@ -207,17 +207,17 @@ public final class CriteriaQueryGenerator {
private String getEnhancedGroupAuthorizationWhereFragment(String fragment, int subjectId) {
String customAuthzFragment = "" //
- + "( %aliasWithFragment%.id IN ( SELECT %aliasWithFragment%.id " + NL //
+ + "( %aliasWithFragment%.id IN ( SELECT %innerAlias%.id " + NL //
+ " FROM %alias% innerAlias " + NL //
+ " JOIN %innerAlias%.roles r JOIN r.subjects s " + NL //
+ " WHERE s.id = %subjectId% )" + NL //
+ " OR" + NL //
- + " %aliasWithFragment%.id IN ( SELECT %aliasWithFragment%.id " + NL //
+ + " %aliasWithFragment%.id IN ( SELECT %innerAlias%.id " + NL //
+ " FROM %alias% innerAlias " + NL //
+ " JOIN %innerAlias%.clusterResourceGroup crg JOIN crg.roles r JOIN r.subjects s " + NL //
+ " WHERE crg.recursive = true AND s.id = %subjectId% )" + NL //
+ " OR" + NL //
- + " %aliasWithFragment%.id IN ( SELECT %aliasWithFragment%.id" + NL //
+ + " %aliasWithFragment%.id IN ( SELECT %innerAlias%.id" + NL //
+ " FROM %alias% innerAlias " + NL //
+ " JOIN %innerAlias%.subject s" + NL //
+ " WHERE s.id = %subjectId% ) ) " + NL;
commit b6d94f357d1831ebd56edcb83b55d8b06efa9948
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 12:28:10 2011 -0400
show prop description for a list-of-maps prop as tooltip when user hovers over the prop name (https://bugzilla.redhat.com/show_bug.cgi?id=696750)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 5ff37bb..a956c46 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -71,6 +71,8 @@ import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangeHandler;
import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import com.smartgwt.client.widgets.form.fields.events.TitleHoverEvent;
+import com.smartgwt.client.widgets.form.fields.events.TitleHoverHandler;
import com.smartgwt.client.widgets.form.validator.CustomValidator;
import com.smartgwt.client.widgets.form.validator.FloatRangeValidator;
import com.smartgwt.client.widgets.form.validator.IntegerRangeValidator;
@@ -662,7 +664,9 @@ public class ConfigurationEditor extends LocatableVLayout {
if (memberDefinition instanceof PropertyDefinitionMap) {
// List of Maps is a specially supported case with summary fields as columns in a table
- // Note: This field spans 3 columns.
+ // Note: This field spans 3 columns. Since the description column is supplanted, show
+ // the description as a tooltip when the user hovers over the property name.
+ nameItem.setTooltip(propertyDefinition.getDescription());
PropertyDefinitionMap memberDefinitionMap = (PropertyDefinitionMap) memberDefinition;
CanvasItem listOfMapsItem = buildListOfMapsField(locatorId, memberDefinitionMap, propertyDefinitionList,
propertyList);
commit 27a33d631055089be574ae4da5b8b29284fcbf53
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 15 12:05:38 2011 -0400
add ctime, itime, mtime, modifiedBy, and resourceKey fields to resource summary header and resource list/search view (https://bugzilla.redhat.com/show_bug.cgi?id=696741)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
index e881c37..5c94399 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
@@ -22,14 +22,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.*;
import java.util.ArrayList;
import java.util.HashSet;
@@ -196,6 +189,7 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
record.setAttribute("resource", res);
record.setAttribute("id", res.getId());
record.setAttribute(NAME.propertyName(), res.getName());
+ record.setAttribute(KEY.propertyName(), res.getResourceKey());
record.setAttribute(DESCRIPTION.propertyName(), res.getDescription());
record.setAttribute(LOCATION.propertyName(), res.getLocation());
record.setAttribute(TYPE.propertyName(), res.getResourceType().getId());
@@ -206,6 +200,10 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP));
record.setAttribute(AVAILABILITY.propertyName(), ImageManager.getAvailabilityIconFromAvailType(res
.getCurrentAvailability().getAvailabilityType()));
+ record.setAttribute(CTIME.propertyName(), res.getCtime());
+ record.setAttribute(ITIME.propertyName(), res.getItime());
+ record.setAttribute(MTIME.propertyName(), res.getMtime());
+ record.setAttribute(MODIFIER.propertyName(), res.getModifiedBy());
record.setAttribute("resourcePermission", from.getResourcePermission());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
index 1fd6e6d..2904a27 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
@@ -34,6 +34,8 @@ public enum ResourceDataSourceField {
LOCATION("location", "Location"), // TODO: i18n //
+ KEY("resourceKey", "Key"),
+
TYPE("resourceType.name", CoreGUI.getMessages().common_title_type()),
PLUGIN("pluginName", CoreGUI.getMessages().common_title_plugin()),
@@ -42,7 +44,15 @@ public enum ResourceDataSourceField {
CATEGORY("resourceType.category", CoreGUI.getMessages().common_title_category()),
- AVAILABILITY("currentAvailability", CoreGUI.getMessages().common_title_availability());
+ AVAILABILITY("currentAvailability", CoreGUI.getMessages().common_title_availability()),
+
+ CTIME("ctime", "Discovery Time"),
+
+ ITIME("itime", "Import Time"),
+
+ MTIME("mtime", "Last Modified Time"),
+
+ MODIFIER("modifiedBy", "Last Modifier");
/**
* Corresponds to a property name of Resource (e.g. resourceType.name).
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index 89484c8..1f1b0bd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
@@ -18,14 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.*;
import java.util.HashSet;
import java.util.List;
@@ -36,6 +29,7 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
+import com.smartgwt.client.data.fields.DataSourceDateTimeField;
import com.smartgwt.client.data.fields.DataSourceImageField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
@@ -101,6 +95,11 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
nameDataField.setCanEdit(false);
fields.add(nameDataField);
+ DataSourceTextField keyDataField = new DataSourceTextField(KEY.propertyName(), KEY.title(), 200);
+ keyDataField.setCanEdit(false);
+ keyDataField.setDetail(true);
+ fields.add(keyDataField);
+
DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), DESCRIPTION
.title());
descriptionDataField.setCanEdit(false);
@@ -131,6 +130,22 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
availabilityDataField.setCanEdit(false);
fields.add(availabilityDataField);
+ DataSourceTextField ctimeDataField = new DataSourceTextField(CTIME.propertyName(), CTIME.title());
+ ctimeDataField.setDetail(true);
+ fields.add(ctimeDataField);
+
+ DataSourceTextField itimeDataField = new DataSourceTextField(ITIME.propertyName(), ITIME.title());
+ itimeDataField.setDetail(true);
+ fields.add(itimeDataField);
+
+ DataSourceTextField mtimeDataField = new DataSourceTextField(MTIME.propertyName(), MTIME.title());
+ mtimeDataField.setDetail(true);
+ fields.add(mtimeDataField);
+
+ DataSourceTextField modifiedByDataField = new DataSourceTextField(MODIFIER.propertyName(), MODIFIER.title());
+ modifiedByDataField.setDetail(true);
+ fields.add(modifiedByDataField);
+
return fields;
}
@@ -233,6 +248,7 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
record.setAttribute("id", from.getId());
record.setAttribute("uuid", from.getUuid());
record.setAttribute(NAME.propertyName(), from.getName());
+ record.setAttribute(KEY.propertyName(), from.getResourceKey());
record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
record.setAttribute(LOCATION.propertyName(), from.getLocation());
record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
@@ -243,6 +259,10 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP));
record.setAttribute(AVAILABILITY.propertyName(), ImageManager.getAvailabilityIconFromAvailType(from
.getCurrentAvailability().getAvailabilityType()));
+ record.setAttribute(CTIME.propertyName(), from.getCtime());
+ record.setAttribute(ITIME.propertyName(), from.getItime());
+ record.setAttribute(MTIME.propertyName(), from.getMtime());
+ record.setAttribute(MODIFIER.propertyName(), from.getModifiedBy());
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, from.getAncestry());
record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, from.getResourceType().getId());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index b22694f..025ee97 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,14 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.*;
import java.util.ArrayList;
import java.util.Collection;
@@ -50,7 +43,6 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
-import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesDataSource;
import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.RecordExtractor;
import org.rhq.enterprise.gui.coregui.client.components.table.ResourceAuthorizedTableAction;
@@ -58,6 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.components.table.IconField;
import org.rhq.enterprise.gui.coregui.client.components.table.ResourceCategoryCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
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.util.RPCDataSource;
@@ -68,6 +61,8 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
+ * The list view for {@link Resource}s.
+ *
* @author Greg Hinkle
*/
public class ResourceSearchView extends Table {
@@ -186,12 +181,12 @@ public class ResourceSearchView extends Table {
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
String resCat = record.getAttribute(CATEGORY.propertyName());
switch (ResourceCategory.valueOf(resCat)) {
- case PLATFORM:
- return MSG.common_title_platform();
- case SERVER:
- return MSG.common_title_server();
- case SERVICE:
- return MSG.common_title_service();
+ case PLATFORM:
+ return MSG.common_title_platform();
+ case SERVER:
+ return MSG.common_title_server();
+ case SERVICE:
+ return MSG.common_title_service();
}
return null;
}
@@ -214,6 +209,9 @@ public class ResourceSearchView extends Table {
});
fields.add(nameField);
+ ListGridField keyField = new ListGridField(KEY.propertyName(), KEY.title(), 170);
+ fields.add(keyField);
+
ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
fields.add(ancestryField);
@@ -241,6 +239,21 @@ public class ResourceSearchView extends Table {
IconField availabilityField = new IconField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 70);
fields.add(availabilityField);
+ ListGridField ctimeField = new ListGridField(CTIME.propertyName(), CTIME.title(), 120);
+ ctimeField.setCellFormatter(new TimestampCellFormatter());
+ fields.add(ctimeField);
+
+ ListGridField itimeField = new ListGridField(ITIME.propertyName(), ITIME.title(), 120);
+ itimeField.setCellFormatter(new TimestampCellFormatter());
+ fields.add(itimeField);
+
+ ListGridField mtimeField = new ListGridField(MTIME.propertyName(), MTIME.title(), 120);
+ mtimeField.setCellFormatter(new TimestampCellFormatter());
+ fields.add(mtimeField);
+
+ ListGridField modifiedByField = new ListGridField(MODIFIER.propertyName(), MODIFIER.title(), 100);
+ fields.add(modifiedByField);
+
return fields;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/OverviewForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/OverviewForm.java
index 31b7c95..245ab2c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/OverviewForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/OverviewForm.java
@@ -42,9 +42,11 @@ import org.rhq.enterprise.gui.coregui.client.components.form.EditableFormItem;
import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
import org.rhq.enterprise.gui.coregui.client.components.form.StringLengthValidator;
import org.rhq.enterprise.gui.coregui.client.components.form.SimpleEditableFormItem.ValueEditedHandler;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
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.AncestryUtil;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -128,14 +130,6 @@ public class OverviewForm extends EnhancedDynamicForm {
}
private void buildForm(ResourceType type) {
- List<MeasurementDefinition> traits = new ArrayList<MeasurementDefinition>();
-
- for (MeasurementDefinition measurement : type.getMetricDefinitions()) {
- if (measurement.getDataType() == DataType.TRAIT && measurement.getDisplayType() == DisplayType.SUMMARY) {
- traits.add(measurement);
- }
- }
-
StringLengthValidator notEmptyOrNullValidator = new StringLengthValidator(1, null, false);
StringLengthValidator notNullValidator = new StringLengthValidator(null, null, false);
@@ -155,6 +149,13 @@ public class OverviewForm extends EnhancedDynamicForm {
formItems.add(typeItem);
final Resource resource = this.resourceComposite.getResource();
+
+ // Key
+ StaticTextItem keyItem = new StaticTextItem(ResourceDataSourceField.KEY.propertyName(),
+ ResourceDataSourceField.KEY.title());
+ keyItem.setValue(resource.getResourceKey());
+ formItems.add(keyItem);
+
boolean modifiable = this.resourceComposite.getResourcePermission().isInventory();
// Name
@@ -282,17 +283,47 @@ public class OverviewForm extends EnhancedDynamicForm {
String version = (resource.getVersion() != null) ? resource.getVersion() : "<i>" + MSG.common_label_none()
+ "</i>";
versionItem.setValue(version);
- versionItem.setEndRow(true);
formItems.add(versionItem);
+ // Timestamps
+ StaticTextItem ctimeItem = new StaticTextItem(ResourceDataSourceField.CTIME.propertyName(),
+ ResourceDataSourceField.CTIME.title());
+ String ctime = TimestampCellFormatter.format(resource.getCtime());
+ ctimeItem.setValue(ctime);
+ formItems.add(ctimeItem);
+
+ StaticTextItem itimeItem = new StaticTextItem(ResourceDataSourceField.ITIME.propertyName(),
+ ResourceDataSourceField.ITIME.title());
+ String itime = TimestampCellFormatter.format(resource.getItime());
+ itimeItem.setValue(itime);
+ formItems.add(itimeItem);
+
+ StaticTextItem mtimeItem = new StaticTextItem(ResourceDataSourceField.MTIME.propertyName(),
+ ResourceDataSourceField.MTIME.title());
+ String mtime = TimestampCellFormatter.format(resource.getMtime());
+ mtimeItem.setValue(mtime);
+ formItems.add(mtimeItem);
+
+ StaticTextItem modifierItem = new StaticTextItem(ResourceDataSourceField.MODIFIER.propertyName(),
+ ResourceDataSourceField.MODIFIER.title());
+ modifierItem.setValue(resource.getModifiedBy());
+ formItems.add(modifierItem);
+
// Traits
- Collections.sort(traits, new Comparator<MeasurementDefinition>() {
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ List<MeasurementDefinition> summaryTraitDefs = new ArrayList<MeasurementDefinition>();
+ for (MeasurementDefinition measurementDef : type.getMetricDefinitions()) {
+ if (measurementDef.getDataType() == DataType.TRAIT && measurementDef.getDisplayType() == DisplayType.SUMMARY) {
+ summaryTraitDefs.add(measurementDef);
+ }
+ }
+
+ Collections.sort(summaryTraitDefs, new Comparator<MeasurementDefinition>() {
+ public int compare(MeasurementDefinition md1, MeasurementDefinition md2) {
+ return new Integer(md1.getDisplayOrder()).compareTo(md2.getDisplayOrder());
}
});
- for (MeasurementDefinition trait : traits) {
+ for (MeasurementDefinition trait : summaryTraitDefs) {
String formItemId = buildFormItemIdFromTraitDisplayName(trait.getDisplayName());
StaticTextItem formItem = new StaticTextItem(formItemId, trait.getDisplayName());
formItem.setTooltip(trait.getDescription());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index d22fcef..72f8c3d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -564,7 +564,7 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return result;
}
- protected DataSourceTextField createTextField(String name, String title, Integer minLength, Integer maxLength,
+ protected static DataSourceTextField createTextField(String name, String title, Integer minLength, Integer maxLength,
Boolean required) {
DataSourceTextField textField = new DataSourceTextField(name, title);
textField.setLength(maxLength);
@@ -578,7 +578,7 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return textField;
}
- protected DataSourceTextField createBooleanField(String name, String title, Boolean required) {
+ protected static DataSourceTextField createBooleanField(String name, String title, Boolean required) {
DataSourceTextField textField = new DataSourceTextField(name, title);
textField.setLength(Boolean.FALSE.toString().length());
textField.setRequired(required);
@@ -589,7 +589,7 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
return textField;
}
- protected DataSourceIntegerField createIntegerField(String name, String title, Integer minValue, Integer maxValue,
+ protected static DataSourceIntegerField createIntegerField(String name, String title, Integer minValue, Integer maxValue,
Boolean required) {
DataSourceIntegerField textField = new DataSourceIntegerField(name, title);
textField.setRequired(required);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index cfe698d..cb28499 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
@@ -70,16 +70,16 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re
// "ROOT_ID \n" +
"id", //
"uuid", // This is important, because it is what Resource's equals() and hashCode() impls use.
- // "resourceKey \n" +
+ "resourceKey", //
"name", //
"ancestry", //
- // "connected \n" +
+ //"connected", //
"version", //
"description", //
- // "ctime \n" +
- // "mtime \n" +
- // "itime \n" +
- // "modifiedBy \n" +
+ "ctime", //
+ "mtime", //
+ "itime", //
+ "modifiedBy", //
"location", //
"resourceType", //
"childResources", //
commit dd7357549e1b2f241dea193cea6d8941e21bde27
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Apr 14 17:26:53 2011 -0400
A workaround fix for [BZ 696740 - Resource tree not always expanding in detail view]
The code looked good but didn't work in all cases. I suspect maybe a smartgwt
problem. A added what should be unnecessary code to get it to work. Seems
ok but don't know if it will last forever. Maybe in a future version of
smartgwt we can remove it.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
index 6a38008..4691f8d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
@@ -47,7 +47,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.components.tree.EnhancedTreeNode;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementScheduleGWTService;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
@@ -127,25 +126,24 @@ public class ResourceTreeDatasource extends DataSource {
final String parentResourceId = request.getCriteria().getAttribute("parentId");
//com.allen_sauer.gwt.log.client.Log.info("All attributes: " + Arrays.toString(request.getCriteria().getAttributes()));
- ResourceCriteria criteria = new ResourceCriteria();
-
if (parentResourceId == null) {
// If this gets called more than once it's a problem. Don't load initial data more than once.
// Subsequent fetches should be due to parent node tree expansion
if (null != this.initialData) {
Log.debug("ResourceTreeDatasource: Loading initial data...");
-
- processIncomingData(this.initialData, response, requestId);
- response.setStatus(DSResponse.STATUS_SUCCESS);
+ List<Resource> temp = this.initialData;
this.initialData = null;
+
+ processIncomingData(temp, response, requestId);
} else {
- processResponse(requestId, response);
response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(requestId, response);
}
} else {
Log.debug("ResourceTreeDatasource: Loading Resource [" + parentResourceId + "]...");
+ ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterParentResourceId(Integer.parseInt(parentResourceId));
resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() {
@@ -169,11 +167,11 @@ public class ResourceTreeDatasource extends DataSource {
EnumSet.of(ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory),
new ResourceTypeRepository.ResourceTypeLoadedCallback() {
+
public void onResourceTypeLoaded(List<Resource> result) {
TreeNode[] treeNodes = buildNodes(result, lockedData);
response.setData(treeNodes);
processResponse(requestId, response);
- response.setStatus(DSResponse.STATUS_SUCCESS);
}
});
}
@@ -210,8 +208,7 @@ public class ResourceTreeDatasource extends DataSource {
// ensure a clean set.
Set<String> allNodeIds = new HashSet<String>(resourceNodes.size() * 2);
- Map<String, Map<String, AutoGroupTreeNode>> parentNodeIdToAutoGroupsByName =
- new HashMap<String, Map<String, AutoGroupTreeNode>>();
+ Map<String, Map<String, AutoGroupTreeNode>> parentNodeIdToAutoGroupsByName = new HashMap<String, Map<String, AutoGroupTreeNode>>();
Set<AutoGroupTreeNode> ambiguouslyNamedAutoGroupNodes = new HashSet<AutoGroupTreeNode>();
for (ResourceTreeNode resourceNode : resourceNodes) {
@@ -242,7 +239,8 @@ public class ResourceTreeDatasource extends DataSource {
autoGroupNodesByName = new HashMap<String, AutoGroupTreeNode>();
parentNodeIdToAutoGroupsByName.put(parentID, autoGroupNodesByName);
} else {
- AutoGroupTreeNode ambiguouslyNamedAutogroupNode = autoGroupNodesByName.get(autogroupNode.getName());
+ AutoGroupTreeNode ambiguouslyNamedAutogroupNode = autoGroupNodesByName.get(autogroupNode
+ .getName());
if (ambiguouslyNamedAutogroupNode != null) {
ambiguouslyNamedAutoGroupNodes.add(ambiguouslyNamedAutogroupNode);
ambiguouslyNamedAutoGroupNodes.add(autogroupNode);
@@ -482,8 +480,8 @@ public class ResourceTreeDatasource extends DataSource {
public void disambiguateName() {
String typeName = StringUtility.pluralize(this.resourceType.getName());
- String name = typeName + " (" + this.resourceType.getPlugin() + " " + MSG.common_title_plugin().toLowerCase()
- + ")";
+ String name = typeName + " (" + this.resourceType.getPlugin() + " "
+ + MSG.common_title_plugin().toLowerCase() + ")";
setName(name);
}
}
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 a94ca04..0ff7934 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
@@ -309,6 +309,7 @@ public class ResourceTreeView extends LocatableVLayout {
private void updateSelection() {
TreeNode selectedNode;
+
if (treeGrid != null && treeGrid.getTree() != null
&& (selectedNode = treeGrid.getTree().findById(selectedNodeId)) != null) {
@@ -636,6 +637,7 @@ public class ResourceTreeView extends LocatableVLayout {
private void loadTree(final int selectedResourceId, final boolean updateSelection,
final AsyncCallback<Void> callback) {
+
if (updateSelection) {
selectedNodeId = ResourceTreeNode.idOf(selectedResourceId);
}
@@ -693,6 +695,18 @@ public class ResourceTreeView extends LocatableVLayout {
}
});
+ // OK, there is no good reason for this to be here. But there are times when the
+ // callback above seems to get called prior to the treeGrid.getTree() having been
+ // updated with the fetched data. I think this is a smartgwt bug but it's hard to
+ // prove. Furthermore, given that the fetchData call is async there is really no
+ // reason why this should get called after the callback above. Having said all that,
+ // this seems to fix the issue as it 1) does currently get called after the callback
+ // and 2) the tree seems to be update immediately after the callback completes.
+ // So, for now use this, but TODO: find a better way.
+ if (updateSelection) {
+ updateSelection();
+ }
+
} else {
ResourceTypeRepository.Cache.getInstance().loadResourceTypes(lineage,
EnumSet.of(ResourceTypeRepository.MetadataType.subCategory),
commit 1bbe2633c15513e694b828c2971f1c95028bef86
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 14 17:14:22 2011 -0400
Resource version and location fields are no longer filtered by ResourceGWTServiceImpl; added support for these fields to ResourceDataSource, ResourceCompositeDataSource, and ResourceSearchView (in ResourceSearchView, location field is hidden by default, but version field is not); hide plugin field by default in ResourceSearchView, since the plugin name can be found via either the Name tooltip or the Ancestry tooltip; add hideField() method to Table
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 8dcf52f..47a5c1f 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
@@ -121,6 +121,33 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
coreGUI = this;
+ registerPageKeys();
+
+ GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
+ public void onUncaughtException(Throwable e) {
+ getErrorHandler().handleError(MSG.view_core_uncaught(), e);
+ }
+ });
+
+ /* after having this enabled for a while, the majority opinion is that this is more annoying than helpful
+ *
+ Window.addWindowClosingHandler(new Window.ClosingHandler() {
+ public void onWindowClosing(Window.ClosingEvent event) {
+ event.setMessage("Are you sure you want to leave RHQ?");
+ }
+ });
+ */
+
+ messageCenter = new MessageCenter();
+
+ UserSessionManager.login();
+
+ // removing loading image, which can be seen if LoginView doesn't completely cover it
+ Element loadingPanel = DOM.getElementById("Loading-Panel");
+ loadingPanel.removeFromParent();
+ }
+
+ private void registerPageKeys() {
if (isDebugMode()) {
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
@@ -174,29 +201,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
goToView("Test");
}
});
-
- GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
- public void onUncaughtException(Throwable e) {
- getErrorHandler().handleError(MSG.view_core_uncaught(), e);
- }
- });
-
- /* after having this enabled for a while, the majority opinion is that this is more annoying than helpful
- *
- Window.addWindowClosingHandler(new Window.ClosingHandler() {
- public void onWindowClosing(Window.ClosingEvent event) {
- event.setMessage("Are you sure you want to leave RHQ?");
- }
- });
- */
-
- messageCenter = new MessageCenter();
-
- UserSessionManager.login();
-
- // removing loading image, which can be seen if LoginView doesn't completely cover it
- Element loadingPanel = DOM.getElementById("Loading-Panel");
- loadingPanel.removeFromParent();
}
public static CoreGUI get() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/IconField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/IconField.java
index 82d6071..427df34 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/IconField.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/IconField.java
@@ -68,6 +68,9 @@ public class IconField extends ListGridField {
setType(ListGridFieldType.IMAGE);
setAlign(Alignment.CENTER);
setShowDefaultContextMenu(false);
+ if (DEFAULT_TITLE.equals(getTitle())) {
+ setCanHide(false);
+ }
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 401a27c..7c8fcc9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -88,6 +88,8 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
+
/**
* A tabular view of set of data records from an {@link RPCDataSource}.
*
@@ -906,6 +908,11 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
return MSG.common_msg_deleteConfirm(getDataTypeNamePlural());
}
+ protected void hideField(ListGridField field) {
+ getListGrid().hideField(field.getName());
+ field.setHidden(true);
+ }
+
// -------------- Inner utility classes ------------- //
/**
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
index ba890d4..50fe917 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
@@ -375,7 +375,7 @@ public abstract class AncestryUtil {
return resourceName;
}
- // We do not want smargwt to see we are storing our map into an attribute because it barfs on our key/value pairs
+ // We do not want smartgwt to see we are storing our map into an attribute because it barfs on our key/value pairs
// so instead we have to wrap it in a non-Map POJO Object so smartgwt just handles it as a java.lang.Object.
public static class MapWrapper {
private Map<Integer, ResourceType> map;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
index 0567d7c..e881c37 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
@@ -20,20 +20,22 @@
* if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
@@ -66,6 +68,7 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
* @author Jay Shaughnessy
*/
public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite, ResourceCriteria> {
+
private static ResourceCompositeDataSource INSTANCE;
private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
@@ -108,9 +111,9 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
protected void dataRetrieved(final PageList<ResourceComposite> result, final DSResponse response,
final DSRequest request) {
- HashSet<Integer> typesSet = new HashSet<Integer>();
- HashSet<String> ancestries = new HashSet<String>();
- ArrayList<Resource> resources = new ArrayList<Resource>(result.size());
+ Set<Integer> typesSet = new HashSet<Integer>();
+ Set<String> ancestries = new HashSet<String>();
+ List<Resource> resources = new ArrayList<Resource>(result.size());
for (ResourceComposite resourceComposite : result) {
Resource resource = resourceComposite.getResource();
resources.add(resource);
@@ -194,8 +197,10 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
record.setAttribute("id", res.getId());
record.setAttribute(NAME.propertyName(), res.getName());
record.setAttribute(DESCRIPTION.propertyName(), res.getDescription());
+ record.setAttribute(LOCATION.propertyName(), res.getLocation());
record.setAttribute(TYPE.propertyName(), res.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), res.getResourceType().getPlugin());
+ record.setAttribute(VERSION.propertyName(), res.getVersion());
record.setAttribute(CATEGORY.propertyName(), res.getResourceType().getCategory().name());
record.setAttribute("icon", ImageManager.getResourceIcon(res.getResourceType().getCategory(), res
.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP));
@@ -214,4 +219,5 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
public ResourceGWTServiceAsync getResourceService() {
return resourceService;
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
index 617ca08..f333ddf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
@@ -175,4 +175,5 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
return new ResourceCompositeSearchView(locatorId, parentResourceComposite, new Criteria("parentId", String
.valueOf(parentResourceComposite.getResource().getId())), MSG.view_inventory_resources_title_children());
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
index 3f784b0..1fd6e6d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
@@ -32,6 +32,8 @@ public enum ResourceDataSourceField {
DESCRIPTION("description", CoreGUI.getMessages().common_title_description()),
+ LOCATION("location", "Location"), // TODO: i18n //
+
TYPE("resourceType.name", CoreGUI.getMessages().common_title_type()),
PLUGIN("pluginName", CoreGUI.getMessages().common_title_plugin()),
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index eb948c8..89484c8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
@@ -21,9 +21,11 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
import java.util.HashSet;
import java.util.List;
@@ -104,14 +106,24 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
descriptionDataField.setCanEdit(false);
fields.add(descriptionDataField);
+ DataSourceTextField locationDataField = new DataSourceTextField(LOCATION.propertyName(), LOCATION.title());
+ locationDataField.setCanEdit(false);
+ locationDataField.setDetail(true);
+ fields.add(locationDataField);
+
DataSourceTextField typeNameDataField = new DataSourceTextField(TYPE.propertyName(), TYPE.title());
fields.add(typeNameDataField);
DataSourceTextField pluginNameDataField = new DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title());
+ pluginNameDataField.setDetail(true);
fields.add(pluginNameDataField);
+ DataSourceTextField versionDataField = new DataSourceTextField(VERSION.propertyName(), VERSION.title());
+ fields.add(versionDataField);
+
DataSourceTextField categoryDataField = new DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- categoryDataField.setHidden(true); // our icon will show this, no need to make this visible by default
+ // The icon field will show the category, no need to make the category field visible by default.
+ categoryDataField.setDetail(true);
fields.add(categoryDataField);
DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), AVAILABILITY
@@ -222,8 +234,10 @@ public class ResourceDatasource extends RPCDataSource<Resource, ResourceCriteria
record.setAttribute("uuid", from.getUuid());
record.setAttribute(NAME.propertyName(), from.getName());
record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
+ record.setAttribute(LOCATION.propertyName(), from.getLocation());
record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
+ record.setAttribute(VERSION.propertyName(), from.getVersion());
record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory().name());
record.setAttribute("icon", ImageManager.getResourceIcon(from.getResourceType().getCategory(), from
.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 6e639c5..b22694f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.LOCATION;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN;
import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
@@ -49,6 +50,7 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesDataSource;
import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.RecordExtractor;
import org.rhq.enterprise.gui.coregui.client.components.table.ResourceAuthorizedTableAction;
@@ -127,6 +129,57 @@ public class ResourceSearchView extends Table {
@Override
protected void configureTable() {
+ List<ListGridField> fields = createFields();
+ setListGridFields(fields.toArray(new ListGridField[fields.size()]));
+
+ addTableAction(extendLocatorId("Uninventory"), MSG.common_button_uninventory(), MSG
+ .view_inventory_resources_uninventoryConfirm(), new ResourceAuthorizedTableAction(ResourceSearchView.this,
+ TableActionEnablement.ANY, Permission.DELETE_RESOURCE, new RecordExtractor<Integer>() {
+
+ public Collection<Integer> extract(Record[] records) {
+ List<Integer> result = new ArrayList<Integer>(records.length);
+ for (Record record : records) {
+ result.add(record.getAttributeAsInt("id"));
+ }
+
+ return result;
+ }
+ }) {
+
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ int[] resourceIds = TableUtility.getIds(selection);
+ ResourceGWTServiceAsync resourceManager = GWTServiceLookup.getResourceService();
+
+ resourceManager.uninventoryResources(resourceIds, new AsyncCallback<List<Integer>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_uninventoryFailed(), caught);
+ }
+
+ public void onSuccess(List<Integer> result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message(MSG.view_inventory_resources_uninventorySuccessful(), Severity.Info));
+
+ ResourceSearchView.this.refresh();
+ }
+ });
+ }
+ });
+
+ setListGridDoubleClickHandler(new DoubleClickHandler() {
+ public void onDoubleClick(DoubleClickEvent event) {
+ ListGrid listGrid = (ListGrid) event.getSource();
+ ListGridRecord[] selectedRows = listGrid.getSelection();
+ if (selectedRows != null && selectedRows.length == 1) {
+ String selectedId = selectedRows[0].getAttribute("id");
+ CoreGUI.goToView(LinkManager.getResourceLink(Integer.valueOf(selectedId)));
+ }
+ }
+ });
+ }
+
+ protected List<ListGridField> createFields() {
+ List<ListGridField> fields = new ArrayList<ListGridField>();
+
IconField iconField = new IconField();
iconField.setShowHover(true);
iconField.setHoverCustomizer(new HoverCustomizer() {
@@ -143,6 +196,7 @@ public class ResourceSearchView extends Table {
return null;
}
});
+ fields.add(iconField);
ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250);
nameField.setCellFormatter(new CellFormatter() {
@@ -158,71 +212,36 @@ public class ResourceSearchView extends Table {
return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
}
});
+ fields.add(nameField);
ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
+ fields.add(ancestryField);
ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(), DESCRIPTION.title());
descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
+ fields.add(descriptionField);
+
+ ListGridField locationField = new ListGridField(LOCATION.propertyName(), LOCATION.title(), 180);
+ locationField.setCellFormatter(new EscapedHtmlCellFormatter());
+ fields.add(locationField);
ListGridField typeNameField = new ListGridField(TYPE.propertyName(), TYPE.title(), 130);
+ fields.add(typeNameField);
ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(), PLUGIN.title(), 100);
+ fields.add(pluginNameField);
ListGridField versionField = new ListGridField(VERSION.propertyName(), VERSION.title(), 60);
- versionField.setHidden(true);
+ fields.add(versionField);
ListGridField categoryField = new ListGridField(CATEGORY.propertyName(), CATEGORY.title(), 60);
categoryField.setCellFormatter(new ResourceCategoryCellFormatter());
- categoryField.setHidden(true); // the icon field already shows us this, no need to show it in another column
+ fields.add(categoryField);
IconField availabilityField = new IconField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 70);
+ fields.add(availabilityField);
- setListGridFields(iconField, nameField, ancestryField, descriptionField, typeNameField, pluginNameField,
- versionField, categoryField, availabilityField);
-
- addTableAction(extendLocatorId("Uninventory"), MSG.common_button_uninventory(), MSG
- .view_inventory_resources_uninventoryConfirm(), new ResourceAuthorizedTableAction(ResourceSearchView.this,
- TableActionEnablement.ANY, Permission.DELETE_RESOURCE, new RecordExtractor<Integer>() {
-
- public Collection<Integer> extract(Record[] records) {
- List<Integer> result = new ArrayList<Integer>(records.length);
- for (Record record : records) {
- result.add(record.getAttributeAsInt("id"));
- }
-
- return result;
- }
- }) {
-
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- int[] resourceIds = TableUtility.getIds(selection);
- ResourceGWTServiceAsync resourceManager = GWTServiceLookup.getResourceService();
-
- resourceManager.uninventoryResources(resourceIds, new AsyncCallback<List<Integer>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_uninventoryFailed(), caught);
- }
-
- public void onSuccess(List<Integer> result) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_inventory_resources_uninventorySuccessful(), Severity.Info));
-
- ResourceSearchView.this.refresh();
- }
- });
- }
- });
-
- setListGridDoubleClickHandler(new DoubleClickHandler() {
- public void onDoubleClick(DoubleClickEvent event) {
- ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
- if (selectedRows != null && selectedRows.length == 1) {
- String selectedId = selectedRows[0].getAttribute("id");
- CoreGUI.goToView(LinkManager.getResourceLink(Integer.valueOf(selectedId)));
- }
- }
- });
+ return fields;
}
public int getMatches() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index 69f815b..cfe698d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
@@ -74,13 +74,13 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re
"name", //
"ancestry", //
// "connected \n" +
- // "version \n" +
+ "version", //
"description", //
// "ctime \n" +
// "mtime \n" +
// "itime \n" +
// "modifiedBy \n" +
- // "location \n" +
+ "location", //
"resourceType", //
"childResources", //
"parentResource", //
commit 10dfbb14b4e20f42e49acce301d4162b16dee9a2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 14 12:26:58 2011 -0400
don't call isRemoved() on managed props with null values when updating a managed component's config, and don't bother setting default values defined on managed props in the RHQ configdef (at least improves the issue described by https://bugzilla.redhat.com/show_bug.cgi?id=694660)
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ConversionUtils.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ConversionUtils.java
index 0f2bee0..e813772 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ConversionUtils.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ConversionUtils.java
@@ -1,6 +1,6 @@
/*
* Jopr Management Platform
-* Copyright (C) 2005-2009 Red Hat, Inc.
+* Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,6 @@
*/
package org.rhq.plugins.jbossas5.util;
-import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -62,9 +61,7 @@ import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.metatype.api.types.MapCompositeMetaType;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
/**
* Utility class to convert some basic Profile Service objects to JON objects, and some basic manipulation and data
@@ -78,14 +75,13 @@ import org.jboss.metatype.api.values.SimpleValue;
*/
public class ConversionUtils
{
+
private static final Log LOG = LogFactory.getLog(ConversionUtils.class);
private static final Map<String, ComponentType> COMPONENT_TYPE_CACHE = new HashMap<String, ComponentType>();
private static final Map<String, KnownDeploymentTypes> DEPLOYMENT_TYPE_CACHE = new HashMap<String, KnownDeploymentTypes>();
private static final Map<String, Configuration> DEFAULT_PLUGIN_CONFIG_CACHE = new HashMap<String, Configuration>();
- protected static final String PLUGIN = "ProfileService";
-
public static ComponentType getComponentType(@NotNull ResourceType resourceType)
{
String resourceTypeName = resourceType.getName();
@@ -154,8 +150,9 @@ public class ConversionUtils
}
PropertySimple customProp = customProps.get(propName);
PropertyAdapter propertyAdapter = PropertyAdapterFactory.getCustomPropertyAdapter(customProp);
- if (propertyAdapter == null)
+ if (propertyAdapter == null) {
propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(metaValue);
+ }
if (propertyAdapter == null)
{
LOG.error("Unable to find a PropertyAdapter for ManagedProperty '" + propName + "' with MetaType ["
@@ -180,7 +177,7 @@ public class ConversionUtils
Map<String, PropertySimple> customProps)
{
ConfigurationDefinition configDefinition = resourceType.getResourceConfigurationDefinition();
- Set<String> missingManagedPropertyNames = new HashSet();
+ Set<String> missingManagedPropertyNames = new HashSet<String>();
for (Property property : configuration.getProperties())
{
String propertyName = property.getName();
@@ -202,7 +199,7 @@ public class ConversionUtils
}
if (!missingManagedPropertyNames.isEmpty())
throw new IllegalStateException("***** The following properties are defined in this plugin's "
- + "descriptor but have no coresponding ManagedProperties: " + missingManagedPropertyNames);
+ + "descriptor but have no corresponding ManagedProperties: " + missingManagedPropertyNames);
}
return;
}
@@ -224,36 +221,25 @@ public class ConversionUtils
@NotNull ManagedProperty managedProperty,
@Nullable PropertySimple customProperty)
{
- if (property == null ||
- (property instanceof PropertySimple && ((PropertySimple)property).getStringValue() == null))
- {
- // The property is unset, which translates to "removed" in Profile Service lingo.
- // We will also set the ManagedProperty's MetaValue to a default value - this will be handled by the
- // conversion performed below by the property's adapter.
- managedProperty.setRemoved(true);
- }
- // If the ManagedProperty defines a default value, assume it's more definitive than any default value that may
- // have been defined in the plugin descriptor, and update the PropertyDefinition to use that as its default
- // value.
- MetaValue defaultValue = managedProperty.getDefaultValue();
- if (defaultValue != null)
- updateDefaultValueOnPropertyDefinition(propertyDefinition, defaultValue);
// See if there is a custom adapter defined for this property.
PropertyAdapter propertyAdapter = PropertyAdapterFactory.getCustomPropertyAdapter(customProperty);
+
MetaValue metaValue = managedProperty.getValue();
if (metaValue != null)
{
LOG.trace("Populating existing MetaValue of type " + metaValue.getMetaType()
+ " from RHQ property " + property + " with definition " + propertyDefinition + "...");
- if (propertyAdapter == null)
+ if (propertyAdapter == null) {
propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(metaValue);
+ }
propertyAdapter.populateMetaValueFromProperty(property, metaValue, propertyDefinition);
}
else
{
MetaType metaType = managedProperty.getMetaType();
- if (propertyAdapter == null)
+ if (propertyAdapter == null) {
propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(metaType);
+ }
LOG.trace("Converting property " + property + " with definition " + propertyDefinition
+ " to MetaValue of type " + metaType + "...");
metaValue = propertyAdapter.convertToMetaValue(property, propertyDefinition, metaType);
@@ -261,37 +247,6 @@ public class ConversionUtils
}
}
- private static void updateDefaultValueOnPropertyDefinition(PropertyDefinition propertyDefinition,
- @NotNull MetaValue defaultValue)
- {
- if (!(propertyDefinition instanceof PropertyDefinitionSimple))
- {
- LOG.debug("Cannot update default value on non-simple property definition " + propertyDefinition
- + "(default value is " + defaultValue + ").");
- return;
- }
- MetaType metaType = defaultValue.getMetaType();
- if (!metaType.isSimple() && !metaType.isEnum())
- {
- LOG.debug("Cannot update default value on " + propertyDefinition
- + ", because default value's type (" + metaType + ") is not simple or enum.");
- return;
- }
- PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple)propertyDefinition;
- if (metaType.isSimple())
- {
- SimpleValue defaultSimpleValue = (SimpleValue)defaultValue;
- Serializable value = defaultSimpleValue.getValue();
- propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
- }
- else
- { // defaultValueMetaType.isEnum()
- EnumValue defaultEnumValue = (EnumValue)defaultValue;
- Serializable value = defaultEnumValue.getValue();
- propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
- }
- }
-
public static MetaType convertPropertyDefinitionToMetaType(PropertyDefinition propDef)
{
MetaType memberMetaType;
commit cb487cf48f9a933fb225bfc15ba6ff43beeb14de
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 14 11:56:32 2011 -0400
update ResourceConfigurationUpdateCriteria to require CONFIGURE_READ perm (should fix https://bugzilla.redhat.com/show_bug.cgi?id=696648)
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
index ac30ab2..b3c4dc2 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
@@ -214,7 +214,7 @@ public abstract class Criteria implements Serializable {
*
* The restriction, once set, can be removed by passing NULL to this method.
*
- * @eee Restriction
+ * @see Restriction
*/
public void setRestriction(Restriction restriction) {
this.restriction = restriction;
@@ -254,6 +254,7 @@ public abstract class Criteria implements Serializable {
* @param requiredPermissions the permissions required by the user on any applicable objects.
* Typically resource permissions needed by the user on returned resources or resource related data.
*/
+ // TODO (ips): This should really be renamed setRequiredPermissions()...
public void addRequiredPermissions(Permission... requiredPermissions) {
this.requiredPermissions = Arrays.asList(requiredPermissions);
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java
index d2e024c..c4a8faf 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -29,16 +29,20 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
+import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.util.PageOrdering;
/**
+ * Criteria for retrieving Resource (not plugin) configuration {@link ResourceConfigurationUpdate}s.
+ *
* @author Greg Hinkle
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@SuppressWarnings("unused")
public class ResourceConfigurationUpdateCriteria extends AbstractResourceConfigurationUpdateCriteria {
+
private static final long serialVersionUID = 1L;
public static final String SORT_FIELD_RESOURCE_NAME = "resourceName";
@@ -57,6 +61,7 @@ public class ResourceConfigurationUpdateCriteria extends AbstractResourceConfigu
private PageOrdering sortResourceId; // requires sort override
public ResourceConfigurationUpdateCriteria() {
+ addRequiredPermissions(Permission.CONFIGURE_READ);
filterOverrides.put("groupConfigurationUpdateId", "groupConfigurationUpdate.id = ?");
filterOverrides.put("resourceTypeId", "resource.resourceType.id = ?");
@@ -114,4 +119,5 @@ public class ResourceConfigurationUpdateCriteria extends AbstractResourceConfigu
addSortField(SORT_FIELD_RESOURCE_ID);
this.sortResourceId = sortResourceId;
}
+
}
commit a0b2e2aaa069a387fde1963071b75cf649f30084
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Apr 14 12:23:06 2011 -0400
Finish work for [BZ 696667 - Some list views require refresh for initial population]
This commit:
- fixes alert history view
- fixes operation history view
- fixes an I18N issue if the event history severity filter
- expands impl and consolidates use of EnumSelectItem for enum based filters
- add and fixes some constant usage for filter widget names
- changes I18N values for alert prio from uppercase to capitalized values
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 262f7d0..64d2c9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -71,14 +71,16 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
* @author John Mazzitelli
*/
public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
- private AlertGWTServiceAsync alertService = GWTServiceLookup.getAlertService();
-
- private EntityContext entityContext;
-
public static final String PRIORITY_ICON_HIGH = ImageManager.getAlertIcon(AlertPriority.HIGH);
public static final String PRIORITY_ICON_MEDIUM = ImageManager.getAlertIcon(AlertPriority.MEDIUM);
public static final String PRIORITY_ICON_LOW = ImageManager.getAlertIcon(AlertPriority.LOW);
+ public static final String FILTER_PRIORITIES = "priorities";
+
+ private AlertGWTServiceAsync alertService = GWTServiceLookup.getAlertService();
+
+ private EntityContext entityContext;
+
public AlertDataSource() {
this(EntityContext.forSubsystemView());
}
@@ -224,7 +226,7 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
@Override
protected void executeFetch(final DSRequest request, final DSResponse response, final AlertCriteria criteria) {
if (criteria == null) {
- // the user selected no severities in the filter - it makes sense from the UI perspective to show 0 rows
+ // the user selected no priorities in the filter - it makes sense from the UI perspective to show 0 rows
response.setTotalRows(0);
processResponse(request.getRequestId(), response);
return;
@@ -303,16 +305,16 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
@Override
protected AlertCriteria getFetchCriteria(DSRequest request) {
- AlertPriority[] severitiesFilter = getArrayFilter(request, "severities", AlertPriority.class);
+ AlertPriority[] prioritiesFilter = getArrayFilter(request, FILTER_PRIORITIES, AlertPriority.class);
- if (severitiesFilter == null || severitiesFilter.length == 0) {
- return null; // user didn't select any severities - return null to indicate no data should be displayed
+ if (prioritiesFilter == null || prioritiesFilter.length == 0) {
+ return null; // user didn't select any priorities - return null to indicate no data should be displayed
}
AlertCriteria criteria = new AlertCriteria();
criteria.setPageControl(getPageControl(request));
- criteria.addFilterPriorities(severitiesFilter);
+ criteria.addFilterPriorities(prioritiesFilter);
criteria.addFilterEntityContext(entityContext);
criteria.fetchConditionLogs(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
index 0a64610..45dd32c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
@@ -24,9 +24,9 @@ import java.util.Arrays;
import java.util.LinkedHashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.ResultSet;
import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.MultipleAppearance;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -41,6 +41,7 @@ import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
@@ -71,10 +72,22 @@ public class AlertHistoryView extends TableSection<AlertDataSource> {
private static SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier(AlertCriteria.SORT_FIELD_CTIME,
SortDirection.DESCENDING);
+ private static final Criteria INITIAL_CRITERIA = new Criteria();
EntityContext context;
boolean hasWriteAccess;
AlertDataSource dataSource;
+ static {
+ AlertPriority[] priorityValues = AlertPriority.values();
+ String[] priorityNames = new String[priorityValues.length];
+ int i = 0;
+ for (AlertPriority s : priorityValues) {
+ priorityNames[i++] = s.name();
+ }
+
+ INITIAL_CRITERIA.addCriteria(AlertDataSource.FILTER_PRIORITIES, priorityNames);
+ }
+
// for subsystem views
public AlertHistoryView(String locatorId) {
this(locatorId, SUBSYSTEM_VIEW_ID.getTitle(), EntityContext.forSubsystemView(), false);
@@ -89,10 +102,11 @@ public class AlertHistoryView extends TableSection<AlertDataSource> {
}
protected AlertHistoryView(String locatorId, String tableTitle, EntityContext context, boolean hasWriteAccess) {
- super(locatorId, tableTitle, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
+ super(locatorId, tableTitle, INITIAL_CRITERIA, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
this.context = context;
this.hasWriteAccess = hasWriteAccess;
+ setInitialCriteriaFixed(false);
setDataSource(getDataSource());
}
@@ -106,10 +120,6 @@ public class AlertHistoryView extends TableSection<AlertDataSource> {
@Override
protected void configureTableFilters() {
- SelectItem priorityFilter = new SelectItem("severities", MSG.view_alerts_table_filter_priority());
- priorityFilter.setMultiple(true);
- priorityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);
-
LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(3);
priorities.put(AlertPriority.HIGH.name(), MSG.common_alert_high());
priorities.put(AlertPriority.MEDIUM.name(), MSG.common_alert_medium());
@@ -118,9 +128,8 @@ public class AlertHistoryView extends TableSection<AlertDataSource> {
priorityIcons.put(AlertPriority.HIGH.name(), ImageManager.getAlertIcon(AlertPriority.HIGH));
priorityIcons.put(AlertPriority.MEDIUM.name(), ImageManager.getAlertIcon(AlertPriority.MEDIUM));
priorityIcons.put(AlertPriority.LOW.name(), ImageManager.getAlertIcon(AlertPriority.LOW));
- priorityFilter.setValueMap(priorities);
- priorityFilter.setValueIcons(priorityIcons);
- priorityFilter.setValues(AlertPriority.HIGH.name(), AlertPriority.MEDIUM.name(), AlertPriority.LOW.name());
+ SelectItem priorityFilter = new EnumSelectItem(AlertDataSource.FILTER_PRIORITIES, MSG
+ .view_alerts_table_filter_priority(), AlertPriority.class, priorities, priorityIcons);
if (isShowFilterForm()) {
setFilterFormItems(priorityFilter);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnumSelectItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnumSelectItem.java
index c5404de..eb1fe76 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnumSelectItem.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnumSelectItem.java
@@ -24,9 +24,9 @@ package org.rhq.enterprise.gui.coregui.client.components.form;
import java.util.EnumSet;
import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.Set;
-import com.google.gwt.core.client.JavaScriptObject;
import com.smartgwt.client.types.MultipleAppearance;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -37,43 +37,45 @@ import com.smartgwt.client.widgets.form.fields.SelectItem;
*/
public class EnumSelectItem extends SelectItem {
- public EnumSelectItem(Class<? extends Enum<?>> e) {
- super();
- init(e);
- }
-
- public EnumSelectItem(JavaScriptObject jsObj, Class<? extends Enum<?>> e) {
- super(jsObj);
- init(e);
- }
-
- public EnumSelectItem(String name, Class<? extends Enum<?>> e) {
- super(name);
- init(e);
- }
-
- public EnumSelectItem(String name, String title, Class<? extends Enum<?>> e) {
+ /**
+ * @param name name of the SelectItem
+ * @param title display name of the SelectItem (should be I18N)
+ * @param e the Enum class object
+ * @param valueMap EnumName->DisplayName map. Enums without a mapping with use .toString() for the display. For I18N
+ * this should be supplied. Can be null.
+ * @param valueIcons EnumName->Icon map. Enums without a mapping have no icon. Can be null.
+ */
+ public EnumSelectItem(String name, String title, Class<? extends Enum<?>> e,
+ LinkedHashMap<String, String> valueMap, Map<String, String> valueIcons) {
super(name, title);
- init(e);
+ init(e, valueMap, valueIcons);
}
- public void init(Class<? extends Enum<?>> e) {
+ public void init(Class<? extends Enum<?>> e, LinkedHashMap<String, String> valueMap, Map<String, String> valueIcons) {
setMultiple(true);
setMultipleAppearance(MultipleAppearance.PICKLIST);
- LinkedHashMap<String, String> valueMap = getEnumValueMap(e);
+ valueMap = getEnumValueMap(e, valueMap);
Set<String> keys = valueMap.keySet();
setValueMap(valueMap);
setValues(keys.toArray(new String[keys.size()])); // select them all by default
+
+ if (null != valueIcons) {
+ setValueIcons(valueIcons);
+ }
}
@SuppressWarnings("unchecked")
- private LinkedHashMap<String, String> getEnumValueMap(Class<? extends Enum> e) {
- LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
+ private LinkedHashMap<String, String> getEnumValueMap(Class<? extends Enum> e,
+ LinkedHashMap<String, String> valueMap) {
+ LinkedHashMap<String, String> map = (null != valueMap) ? valueMap : new LinkedHashMap<String, String>();
for (Object o : EnumSet.allOf(e)) {
Enum v = (Enum) o;
- map.put(v.name(), v.toString());
+ String name = v.name();
+ if (!valueMap.containsKey(name)) {
+ map.put(name, v.toString());
+ }
}
return map;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
index f2f8acc..2c426e5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
@@ -53,6 +53,8 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class EventCompositeDatasource extends RPCDataSource<EventComposite, EventCriteria> {
+ public static final String FILTER_SEVERITIES = "severities";
+
private EntityContext entityContext;
public EventCompositeDatasource(EntityContext context) {
@@ -136,7 +138,7 @@ public class EventCompositeDatasource extends RPCDataSource<EventComposite, Even
@SuppressWarnings("unchecked")
@Override
protected EventCriteria getFetchCriteria(final DSRequest request) {
- EventSeverity[] severities = getArrayFilter(request, "severities", EventSeverity.class);
+ EventSeverity[] severities = getArrayFilter(request, FILTER_SEVERITIES, EventSeverity.class);
if (severities == null || severities.length == 0) {
return null; // user didn't select any severities - return null to indicate no data should be displayed
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
index 673ad1d..4a516e6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
@@ -23,6 +23,7 @@
package org.rhq.enterprise.gui.coregui.client.inventory.common.event;
import java.util.ArrayList;
+import java.util.LinkedHashMap;
import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -71,7 +72,7 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
severityNames[i++] = s.name();
}
- INITIAL_CRITERIA.addCriteria("severities", severityNames);
+ INITIAL_CRITERIA.addCriteria(EventCompositeDatasource.FILTER_SEVERITIES, severityNames);
}
public static EventCompositeHistoryView get(String locatorId, ResourceGroupComposite composite) {
@@ -108,8 +109,21 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
protected void configureTableFilters() {
final TextItem sourceFilter = new TextItem("source", MSG.view_inventory_eventHistory_sourceFilter());
final TextItem detailsFilter = new TextItem("details", MSG.view_inventory_eventHistory_detailsFilter());
- final EnumSelectItem severityFilter = new EnumSelectItem("severities", MSG
- .view_inventory_eventHistory_severityFilter(), EventSeverity.class);
+
+ LinkedHashMap<String, String> severities = new LinkedHashMap<String, String>(5);
+ severities.put(EventSeverity.DEBUG.name(), MSG.common_severity_debug());
+ severities.put(EventSeverity.INFO.name(), MSG.common_severity_info());
+ severities.put(EventSeverity.WARN.name(), MSG.common_severity_warn());
+ severities.put(EventSeverity.ERROR.name(), MSG.common_severity_error());
+ severities.put(EventSeverity.FATAL.name(), MSG.common_severity_fatal());
+ LinkedHashMap<String, String> severityIcons = new LinkedHashMap<String, String>(5);
+ severityIcons.put(EventSeverity.DEBUG.name(), ImageManager.getEventSeverityBadge(EventSeverity.DEBUG));
+ severityIcons.put(EventSeverity.INFO.name(), ImageManager.getEventSeverityBadge(EventSeverity.INFO));
+ severityIcons.put(EventSeverity.WARN.name(), ImageManager.getEventSeverityBadge(EventSeverity.WARN));
+ severityIcons.put(EventSeverity.ERROR.name(), ImageManager.getEventSeverityBadge(EventSeverity.ERROR));
+ severityIcons.put(EventSeverity.FATAL.name(), ImageManager.getEventSeverityBadge(EventSeverity.FATAL));
+ final EnumSelectItem severityFilter = new EnumSelectItem(EventCompositeDatasource.FILTER_SEVERITIES, MSG
+ .view_inventory_eventHistory_severityFilter(), EventSeverity.class, severities, severityIcons);
setFilterFormItems(sourceFilter, detailsFilter, severityFilter);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
index eec9831..118b1e3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryDataSource.java
@@ -57,7 +57,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
-import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
@@ -363,8 +362,7 @@ public class OperationHistoryDataSource extends
@Override
protected ResourceOperationHistoryCriteria getFetchCriteria(DSRequest request) {
- OperationRequestStatus[] statusFilter = getArrayFilter(request, Constant.OPERATION_STATUS,
- OperationRequestStatus.class);
+ OperationRequestStatus[] statusFilter = getArrayFilter(request, Field.STATUS, OperationRequestStatus.class);
if (statusFilter == null || statusFilter.length == 0) {
return null; // user didn't select any severities - return null to indicate no data should be displayed
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
index aa02adc..b19104e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/OperationHistoryView.java
@@ -22,9 +22,9 @@ package org.rhq.enterprise.gui.coregui.client.operation;
import java.util.ArrayList;
import java.util.LinkedHashMap;
+import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.MultipleAppearance;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -34,11 +34,10 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.AbstractConfigurationHistoryDataSource.Field;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDetailsView;
/**
@@ -52,15 +51,27 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
public static final ViewName SUBSYSTEM_VIEW_ID = new ViewName("RecentOperations", MSG
.common_title_recent_operations());
+ private static final Criteria INITIAL_CRITERIA = new Criteria();
private static final String HEADER_ICON = "subsystems/control/Operation_24.png";
- private static final SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier(Field.CREATED_TIME,
- SortDirection.DESCENDING);
+ private static final SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier(
+ OperationHistoryDataSource.Field.CREATED_TIME, SortDirection.DESCENDING);
EntityContext context;
boolean hasControlPermission;
OperationHistoryDataSource dataSource;
+ static {
+ OperationRequestStatus[] statusValues = OperationRequestStatus.values();
+ String[] statusNames = new String[statusValues.length];
+ int i = 0;
+ for (OperationRequestStatus s : statusValues) {
+ statusNames[i++] = s.name();
+ }
+
+ INITIAL_CRITERIA.addCriteria(OperationHistoryDataSource.Field.STATUS, statusNames);
+ }
+
// for subsystem views
public OperationHistoryView(String locatorId) {
this(locatorId, SUBSYSTEM_VIEW_ID.getTitle(), EntityContext.forSubsystemView(), false);
@@ -76,10 +87,11 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
protected OperationHistoryView(String locatorId, String tableTitle, EntityContext context,
boolean hasControlPermission) {
- super(locatorId, tableTitle, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
+ super(locatorId, tableTitle, INITIAL_CRITERIA, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
this.context = context;
this.hasControlPermission = hasControlPermission;
+ setInitialCriteriaFixed(false);
setDataSource(getDataSource());
}
@@ -93,18 +105,11 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
@Override
protected void configureTableFilters() {
- SelectItem statusFilter = new SelectItem(Constant.OPERATION_STATUS, MSG.common_title_operation_status());
- statusFilter.setWrapTitle(false);
- statusFilter.setWidth(325);
- statusFilter.setMultiple(true);
- statusFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);
-
- LinkedHashMap<String, String> stati = new LinkedHashMap<String, String>(4);
- stati.put(OperationRequestStatus.SUCCESS.name(), MSG.common_status_success());
- stati.put(OperationRequestStatus.INPROGRESS.name(), MSG.common_status_inprogress());
- stati.put(OperationRequestStatus.CANCELED.name(), MSG.common_status_canceled());
- stati.put(OperationRequestStatus.FAILURE.name(), MSG.common_status_failed());
-
+ LinkedHashMap<String, String> statusValues = new LinkedHashMap<String, String>(4);
+ statusValues.put(OperationRequestStatus.SUCCESS.name(), MSG.common_status_success());
+ statusValues.put(OperationRequestStatus.INPROGRESS.name(), MSG.common_status_inprogress());
+ statusValues.put(OperationRequestStatus.CANCELED.name(), MSG.common_status_canceled());
+ statusValues.put(OperationRequestStatus.FAILURE.name(), MSG.common_status_failed());
LinkedHashMap<String, String> statusIcons = new LinkedHashMap<String, String>(3);
statusIcons.put(OperationRequestStatus.SUCCESS.name(), ImageManager
.getOperationResultsIcon(OperationRequestStatus.SUCCESS));
@@ -114,10 +119,10 @@ public class OperationHistoryView extends TableSection<OperationHistoryDataSourc
.getOperationResultsIcon(OperationRequestStatus.CANCELED));
statusIcons.put(OperationRequestStatus.FAILURE.name(), ImageManager
.getOperationResultsIcon(OperationRequestStatus.FAILURE));
- statusFilter.setValueMap(stati);
- statusFilter.setValueIcons(statusIcons);
- statusFilter.setValues(OperationRequestStatus.SUCCESS.name(), OperationRequestStatus.INPROGRESS.name(),
- OperationRequestStatus.FAILURE.name(), OperationRequestStatus.CANCELED.name());
+
+ SelectItem statusFilter = new EnumSelectItem(OperationHistoryDataSource.Field.STATUS, MSG
+ .common_title_operation_status(), OperationRequestStatus.class, statusValues, statusIcons);
+ statusFilter.setWidth(325);
if (isShowFilterForm()) {
setFilterFormItems(statusFilter);
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 7f028ee..c862f97 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
@@ -257,9 +257,9 @@ common_val_nth = {0}th
# Common Alert Priorities
#------------------------
-common_alert_high = HIGH
-common_alert_medium = MEDIUM
-common_alert_low = LOW
+common_alert_high = High
+common_alert_medium = Medium
+common_alert_low = Low
# Common Calendar
#--------------
commit 2bcef38dc48eb972361a3f50d893a607ad08f37f
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 14 11:16:03 2011 -0400
Documenting rhq.sync-endpoint-address and setting it to default of false
diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
index ac5130a..704c50a 100644
--- a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
@@ -570,8 +570,13 @@ rhq.server.content.filesystem=${jboss.server.data.dir}/packagebits
# The frequency (in millis) the server checks for updated plugins
rhq.server.plugin-scan-period-ms=${rhq.server.plugin-scan-period-ms}
-# TODO: please explain what this is - how is ${rhq.sync.endpoint-address} set?
-rhq.sync.endpoint-address=${rhq.sync.endpoint-address}
+# When this is enabled, the server at start up will compare its endpoint
+# address to the host name/address found on the host machine. If they differ,
+# the server endpoint address will be updated to the value found on the host
+# machine. This is targeted for use in cloud deployments where IP addresses
+# change frequently, but it can be of use in other deployment settings where
+# you have to deal with IP address changes.
+rhq.sync.endpoint-address=false
# Auto-Install Pre-Configuration Settings
# If you wish to circumvent the installer webapp and auto-install the server
commit 7e7b9115dcca9a5ba639aa0bf69fe589eb92fd17
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 14 10:47:29 2011 -0400
remove obsolete server config props.
add comment to plugin deploy threads
move the sync endpoint away from the autoinstall props since being together made them seem related. Maybe they are related?
in any event, added a TODO - someone needs to add comments on it
diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
index c98dd12..ac5130a 100644
--- a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
@@ -474,25 +474,11 @@ rhq.server.startup.pooledinvoker.rmiport=7445
rhq.server.startup.ajp.port=9009
rhq.server.startup.unifiedinvoker.port=5446
rhq.server.startup.aspectdeployer.bind-port=4873
-# It is not recommended to increase this value
+
+# The number of concurrent threads used to deploy plugins.
+# Currently, it is not recommended to increase this value.
rhq.server.plugin-deployer-threads=1
-# Cluster configuration
-# The cluster service has been disabled in 1.1. It will be revisited when we look at cluster management support.
-#jboss.partition.name=RHQPartition
-#jgroups.bind_addr=127.0.0.1
-#jgroups.udp.mcast_addr=228.1.2.4
-#jboss.hapartition.mcast_port=55566
-#jboss.ejb3entitypartition.mcast_port=53333
-#jboss.alertcachepartition.mcast_port=58899
-#rhq.server.startup.partition.udpLoopback=false
-#rhq.server.startup.hajndi.port=2100
-#rhq.server.startup.hajndi.rmiport=2101
-#rhq.server.startup.hajndi.autodiscoverygroupport=2102
-#rhq.server.startup.hajrmpinvoker.rmiport=5447
-#rhq.server.startup.hapooledinvoker.port=5448
-#jgroups.udp.ip_ttl=2
-
# RHQ Server's remote endpoint for agents to talk to
# bind-address and bind-port are derived from the HA server definition,
# if you set the address/port here, they will override the HA server definition found in the database
@@ -584,6 +570,9 @@ rhq.server.content.filesystem=${jboss.server.data.dir}/packagebits
# The frequency (in millis) the server checks for updated plugins
rhq.server.plugin-scan-period-ms=${rhq.server.plugin-scan-period-ms}
+# TODO: please explain what this is - how is ${rhq.sync.endpoint-address} set?
+rhq.sync.endpoint-address=${rhq.sync.endpoint-address}
+
# Auto-Install Pre-Configuration Settings
# If you wish to circumvent the installer webapp and auto-install the server
# immediately upon first startup, make sure all of the settings above are
@@ -606,7 +595,6 @@ rhq.server.plugin-scan-period-ms=${rhq.server.plugin-scan-period-ms}
rhq.autoinstall.enabled=false
rhq.autoinstall.database=auto
rhq.autoinstall.public-endpoint-address=
-rhq.sync.endpoint-address=${rhq.sync.endpoint-address}
</echo>
commit 5e6b9a0580eb8373a33e5054b184f4d91a674681
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Apr 14 14:59:50 2011 +0200
BZ 694476 - the user is now only expected to list the non-standard module mappings instead of all modules in the plugin config. This enables a clear and simple upgrade path from previous versions.
Also made the loaded module detection more robust.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index cea063e..360e75c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -128,7 +128,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
public static final String PLUGIN_CONFIG_VHOST_IN_SINGLE_FILE_PROP_VALUE = "single-file";
public static final String PLUGIN_CONFIG_VHOST_PER_FILE_PROP_VALUE = "vhost-per-file";
- public static final String PLUGIN_CONFIG_MODULE_NAMES = "moduleNames";
+ public static final String PLUGIN_CONFIG_CUSTOM_MODULE_NAMES = "customModuleNames";
public static final String PLUGIN_CONFIG_MODULE_MAPPING = "moduleMapping";
public static final String PLUGIN_CONFIG_MODULE_NAME = "moduleName";
public static final String PLUGIN_CONFIG_MODULE_SOURCE_FILE = "moduleSourceFile";
@@ -156,6 +156,8 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
private ApacheBinaryInfo binaryInfo;
private long availPingTime = -1;
+ private Map<String, String> moduleNames;
+
/**
* Delegate instance for handling all calls to invoke operations on this component.
*/
@@ -221,6 +223,29 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
this.operationsDelegate = new ApacheServerOperationsDelegate(this, pluginConfig, this.resourceContext
.getSystemInformation());
+ //init the module names with the defaults
+ moduleNames = new HashMap<String, String>(ApacheServerDiscoveryComponent.getDefaultModuleNames(binaryInfo.getVersion()));
+
+ //and add the user-provided overrides/additions
+ PropertyList list = resourceContext.getPluginConfiguration().getList(PLUGIN_CONFIG_CUSTOM_MODULE_NAMES);
+
+ if (list != null) {
+ for (Property p : list.getList()) {
+ PropertyMap map = (PropertyMap) p;
+ String sourceFile = map.getSimpleValue(PLUGIN_CONFIG_MODULE_SOURCE_FILE, null);
+ String moduleName = map.getSimpleValue(PLUGIN_CONFIG_MODULE_NAME, null);
+
+ if (sourceFile == null || moduleName == null) {
+ log.info("A corrupted module name mapping found (" + sourceFile + " = " + moduleName
+ + "). Check your module mappings in the plugin configuration for the server: "
+ + resourceContext.getResourceKey());
+ continue;
+ }
+
+ moduleNames.put(sourceFile, moduleName);
+ }
+ }
+
startEventPollers();
} catch (Exception e) {
if (this.snmpClient != null) {
@@ -764,31 +789,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
}
public Map<String, String> getModuleNames() {
- PropertyList list = resourceContext.getPluginConfiguration().getList(PLUGIN_CONFIG_MODULE_NAMES);
-
- if (list == null) {
- log.warn("Could not find the list of the module names. This should not happen as that is a required property.");
- return Collections.emptyMap();
- }
-
- Map<String, String> ret = new HashMap<String, String>();
-
- for (Property p : list.getList()) {
- PropertyMap map = (PropertyMap) p;
- String sourceFile = map.getSimpleValue(PLUGIN_CONFIG_MODULE_SOURCE_FILE, null);
- String moduleName = map.getSimpleValue(PLUGIN_CONFIG_MODULE_NAME, null);
-
- if (sourceFile == null || moduleName == null) {
- log.info("A corrupted module name mapping found (" + sourceFile + " = " + moduleName
- + "). Check your module mappings in the plugin configuration for the server: "
- + resourceContext.getResourceKey());
- continue;
- }
-
- ret.put(sourceFile, moduleName);
- }
-
- return ret;
+ return moduleNames;
}
public ProcessInfo getCurrentProcessInfo() {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 7e5264a..7ff86ee 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -91,8 +91,8 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
}
}
- private static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
- private static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_13;
+ public static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
+ public static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_13;
static {
MODULE_SOURCE_FILE_TO_MODULE_NAME_20 = new LinkedHashMap<String, String>();
@@ -319,12 +319,12 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
PluginDescriptorBasedAugeasConfiguration.INCLUDE_GLOBS_PROP, serverConfigFile);
pluginConfig.put(inclusionGlobs);
- addModuleNames(pluginConfig, binaryInfo.getVersion());
+ pluginConfig.put(new PropertyList(ApacheServerComponent.PLUGIN_CONFIG_CUSTOM_MODULE_NAMES));
ApacheDirectiveTree serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
//extract the runtime configuration out of declared config
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getModuleNames(binaryInfo.getVersion()));
+ serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()));
String serverUrl = null;
String vhostsGlobInclude = null;
@@ -336,7 +336,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
serverRootProp.setValue(serverRoot);
//reparse the configuration with the new ServerRoot
serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getModuleNames(binaryInfo.getVersion()));
+ serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()));
}
serverUrl = getUrl(serverConfig, binaryInfo.getVersion());
@@ -748,20 +748,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
}
}
- private static void addModuleNames(Configuration pluginConfig, String version) {
- PropertyList list = new PropertyList(ApacheServerComponent.PLUGIN_CONFIG_MODULE_NAMES);
- pluginConfig.put(list);
-
- for(Map.Entry<String, String> entry : getModuleNames(version).entrySet()) {
- PropertyMap map = new PropertyMap(ApacheServerComponent.PLUGIN_CONFIG_MODULE_MAPPING);
- list.add(map);
-
- map.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_MODULE_SOURCE_FILE, entry.getKey()));
- map.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_MODULE_NAME, entry.getValue()));
- }
- }
-
- private static Map<String, String> getModuleNames(String version) {
+ public static Map<String, String> getDefaultModuleNames(String version) {
switch (HttpdAddressUtility.get(version)) {
case APACHE_1_3 :
return MODULE_SOURCE_FILE_TO_MODULE_NAME_13;
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 48ebce9..8fa448f 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -131,15 +131,23 @@ public class RuntimeApacheConfiguration {
moduleName = moduleFile;
moduleFile = moduleFiles.get(moduleName);
- //reverse lookup failed - there is really no such module, then
if (moduleFile == null) {
- LOG.warn("Encountered unknown module name in an IfModule directive: " + moduleFile);
- continue;
+ //reverse lookup failed - there is no such module in the mappings
+ //the last attempt is to see if the modulename wasn't used one of the previous
+ //load module directives
+ if (!currentlyLoadedModules.contains(moduleName)) {
+ LOG.warn("Encountered unknown module name in an IfModule directive: " + moduleFile);
+ continue;
+ }
}
}
-
- boolean result = currentlyLoadedModules.contains(moduleFile);
-
+
+ //the compiled in modules are being reported by apache using their source file
+ //and the on-demand loaded modules are identified by their
+ //module name - consistent, huh?
+ boolean result = currentlyLoadedModules.contains(moduleFile)
+ || currentlyLoadedModules.contains(moduleName);
+
if (result != negate) {
nodesToPromote.add(node);
} else {
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
index 2c2d521..b80a3f3 100644
--- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
@@ -356,14 +356,18 @@
</c:group>
<c:group name="Advanced">
- <c:list-property name="moduleNames">
- <c:description>This list contains all the known mappings from the module source file name (as used in IfModule directive)
- to module name (as used in LoadModule directive). Extracting this information from the module binary is rather difficult without
- having to support the different binary layouts of those files between apache versions (and operating systems).
- This list contains all the standard modules referenced in the official apache documentation.
- Please add all the modules you are using in your apache configuration so that the plugin can
- correctly detect the configuration in use (if some of it is guarded by using IfModule directives, the plugin needs an entry in
- this map to figure out whether the module is in fact being used at runtime or not).</c:description>
+ <c:list-property name="customModuleNames">
+ <c:description>
+ Apache can use 2 values to identify a module. Either its module name that is used in the LoadModule directive
+ or its source file that can be used in the IfModule directive (as of Apache 2.1 the IfModule directive can but doesn't have to
+ use the module name, too).
+
+ The plugin contains the mappings of the module names to module files for all the standard apache modules mentioned
+ on the http://httpd.apache.org/docs/current/mod/ plus the SNMP module and mod_jk.
+
+ If you use any non-standard modules and use their source file in the IfModule directives, you have to add the module-name-to-module-file
+ mapping to this list so that the plugin can determine the correct runtime configuration of the apache instance.
+ </c:description>
<c:map-property name="moduleMapping">
<c:simple-property name="moduleSourceFile" description="The source file of the module (as used in IfModule directives)"/>
<c:simple-property name="moduleName" description="The name of the module (as used in LoadModule directives)"/>
commit 28cb298cbed14c2843c2245f1411f74834c6b9c2
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 13 18:04:57 2011 -0400
A fix to eliminate duplicate refresh of table data (commit abc7cd665aa8a)
exposed issues in some of our view impls that unintentionally relied
on the refresh (second fetch) to work.
In short, the broken views need to supply initialCriteria for the first
fetch (nitiated by autoFetch=true on the listgrid).
But, we may not want that initialCriteria to be "fixed" for future fetches,
so I added an easy way to override that behavior.
This commit fixes the event history view. Subsequent commits will fix the
other broken views.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index a353a59..401a27c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -118,7 +118,8 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
private boolean showFilterForm = true;
private String tableTitle;
- private Criteria fixedCriteria;
+ private Criteria initialCriteria;
+ private boolean initialCriteriaFixed = true;
private SortSpecifier[] sortSpecifiers;
private String[] excludedFieldNames;
private boolean autoFetchData;
@@ -152,6 +153,10 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
this(locatorId, tableTitle, null, sortSpecifiers, null, true);
}
+ protected Table(String locatorId, String tableTitle, SortSpecifier[] sortSpecifiers, Criteria criteria) {
+ this(locatorId, tableTitle, criteria, sortSpecifiers, null, true);
+ }
+
public Table(String locatorId, String tableTitle, boolean autoFetchData) {
this(locatorId, tableTitle, null, null, null, autoFetchData);
}
@@ -174,7 +179,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
setOverflow(Overflow.HIDDEN);
this.tableTitle = tableTitle;
- this.fixedCriteria = criteria;
+ this.initialCriteria = criteria;
this.sortSpecifiers = sortSpecifiers;
this.excludedFieldNames = excludedFieldNames;
this.autoFetchData = autoFetchData;
@@ -235,8 +240,8 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
listGrid = new LocatableListGrid(contents.extendLocatorId("ListGrid"));
listGrid.setAutoFetchData(autoFetchData);
- if (fixedCriteria != null) {
- listGrid.setInitialCriteria(fixedCriteria);
+ if (initialCriteria != null) {
+ listGrid.setInitialCriteria(initialCriteria);
}
if (sortSpecifiers != null) {
listGrid.setInitialSort(sortSpecifiers);
@@ -555,28 +560,47 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
}
+ protected boolean isInitialCriteriaFixed() {
+ return initialCriteriaFixed;
+ }
+
+ /**
+ * @param initialCriteriaFixed If true initialCriteria is applied to all subsequent fetch criteria. If false
+ * initialCriteria is used only for the initial autoFetch. Irrelevant if autoFetch is false. Default is true.
+ */
+ protected void setInitialCriteriaFixed(boolean initialCriteriaFixed) {
+ this.initialCriteriaFixed = initialCriteriaFixed;
+ }
+
/**
*
* @return the current criteria, which includes any fixed criteria, as well as any user-specified filters; may be
* null if there are no fixed criteria or user-specified filters
*/
protected Criteria getCurrentCriteria() {
- Criteria criteria;
+ Criteria criteria = null;
+
// If this table has a filter form (table filters OR search bar),
// we need to refresh it as per the filtering, combined with any fixed criteria.
if (this.filterForm != null && this.filterForm.hasContent()) {
+
criteria = this.filterForm.getValuesAsCriteria();
- if (criteria != null) {
- if (this.fixedCriteria != null) {
- // There is fixed criteria - add it to the filter form criteria.
- addCriteria(criteria, this.fixedCriteria);
+
+ if (this.initialCriteriaFixed) {
+ if (criteria != null) {
+ if (this.initialCriteria != null) {
+ // There is fixed criteria - add it to the filter form criteria.
+ addCriteria(criteria, this.initialCriteria);
+ }
+ } else {
+ criteria = this.initialCriteria;
}
- } else {
- criteria = this.fixedCriteria;
}
- } else {
- criteria = this.fixedCriteria;
+ } else if (this.initialCriteriaFixed) {
+
+ criteria = this.initialCriteria;
}
+
return criteria;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
index 6768fce..df8a406 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
@@ -72,6 +72,10 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
super(locatorId, tableTitle, sortSpecifiers);
}
+ protected TableSection(String locatorId, String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers) {
+ super(locatorId, tableTitle, sortSpecifiers, criteria);
+ }
+
protected TableSection(String locatorId, String tableTitle, boolean autoFetchData) {
super(locatorId, tableTitle, autoFetchData);
}
@@ -175,8 +179,8 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
}
Integer recordId = getId(record);
String detailsUrl = "#" + getBasePath() + "/" + recordId;
- String formattedValue = (escapeHtmlInDetailsLinkColumn) ? StringUtility.escapeHtml(value.toString()) :
- value.toString();
+ String formattedValue = (escapeHtmlInDetailsLinkColumn) ? StringUtility.escapeHtml(value.toString())
+ : value.toString();
return SeleniumUtility.getLocatableHref(detailsUrl, formattedValue, null);
}
};
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
index 490ee4f..f2f8acc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeDatasource.java
@@ -133,6 +133,7 @@ public class EventCompositeDatasource extends RPCDataSource<EventComposite, Even
});
}
+ @SuppressWarnings("unchecked")
@Override
protected EventCriteria getFetchCriteria(final DSRequest request) {
EventSeverity[] severities = getArrayFilter(request, "severities", EventSeverity.class);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
index 8456f2b..673ad1d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/event/EventCompositeHistoryView.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.SortDirection;
@@ -57,10 +58,22 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*/
public class EventCompositeHistoryView extends TableSection<EventCompositeDatasource> {
- private static SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier("timestamp", SortDirection.DESCENDING);
+ private static final SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier("timestamp", SortDirection.DESCENDING);
+ private static final Criteria INITIAL_CRITERIA = new Criteria();
private EntityContext context;
private boolean hasWriteAccess;
+ static {
+ EventSeverity[] severityValues = EventSeverity.values();
+ String[] severityNames = new String[severityValues.length];
+ int i = 0;
+ for (EventSeverity s : severityValues) {
+ severityNames[i++] = s.name();
+ }
+
+ INITIAL_CRITERIA.addCriteria("severities", severityNames);
+ }
+
public static EventCompositeHistoryView get(String locatorId, ResourceGroupComposite composite) {
String tableTitle = MSG.view_inventory_eventHistory_groupEventHistory();
EntityContext context = EntityContext.forGroup(composite.getResourceGroup().getId());
@@ -76,10 +89,11 @@ public class EventCompositeHistoryView extends TableSection<EventCompositeDataso
}
private EventCompositeHistoryView(String locatorId, String tableTitle, EntityContext context, boolean hasWriteAccess) {
- super(locatorId, tableTitle, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
+ super(locatorId, tableTitle, INITIAL_CRITERIA, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
this.context = context;
this.hasWriteAccess = hasWriteAccess;
+ setInitialCriteriaFixed(false);
setDataSource(new EventCompositeDatasource(this.context));
}
commit d3b8e692977850ad7469c6c6e8a423f8ff0f58a8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 13 16:25:47 2011 -0400
somewhat related to BZ 680167 - make the plugin config history page sorted on ID just as the config history page is
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationHistoryDataSource.java
index 3e4e1d2..39a5d3c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationHistoryDataSource.java
@@ -33,7 +33,9 @@ import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
import org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
@@ -160,7 +162,9 @@ public class PluginConfigurationHistoryDataSource extends
criteria.fetchResource(true);
criteria.fetchGroupConfigurationUpdate(true);
- criteria.setPageControl(getPageControl(request));
+ PageControl pc = getPageControl(request);
+ pc.addDefaultOrderingField(Field.ID, PageOrdering.DESC);
+ criteria.setPageControl(pc);
final Integer resourceId = (Integer) request.getCriteria().getValues().get(CriteriaField.RESOURCE_ID);
if (resourceId != null) {
commit ea2dc1196a085b63e13ed159ba82cc089cb451ce
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 13 15:26:53 2011 -0400
Fix related to [BZ 680167]
- Prevent listgrid sort request from generating an unwanted config
history datasource fetch. Utilize server-side sorting via PageList
support in Criteria API.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
index 0804cbf..72966cf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
@@ -90,7 +89,6 @@ public abstract class AbstractConfigurationHistoryView<T extends AbstractConfigu
protected void configureTable() {
List<ListGridField> fields = getDataSource().getListGridFields(this.resourceId == null);
setListGridFields(true, fields.toArray(new ListGridField[fields.size()])); // true = always show the ID field
- getListGrid().sort(AbstractConfigurationHistoryDataSource.Field.ID, SortDirection.DESCENDING);
addTableAction(extendLocatorId("Delete"), MSG.common_button_delete(), MSG.common_msg_areYouSure(),
new AbstractTableAction(hasWritePerm ? TableActionEnablement.ANY : TableActionEnablement.NEVER) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
index d7556d7..f797849 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
@@ -33,7 +33,9 @@ import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
@@ -161,7 +163,9 @@ public class ConfigurationHistoryDataSource extends
criteria.fetchResource(true);
criteria.fetchGroupConfigurationUpdate(true);
- criteria.setPageControl(getPageControl(request));
+ PageControl pc = getPageControl(request);
+ pc.addDefaultOrderingField(Field.ID, PageOrdering.DESC);
+ criteria.setPageControl(pc);
final Integer resourceId = (Integer) request.getCriteria().getValues().get(CriteriaField.RESOURCE_ID);
if (resourceId != null) {
commit 3ef4886883d543ca0c0b061863f87aa26ac19327
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 13 15:15:05 2011 -0400
implement a datasource stats debug window. control-alt-s brings up the window.
you have to toggle it on to start collecting data from datasource responses.
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 c51da62..8dcf52f 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
@@ -51,6 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
import org.rhq.enterprise.gui.coregui.client.report.ReportTopView;
import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
import org.rhq.enterprise.gui.coregui.client.test.TestRemoteServiceStatisticsView;
+import org.rhq.enterprise.gui.coregui.client.test.TestDataSourceResponseStatisticsView;
import org.rhq.enterprise.gui.coregui.client.test.TestTopView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
import org.rhq.enterprise.gui.coregui.client.util.WidgetUtility;
@@ -131,8 +132,11 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
});
}
+ // Control-Shift-S for aggregate rpc service stats
KeyIdentifier statisticsWindowKey = new KeyIdentifier();
statisticsWindowKey.setCtrlKey(true);
+ statisticsWindowKey.setShiftKey(true);
+ statisticsWindowKey.setAltKey(false);
statisticsWindowKey.setKeyName("S");
Page.registerKey(statisticsWindowKey, new KeyCallback() {
public void execute(String keyName) {
@@ -140,6 +144,18 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
});
+ // Control-Alt-S for response stats
+ KeyIdentifier responseStatsWindowKey = new KeyIdentifier();
+ responseStatsWindowKey.setCtrlKey(true);
+ statisticsWindowKey.setShiftKey(false);
+ responseStatsWindowKey.setAltKey(true);
+ responseStatsWindowKey.setKeyName("s");
+ Page.registerKey(responseStatsWindowKey, new KeyCallback() {
+ public void execute(String keyName) {
+ TestDataSourceResponseStatisticsView.showInWindow();
+ }
+ });
+
KeyIdentifier messageCenterWindowKey = new KeyIdentifier();
messageCenterWindowKey.setCtrlKey(true);
messageCenterWindowKey.setKeyName("M");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestDataSourceResponseStatisticsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestDataSourceResponseStatisticsView.java
new file mode 100644
index 0000000..cf9f2df
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestDataSourceResponseStatisticsView.java
@@ -0,0 +1,406 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-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.test;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.Timer;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.data.RecordList;
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.rpc.DataSourceResponseStatistics;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
+
+/**
+ * A view that gives a display of statistics for datasource responses.
+ *
+ * @see RPCDataSource
+ *
+ * @author John Mazzitelli
+ */
+public class TestDataSourceResponseStatisticsView extends Table {
+
+ public static void showInWindow() {
+ new StatisticsWindow("DataSourceResponseStatisticsWindow").show();
+ }
+
+ private static final String TABLE_TITLE_PREFIX = "DataSource Response Statistics";
+ private static String timerTitleString = null;
+
+ private static String getTableTitle() {
+ String t = TABLE_TITLE_PREFIX + (DataSourceResponseStatistics.isEnableCollection() ? " (COLLECTING DATA)" : "");
+ if (timerTitleString != null) {
+ t += timerTitleString;
+ }
+ return t;
+ }
+
+ // these are used both as the name of the fields, titles of the headers and the columns of the CSV output
+ private static final String FIELD_TIMESTAMP = "timestamp";
+ private static final String FIELD_REQUEST_ID = "requestId";
+ private static final String FIELD_STATUS = "status";
+ private static final String FIELD_TOTAL_ROWS = "totalRows";
+ private static final String FIELD_START_ROW = "startRow";
+ private static final String FIELD_END_ROW = "endRow";
+
+ private static final SortSpecifier[] defaultSorts = new SortSpecifier[] { new SortSpecifier(FIELD_TIMESTAMP,
+ SortDirection.ASCENDING) };
+
+ // if this is not null, this view is hosted by this standalone Window
+ private StatisticsWindow window = null;
+ private Timer refreshTimer = null;
+ private boolean refreshOnPageChange = false;
+
+ public TestDataSourceResponseStatisticsView(String locatorId) {
+ super(locatorId, getTableTitle(), null, defaultSorts, null, false);
+
+ refreshTimer = new Timer() {
+ @Override
+ public void run() {
+ refresh();
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void configureTable() {
+ ListGridField timestamp = new ListGridField(FIELD_TIMESTAMP, "Timestamp");
+ ListGridField reqId = new ListGridField(FIELD_REQUEST_ID, "Request ID");
+ ListGridField status = new ListGridField(FIELD_STATUS, "Status");
+ ListGridField totalRows = new ListGridField(FIELD_TOTAL_ROWS, "Total Rows");
+ ListGridField startRow = new ListGridField(FIELD_START_ROW, "Start Row");
+ ListGridField endRow = new ListGridField(FIELD_END_ROW, "End Row");
+
+ timestamp.setType(ListGridFieldType.DATE);
+ TimestampCellFormatter.prepareDateField(timestamp);
+
+ status.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value == null) {
+ return "?";
+ }
+ int statusNum = ((Integer) value).intValue();
+ if (statusNum == DSResponse.STATUS_SUCCESS) {
+ return "SUCCESS";
+ } else if (statusNum == DSResponse.STATUS_FAILURE) {
+ return "FAILURE";
+ } else if (statusNum == DSResponse.STATUS_SERVER_TIMEOUT) {
+ return "SERVER TIMEOUT";
+ } else if (statusNum == DSResponse.STATUS_TRANSPORT_ERROR) {
+ return "TRANSPORT ERROR";
+ }
+ return value.toString(); // just return the actual number for all other, rare, error codes
+ }
+ });
+
+ timestamp.setAlign(Alignment.LEFT);
+ reqId.setAlign(Alignment.RIGHT);
+ status.setAlign(Alignment.CENTER);
+ totalRows.setAlign(Alignment.CENTER);
+ startRow.setAlign(Alignment.CENTER);
+ endRow.setAlign(Alignment.CENTER);
+
+ timestamp.setWidth("20%");
+ reqId.setWidth("*");
+ status.setWidth("10%");
+ totalRows.setWidth("10%");
+ startRow.setWidth("10%");
+ endRow.setWidth("10%");
+
+ getListGrid().setFields(timestamp, reqId, status, totalRows, startRow, endRow);
+ refresh();
+
+ addTableAction(extendLocatorId("toggleCollection"), "Toggle On/Off", MSG.common_msg_areYouSure(),
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ boolean toBeEnabled = !DataSourceResponseStatistics.isEnableCollection();
+ DataSourceResponseStatistics.setEnableCollection(toBeEnabled);
+
+ if (!toBeEnabled) {
+ // disabling collection - no need to periodically refresh anymore so cancel timers
+ refreshTimer.cancel();
+ refreshOnPageChange = false;
+ timerTitleString = null;
+ }
+
+ setTableTitle(getTableTitle());
+ if (window != null) {
+ window.setTitle(getTableTitle());
+ }
+ }
+ });
+
+ addTableAction(extendLocatorId("deleteAll"), MSG.common_button_delete_all(), MSG.common_msg_areYouSure(),
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ DataSourceResponseStatistics.clearAll();
+ refresh();
+ }
+ });
+
+ addTableAction(extendLocatorId("export"), "Export To CSV",
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ StringBuilder csv = new StringBuilder();
+ csv.append(FIELD_TIMESTAMP).append(',') //
+ .append(FIELD_REQUEST_ID).append(',') //
+ .append(FIELD_STATUS).append(',') //
+ .append(FIELD_TOTAL_ROWS).append(',') //
+ .append(FIELD_START_ROW).append(',') //
+ .append(FIELD_END_ROW).append('\n');
+
+ RecordList records = getListGrid().getDataAsRecordList();
+ int recordsSize = records.getLength();
+ for (int i = 0; i < recordsSize; i++) {
+ Record record = records.get(i);
+ csv.append(record.getAttributeAsDate(FIELD_TIMESTAMP)).append(',') //
+ .append(record.getAttribute(FIELD_REQUEST_ID)).append(',') //
+ .append(record.getAttribute(FIELD_STATUS)).append(',') //
+ .append(record.getAttribute(FIELD_TOTAL_ROWS)).append(',') //
+ .append(record.getAttribute(FIELD_START_ROW)).append(',') //
+ .append(record.getAttribute(FIELD_END_ROW)).append('\n');
+ }
+
+ new MessageWindow(extendLocatorId("csv"), "Export To CSV", "<pre>" + csv.toString() + "</pre>")
+ .show();
+ }
+ });
+
+ addTableAction(extendLocatorId("refresh"), MSG.common_button_refresh(), new AbstractTableAction(
+ TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ refresh();
+ }
+ });
+
+ if (window != null) {
+ LinkedHashMap<String, Integer> timerValues = new LinkedHashMap<String, Integer>();
+ timerValues.put("Now", Integer.valueOf("-2"));
+ timerValues.put(MSG.common_val_never(), Integer.valueOf("-1"));
+ timerValues.put("On Page Change", Integer.valueOf("0"));
+ timerValues.put("1", Integer.valueOf("1"));
+ timerValues.put("5", Integer.valueOf("5"));
+ timerValues.put("10", Integer.valueOf("10"));
+ timerValues.put("30", Integer.valueOf("30"));
+ timerValues.put("60", Integer.valueOf("60"));
+ History.addValueChangeHandler(new ValueChangeHandler<String>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<String> event) {
+ if (refreshOnPageChange) {
+ refresh();
+ }
+ }
+ });
+
+ addTableAction(extendLocatorId("refreshTimer"), "Refresh Timer", null, timerValues,
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+
+ Integer timeout = (Integer) actionValue;
+
+ // if being asked to refresh now, just refresh but don't touch our schedules
+ if (timeout == null || timeout.intValue() == -2) {
+ refresh();
+ return;
+ }
+
+ // cancel everything - will reinstate if user elected to do one of these
+ refreshTimer.cancel();
+ refreshOnPageChange = false;
+
+ if (timeout.intValue() == -1) {
+ timerTitleString = null;
+ } else if (timeout.intValue() == 0) {
+ refreshOnPageChange = true;
+ timerTitleString = " (refresh on page change)";
+ } else {
+ refreshTimer.scheduleRepeating(timeout.intValue() * 1000);
+ timerTitleString = " (refresh every " + timeout + "s)";
+ }
+
+ setTableTitle(getTableTitle());
+ if (window != null) {
+ window.setTitle(getTableTitle());
+ }
+ }
+ });
+ } else { // not in the standalone window
+ addTableAction(extendLocatorId("responseShowInWin"), "Show In Window", new AbstractTableAction(
+ TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ new StatisticsWindow(extendLocatorId("responseStatsWin")).show();
+ }
+ });
+ }
+
+ }
+
+ @Override
+ protected SelectionStyle getDefaultSelectionStyle() {
+ return SelectionStyle.NONE;
+ }
+
+ @Override
+ public boolean isShowFooterRefresh() {
+ return false;
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ getListGrid().setRecords(transform(DataSourceResponseStatistics.getAll()));
+ if (window != null) {
+ window.blink();
+ }
+ }
+
+ private ListGridRecord[] transform(ArrayList<DataSourceResponseStatistics.Record> arrayList) {
+ ListGridRecord[] results = new ListGridRecord[arrayList.size()];
+ for (int i = 0; i < arrayList.size(); i++) {
+ results[i] = transform(arrayList.get(i));
+ }
+ return results;
+ }
+
+ private ListGridRecord transform(DataSourceResponseStatistics.Record stat) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_TIMESTAMP, stat.timestamp);
+ record.setAttribute(FIELD_REQUEST_ID, stat.requestId);
+ record.setAttribute(FIELD_STATUS, stat.status);
+ record.setAttribute(FIELD_TOTAL_ROWS, stat.totalRows);
+ record.setAttribute(FIELD_START_ROW, stat.startRow);
+ record.setAttribute(FIELD_END_ROW, stat.endRow);
+ return record;
+ }
+
+ class MessageWindow extends LocatableWindow {
+ public MessageWindow(String locatorId, String title, String message) {
+ super(locatorId);
+
+ LocatableHTMLPane htmlPane = new LocatableHTMLPane(extendLocatorId("responseStatsWinDetailsPane"));
+ htmlPane.setMargin(10);
+ htmlPane.setDefaultWidth(600);
+ htmlPane.setDefaultHeight(400);
+ htmlPane.setContents(message);
+
+ setTitle(title);
+ setShowMinimizeButton(false);
+ setShowMaximizeButton(true);
+ setShowCloseButton(true);
+ setDismissOnEscape(false); // force close button to be pressed to ensure our close handler is called
+ setIsModal(true);
+ setShowModalMask(true);
+ setAutoSize(true);
+ setAutoCenter(true);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ markForDestroy();
+ }
+ });
+ addItem(htmlPane);
+ }
+ }
+
+ static class StatisticsWindow extends LocatableWindow {
+ private Timer blinkTimer;
+
+ public StatisticsWindow(String locatorId) {
+ super(locatorId);
+
+ final TestDataSourceResponseStatisticsView view;
+ view = new TestDataSourceResponseStatisticsView(extendLocatorId("ResponseStatsViewInWin"));
+ view.window = this;
+
+ setTitle(getTableTitle());
+ setShowMinimizeButton(true);
+ setShowMaximizeButton(true);
+ setShowCloseButton(true);
+ setIsModal(false);
+ setShowModalMask(false);
+ setWidth(800);
+ setHeight(400);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ view.refreshTimer.cancel();
+ view.refreshOnPageChange = false;
+ view.markForDestroy();
+ markForDestroy();
+ }
+ });
+
+ addItem(view);
+
+ final String origColor = getBodyColor();
+ blinkTimer = new Timer() {
+ @Override
+ public void run() {
+ setBodyColor(origColor);
+ setTitle(getTableTitle());
+ }
+ };
+ }
+
+ public void blink() {
+ // window.flash() isn't working so do it ourselves
+ if (getMinimized()) {
+ setTitle(getTableTitle() + " *");
+ } else {
+ setBodyColor(getHiliteBodyColor());
+ }
+ redraw();
+ blinkTimer.schedule(250);
+ }
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 4e4348e..d22fcef 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -59,6 +59,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.effects.ColoringUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.rpc.DataSourceResponseStatistics;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
@@ -206,6 +207,12 @@ public abstract class RPCDataSource<T, C extends org.rhq.core.domain.criteria.Cr
}
}
+ @Override
+ public void processResponse(String requestId, DSResponse responseProperties) {
+ super.processResponse(requestId, responseProperties);
+ DataSourceResponseStatistics.record(requestId, responseProperties);
+ }
+
protected void sendSuccessResponse(DSRequest request, DSResponse response, T dataObject) {
sendSuccessResponse(request, response, dataObject, null);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/DataSourceResponseStatistics.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/DataSourceResponseStatistics.java
new file mode 100644
index 0000000..40d6b83
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/DataSourceResponseStatistics.java
@@ -0,0 +1,64 @@
+package org.rhq.enterprise.gui.coregui.client.util.rpc;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import com.smartgwt.client.data.DSResponse;
+
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * Tracks responses received by {@link RPCDataSource}.
+ *
+ * @author John Mazzitelli
+ */
+public class DataSourceResponseStatistics {
+
+ public static class Record {
+ public Date timestamp;
+ public String requestId;
+ public int status;
+ public Integer totalRows;
+ public Integer startRow;
+ public Integer endRow;
+
+ private Record(String requestId, DSResponse response) {
+ this.timestamp = new Date();
+ this.requestId = requestId;
+ this.status = response.getStatus();
+ this.totalRows = response.getTotalRows();
+ this.startRow = response.getStartRow();
+ this.endRow = response.getEndRow();
+ }
+ }
+
+ private static boolean enableCollection = false;
+ private static ArrayList<Record> statistics = new ArrayList<Record>();
+
+ private DataSourceResponseStatistics() {
+ // static access only
+ }
+
+ public static boolean isEnableCollection() {
+ return enableCollection;
+ }
+
+ public static void setEnableCollection(boolean enabled) {
+ enableCollection = enabled;
+ }
+
+ public static void record(String requestId, DSResponse response) {
+ if (enableCollection) {
+ Record record = new Record(requestId, response);
+ statistics.add(record);
+ }
+ }
+
+ public static ArrayList<Record> getAll() {
+ return statistics;
+ }
+
+ public static void clearAll() {
+ statistics.clear();
+ }
+}
commit 7cb4d2d916a687e283e93adcc797e32c4da8b841
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 13 12:22:53 2011 -0400
why is the remote stats class in the i18n test package? move it up to the test package
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 17b9a00..c51da62 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
@@ -50,8 +50,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceT
import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
import org.rhq.enterprise.gui.coregui.client.report.ReportTopView;
import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
+import org.rhq.enterprise.gui.coregui.client.test.TestRemoteServiceStatisticsView;
import org.rhq.enterprise.gui.coregui.client.test.TestTopView;
-import org.rhq.enterprise.gui.coregui.client.test.i18n.TestRemoteServiceStatisticsView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
import org.rhq.enterprise.gui.coregui.client.util.WidgetUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRemoteServiceStatisticsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRemoteServiceStatisticsView.java
new file mode 100644
index 0000000..1c03410
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRemoteServiceStatisticsView.java
@@ -0,0 +1,348 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-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.test;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.Timer;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.data.RecordList;
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
+import org.rhq.enterprise.gui.coregui.client.util.rpc.RemoteServiceStatistics;
+import org.rhq.enterprise.gui.coregui.client.util.rpc.RemoteServiceStatistics.Record.Summary;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
+
+/**
+ * A view that gives a display of statistics for all remote services executed since the application was loaded.
+ *
+ * @author Joseph Marques
+ */
+public class TestRemoteServiceStatisticsView extends Table {
+
+ public static void showInWindow() {
+ new StatisticsWindow("StatisticsWindow").show();
+ }
+
+ public static final String TABLE_TITLE = "Remote Service Statistics";
+
+ // these are used both as the name of the fields, titles of the headers and the columns of the CSV output
+ private static final String FIELD_SERVICENAME = "serviceName";
+ private static final String FIELD_METHODNAME = "methodName";
+ private static final String FIELD_COUNT = "count";
+ private static final String FIELD_SLOWEST = "slowest";
+ private static final String FIELD_AVERAGE = "average";
+ private static final String FIELD_FASTEST = "fastest";
+ private static final String FIELD_STDDEV = "stddev";
+
+ private static final SortSpecifier[] defaultSorts = new SortSpecifier[] { new SortSpecifier("average",
+ SortDirection.DESCENDING) };
+
+ // if this is not null, this view is hosted by this standalone Window
+ private StatisticsWindow window = null;
+ private Timer refreshTimer = null;
+ private boolean refreshOnPageChange = false;
+
+ public TestRemoteServiceStatisticsView(String locatorId) {
+ super(locatorId, TABLE_TITLE, null, defaultSorts, null, false);
+
+ refreshTimer = new Timer() {
+ @Override
+ public void run() {
+ refresh();
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void configureTable() {
+ ListGridField serviceName = new ListGridField(FIELD_SERVICENAME, "Service Name");
+ ListGridField methodName = new ListGridField(FIELD_METHODNAME, "Method Name");
+ ListGridField count = new ListGridField(FIELD_COUNT, "Count");
+ ListGridField slowest = new ListGridField(FIELD_SLOWEST, "Slowest (ms)");
+ ListGridField average = new ListGridField(FIELD_AVERAGE, "Average (ms)");
+ ListGridField fastest = new ListGridField(FIELD_FASTEST, "Fastest (ms)");
+ ListGridField stddev = new ListGridField(FIELD_STDDEV, "Std Dev");
+
+ count.setAlign(Alignment.CENTER);
+ slowest.setAlign(Alignment.RIGHT);
+ average.setAlign(Alignment.RIGHT);
+ fastest.setAlign(Alignment.RIGHT);
+ stddev.setAlign(Alignment.RIGHT);
+
+ serviceName.setWidth("20%");
+ methodName.setWidth("*");
+ count.setWidth("8%");
+ slowest.setWidth("13%");
+ average.setWidth("13%");
+ fastest.setWidth("13%");
+ stddev.setWidth("8%");
+
+ getListGrid().setFields(serviceName, methodName, count, slowest, average, fastest, stddev);
+ refresh();
+
+ addTableAction(extendLocatorId("deleteAll"), MSG.common_button_delete_all(), MSG.common_msg_areYouSure(),
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ RemoteServiceStatistics.clearAll();
+ refresh();
+ }
+ });
+
+ addTableAction(extendLocatorId("export"), "Export To CSV",
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ StringBuilder csv = new StringBuilder();
+ csv.append(FIELD_SERVICENAME).append(',') //
+ .append(FIELD_METHODNAME).append(',') //
+ .append(FIELD_COUNT).append(',') //
+ .append(FIELD_SLOWEST).append(',') //
+ .append(FIELD_AVERAGE).append(',') //
+ .append(FIELD_FASTEST).append(',') //
+ .append(FIELD_STDDEV).append('\n');
+
+ RecordList records = getListGrid().getDataAsRecordList();
+ int recordsSize = records.getLength();
+ for (int i = 0; i < recordsSize; i++) {
+ Record record = records.get(i);
+ csv.append(record.getAttribute(FIELD_SERVICENAME)).append(',') //
+ .append(record.getAttribute(FIELD_METHODNAME)).append(',') //
+ .append(record.getAttribute(FIELD_COUNT)).append(',') //
+ .append(record.getAttribute(FIELD_SLOWEST)).append(',') //
+ .append(record.getAttribute(FIELD_AVERAGE)).append(',') //
+ .append(record.getAttribute(FIELD_FASTEST)).append(',') //
+ .append(record.getAttribute(FIELD_STDDEV)).append('\n');
+ }
+
+ new MessageWindow(extendLocatorId("csv"), "Export To CSV", "<pre>" + csv.toString() + "</pre>")
+ .show();
+ }
+ });
+
+ addTableAction(extendLocatorId("refresh"), MSG.common_button_refresh(), new AbstractTableAction(
+ TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ refresh();
+ }
+ });
+
+ if (window != null) {
+ LinkedHashMap<String, Integer> timerValues = new LinkedHashMap<String, Integer>();
+ timerValues.put("Now", Integer.valueOf("-2"));
+ timerValues.put(MSG.common_val_never(), Integer.valueOf("-1"));
+ timerValues.put("On Page Change", Integer.valueOf("0"));
+ timerValues.put("1", Integer.valueOf("1"));
+ timerValues.put("5", Integer.valueOf("5"));
+ timerValues.put("10", Integer.valueOf("10"));
+ timerValues.put("30", Integer.valueOf("30"));
+ timerValues.put("60", Integer.valueOf("60"));
+ History.addValueChangeHandler(new ValueChangeHandler<String>() {
+ @Override
+ public void onValueChange(ValueChangeEvent<String> event) {
+ if (refreshOnPageChange) {
+ refresh();
+ }
+ }
+ });
+
+ addTableAction(extendLocatorId("refreshTimer"), "Refresh Timer", null, timerValues,
+ new AbstractTableAction(TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+
+ Integer timeout = (Integer) actionValue;
+
+ // if being asked to refresh now, just refresh but don't touch our schedules
+ if (timeout == null || timeout.intValue() == -2) {
+ refresh();
+ return;
+ }
+
+ // cancel everything - will reinstate if user elected to do one of these
+ refreshTimer.cancel();
+ refreshOnPageChange = false;
+
+ if (timeout.intValue() == -1) {
+ setTableTitle(TABLE_TITLE);
+ } else if (timeout.intValue() == 0) {
+ refreshOnPageChange = true;
+ setTableTitle(TABLE_TITLE + " (refresh on page change)");
+ } else {
+ refreshTimer.scheduleRepeating(timeout.intValue() * 1000);
+ setTableTitle(TABLE_TITLE + " (refresh every " + timeout + "s)");
+ }
+ }
+ });
+ } else { // not in the standalone window
+ addTableAction(extendLocatorId("showInWin"), "Show In Window", new AbstractTableAction(
+ TableActionEnablement.ALWAYS) {
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ new StatisticsWindow(extendLocatorId("statsWin")).show();
+ }
+ });
+ }
+
+ }
+
+ @Override
+ protected SelectionStyle getDefaultSelectionStyle() {
+ return SelectionStyle.NONE;
+ }
+
+ @Override
+ public boolean isShowFooterRefresh() {
+ return false;
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ getListGrid().setRecords(transform(RemoteServiceStatistics.getAll()));
+ if (window != null) {
+ window.blink();
+ }
+ }
+
+ private ListGridRecord[] transform(List<Summary> stats) {
+ ListGridRecord[] results = new ListGridRecord[stats.size()];
+ for (int i = 0; i < stats.size(); i++) {
+ results[i] = transform(stats.get(i));
+ }
+ return results;
+ }
+
+ private ListGridRecord transform(Summary stat) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_SERVICENAME, stat.serviceName);
+ record.setAttribute(FIELD_METHODNAME, stat.methodName);
+ record.setAttribute(FIELD_COUNT, stat.count);
+ record.setAttribute(FIELD_SLOWEST, stat.slowest);
+ record.setAttribute(FIELD_AVERAGE, stat.average);
+ record.setAttribute(FIELD_FASTEST, stat.fastest);
+ record.setAttribute(FIELD_STDDEV, stat.stddev);
+ return record;
+ }
+
+ class MessageWindow extends LocatableWindow {
+ public MessageWindow(String locatorId, String title, String message) {
+ super(locatorId);
+
+ LocatableHTMLPane htmlPane = new LocatableHTMLPane(extendLocatorId("winDetailsPane"));
+ htmlPane.setMargin(10);
+ htmlPane.setDefaultWidth(600);
+ htmlPane.setDefaultHeight(400);
+ htmlPane.setContents(message);
+
+ setTitle(title);
+ setShowMinimizeButton(false);
+ setShowMaximizeButton(true);
+ setShowCloseButton(true);
+ setDismissOnEscape(false); // force close button to be pressed to ensure our close handler is called
+ setIsModal(true);
+ setShowModalMask(true);
+ setAutoSize(true);
+ setAutoCenter(true);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ markForDestroy();
+ }
+ });
+ addItem(htmlPane);
+ }
+ }
+
+ static class StatisticsWindow extends LocatableWindow {
+ private Timer blinkTimer;
+
+ public StatisticsWindow(String locatorId) {
+ super(locatorId);
+
+ final TestRemoteServiceStatisticsView view;
+ view = new TestRemoteServiceStatisticsView(extendLocatorId("StatsViewInWin"));
+ view.window = this;
+
+ setTitle(TABLE_TITLE);
+ setShowMinimizeButton(true);
+ setShowMaximizeButton(true);
+ setShowCloseButton(true);
+ setIsModal(false);
+ setShowModalMask(false);
+ setWidth(700);
+ setHeight(300);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ view.refreshTimer.cancel();
+ view.refreshOnPageChange = false;
+ view.markForDestroy();
+ markForDestroy();
+ }
+ });
+
+ addItem(view);
+
+ final String origColor = getBodyColor();
+ blinkTimer = new Timer() {
+ @Override
+ public void run() {
+ setBodyColor(origColor);
+ setTitle(TABLE_TITLE);
+ }
+ };
+ }
+
+ public void blink() {
+ // window.flash() isn't working so do it ourselves
+ if (getMinimized()) {
+ setTitle(TABLE_TITLE + " *");
+ } else {
+ setBodyColor(getHiliteBodyColor());
+ }
+ redraw();
+ blinkTimer.schedule(250);
+ }
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
index 1844270..58a6cd6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
@@ -39,7 +39,6 @@ import org.rhq.enterprise.gui.coregui.client.test.configuration.TestGroupConfigu
import org.rhq.enterprise.gui.coregui.client.test.configuration.TestReadOnlyConfigurationView;
import org.rhq.enterprise.gui.coregui.client.test.configuration.TestReadOnlyGroupConfigurationView;
import org.rhq.enterprise.gui.coregui.client.test.i18n.TestPluralizationView;
-import org.rhq.enterprise.gui.coregui.client.test.i18n.TestRemoteServiceStatisticsView;
import org.rhq.enterprise.gui.coregui.client.test.inventory.TestSearchBarView;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
deleted file mode 100644
index 7a36f1d..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-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.test.i18n;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.Timer;
-import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.RecordList;
-import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.types.SortDirection;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
-import com.smartgwt.client.widgets.events.CloseClientEvent;
-import com.smartgwt.client.widgets.grid.ListGridField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
-import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
-import org.rhq.enterprise.gui.coregui.client.components.table.Table;
-import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
-import org.rhq.enterprise.gui.coregui.client.util.rpc.RemoteServiceStatistics;
-import org.rhq.enterprise.gui.coregui.client.util.rpc.RemoteServiceStatistics.Record.Summary;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-
-/**
- * A view that gives a display of statistics for all remote services executed since the application was loaded.
- *
- * @author Joseph Marques
- */
-public class TestRemoteServiceStatisticsView extends Table {
-
- public static void showInWindow() {
- new StatisticsWindow("StatisticsWindow").show();
- }
-
- public static final String TABLE_TITLE = "Remote Service Statistics";
-
- // these are used both as the name of the fields, titles of the headers and the columns of the CSV output
- private static final String FIELD_SERVICENAME = "serviceName";
- private static final String FIELD_METHODNAME = "methodName";
- private static final String FIELD_COUNT = "count";
- private static final String FIELD_SLOWEST = "slowest";
- private static final String FIELD_AVERAGE = "average";
- private static final String FIELD_FASTEST = "fastest";
- private static final String FIELD_STDDEV = "stddev";
-
- private static final SortSpecifier[] defaultSorts = new SortSpecifier[] { new SortSpecifier("average",
- SortDirection.DESCENDING) };
-
- // if this is not null, this view is hosted by this standalone Window
- private StatisticsWindow window = null;
- private Timer refreshTimer = null;
- private boolean refreshOnPageChange = false;
-
- public TestRemoteServiceStatisticsView(String locatorId) {
- super(locatorId, TABLE_TITLE, null, defaultSorts, null, false);
-
- refreshTimer = new Timer() {
- @Override
- public void run() {
- refresh();
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void configureTable() {
- ListGridField serviceName = new ListGridField(FIELD_SERVICENAME, "Service Name");
- ListGridField methodName = new ListGridField(FIELD_METHODNAME, "Method Name");
- ListGridField count = new ListGridField(FIELD_COUNT, "Count");
- ListGridField slowest = new ListGridField(FIELD_SLOWEST, "Slowest (ms)");
- ListGridField average = new ListGridField(FIELD_AVERAGE, "Average (ms)");
- ListGridField fastest = new ListGridField(FIELD_FASTEST, "Fastest (ms)");
- ListGridField stddev = new ListGridField(FIELD_STDDEV, "Std Dev");
-
- count.setAlign(Alignment.CENTER);
- slowest.setAlign(Alignment.RIGHT);
- average.setAlign(Alignment.RIGHT);
- fastest.setAlign(Alignment.RIGHT);
- stddev.setAlign(Alignment.RIGHT);
-
- serviceName.setWidth("20%");
- methodName.setWidth("*");
- count.setWidth("8%");
- slowest.setWidth("13%");
- average.setWidth("13%");
- fastest.setWidth("13%");
- stddev.setWidth("8%");
-
- getListGrid().setFields(serviceName, methodName, count, slowest, average, fastest, stddev);
- refresh();
-
- addTableAction(extendLocatorId("deleteAll"), MSG.common_button_delete_all(), MSG.common_msg_areYouSure(),
- new AbstractTableAction(TableActionEnablement.ALWAYS) {
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- RemoteServiceStatistics.clearAll();
- refresh();
- }
- });
-
- addTableAction(extendLocatorId("export"), "Export To CSV",
- new AbstractTableAction(TableActionEnablement.ALWAYS) {
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- StringBuilder csv = new StringBuilder();
- csv.append(FIELD_SERVICENAME).append(',') //
- .append(FIELD_METHODNAME).append(',') //
- .append(FIELD_COUNT).append(',') //
- .append(FIELD_SLOWEST).append(',') //
- .append(FIELD_AVERAGE).append(',') //
- .append(FIELD_FASTEST).append(',') //
- .append(FIELD_STDDEV).append('\n');
-
- RecordList records = getListGrid().getDataAsRecordList();
- int recordsSize = records.getLength();
- for (int i = 0; i < recordsSize; i++) {
- Record record = records.get(i);
- csv.append(record.getAttribute(FIELD_SERVICENAME)).append(',') //
- .append(record.getAttribute(FIELD_METHODNAME)).append(',') //
- .append(record.getAttribute(FIELD_COUNT)).append(',') //
- .append(record.getAttribute(FIELD_SLOWEST)).append(',') //
- .append(record.getAttribute(FIELD_AVERAGE)).append(',') //
- .append(record.getAttribute(FIELD_FASTEST)).append(',') //
- .append(record.getAttribute(FIELD_STDDEV)).append('\n');
- }
-
- new MessageWindow(extendLocatorId("csv"), "Export To CSV", "<pre>" + csv.toString() + "</pre>")
- .show();
- }
- });
-
- addTableAction(extendLocatorId("refresh"), MSG.common_button_refresh(), new AbstractTableAction(
- TableActionEnablement.ALWAYS) {
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- refresh();
- }
- });
-
- if (window != null) {
- LinkedHashMap<String, Integer> timerValues = new LinkedHashMap<String, Integer>();
- timerValues.put("Now", Integer.valueOf("-2"));
- timerValues.put(MSG.common_val_never(), Integer.valueOf("-1"));
- timerValues.put("On Page Change", Integer.valueOf("0"));
- timerValues.put("1", Integer.valueOf("1"));
- timerValues.put("5", Integer.valueOf("5"));
- timerValues.put("10", Integer.valueOf("10"));
- timerValues.put("30", Integer.valueOf("30"));
- timerValues.put("60", Integer.valueOf("60"));
- History.addValueChangeHandler(new ValueChangeHandler<String>() {
- @Override
- public void onValueChange(ValueChangeEvent<String> event) {
- if (refreshOnPageChange) {
- refresh();
- }
- }
- });
-
- addTableAction(extendLocatorId("refreshTimer"), "Refresh Timer", null, timerValues,
- new AbstractTableAction(TableActionEnablement.ALWAYS) {
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
-
- Integer timeout = (Integer) actionValue;
-
- // if being asked to refresh now, just refresh but don't touch our schedules
- if (timeout == null || timeout.intValue() == -2) {
- refresh();
- return;
- }
-
- // cancel everything - will reinstate if user elected to do one of these
- refreshTimer.cancel();
- refreshOnPageChange = false;
-
- if (timeout.intValue() == -1) {
- setTableTitle(TABLE_TITLE);
- } else if (timeout.intValue() == 0) {
- refreshOnPageChange = true;
- setTableTitle(TABLE_TITLE + " (refresh on page change)");
- } else {
- refreshTimer.scheduleRepeating(timeout.intValue() * 1000);
- setTableTitle(TABLE_TITLE + " (refresh every " + timeout + "s)");
- }
- }
- });
- } else { // not in the standalone window
- addTableAction(extendLocatorId("showInWin"), "Show In Window", new AbstractTableAction(
- TableActionEnablement.ALWAYS) {
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- new StatisticsWindow(extendLocatorId("statsWin")).show();
- }
- });
- }
-
- }
-
- @Override
- protected SelectionStyle getDefaultSelectionStyle() {
- return SelectionStyle.NONE;
- }
-
- @Override
- public boolean isShowFooterRefresh() {
- return false;
- }
-
- @Override
- public void refresh() {
- super.refresh();
- getListGrid().setRecords(transform(RemoteServiceStatistics.getAll()));
- if (window != null) {
- window.blink();
- }
- }
-
- private ListGridRecord[] transform(List<Summary> stats) {
- ListGridRecord[] results = new ListGridRecord[stats.size()];
- for (int i = 0; i < stats.size(); i++) {
- results[i] = transform(stats.get(i));
- }
- return results;
- }
-
- private ListGridRecord transform(Summary stat) {
- ListGridRecord record = new ListGridRecord();
- record.setAttribute(FIELD_SERVICENAME, stat.serviceName);
- record.setAttribute(FIELD_METHODNAME, stat.methodName);
- record.setAttribute(FIELD_COUNT, stat.count);
- record.setAttribute(FIELD_SLOWEST, stat.slowest);
- record.setAttribute(FIELD_AVERAGE, stat.average);
- record.setAttribute(FIELD_FASTEST, stat.fastest);
- record.setAttribute(FIELD_STDDEV, stat.stddev);
- return record;
- }
-
- class MessageWindow extends LocatableWindow {
- public MessageWindow(String locatorId, String title, String message) {
- super(locatorId);
-
- LocatableHTMLPane htmlPane = new LocatableHTMLPane(extendLocatorId("winDetailsPane"));
- htmlPane.setMargin(10);
- htmlPane.setDefaultWidth(600);
- htmlPane.setDefaultHeight(400);
- htmlPane.setContents(message);
-
- setTitle(title);
- setShowMinimizeButton(false);
- setShowMaximizeButton(true);
- setShowCloseButton(true);
- setDismissOnEscape(false); // force close button to be pressed to ensure our close handler is called
- setIsModal(true);
- setShowModalMask(true);
- setAutoSize(true);
- setAutoCenter(true);
- setShowResizer(true);
- setCanDragResize(true);
- centerInPage();
- addCloseClickHandler(new CloseClickHandler() {
- @Override
- public void onCloseClick(CloseClientEvent event) {
- markForDestroy();
- }
- });
- addItem(htmlPane);
- }
- }
-
- static class StatisticsWindow extends LocatableWindow {
- private Timer blinkTimer;
-
- public StatisticsWindow(String locatorId) {
- super(locatorId);
-
- final TestRemoteServiceStatisticsView view;
- view = new TestRemoteServiceStatisticsView(extendLocatorId("StatsViewInWin"));
- view.window = this;
-
- setTitle(TABLE_TITLE);
- setShowMinimizeButton(true);
- setShowMaximizeButton(true);
- setShowCloseButton(true);
- setIsModal(false);
- setShowModalMask(false);
- setWidth(700);
- setHeight(300);
- setShowResizer(true);
- setCanDragResize(true);
- centerInPage();
- addCloseClickHandler(new CloseClickHandler() {
- @Override
- public void onCloseClick(CloseClientEvent event) {
- view.refreshTimer.cancel();
- view.refreshOnPageChange = false;
- view.markForDestroy();
- markForDestroy();
- }
- });
-
- addItem(view);
-
- final String origColor = getBodyColor();
- blinkTimer = new Timer() {
- @Override
- public void run() {
- setBodyColor(origColor);
- setTitle(TABLE_TITLE);
- }
- };
- }
-
- public void blink() {
- // window.flash() isn't working so do it ourselves
- if (getMinimized()) {
- setTitle(TABLE_TITLE + " *");
- } else {
- setBodyColor(getHiliteBodyColor());
- }
- redraw();
- blinkTimer.schedule(250);
- }
- }
-}
commit 497b943ecf7e2c101cf4f631b6ffd6097d88acec
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 13 15:24:31 2011 -0400
drop support for "gecko" user-agent, which represents FF 1.x
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 527bd94..7cff82b 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -48,15 +48,15 @@
ie6: IE6/IE7
ie8: IE8
- gecko: FF2
- gecko1_8: FF3
+ gecko: FF1 (NOTE: Support for this was dropped in GWT 2.1.)
+ gecko1_8: FF2/FF3/FF4
safari: Safari/Chrome
opera: Opera
Multiple agents can be specified as a comma-delimited list, as demonstrated by the default
value below.
-->
- <gwt.userAgent>ie6,ie8,gecko,gecko1_8,safari,opera</gwt.userAgent>
+ <gwt.userAgent>ie6,ie8,gecko1_8,safari,opera</gwt.userAgent>
<!-- Change this to "true" via the mvn command line or your ~/.m2/settings.xml to speed
up gwt compilation. -->
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 3d1f770..a7b603d 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -79,8 +79,8 @@
ie6: IE6/IE7
ie8: IE8
- gecko: FF2
- gecko1_8: FF3
+ gecko: FF1 (NOTE: Support for this was dropped in GWT 2.1.)
+ gecko1_8: FF2/FF3/FF4
safari: Safari/Chrome
opera: Opera
@@ -88,7 +88,7 @@
The gwt.userAgent property is substituted by the Maven resources plugin
during the resources phase. The default value (defined in coregui/pom.xml)
- is "ie6,ie8,gecko,gecko1_8,safari,opera" (i.e. all supported browsers).
+ is "ie6,ie8,gecko1_8,safari,opera" (i.e. all supported browsers, except FF1).
To override this value, specify the user.agent property on the mvn
command line (e.g. -Duser.agent=gecko1_8) or in your ~/.m2/settings.xml.
-->
commit 97ea71fc6d0f052ad7dcf250fdba1018db8018d1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 13 13:17:30 2011 -0400
refactor Table.refresh() to make it more straightforward
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index eb4d04a..a353a59 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -118,7 +118,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
private boolean showFilterForm = true;
private String tableTitle;
- private Criteria criteria;
+ private Criteria fixedCriteria;
private SortSpecifier[] sortSpecifiers;
private String[] excludedFieldNames;
private boolean autoFetchData;
@@ -174,7 +174,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
setOverflow(Overflow.HIDDEN);
this.tableTitle = tableTitle;
- this.criteria = criteria;
+ this.fixedCriteria = criteria;
this.sortSpecifiers = sortSpecifiers;
this.excludedFieldNames = excludedFieldNames;
this.autoFetchData = autoFetchData;
@@ -235,8 +235,8 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
listGrid = new LocatableListGrid(contents.extendLocatorId("ListGrid"));
listGrid.setAutoFetchData(autoFetchData);
- if (criteria != null) {
- listGrid.setInitialCriteria(criteria);
+ if (fixedCriteria != null) {
+ listGrid.setInitialCriteria(fixedCriteria);
}
if (sortSpecifiers != null) {
listGrid.setInitialSort(sortSpecifiers);
@@ -478,7 +478,6 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
public void onDataArrived(DataArrivedEvent dataArrivedEvent) {
if (null != listGrid) {
refreshTableInfo();
- fieldSizes.clear();
}
}
});
@@ -544,57 +543,44 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
this.showFooter = showFooter;
}
- private ArrayList<Integer> fieldSizes = new ArrayList<Integer>();
-
/**
- * Refreshes the list grid with the explicit criteria.
- * Usually you do not want to call this - to maintain proper filtering
- * and usage of the initial criteria, call {@link #refresh()} instead.
- *
- * @param criteria the criteria to use to refresh the table with
+ * Refreshes the list grid's data, filtered by any fixed criteria, as well as any user-specified filters.
*/
- protected void refresh(Criteria criteria) {
- if (null != this.listGrid) {
- if (criteria != null) {
- this.listGrid.setCriteria(criteria);
- }
+ public void refresh() {
+ if (this.listGrid != null) {
+ Criteria criteria = getCurrentCriteria();
+ this.listGrid.setCriteria(criteria);
this.listGrid.invalidateCache();
this.listGrid.markForRedraw();
}
}
/**
- * Refreshes the list grid so it reloads. This attempts to maintain
- * the original criteria along with any current filter settings.
+ *
+ * @return the current criteria, which includes any fixed criteria, as well as any user-specified filters; may be
+ * null if there are no fixed criteria or user-specified filters
*/
- public void refresh() {
- if (null != this.listGrid) {
- // if this table has a filter form (table filters OR search bar)
- // we need to refresh it as per the filtering.
- if (this.filterForm != null && this.filterForm.hasContent()) {
- Criteria filterFormCriteria = this.filterForm.getValuesAsCriteria();
- if (this.criteria == null) {
- // there was no initial criteria, filter based on the filter form data only
- refresh(filterFormCriteria);
- } else {
- // there is both initial criteria and filters. We need criteria that combines both.
- Criteria fullCriteria = new Criteria();
- addCriteria(fullCriteria, this.criteria);
- if (filterFormCriteria != null) {
- addCriteria(fullCriteria, filterFormCriteria);
- }
- refresh(fullCriteria);
+ protected Criteria getCurrentCriteria() {
+ Criteria criteria;
+ // If this table has a filter form (table filters OR search bar),
+ // we need to refresh it as per the filtering, combined with any fixed criteria.
+ if (this.filterForm != null && this.filterForm.hasContent()) {
+ criteria = this.filterForm.getValuesAsCriteria();
+ if (criteria != null) {
+ if (this.fixedCriteria != null) {
+ // There is fixed criteria - add it to the filter form criteria.
+ addCriteria(criteria, this.fixedCriteria);
}
} else {
- // If there are no filters, just do a default refresh by simply invalidating the cache.
- // This should reuse the original initial criteria.
- this.listGrid.invalidateCache();
- this.listGrid.markForRedraw();
+ criteria = this.fixedCriteria;
}
+ } else {
+ criteria = this.fixedCriteria;
}
+ return criteria;
}
- // Smartgwt 2.4's version of Criteria.addCriteria for some reason doesn't have else clauses for the array types
+ // SmartGWT 2.4's version of Criteria.addCriteria for some reason doesn't have else clauses for the array types
// and it doesn't handle Object types properly (seeing odd behavior because of this), so this method explicitly
// supports adding array types and Objects.
// This method takes the src criteria and adds it to the dest criteria.
commit 0aaae0296431f4f66d28f38dc4a60cbe028d276d
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 13 13:16:45 2011 -0400
add test to remote PS client that demonstrates how setting a prop to null does not work right
diff --git a/modules/jopr/etc/jbas5-jnp-client/client.sh b/modules/jopr/etc/jbas5-jnp-client/client.sh
old mode 100644
new mode 100755
index 240f137..f4285ce
--- a/modules/jopr/etc/jbas5-jnp-client/client.sh
+++ b/modules/jopr/etc/jbas5-jnp-client/client.sh
@@ -9,7 +9,11 @@
MAIN_JAR_NAME=jbas5-jnp-client-1.0.jar
MAIN_CLASS=test.RmiClient
-JBOSS_HOME=/home/ips/Applications/jboss-6.0.0-SNAPSHOT
+JBOSS_HOME=/home/ips/Applications/jboss-eap-5.1/jboss-as
+if [ ! -d "$JBOSS_HOME" ]; then
+ echo "Dir specified by JBOSS_HOME variable ($JBOSS_HOME) does not exist."
+ exit 1
+fi
JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8788"
@@ -44,6 +48,12 @@ JAVA=$JAVA_HOME/bin/java
# JBOSS_CLASSPATH was not yet set
#if not "%JBOSS_CLASSPATH%" == "" GOTO HAVE_JB_CP
JBOSS_CLASSPATH=$JBOSS_HOME/client/jbossall-client.jar
+# AS 6.0 M1 and later needs the following two jars
+JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JBOSS_HOME/lib/jboss-classpool.jar
+JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JBOSS_HOME/lib/jboss-classpool-scoped.jar
+# AS 6.0 M4 and later needs the following two jars
+JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JBOSS_HOME/common/lib/jboss-as-profileservice.jar
+JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JBOSS_HOME/lib/jboss-profileservice-spi.jar
# For the call to new InitialContext() (using org.jnp.interfaces.NamingContextFactory)...
#JBOSS_CLASSPATH=$JBOSS_CLASSPATH:$JBOSS_HOME/client/jnp-client.jar
diff --git a/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java b/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
index 91b23ee..685897b 100644
--- a/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
+++ b/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
@@ -7,6 +7,10 @@ import javax.naming.InitialContext;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.profileservice.spi.ProfileService;
public class RmiClient
@@ -35,11 +39,25 @@ public class RmiClient
DeploymentManager deploymentManager = profileService.getDeploymentManager();
System.err.println("DeploymentManager: " + deploymentManager);
- profileService.getDomains();
- profileService.getProfileKeys();
+ //profileService.getDomains();
+ //profileService.getProfileKeys();
managementView.load();
- managementView.getDeploymentNames();
- deploymentManager.getProfiles();
+ //managementView.getDeploymentNames();
+ //deploymentManager.getProfiles();
+
+ ComponentType localTxDataSourceType = new ComponentType("DataSource", "LocalTx");
+ ManagedComponent defaultDSComponent = managementView.getComponent("DefaultDS", localTxDataSourceType);
+ ManagedProperty maxPoolSizeProp = defaultDSComponent.getProperty("max-pool-size");
+ SimpleValueSupport maxPoolSizeValue = (SimpleValueSupport)maxPoolSizeProp.getValue();
+ System.err.println("original value: " + maxPoolSizeValue.getValue());
+ maxPoolSizeValue.setValue(null);
+ managementView.updateComponent(defaultDSComponent);
+
+ managementView.load();
+ defaultDSComponent = managementView.getComponent("DefaultDS", localTxDataSourceType);
+ maxPoolSizeProp = defaultDSComponent.getProperty("max-pool-size");
+ maxPoolSizeValue = ((SimpleValueSupport)maxPoolSizeProp.getValue());
+ System.err.println("new value: " + maxPoolSizeValue.getValue());
}
}
commit 24dd3ebadfca65618caad06ab45887a09d0f3972
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Apr 13 17:50:24 2011 +0200
BZ 694476 - We now correctly determine the runtime configuration of the apache server
by taking into account the list of loaded modules and -D options passed to it on commandline.
With this in place, it is possible to deterministically match the discovered vhost resources
with the vhosts from the list returned by the SNMP plugin merely knowing the ordering in which
the SNMP plugin returns the list.
This commit contains both of the above fixes.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index a9e3949..cea063e 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -22,8 +22,11 @@ import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Collections;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -43,6 +46,9 @@ import org.rhq.augeas.util.Glob;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.event.EventSeverity;
@@ -65,6 +71,7 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.core.system.OperatingSystemType;
+import org.rhq.core.system.ProcessInfo;
import org.rhq.core.system.SystemInfo;
import org.rhq.plugins.apache.augeas.ApacheAugeasNode;
import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
@@ -121,6 +128,11 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
public static final String PLUGIN_CONFIG_VHOST_IN_SINGLE_FILE_PROP_VALUE = "single-file";
public static final String PLUGIN_CONFIG_VHOST_PER_FILE_PROP_VALUE = "vhost-per-file";
+ public static final String PLUGIN_CONFIG_MODULE_NAMES = "moduleNames";
+ public static final String PLUGIN_CONFIG_MODULE_MAPPING = "moduleMapping";
+ public static final String PLUGIN_CONFIG_MODULE_NAME = "moduleName";
+ public static final String PLUGIN_CONFIG_MODULE_SOURCE_FILE = "moduleSourceFile";
+
public static final String AUXILIARY_INDEX_PROP = "_index";
public static final String SERVER_BUILT_TRAIT = "serverBuilt";
@@ -154,7 +166,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
this.resourceContext = resourceContext;
this.eventContext = resourceContext.getEventContext();
this.snmpClient = new SNMPClient();
-
+
try {
boolean configured = false;
@@ -401,7 +413,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
ApacheParser parser = new ApacheParserImpl(parserTree,getServerRoot().getAbsolutePath());
ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser);
- addr = getAddressUtility().getVirtualHostSampleAddress(parserTree, vhostDefs[0], serverName, false);
+ addr = getAddressUtility().getVirtualHostSampleAddress(parserTree, vhostDefs[0], serverName);
} catch (Exception e) {
report.setStatus(CreateResourceStatus.FAILURE);
report.setErrorMessage("Wrong format of virtual host resource name.");
@@ -751,6 +763,42 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
}
}
+ public Map<String, String> getModuleNames() {
+ PropertyList list = resourceContext.getPluginConfiguration().getList(PLUGIN_CONFIG_MODULE_NAMES);
+
+ if (list == null) {
+ log.warn("Could not find the list of the module names. This should not happen as that is a required property.");
+ return Collections.emptyMap();
+ }
+
+ Map<String, String> ret = new HashMap<String, String>();
+
+ for (Property p : list.getList()) {
+ PropertyMap map = (PropertyMap) p;
+ String sourceFile = map.getSimpleValue(PLUGIN_CONFIG_MODULE_SOURCE_FILE, null);
+ String moduleName = map.getSimpleValue(PLUGIN_CONFIG_MODULE_NAME, null);
+
+ if (sourceFile == null || moduleName == null) {
+ log.info("A corrupted module name mapping found (" + sourceFile + " = " + moduleName
+ + "). Check your module mappings in the plugin configuration for the server: "
+ + resourceContext.getResourceKey());
+ continue;
+ }
+
+ ret.put(sourceFile, moduleName);
+ }
+
+ return ret;
+ }
+
+ public ProcessInfo getCurrentProcessInfo() {
+ return resourceContext.getNativeProcess();
+ }
+
+ public ApacheBinaryInfo getCurrentBinaryInfo() {
+ return binaryInfo;
+ }
+
// TODO: Move this method to a helper class.
static void addSnmpMetricValueToReport(MeasurementReport report, MeasurementScheduleRequest schedule,
SNMPValue snmpValue, boolean valueIsTimestamp) throws SNMPException {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index c82d3ae..7e5264a 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -20,16 +20,17 @@ package org.rhq.plugins.apache;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URI;
-import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
@@ -37,10 +38,13 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+
import org.rhq.augeas.util.Glob;
import org.rhq.augeas.util.GlobFilter;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
@@ -63,6 +67,7 @@ import org.rhq.plugins.apache.util.AugeasNodeValueUtil;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
import org.rhq.plugins.apache.util.HttpdAddressUtility.Address;
import org.rhq.plugins.apache.util.OsProcessUtility;
+import org.rhq.plugins.apache.util.RuntimeApacheConfiguration;
import org.rhq.plugins.platform.PlatformComponent;
import org.rhq.rhqtransform.impl.PluginDescriptorBasedAugeasConfiguration;
@@ -85,6 +90,151 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
super(message);
}
}
+
+ private static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
+ private static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_13;
+
+ static {
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20 = new LinkedHashMap<String, String>();
+
+ //these are extracted from http://httpd.apache.org/docs/current/mod/
+ //and linked pages
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("beos.c", "mpm_beos_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("event.c", "mpm_event_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mpm_netware.c", "mpm_netware_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mpmt_os2.c", "mpm_mpmt_os2_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("prefork.c", "mpm_prefork_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mpm_winnt.c", "mpm_winnt_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("worker.c", "mpm_worker_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_actions.c", "actions_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_alias.c", "alias_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_asis.c", "asis_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_auth_basic.c", "auth_basic_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_auth_digest.c", "auth_digest_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_alias.c", "authn_alias_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_anon.c", "authn_anon_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_dbd.c", "authn_dbd_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_dbm.c", "authn_dbm_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_default.c", "authn_default_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authn_file.c", "authn_file_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authnz_ldap.c", "authnz_ldap_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_dbm.c", "authz_dbm_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_default.c", "authz_default_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_groupfile.c", "authz_groupfile_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_host.c", "authz_host_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_owner.c", "authz_owner_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_authz_user.c", "authz_user_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_autoindex.c", "autoindex_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_cache.c", "cache_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_cern_meta.c", "cern_meta_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_cgi.c", "cgi_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_cgid.c", "cgid_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_charset_lite.c", "charset_lite_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dav.c", "dav_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dav_fs.c", "dav_fs_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dav_lock.c", "dav_lock_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dbd.c", "dbd_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_deflate.c", "deflate_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dir.c", "dir_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_disk_cache.c", "disk_cache_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_dumpio.c", "dumpio_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_echo.c", "echo_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_env.c", "env_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_example.c", "example_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_expires.c", "expires_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_ext_filter.c", "ext_filter_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_file_cache.c", "file_cache_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_filter.c", "filter_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_headers.c", "headers_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_ident.c", "ident_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_imagemap.c", "imagemap_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_include.c", "include_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_info.c", "info_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_isapi.c", "isapi_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("util_ldap.c", "ldap_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_log_config.c", "log_config_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_log_forensic.c", "log_forensic_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_logio.c", "logio_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_mem_cache.c", "mem_cache_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_mime.c", "mime_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_mime_magic.c", "mime_magic_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_negotiation.c", "negotiation_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_nw_ssl.c", "nwssl_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy.c", "proxy_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_ajp.c", "proxy_ajp_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_balancer.c", "proxy_balancer_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_connect.c", "proxy_connect_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_ftp.c", "proxy_ftp_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_http.c", "proxy_http_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_proxy_scgi.c", "proxy_scgi_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_reqtimeout.c", "reqtimeout_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_rewrite.c", "rewrite_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_setenvif.c", "setenvif_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_so.c", "so_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_speling.c", "speling_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_ssl.c", "ssl_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_status.c", "status_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_substitute.c", "substitute_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_suexec.c", "suexec_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_unique_id.c", "unique_id_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_userdir.c", "userdir_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_usertrack.c", "usertrack_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_version.c", "version_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_vhost_alias.c", "vhost_alias_module");
+
+ //some hand picked modules
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod_jk.c", "jk_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod-snmpcommon.c", "snmpcommon_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("mod-snmpagt.c", "snmpagt_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_20.put("covalent-snmp-v20.c", "snmp_agt_module");
+
+ //this list is for apache 1.3
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13 = new LinkedHashMap<String, String>();
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_access.c", "access_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_actions.c", "action_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_alias.c", "alias_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_asis.c", "asis_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_auth.c", "auth_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_auth_anon.c", "anon_auth_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_auth_db.c", "db_auth_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_auth_dbm.c", "dbm_auth_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_auth_digest.c", "digest_auth_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_autoindex.c", "autoindex_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_cern_meta.c", "cern_meta_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_cgi.c", "cgi_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_digest.c", "digest_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_dir.c", "dir_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_env.c", "env_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_example.c", "example_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_expires.c", "expires_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_headers.c", "headers_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_imap.c", "imap_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_include.c", "includes_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_info.c", "info_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_isapi.c", "isapi_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_log_agent.c", "agent_log_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_log_config.c", "config_log_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_log_forensic.c", "log_forensic_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_log_referer.c", "referer_log_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_mime.c", "mime_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_mime_magic.c", "mime_magic_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_mmap_static.c", "mmap_static_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_negotiation.c", "negotiation_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_proxy.c", "proxy_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_rewrite.c", "rewrite_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_setenvif.c", "setenvif_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_so.c", "so_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_speling.c", "speling_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_status.c", "status_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_unique_id.c", "unique_id_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_userdir.c", "userdir_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_usertrack.c", "usertrack_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_vhost_alias.c", "vhost_alias_module");
+
+ //and some hand-picks
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("mod_jk.c", "jk_module");
+ MODULE_SOURCE_FILE_TO_MODULE_NAME_13.put("covalent-snmp-v13.c", "snmp_agt_module");
+ }
public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext<PlatformComponent> discoveryContext) throws Exception {
@@ -169,8 +319,13 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
PluginDescriptorBasedAugeasConfiguration.INCLUDE_GLOBS_PROP, serverConfigFile);
pluginConfig.put(inclusionGlobs);
+ addModuleNames(pluginConfig, binaryInfo.getVersion());
+
ApacheDirectiveTree serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
+ //extract the runtime configuration out of declared config
+ serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getModuleNames(binaryInfo.getVersion()));
+
String serverUrl = null;
String vhostsGlobInclude = null;
@@ -181,6 +336,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
serverRootProp.setValue(serverRoot);
//reparse the configuration with the new ServerRoot
serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
+ serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getModuleNames(binaryInfo.getVersion()));
}
serverUrl = getUrl(serverConfig, binaryInfo.getVersion());
@@ -441,7 +597,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
}
}
- private static ApacheDirectiveTree loadParser(String path, String serverRoot) throws Exception {
+ public static ApacheDirectiveTree loadParser(String path, String serverRoot) {
ApacheDirectiveTree tree = new ApacheDirectiveTree();
ApacheParser parser = new ApacheParserImpl(tree, serverRoot);
@@ -591,4 +747,27 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
rdr.close();
}
}
+
+ private static void addModuleNames(Configuration pluginConfig, String version) {
+ PropertyList list = new PropertyList(ApacheServerComponent.PLUGIN_CONFIG_MODULE_NAMES);
+ pluginConfig.put(list);
+
+ for(Map.Entry<String, String> entry : getModuleNames(version).entrySet()) {
+ PropertyMap map = new PropertyMap(ApacheServerComponent.PLUGIN_CONFIG_MODULE_MAPPING);
+ list.add(map);
+
+ map.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_MODULE_SOURCE_FILE, entry.getKey()));
+ map.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_MODULE_NAME, entry.getValue()));
+ }
+ }
+
+ private static Map<String, String> getModuleNames(String version) {
+ switch (HttpdAddressUtility.get(version)) {
+ case APACHE_1_3 :
+ return MODULE_SOURCE_FILE_TO_MODULE_NAME_13;
+ case APACHE_2_x:
+ return MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
+ default: throw new IllegalStateException("Unknown HttpdAddressUtility instance.");
+ }
+ }
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index b43e156..1f355a1 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -55,11 +55,13 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.util.ResponseTimeConfiguration;
import org.rhq.core.pluginapi.util.ResponseTimeLogParser;
import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
+import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
import org.rhq.plugins.apache.util.AugeasNodeSearch;
import org.rhq.plugins.apache.util.AugeasNodeValueUtil;
import org.rhq.plugins.apache.util.ConfigurationTimestamp;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
+import org.rhq.plugins.apache.util.RuntimeApacheConfiguration;
import org.rhq.plugins.www.snmp.SNMPException;
import org.rhq.plugins.www.snmp.SNMPSession;
import org.rhq.plugins.www.snmp.SNMPValue;
@@ -480,11 +482,7 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
return oid;
}
- public static int getMatchingWwwServiceIndex(ApacheServerComponent parent, String resourceKey, List<SNMPValue> names, List<SNMPValue> ports) {
- int ret = -1;
- Iterator<SNMPValue> namesIterator = names.iterator();
- Iterator<SNMPValue> portsIterator = ports.iterator();
-
+ public static int getWwwServiceIndex(ApacheServerComponent parent, String resourceKey) {
//figure out the servername and addresses of this virtual host
//from the resource key.
String vhostServerName = null;
@@ -492,154 +490,87 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
int pipeIdx = resourceKey.indexOf('|');
if (pipeIdx >= 0) {
vhostServerName = resourceKey.substring(0, pipeIdx);
- }
+ if (vhostServerName.isEmpty()) {
+ vhostServerName = null;
+ }
+ }
vhostAddressStrings = resourceKey.substring(pipeIdx + 1).split(" ");
- ApacheDirectiveTree tree = parent.loadParser();
+ int foundIdx = 0;
- //convert the vhost addresses into fully qualified ip/port addresses
- List<HttpdAddressUtility.Address> vhostAddresses = new ArrayList<HttpdAddressUtility.Address>(
- vhostAddressStrings.length);
-
- if (vhostAddressStrings.length == 1 && MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
- List<HttpdAddressUtility.Address> serverAddrs = parent.getAddressUtility().getAllMainServerAddresses(tree, true);
- if (serverAddrs != null) {
- vhostAddresses.addAll(serverAddrs);
- }
- } else {
- for (int i = 0; i < vhostAddressStrings.length; ++i) {
- HttpdAddressUtility.Address vhostAddr = parent.getAddressUtility().getVirtualHostSampleAddress(tree, vhostAddressStrings[i],
- vhostServerName, true);
- if (vhostAddr != null) {
- vhostAddresses.add(vhostAddr);
+ //only look for the vhost entry if the vhost we're looking for isn't the main server
+ if (!MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
+ ApacheDirectiveTree tree = parent.loadParser();
+ tree = RuntimeApacheConfiguration.extract(tree, parent.getCurrentProcessInfo(), parent.getCurrentBinaryInfo(), parent.getModuleNames());
+
+ //find the vhost entry the resource key represents
+ List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
+ for(ApacheDirective vhost : vhosts) {
+ List<ApacheDirective> serverNames = vhost.getChildByName("ServerName");
+ String serverName = serverNames.size() > 0 ? serverNames.get(0).getValuesAsString() : null;
+
+ List<String> addrs = vhost.getValues();
+
+ boolean serverNamesMatch = (serverName == null && vhostServerName == null) ||
+ (serverName != null && serverName.equals(vhostServerName));
+ boolean addrsMatch = true;
+
+ if (addrs.size() != vhostAddressStrings.length) {
+ addrsMatch = false;
+ } else {
+ for(int i = 0; i < vhostAddressStrings.length; ++i) {
+ if (!addrs.contains(vhostAddressStrings[i])) {
+ addrsMatch = false;
+ break;
+ }
+ }
+ }
+
+ if (serverNamesMatch && addrsMatch) {
+ break;
}
+
+ ++foundIdx;
}
- }
-
- //finding the snmp index that corresponds to the address(es) of the vhost isn't that simple
- //because the snmp module in apache always resolves the IPs to hostnames.
- //on the other hand, the resource key tries to be more accurate about what a
- //vhost can actually be represented as. A vhost is represented by at most 1 hostname (i.e. ServerName)
- //and possibly multiple IP addresses.
- SNMPValue bestMatch = null;
- int bestMatchRate = 0;
-
- while (namesIterator.hasNext()) {
- SNMPValue nameValue = namesIterator.next();
- SNMPValue portValue = portsIterator.next();
-
- String snmpHost = nameValue.toString();
- String fullPort = portValue.toString();
-
- int snmpPort = Integer.parseInt(fullPort.substring(fullPort.lastIndexOf(".") + 1));
- HttpdAddressUtility.Address snmpAddress = new HttpdAddressUtility.Address(snmpHost, snmpPort);
-
- int matchRate = matchRate(vhostAddresses, snmpAddress);
- if (matchRate > bestMatchRate) {
- bestMatch = nameValue;
- bestMatchRate = matchRate;
+ if (foundIdx == vhosts.size()) {
+ log.debug("The virtual host with resource key [" + resourceKey + "] doesn't seem to be present in the apache configuration anymore.");
+ return -1;
+ } else {
+ //httpd vhosts are internally (in httpd internal data structures) ordered like this:
+ //1) the main server entry is always first
+ //2) all the vhosts are ordered from the last to appear in the joined config files to the first one
+
+ //we now have an index to the list of the vhosts in the order they are defined.
+ //so let's swap it over.
+ //just subtracting from the size will give us the "room" for the first index
+ //being the main host. In another words the below subtraction is correct even though
+ //you might think there's a 1-off bug there.
+ foundIdx = vhosts.size() - foundIdx;
}
}
- if (bestMatch != null) {
- String nameOID = bestMatch.getOID();
- ret = Integer.parseInt(nameOID.substring(nameOID.lastIndexOf(".") + 1));
- } else {
- log.warn("Unable to match the Virtual Host [" + resourceKey + "] with any of the SNMP advertised vhosts: " + names + ". It won't be possible to monitor the Virtual Host.");
- }
- return ret;
+ //the snmp indices are 1-based
+ return foundIdx + 1;
}
/**
* @return the index of the virtual host that identifies it in SNMP
* @throws Exception on SNMP error
*/
- private int getWwwServiceIndex() throws Exception {
+ private int getWwwServiceIndex() {
ConfigurationTimestamp currentTimestamp = resourceContext.getParentResourceComponent().getConfigurationTimestamp();
if (!lastConfigurationTimeStamp.equals(currentTimestamp)) {
snmpWwwServiceIndex = -1;
//don't go through this configuration again even if we fail further below.. we'd fail again.
lastConfigurationTimeStamp = currentTimestamp;
- //configuration has changed. re-read the service index of this virtual host
-
- //we have to scan the SNMP to find the entry corresponding to this vhost.
- SNMPSession snmpSession = resourceContext.getParentResourceComponent().getSNMPSession();
-
- List<SNMPValue> names;
- List<SNMPValue> ports;
-
- names = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_NAME);
- ports = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_PORT);
-
- snmpWwwServiceIndex = getMatchingWwwServiceIndex(resourceContext.getParentResourceComponent(), resourceContext.getResourceKey(), names, ports);
+ //configuration has changed. re-read the service index of this virtual host
+ snmpWwwServiceIndex = getWwwServiceIndex(resourceContext.getParentResourceComponent(), resourceContext.getResourceKey());
}
return snmpWwwServiceIndex;
}
- public static int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) {
- for(HttpdAddressUtility.Address a : addresses) {
- if (HttpdAddressUtility.isAddressConforming(addressToCheck, a.host, a.port, true)) {
- return 3;
- }
- }
-
- //try to get the IP of the address to check
- InetAddress[] ipAddresses;
- try {
- ipAddresses = InetAddress.getAllByName(addressToCheck.host);
- for(InetAddress ip : ipAddresses) {
- HttpdAddressUtility.Address newCheck = new HttpdAddressUtility.Address(ip.getHostAddress(), addressToCheck.port);
-
- for(HttpdAddressUtility.Address a : addresses) {
- if (HttpdAddressUtility.isAddressConforming(newCheck, a.host, a.port, true)) {
- return 2;
- }
- }
- }
- } catch (UnknownHostException e) {
- log.debug("Unknown host encountered in the httpd configuration: " + addressToCheck.host);
- return 0;
- }
-
- //this stupid 80 = 0 rule is to conform with snmp module
- //the problem is that snmp module represents both 80 and * port defs as 0,
- //so whatever we do, we might mismatch the vhost. But there's no working around that
- //but to modify the snmp module itself.
-
- int addressPort = addressToCheck.port;
- if (addressPort == 80) {
- addressPort = 0;
- }
-
- //ok, try the hardest...
- for(HttpdAddressUtility.Address listAddress: addresses) {
- int listPort = listAddress.port;
- if (listPort == 80) {
- listPort = 0;
- }
-
- InetAddress[] listAddresses;
- try {
- listAddresses = InetAddress.getAllByName(listAddress.host);
- } catch (UnknownHostException e) {
- log.debug("Unknown host encountered in the httpd configuration: " + listAddress.host);
- return 0;
- }
-
- for (InetAddress listInetAddr : listAddresses) {
- for (InetAddress ip : ipAddresses) {
- if (ip.equals(listInetAddr) && addressPort == listPort) {
- return 1;
- }
- }
- }
- }
-
- return 0;
- }
-
private ResourceType getDirectoryResourceType() {
return resourceContext.getResourceType().getChildResourceTypes().iterator().next();
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
index 1b00e9d..09d6a78 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
@@ -21,8 +21,10 @@ package org.rhq.plugins.apache;
import java.io.File;
import java.net.InetAddress;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
@@ -43,6 +45,7 @@ import org.rhq.core.pluginapi.upgrade.ResourceUpgradeFacet;
import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
+import org.rhq.plugins.apache.util.RuntimeApacheConfiguration;
import org.rhq.plugins.apache.util.HttpdAddressUtility.Address;
import org.rhq.plugins.www.snmp.SNMPException;
import org.rhq.plugins.www.snmp.SNMPSession;
@@ -73,6 +76,9 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
ApacheServerComponent serverComponent = context.getParentResourceComponent();
ApacheDirectiveTree tree = serverComponent.loadParser();
+
+ tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(), serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames());
+
//first define the root server as one virtual host
discoverMainServer(context, discoveredResources);
@@ -90,7 +96,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
Configuration pluginConfiguration = context.getDefaultPluginConfiguration();
- Address address = serverComponent.getAddressUtility().getVirtualHostSampleAddress(tree, firstAddress, vhost.serverName, false);
+ Address address = serverComponent.getAddressUtility().getVirtualHostSampleAddress(tree, firstAddress, vhost.serverName);
if (address != null) {
String scheme = address.scheme;
String hostToPing = address.host;
@@ -154,26 +160,46 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
ApacheServerComponent serverComponent = inventoriedResource.getParentResourceComponent();
ApacheDirectiveTree tree = serverComponent.loadParser();
+ tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(), serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames());
List<VHostSpec> vhosts = VHostSpec.detect(tree);
- SnmpWwwServiceIndexes snmpIndexes = getSnmpDiscoveries(serverComponent, inventoriedResource.getParentResourceContext().getResourceKey());
-
for (VHostSpec vhost : vhosts) {
- String legacyResourceKey = createLegacyResourceKey(serverComponent, vhost.serverName, vhost.hosts, snmpIndexes);
- if (resourceKey.equals(legacyResourceKey)) {
+ String[] legacyResourceKeys = createLegacyResourceKeys(serverComponent, tree, vhost.serverName, vhost.hosts);
+ if (Arrays.asList(legacyResourceKeys).contains(resourceKey)) {
newResourceKey = createResourceKey(vhost.serverName, vhost.hosts);
break;
}
}
- if (newResourceKey == null) {
+ if (newResourceKey == null) {
//the last thing to check is whether the inventoried vhost isn't in fact the main server
+ //The main server resource key could have had the following values:
+ //1) a value from SNMP
+ //2) the server url as defined by the parent component
+
String serverUrl = serverComponent.getServerUrl();
- HttpdAddressUtility.Address serverAddress = HttpdAddressUtility.Address.parse(serverUrl);
- HttpdAddressUtility.Address vhostAddress = HttpdAddressUtility.Address.parse(resourceKey);
- if (ApacheVirtualHostServiceComponent.matchRate(Collections.singletonList(serverAddress), vhostAddress) > 0) {
+ if (serverUrl != null) {
+ try {
+ URI mainServerUri = new URI(serverUrl);
+ String host = mainServerUri.getHost();
+ int port = mainServerUri.getPort();
+ if (port == -1) {
+ port = 80;
+ }
+
+ serverUrl = host + ":" + port;
+ } catch (URISyntaxException e) {
+ log.warn("Incorrect main server URL defined in the apache resource [" + inventoriedResource.getParentResourceContext().getResourceKey() + "].");
+ serverUrl = null;
+ }
+ }
+
+ HttpdAddressUtility.Address addr = serverComponent.getAddressUtility().getHttpdInternalMainServerAddressRepresentation(tree);
+ String snmpUrl = addr.host + ":" + addr.port;
+
+ if (resourceKey.equals(serverUrl) || resourceKey.equals(snmpUrl)) {
newResourceKey = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY;
}
}
@@ -243,32 +269,27 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
return keyBuilder.toString();
}
- private static String createLegacyResourceKey(ApacheServerComponent serverComponent, String serverName, List<String> hosts, SnmpWwwServiceIndexes snmpIndexes) {
- if (snmpIndexes != null) {
- String newStyleResourceKey = createResourceKey(serverName, hosts);
- String legacyResourceKey = null;
-
- int snmpWwwServiceIndex = ApacheVirtualHostServiceComponent.getMatchingWwwServiceIndex(serverComponent, newStyleResourceKey, snmpIndexes.names, snmpIndexes.ports);
-
- if (snmpWwwServiceIndex > 0) {
- String host = snmpIndexes.names.get(snmpWwwServiceIndex - 1).toString();
- String fullPort = snmpIndexes.ports.get(snmpWwwServiceIndex - 1).toString();
+ /**
+ * This returns the 2 possible resource keys that a vhost could have had.
+ *
+ * The first element in the array is the resource key as it would be reported
+ * by the SNMP module. This would apply if we were upgrading from RHQ 1.3 or
+ * from RHQ 1.4 with the resource using the SNMP module.
+ * <p>
+ * The second element in the array is the resource key that would have been
+ * returned by RHQ 1.4 if the SNMP module wasn't used.
+ *
+ * @param serverComponent the parent server component
+ * @param serverName the servername of the vhost
+ * @param hosts the list of hosts. This has to have at least 1 element
+ * @return an array of possible resource keys as described
+ */
+ private static String[] createLegacyResourceKeys(ApacheServerComponent serverComponent, ApacheDirectiveTree runtimeConfig, String serverName, List<String> hosts) {
+ String[] ret = new String[2];
+ HttpdAddressUtility.Address internalAddress = serverComponent.getAddressUtility().getHttpdInternalVirtualHostAddressRepresentation(runtimeConfig, hosts.get(0), serverName);
+ ret[0] = internalAddress.host + ":" + internalAddress.port;
- // The port value will be in the form "1.3.6.1.2.1.6.XXXXX",
- // where "1.3.6.1.2.1.6" represents the TCP protocol ID,
- // and XXXXX is the actual port number
- String port = fullPort.substring(fullPort.lastIndexOf(".") + 1);
- legacyResourceKey = host + ":" + port;
- }
-
- if (legacyResourceKey != null) {
- return legacyResourceKey;
- }
- }
-
- //try to derive the same resource key as the SNMP would have... this is to prevent the duplication of
- //vhost resources after the SNMP was configured - how I wish resource upgrade made it to 3.0 to prevent this
- //kind of guessing being necessary.
+ //this is the procedure RHQ 1.4 used to determine the resource key
String host = hosts.get(0);
HttpdAddressUtility.Address hostAddr = HttpdAddressUtility.Address.parse(host);
if (serverName != null) {
@@ -276,55 +297,16 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
hostAddr.host = serverAddr.host;
}
- //the SNMP module seems to resolve the IPs to hostnames.
try {
InetAddress hostName = InetAddress.getByName(hostAddr.host);
hostAddr.host = hostName.getHostName();
} catch (UnknownHostException e) {
log.debug("Host " + hostAddr.host + " is not resolvable.", e);
}
+
+ ret[1] = hostAddr.host + ":" + hostAddr.port;
- return hostAddr.host + ":" + hostAddr.port;
- }
-
- /**
- * @param discoveryContext
- * @return
- */
- private static SnmpWwwServiceIndexes getSnmpDiscoveries(ApacheServerComponent serverComponent, String serverResourceKey) {
- try {
- SNMPSession snmpSession = serverComponent.getSNMPSession();
- List<SNMPValue> nameValues;
- List<SNMPValue> portValues;
-
- try {
- nameValues = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_NAME);
- } catch (SNMPException e) {
- throw new Exception(
- "Error getting SNMP column: " + SNMPConstants.COLUMN_VHOST_NAME + ": " + e.getMessage(), e);
- }
-
- try {
- portValues = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_PORT);
- } catch (SNMPException e) {
- throw new Exception(
- "Error getting SNMP column: " + SNMPConstants.COLUMN_VHOST_PORT + ": " + e.getMessage(), e);
- }
-
- SnmpWwwServiceIndexes ret = new SnmpWwwServiceIndexes();
- ret.names = nameValues;
- ret.ports = portValues;
-
- return ret;
- } catch (Exception e) {
- log.debug("Error while trying to contact SNMP of the apache server " + serverResourceKey, e);
- return null;
- }
- }
-
- private static class SnmpWwwServiceIndexes {
- public List<SNMPValue> names;
- public List<SNMPValue> ports;
+ return ret;
}
private static class VHostSpec {
@@ -349,7 +331,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
List<ApacheDirective> serverNames = vhostDirective.getChildByName("ServerName");
serverName = null;
if (serverNames.size() > 0) {
- serverName = serverNames.get(0).getValuesAsString();
+ serverName = serverNames.get(serverNames.size() - 1).getValuesAsString();
}
}
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
index d4f7dd2..a3a715c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
@@ -109,7 +109,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
File check = new File(expression);
File root = new File(check.isAbsolute() ? Glob.rootPortion(expression) : serverRootPath);
- files.addAll(Glob.match(root, expression));
+ files.addAll(Glob.match(root, expression, Glob.ALPHABETICAL_COMPARATOR));
for (File fl : files){
if (fl.exists() && fl.isFile()) {
@@ -155,7 +155,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
File check = new File(incl);
File root = new File(check.isAbsolute() ? Glob.rootPortion(incl) : serverRootPath);
- files.addAll(Glob.match(root, incl));
+ files.addAll(Glob.match(root, incl, Glob.ALPHABETICAL_COMPARATOR));
}
if (module.getExcludedGlobs() != null) {
@@ -191,7 +191,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
for (String path : foundIncludes) {
File check = new File(path);
File root = new File(check.isAbsolute() ? Glob.rootPortion(path) : serverRoot);
- for (File f :Glob.match(root, path)){
+ for (File f :Glob.match(root, path, Glob.ALPHABETICAL_COMPARATOR)){
ret.add(f);
}
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
index e6454b7..d35613b 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
@@ -78,7 +78,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
File check = new File(inclName);
File root = new File(check.isAbsolute() ? Glob.rootPortion(inclName) : apacheConfig.getServerRootPath());
- files.addAll(Glob.match(root, inclName));
+ files.addAll(Glob.match(root, inclName, Glob.ALPHABETICAL_COMPARATOR));
if (module.getExcludedGlobs() != null)
Glob.excludeAll(files, module.getExcludedGlobs());
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java
index 53cee70..ae8e23e 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirective.java
@@ -5,7 +5,7 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-public class ApacheDirective {
+public class ApacheDirective implements Cloneable {
private String name;
private List<String> values;
@@ -195,4 +195,23 @@ public class ApacheDirective {
public void addValue(String val){
values.add(val);
}
+
+ @Override
+ public ApacheDirective clone() {
+ try {
+ ApacheDirective copy = (ApacheDirective) super.clone();
+
+ List<ApacheDirective> newChildNodes = new ArrayList<ApacheDirective>(childNodes.size());
+ for(ApacheDirective child : childNodes) {
+ ApacheDirective childCopy = child.clone();
+ childCopy.parentNode = copy;
+ newChildNodes.add(childCopy);
+ }
+ copy.childNodes = newChildNodes;
+
+ return copy;
+ } catch (CloneNotSupportedException e) {
+ throw new IllegalStateException("ApacheDirective not cloneable even though it is declared as such.", e);
+ }
+ }
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirectiveTree.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirectiveTree.java
index 4822732..9e0ad8b 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirectiveTree.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheDirectiveTree.java
@@ -3,7 +3,7 @@ package org.rhq.plugins.apache.parser;
import java.util.ArrayList;
import java.util.List;
-public class ApacheDirectiveTree {
+public class ApacheDirectiveTree implements Cloneable {
private ApacheDirective rootNode;
@@ -61,4 +61,12 @@ public class ApacheDirectiveTree {
parentNode.addChildDirective(dir);
return dir;
}
+
+ @Override
+ public ApacheDirectiveTree clone() {
+ ApacheDirectiveTree copy = new ApacheDirectiveTree();
+ copy.rootNode = rootNode.clone();
+
+ return copy;
+ }
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
index 686625e..f0e966f 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
@@ -47,6 +47,6 @@ public class ApacheParserImpl implements ApacheParser{
File check = new File(foundInclude);
File root = new File(check.isAbsolute() ? Glob.rootPortion(foundInclude) : serverRootPath);
- return Glob.match(root, foundInclude);
+ return Glob.match(root, foundInclude, Glob.ALPHABETICAL_COMPARATOR);
}
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java
index 0c41d5c..aedb144 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/ApacheBinaryInfo.java
@@ -23,8 +23,10 @@ import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -60,7 +62,9 @@ public class ApacheBinaryInfo {
private String built;
private String mpm;
private long lastModified = 0;
-
+ private Set<String> compiledInModules = new HashSet<String>();
+ private Set<String> compiledInDefines = new HashSet<String>();
+
private ApacheBinaryInfo(@NotNull
String binaryPath) {
this.binaryPath = binaryPath;
@@ -133,6 +137,8 @@ public class ApacheBinaryInfo {
BufferedReader is = null;
try {
+ compiledInDefines.clear();
+
ProcessExecution processExecution = new ProcessExecution(binaryPath);
processExecution.setArguments(new String[] { "-V" });
processExecution.setWaitForCompletion(10000L);
@@ -164,7 +170,56 @@ public class ApacheBinaryInfo {
}
this.mpm = line;
+ } else if (line.startsWith("-D")) {
+ String define = line.substring(3);
+ int equalsIdx = define.indexOf('=');
+ if (equalsIdx >= 0) {
+ define = define.substring(0, equalsIdx);
+ }
+
+ compiledInDefines.add(define);
+ }
+ }
+ } catch (Throwable t) {
+ String msg = "Error running binary '" + binaryPath + "': " + t.getMessage();
+ LOG.error(msg, t);
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+
+ private void getCompiledInModules(String binaryPath, SystemInfo systemInfo) {
+ BufferedReader is = null;
+
+ try {
+
+ compiledInModules.clear();
+
+ ProcessExecution processExecution = new ProcessExecution(binaryPath);
+ processExecution.setArguments(new String[] { "-l" });
+ processExecution.setWaitForCompletion(10000L);
+ processExecution.setCaptureOutput(true);
+ ProcessExecutionResults results = systemInfo.executeProcess(processExecution);
+
+ if (results.getError() != null) {
+ throw results.getError();
+ }
+
+ String line;
+ is = new BufferedReader(new StringReader(results.getCapturedOutput()));
+ boolean firstLine = true;
+ while ((line = is.readLine()) != null) {
+ if (firstLine) {
+ firstLine = false;
+ continue;
}
+
+ compiledInModules.add(line.trim());
}
} catch (Throwable t) {
String msg = "Error running binary '" + binaryPath + "': " + t.getMessage();
@@ -192,7 +247,8 @@ public class ApacheBinaryInfo {
this.lastModified = binaryFile.lastModified();
getVersionCommandInfo(binaryPath, systemInfo);
-
+ getCompiledInModules(binaryPath, systemInfo);
+
File libHttpd = getHttpdSharedLibrary(binaryFile);
this.version = findVersion((libHttpd != null) ? libHttpd.getPath() : this.binaryPath);
@@ -317,4 +373,12 @@ public class ApacheBinaryInfo {
private static boolean isUnix() {
return File.separatorChar == '/';
}
+
+ public Set<String> getCompiledInModules() {
+ return compiledInModules;
+ }
+
+ public Set<String> getCompiledInDefines() {
+ return compiledInDefines;
+ }
}
\ No newline at end of file
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java
index 873d5b8..7c55fb4 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java
@@ -120,6 +120,9 @@ public enum HttpdAddressUtility {
private static final Log log = LogFactory.getLog(HttpdAddressUtility.class);
+ public static final String BOGUS_HOST_WITHOUT_FORWARD_DNS = "bogus_host_without_forward_dns";
+ public static final String BOGUS_HOST_WITHOUT_REVERSE_DNS = "bogus_host_without_reverse_dns";
+
public static HttpdAddressUtility get(String version) {
return version.startsWith("1.") ? APACHE_1_3 : APACHE_2_x;
}
@@ -159,8 +162,8 @@ public enum HttpdAddressUtility {
}
int lastColonIdx = address.lastIndexOf(':');
- if (lastColonIdx == NO_PORT_SPECIFIED_VALUE) {
- return new Address(address, -1);
+ if (lastColonIdx == -1) {
+ return new Address(address, NO_PORT_SPECIFIED_VALUE);
} else {
int lastRightBracketPos = address.lastIndexOf(']');
if (lastColonIdx > lastRightBracketPos) {
@@ -319,20 +322,14 @@ public enum HttpdAddressUtility {
* @param ag the augeas tree of the httpd configuration
* @param virtualHost the port or address:port of the virtual host
* @param serverName the server name for the namebased virtual hosts (or null if the virtual host is ip based)
- * @param snmpModuleCompatibleMode if true, generates a sample address in the same way as snmp module. Namely
- * deals with the host name wildcard the same way as snmp module (i.e. by assuming it means "localhost", even though it doesn't have to).
* @return the address on which the virtual host can be accessed or null on error
*/
- public Address getVirtualHostSampleAddress(ApacheDirectiveTree ag, String virtualHost, String serverName, boolean snmpModuleCompatibleMode) {
+ public Address getVirtualHostSampleAddress(ApacheDirectiveTree ag, String virtualHost, String serverName) {
try {
Address addr = Address.parse(virtualHost);
if (addr.isHostDefault() || addr.isHostWildcard()) {
Address serverAddr = null;
- if (snmpModuleCompatibleMode) {
- serverAddr = getLocalhost(addr.port);
- } else {
- serverAddr = getMainServerSampleAddress(ag, null, addr.port);
- }
+ serverAddr = getMainServerSampleAddress(ag, null, addr.port);
if (serverAddr == null)
return null;
addr.host = serverAddr.host;
@@ -349,6 +346,76 @@ public enum HttpdAddressUtility {
}
}
+ public Address getHttpdInternalMainServerAddressRepresentation(ApacheDirectiveTree runtimeConfig) {
+ Address ret = null;
+
+ List<ApacheDirective> serverNames = runtimeConfig.search("/ServerName");
+ if (serverNames.size() == 0) {
+ //no servername directive in the apache config
+ ret = new Address(Address.WILDCARD, Address.NO_PORT_SPECIFIED_VALUE);
+ try {
+ ret.host = InetAddress.getLocalHost().getCanonicalHostName();
+ } catch (UnknownHostException e) {
+ ret.host = "127.0.0.1";
+ }
+
+ ret.port = 0;
+ } else {
+ String serverName = serverNames.get(serverNames.size() - 1).getValuesAsString();
+ ret = HttpdAddressUtility.Address.parse(serverName);
+ if (!ret.isPortDefined()) {
+ ret.port = 0;
+ }
+ }
+
+ return ret;
+ }
+
+ public Address getHttpdInternalVirtualHostAddressRepresentation(ApacheDirectiveTree runtimeConfig, String virtualHost, String serverName) {
+ Address ret = null;
+
+ if (serverName != null) {
+ ret = Address.parse(serverName);
+ if (!ret.isPortDefined()) {
+ ret.port = 0;
+ }
+
+ //servername is taken literally and no reverse dns lookup is made
+ //if the servername host is an IP address. We're done here...
+ } else {
+ ret = Address.parse(virtualHost);
+ if (!ret.isPortDefined() || ret.isPortWildcard() || ret.isHostDefault() || ret.isHostWildcard()) {
+ Address mainAddress = getHttpdInternalMainServerAddressRepresentation(runtimeConfig);
+
+ if (!ret.isPortDefined() || ret.isPortWildcard()) {
+ ret.port = mainAddress.port;
+ }
+
+ if (ret.isHostDefault() || ret.isHostWildcard()) {
+ ret.host = mainAddress.host;
+ }
+ }
+
+ //if the vhost hostname is an IP address, a reverse dns lookup is attempted
+ //to get the actual hostname.
+ //the BOGUS* constants are what the apache actually uses to identify such
+ //"error" conditions.
+ try {
+ InetAddress iAddr = InetAddress.getByName(ret.host);
+ String reverseLookup = iAddr.getHostName();
+ if (iAddr.getHostAddress().equals(reverseLookup)) {
+ ret.host = BOGUS_HOST_WITHOUT_REVERSE_DNS;
+ } else {
+ ret.host = reverseLookup;
+ }
+ } catch (UnknownHostException e) {
+ ret.host = BOGUS_HOST_WITHOUT_FORWARD_DNS;
+ }
+ }
+
+ return ret;
+ }
+
private static Address parseListen(String listenValue) {
Address ret = Address.parse(listenValue);
if (!ret.isPortDefined()) {
@@ -388,7 +455,7 @@ public enum HttpdAddressUtility {
* If this flag is set to true, this method takes that into account.
* @return
*/
- public static boolean isAddressConforming(Address listen, String limitingHost, int limitingPort, boolean snmpModuleCompatibleMode) {
+ private static boolean isAddressConforming(Address listen, String limitingHost, int limitingPort, boolean snmpModuleCompatibleMode) {
if (Address.DEFAULT_HOST.equals(limitingHost) || Address.WILDCARD.equals(limitingHost)) {
limitingHost = null;
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
new file mode 100644
index 0000000..48ebce9
--- /dev/null
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -0,0 +1,188 @@
+/*
+ * 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.plugins.apache.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.system.ProcessInfo;
+import org.rhq.plugins.apache.parser.ApacheDirective;
+import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
+
+/**
+ * @author Lukas Krejci
+ */
+public class RuntimeApacheConfiguration {
+
+ private static final Log LOG = LogFactory.getLog(RuntimeApacheConfiguration.class);
+
+ private RuntimeApacheConfiguration() {
+
+ }
+
+ /**
+ * Given the apache configuration and information about the parameters httpd was executed
+ * with this method provides the directive tree that corresponds to the actual
+ * runtime configuration as used by httpd.
+ * <p>
+ * This enables us to see which directives are actually in effect as opposed to just
+ * declared.
+ *
+ * @param tree
+ * @param httpdProcessInfo
+ * @param httpdBinaryInfo
+ * @param moduleNames the mapping from the module filename to the module name
+ * (i.e. mapping from the name used in IfModule to the name used in LoadModule)
+ * @return a new directive tree that represents the runtime configuration
+ */
+ public static ApacheDirectiveTree extract(ApacheDirectiveTree tree, ProcessInfo httpdProcessInfo, ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames) {
+ ApacheDirectiveTree ret = tree.clone();
+
+ List<String> defines = new ArrayList<String>(httpdBinaryInfo.getCompiledInDefines());
+
+ String[] args = httpdProcessInfo.getCommandLine();
+ for(int i = 1; i < args.length; ++i) {
+ String define = null;
+ if (args[i] != null && args[i].startsWith("-D")) {
+ define = args[i].substring(2).trim();
+ }
+
+ if (define != null && define.isEmpty()) {
+ //this means we saw an empty -D arg. This can happen if there is a space between -D and the value.
+ //That is legal though, so we have to accomodate for that.
+ if (i < args.length - 1) {
+ define = args[i + 1].trim();
+ if (define.startsWith("-")) {
+ //this would be another option
+ define = null;
+ } else {
+ ++i; //we can skip the next arg
+ }
+ } else {
+ define = null; //well -D is the last argument
+ }
+ }
+
+ if (define != null) {
+ defines.add(define);
+ }
+ }
+
+ HashSet<String> loadedModules = new HashSet<String>();
+ loadedModules.addAll(httpdBinaryInfo.getCompiledInModules());
+
+ //build a map for reverse lookup we might need in the transform method
+ HashMap<String, String> moduleFiles = new HashMap<String, String>(moduleNames.size());
+ for(Map.Entry<String, String> e : moduleNames.entrySet()) {
+ moduleFiles.put(e.getValue(), e.getKey());
+ }
+
+ transform(ret.getRootNode(), loadedModules, defines, moduleNames, moduleFiles);
+
+ return ret;
+ }
+
+ private static void transform(ApacheDirective parentNode, Set<String> currentlyLoadedModules, List<String> defines, Map<String, String> moduleNames, Map<String, String> moduleFiles) {
+ if (parentNode.getChildDirectives().isEmpty()) {
+ return;
+ }
+
+ ArrayList<ApacheDirective> nodesToRemove = new ArrayList<ApacheDirective>();
+ ArrayList<ApacheDirective> nodesToPromote = new ArrayList<ApacheDirective>();
+
+ for (ApacheDirective node : parentNode.getChildDirectives()) {
+ if (node.getName().equalsIgnoreCase("LoadModule")) {
+ currentlyLoadedModules.add(node.getValues().get(0));
+ } else if (node.getName().equalsIgnoreCase("<IfModule")) {
+ String moduleFile = node.getValuesAsString();
+ boolean negate = false;
+ if (moduleFile.startsWith("!")) {
+ negate = true;
+ moduleFile = moduleFile.substring(1);
+ }
+
+ String moduleName = moduleNames.get(moduleFile);
+ if (moduleName == null) {
+ //as of apache 2.1 module files and module names can both be used in IfModule
+ moduleName = moduleFile;
+ moduleFile = moduleFiles.get(moduleName);
+
+ //reverse lookup failed - there is really no such module, then
+ if (moduleFile == null) {
+ LOG.warn("Encountered unknown module name in an IfModule directive: " + moduleFile);
+ continue;
+ }
+ }
+
+ boolean result = currentlyLoadedModules.contains(moduleFile);
+
+ if (result != negate) {
+ nodesToPromote.add(node);
+ } else {
+ nodesToRemove.add(node);
+ }
+ } else if (node.getName().equalsIgnoreCase("<IfDefine")) {
+ String define = node.getValuesAsString();
+ boolean negate = false;
+ if (define.startsWith("!")) {
+ negate = true;
+ define = define.substring(1);
+ }
+
+ boolean result = defines.contains(define);
+
+ if (negate != result) {
+ nodesToPromote.add(node);
+ } else {
+ nodesToRemove.add(node);
+ }
+ }
+
+ transform(node, currentlyLoadedModules, defines, moduleNames, moduleFiles);
+ }
+
+ for(ApacheDirective node : nodesToRemove) {
+ parentNode.getChildDirectives().remove(node);
+ }
+
+ //add the children of node as children of parent node at the place node
+ //was declared and remove node ... i.e. make it so as if the child nodes
+ //of node were directly in the parentNode in the place of node
+ for(ApacheDirective node : nodesToPromote) {
+ int nodeIdx = parentNode.getChildDirectives().indexOf(node);
+
+ List<ApacheDirective> childNodes = node.getChildDirectives();
+ for(int i = childNodes.size() - 1; i >= 0; --i) {
+ ApacheDirective childNode = childNodes.get(i);
+ parentNode.getChildDirectives().add(nodeIdx, childNode);
+ childNode.setParentNode(parentNode);
+ }
+
+ parentNode.getChildDirectives().remove(nodeIdx + childNodes.size());
+ }
+ }
+}
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
index f6ab6eb..2c2d521 100644
--- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
@@ -355,6 +355,21 @@
</c:group>
+ <c:group name="Advanced">
+ <c:list-property name="moduleNames">
+ <c:description>This list contains all the known mappings from the module source file name (as used in IfModule directive)
+ to module name (as used in LoadModule directive). Extracting this information from the module binary is rather difficult without
+ having to support the different binary layouts of those files between apache versions (and operating systems).
+ This list contains all the standard modules referenced in the official apache documentation.
+ Please add all the modules you are using in your apache configuration so that the plugin can
+ correctly detect the configuration in use (if some of it is guarded by using IfModule directives, the plugin needs an entry in
+ this map to figure out whether the module is in fact being used at runtime or not).</c:description>
+ <c:map-property name="moduleMapping">
+ <c:simple-property name="moduleSourceFile" description="The source file of the module (as used in IfModule directives)"/>
+ <c:simple-property name="moduleName" description="The name of the module (as used in LoadModule directives)"/>
+ </c:map-property>
+ </c:list-property>
+ </c:group>
</plugin-configuration>
<!-- all httpd processes that are not child processes of another httpd process -->
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/augeas/config/AugeasConfigurationSimple.java b/modules/plugins/augeas/src/main/java/org/rhq/augeas/config/AugeasConfigurationSimple.java
index 3ab8e26..0fa093c 100644
--- a/modules/plugins/augeas/src/main/java/org/rhq/augeas/config/AugeasConfigurationSimple.java
+++ b/modules/plugins/augeas/src/main/java/org/rhq/augeas/config/AugeasConfigurationSimple.java
@@ -132,7 +132,7 @@ public class AugeasConfigurationSimple implements AugeasConfiguration {
throw new IllegalStateException("Expecting at least once inclusion pattern for configuration files.");
}
- List<File> files = Glob.matchAll(root, includeGlobs);
+ List<File> files = Glob.matchAll(root, includeGlobs, Glob.ALPHABETICAL_COMPARATOR);
if (module.getExcludedGlobs() != null) {
List<String> excludeGlobs = module.getExcludedGlobs();
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java b/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java
index d41d2a2..c61f932 100644
--- a/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java
+++ b/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java
@@ -27,6 +27,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -41,6 +42,16 @@ public class Glob {
private static final Log log = LogFactory.getLog(Glob.class);
+ public static final Comparator<File> ALPHABETICAL_COMPARATOR = new Comparator<File>() {
+
+ public int compare(File o1, File o2) {
+ String path1 = o1.getAbsolutePath();
+ String path2 = o2.getAbsolutePath();
+
+ return path1.compareTo(path2);
+ }
+ };
+
private Glob() {
}
@@ -79,6 +90,16 @@ public class Glob {
}
/**
+ * This is an overloaded version of the {@link #match(File, String, Comparator)} method
+ * that passes <code>null</code> as the comparator to use.
+ *
+ * @see #match(File, String, Comparator)
+ */
+ public static List<File> match(File parentPath, String globPattern) {
+ return match(parentPath, globPattern, null);
+ }
+
+ /**
* Returns a fixed size list of matches.
*
* The parent path specifies the "root" from which the glob pattern applies.
@@ -90,9 +111,10 @@ public class Glob {
*
* @param parentPath the parent path to start the pattern search
* @param globPattern the glob pattern to match against
+ * @param resultComparator the comparator using which to sort the results or null if no sorting is necessary
* @return the list of matches
*/
- public static List<File> match(File parentPath, String globPattern) {
+ public static List<File> match(File parentPath, String globPattern, Comparator<? super File> resultComparator) {
if (!parentPath.exists()) {
throw new IllegalArgumentException("Path '" + parentPath + "' does not exist.");
}
@@ -133,6 +155,11 @@ public class Glob {
log.debug("Could list files in " + parentPath);
return Collections.emptyList();
}
+
+ if (resultComparator != null) {
+ Arrays.sort(files, resultComparator);
+ }
+
return Arrays.asList(files);
}
@@ -141,14 +168,25 @@ public class Glob {
parent = parent + File.separatorChar;
return parent+pattern;
}
- public static List<File> matchAll(File parentPath, String... globPattern) {
- return matchAll(parentPath, Arrays.asList(globPattern));
- }
+ /**
+ * This is an overloaded version of the {@link #matchAll(File, List, Comparator)} method
+ * that passes <code>null</code> as the comparator to use.
+ *
+ * @see #matchAll(File, List, Comparator)
+ */
public static List<File> matchAll(File parentPath, List<String> globPatterns) {
+ return matchAll(parentPath, globPatterns, null);
+ }
+
+ public static List<File> matchAll(File parentPath, List<String> globPatterns, Comparator<? super File> resultComparator) {
ArrayList<File> matches = new ArrayList<File>();
for(String p : globPatterns) {
- matches.addAll(match(parentPath, p));
+ matches.addAll(match(parentPath, p, null));
+ }
+
+ if (resultComparator != null) {
+ Collections.sort(matches, resultComparator);
}
return matches;
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationComponent.java b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationComponent.java
index 2f500b6..1a37613 100644
--- a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationComponent.java
+++ b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationComponent.java
@@ -312,7 +312,7 @@ public class AugeasConfigurationComponent<T extends ResourceComponent> implement
}
public List<File> getConfigurationFiles() {
- List<File> files = Glob.matchAll(new File(this.augeasRootPath), includeGlobs);
+ List<File> files = Glob.matchAll(new File(this.augeasRootPath), includeGlobs, Glob.ALPHABETICAL_COMPARATOR);
Glob.excludeAll(files, excludeGlobs);
return files;
}
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java
index def1097..292e6df 100644
--- a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java
+++ b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java
@@ -131,7 +131,7 @@ public class AugeasConfigurationDiscoveryComponent<T extends ResourceComponent>
throw new IllegalStateException("Expecting at least one inclusion pattern for configuration files.");
}
- List<File> files = Glob.matchAll(root, includeGlobs);
+ List<File> files = Glob.matchAll(root, includeGlobs, Glob.ALPHABETICAL_COMPARATOR);
if (excludeGlobsProp != null) {
List<String> excludeGlobs = getGlobList(excludeGlobsProp);
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java b/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java
index cd15ef2..dd3f497 100644
--- a/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java
+++ b/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java
@@ -183,7 +183,7 @@ public class PluginDescriptorBasedAugeasConfiguration implements AugeasConfigura
throw new IllegalStateException("Expecting at least once inclusion pattern for configuration files.");
}
- List<File> files = Glob.matchAll(root, includeGlobs);
+ List<File> files = Glob.matchAll(root, includeGlobs, Glob.ALPHABETICAL_COMPARATOR);
if (module.getExcludedGlobs() != null) {
List<String> excludeGlobs = module.getExcludedGlobs();
commit 39096ad47535381425e25f67e1cd0ae8649123ab
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 13 11:21:28 2011 -0400
move log stmt into else block where it should be
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
index 64a8749..6768fce 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
@@ -175,7 +175,8 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
}
Integer recordId = getId(record);
String detailsUrl = "#" + getBasePath() + "/" + recordId;
- String formattedValue = (escapeHtmlInDetailsLinkColumn) ? StringUtility.escapeHtml(value.toString()) : value.toString();
+ String formattedValue = (escapeHtmlInDetailsLinkColumn) ? StringUtility.escapeHtml(value.toString()) :
+ value.toString();
return SeleniumUtility.getLocatableHref(detailsUrl, formattedValue, null);
}
};
@@ -358,13 +359,12 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
protected void switchToTableView() {
final Canvas contents = getTableContents();
if (contents != null) {
- // First refresh the table's data.
- Log.debug("Refreshing data for [" + getClass().getName() + "]...");
- // If this is not the initial display of the table, refresh the table data . Otherwise, a refresh would be
+ // If this is not the initial display of the table, refresh the table's data. Otherwise, a refresh would be
// redundant, since the data was just loaded when the table was drawn.
if (this.initialDisplay) {
this.initialDisplay = false;
} else {
+ Log.debug("Refreshing data for Table [" + getClass().getName() + "]...");
refresh();
}
if (detailsHolder != null && detailsHolder.isVisible()) {
@@ -381,4 +381,5 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
}
}
}
+
}
commit abc7cd665aa8a4129ad25f26371fe8409f995dc7
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 13 10:35:36 2011 -0400
fix a bug in TableSection where a redundant refresh was done on the initial rendering of the Table
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 6aaf418..115d4a8 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
@@ -161,7 +161,7 @@ public class RolesView extends TableSection<RolesDataSource> implements Bookmark
public void onPermissionsLoaded(Set<Permission> permissions) {
if (permissions != null) {
hasManageSecurity = permissions.contains(Permission.MANAGE_SECURITY);
- refresh();
+ refreshTableInfo();
} else {
hasManageSecurity = 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 4fae91e..427b1c2 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
@@ -101,7 +101,7 @@ public class UsersView extends TableSection<UsersDataSource> {
public void onPermissionsLoaded(Set<Permission> permissions) {
if (permissions != null) {
hasManageSecurity = permissions.contains(Permission.MANAGE_SECURITY);
- refresh();
+ refreshTableInfo();
} else {
hasManageSecurity = false;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
index b19abfd..64a8749 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -58,6 +58,7 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
private Canvas detailsView;
private String basePath;
private boolean escapeHtmlInDetailsLinkColumn;
+ private boolean initialDisplay;
protected TableSection(String locatorId, String tableTitle) {
super(locatorId, tableTitle);
@@ -94,6 +95,8 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
protected void onInit() {
super.onInit();
+ this.initialDisplay = true;
+
detailsHolder = new LocatableVLayout(extendLocatorId("tableSection"));
detailsHolder.setAlign(VerticalAlignment.TOP);
//detailsHolder.setWidth100();
@@ -111,10 +114,10 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
}
/**
- * The default implementation wraps the {@link getDetailsLinkColumnCellFormatter()} column with the
+ * The default implementation wraps the {@link #getDetailsLinkColumnCellFormatter()} column with the
* {@link #getDetailsLinkColumnCellFormatter()}. This is typically the 'name' column linking to the detail
* view, given the 'id'. Also, establishes a double click handler for the row which invokes
- * {@link showDetails()}</br>
+ * {@link #showDetails(com.smartgwt.client.widgets.grid.ListGridRecord)}</br>
* </br>
* In general, in overrides, call super.configureTable *after* manipulating the ListGrid fields.
*
@@ -357,7 +360,13 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
if (contents != null) {
// First refresh the table's data.
Log.debug("Refreshing data for [" + getClass().getName() + "]...");
- refresh();
+ // If this is not the initial display of the table, refresh the table data . Otherwise, a refresh would be
+ // redundant, since the data was just loaded when the table was drawn.
+ if (this.initialDisplay) {
+ this.initialDisplay = false;
+ } else {
+ refresh();
+ }
if (detailsHolder != null && detailsHolder.isVisible()) {
detailsHolder.animateHide(AnimationEffect.WIPE, new AnimationCallback() {
@Override
commit 87b488f907b471667c40fe412baad5aecf8042a4
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Apr 13 09:54:52 2011 -0400
BZ 680167 - this doesn't fully fix the issue, but what this does is ensure we don't refresh CoreGUI if we are setting/storing recent resource/group preferences
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
index 9006bec..ce43aa4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
@@ -58,6 +58,14 @@ public class UserPreferences {
private ArrayList<UserPreferenceChangeListener> changeListeners = new ArrayList<UserPreferenceChangeListener>();
+ // when these preferences change, they should not trigger a refresh.
+ private static ArrayList<String> preferencesThatShouldNotCauseRefresh;
+ static {
+ preferencesThatShouldNotCauseRefresh = new ArrayList<String>();
+ preferencesThatShouldNotCauseRefresh.add(UserPreferenceNames.RECENT_RESOURCES);
+ preferencesThatShouldNotCauseRefresh.add(UserPreferenceNames.RECENT_RESOURCE_GROUPS);
+ }
+
public UserPreferences(Subject subject) {
this.subject = subject;
this.userConfiguration = subject.getUserConfiguration();
@@ -77,20 +85,24 @@ public class UserPreferences {
this.autoPersister = new UserPreferenceChangeListener() {
@Override
public void onPreferenceChange(UserPreferenceChangeEvent event) {
- persist();
+ persist(event.name);
}
@Override
public void onPreferenceRemove(UserPreferenceChangeEvent event) {
- persist();
+ persist(event.name);
}
- private void persist() {
+ private void persist(final String preferenceThatChanged) {
store(new AsyncCallback<Subject>() {
@Override
public void onSuccess(Subject result) {
- // don't announce anything, should happen under the covers - just refresh the current page
- CoreGUI.refresh();
+ // Don't announce anything to message center, this should happen under the covers - just refresh the current page.
+ // But we should not blindly refresh - if we are changing preferences that should not affect the current
+ // page, don't refresh as this could cause additional and unnecessary server-side hits (BZ 680167)
+ if (!preferencesThatShouldNotCauseRefresh.contains(preferenceThatChanged)) {
+ CoreGUI.refresh();
+ }
}
@Override
@@ -207,7 +219,7 @@ public class UserPreferences {
}
return value;
}
-
+
protected void setPreference(String name, Collection<?> value) {
StringBuilder buffer = new StringBuilder();
boolean first = true;
13 years, 1 month
[rhq] 2 commits - modules/enterprise modules/plugins
by Heiko W. Rupp
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 240 +++++-----
modules/plugins/pattern-generator/pom.xml | 179 +++++++
modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java | 97 ++++
modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java | 39 +
modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml | 26 +
modules/plugins/pom.xml | 1
6 files changed, 473 insertions(+), 109 deletions(-)
New commits:
commit 0086a6972af8645766363fa42ea6a38ac16ea2dc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 16:12:23 2011 +0200
Add the pattern generator plugin
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
new file mode 100644
index 0000000..afd78d2
--- /dev/null
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -0,0 +1,179 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ >
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-plugins-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version><!-- TODO adjust RHQ version -->
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>pattern-plugin</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ pattern Plugin</name>
+ <description>Generate metrics that follow given patterns</description>
+
+ <properties>
+ <scm.module.path>TODO</scm.module.path>
+ <rhq.version>4.0.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see above too -->
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar"
+ dest="${project.build.outputDirectory}">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ <jar destfile="${deployment.file}"
+ manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+ update="true">
+ </jar>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file"
+ location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Repository</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ <!-- TODO add your own maven repositories here (if needed) -->
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Plugin Repository</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TODO add your dependencies here -->
+
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java
new file mode 100644
index 0000000..5ac3304
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternComponent.java
@@ -0,0 +1,97 @@
+
+package org.rhq.plugins.pattern;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+
+@SuppressWarnings("unused")
+public class PatternComponent implements ResourceComponent, MeasurementFacet
+{
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ int count = 0;
+ int number = 0; // We start with returning zeros
+ int[] wanted = new int[2];
+
+ /**
+ * Return availability of this resource
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
+ */
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+
+ /**
+ * Start the resource connection
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
+ */
+ public void start(ResourceContext context) throws InvalidPluginConfigurationException {
+
+ Configuration conf = context.getPluginConfiguration();
+ String tmp = conf.getSimpleValue("ones","1");
+ int wantedOnes = Integer.parseInt(tmp);
+ if (wantedOnes<1)
+ throw new InvalidPluginConfigurationException("Ones must be > 0");
+ tmp = conf.getSimpleValue("zeros","1");
+ int wantedZeros = Integer.parseInt(tmp);
+ if (wantedZeros<1)
+ throw new InvalidPluginConfigurationException("Zeros must be > 0");
+
+ wanted[0] = wantedZeros;
+ wanted[1] = wantedOnes;
+ }
+
+
+ /**
+ * Tear down the resource connection
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
+ */
+ public void stop() {
+ // Nothing to do.
+ }
+
+
+
+ /**
+ * Gather "measurement" data - actually a series of 1s and 0s starting with 0.
+ * @see org.rhq.core.pluginapi.measurement.MeasurementFacet#getValues(org.rhq.core.domain.measurement.MeasurementReport, java.util.Set)
+ */
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
+
+ for (MeasurementScheduleRequest req : metrics) {
+ if (req.getName().equals("pattern1")) {
+
+ double val;
+
+ val = (double) number;
+
+ if (number==1)
+ System.out.println("XX 1 _ " + new Date());
+
+ count++;
+ // enough of this? Flip over to the other number and reset the series.
+ if (count>=wanted[number]) {
+ number = 1-number;
+ count=0;
+ }
+
+ MeasurementDataNumeric res = new MeasurementDataNumeric(req, val);
+ report.addData(res);
+ }
+ }
+ }
+}
diff --git a/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java
new file mode 100644
index 0000000..cf2b1ac
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/java/org/rhq/plugins/pattern/PatternDiscovery.java
@@ -0,0 +1,39 @@
+package org.rhq.plugins.pattern;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+
+/**
+ * Discovery class
+ */
+@SuppressWarnings("unused")
+public class PatternDiscovery implements ResourceDiscoveryComponent
+{
+
+ /**
+ * Run the auto-discovery
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception {
+ Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(1);
+
+
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(), // ResourceType
+ "pattern",
+ "pattern",
+ "1.1",
+ "Generate metrics that follow a pattern",
+ discoveryContext.getDefaultPluginConfiguration(),
+ null
+ );
+
+
+ // Add to return values
+ discoveredResources.add(detail);
+ return discoveredResources;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml
new file mode 100644
index 0000000..c3ad075
--- /dev/null
+++ b/modules/plugins/pattern-generator/src/main/resources/META-INF/rhq-plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<plugin name="pattern-generator"
+ displayName="pattern-generator Plugin"
+ description="Devs plugin that generates metrics that follow patterns"
+ package="org.rhq.plugins.pattern"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+
+ <server name="pattern"
+ discovery="PatternDiscovery"
+ class="PatternComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="ones" description="Number of ones in a row" type="integer" default="1"/>
+ <c:simple-property name="zeros" description="Number of zeros in a row" type="integer" default="2"/>
+ </plugin-configuration>
+
+ <metric property="pattern1" displayName="Pattern 1 metric" defaultInterval="60000" displayType="summary" defaultOn="true"/>
+
+ </server>
+
+</plugin>
\ No newline at end of file
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f39e509..b1eec53 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -191,6 +191,7 @@
<module>twitter</module>
<module>virt</module>
<module>kickstart</module>
+ <module>pattern-generator</module>
</modules>
</profile>
commit 277a5dd0b06aad80fe420b45b86cf18601e84e03
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:28:09 2011 +0200
Some more translations.
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 805d4bf..667f040 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
@@ -72,7 +72,7 @@ common_title_add_column=Spalte hinzufügen
common_title_add_portlet=Portlet hinzufügen
common_title_alert_range=Alert Range~
common_title_availability = Verfügbar
-common_title_average_metrics=Dursch. Anzahl Metriken pro Minute
+common_title_average_metrics=Durchsch. Anzahl Metriken pro Minute
common_title_available_resources=Verfügbare Ressourcen
common_title_background=Hintergrund
common_title_category = Kategorie
@@ -144,7 +144,6 @@ common_title_status=Status
common_title_summary=Zusammenfassung
common_title_tag_cloud=Tag-Wolke
common_title_the=Die
-common_title_summary_counts=Summary Counts~
common_title_timestamp =Zeitpunkt
common_title_total=Total
common_title_type = Typ
@@ -426,7 +425,6 @@ view_adminTopology_remoteAgentInstall = Installation entfernter Agenten
view_adminTopology_servers = Server
view_adminConfig_downloads = Downloads
-view_adminConfig_license = Lizenz
view_adminConfig_plugins = Plugins
view_adminConfig_systemSettings = Systemeinstellungen
view_adminConfig_templates = Voreinstellungen
@@ -501,40 +499,36 @@ view_alerts_field_created_time=Erstellungszeitpunkt
view_alerts_field_modified_time=Zuletzt geändert
view_alerts_field_enabled=Aktiviert
view_alerts_field_ack_time=Zeitpunkt Bestätigung
-view_alerts_field_ack_subject=Bestätigender benutzer
+view_alerts_field_ack_subject=Bestätigender Benutzer
view_alerts_field_ack_status=Status
-view_alerts_field_ack_status_empty=Noch nicht bestätigt
-view_alerts_field_ack_status_filled={0} bestätigt am {1}
view_alerts_field_name=Name
view_alerts_field_condition_text=Bedingung(en)
-view_alerts_field_condition_text_none=No Conditions~
-view_alerts_field_condition_text_many=Multiple Conditions~
-view_alerts_field_condition_value=Condition Value~
-view_alerts_field_resource=Ressource
+view_alerts_field_condition_text_none=Keine Bedingungen
+view_alerts_field_condition_text_many=Mehrere Bedingungen
+view_alerts_field_condition_value=Bedingung
view_alerts_field_priority=Priorität
-view_alerts_field_parent=Parent~
+view_alerts_field_parent=Eltern
view_alerts_field_protected=Geschützt
view_alerts_field_protected_tooltip=If true, this definition is protected from being changed by the parent definition. In other words, the parent definition settings will not override this definition.~
-view_alerts_loadFailed=Failed to fetch alerts data~
-view_alerts_delete_confirm=Delete the selected alert(s)?~
-view_alerts_delete_confirm_all=Delete all alerts from this source?~
-view_alerts_delete_success=Successfully deleted {0} alerts~
-view_alerts_delete_failure=Failed to delete alerts with id''s: {0}~
-view_alerts_delete_failure_all=Failed to delete all alerts from this source~
+view_alerts_loadFailed=Konnte die Daten für die Alarme nicht laden
+view_alerts_delete_confirm=Die ausgewählten Alarme löschen?
+view_alerts_delete_confirm_all=Alle Alarme aus dieser Quele löschen?
+view_alerts_delete_success=Erfolgreich {0} Alarme gelöscht
+view_alerts_delete_failure=Konnte die Alarme mit den IDs {0} nicht löschen
+view_alerts_delete_failure_all=Löschen aller Alarme dieser Quelle fehlgeschlagen
view_alerts_ack_confirm=Die ausgewählten Alarme bestätigen?
view_alerts_ack_confirm_all=Alle Alarme dieser Quelle bestätigen?
-view_alerts_ack_success=Successfully acknowledged {0} alerts~
-view_alerts_ack_failure=Failed to acknowledge alerts with id''s: {0}~
-view_alerts_ack_failure_all=Failed to acknowledge all alerts from this source~
-view_alert_details_loadFailed=Failed to fetch alert details~
-view_alert_details_breadcrumb=Details
+view_alerts_ack_success=Erfolgreich {0} Alarme bestätigt
+view_alerts_ack_failure=Bestätigen der Alarme mit den IDs {0} fehlgeschlagen
+view_alerts_ack_failure_all=Bestätigung aller Alarme deiser Quelle fehlgeschlagen
+view_alert_details_loadFailed=Laden der Details für den Alarm fehlgeschlagen
view_alert_details_field_ack_by=Bestätigt durch
view_alert_details_field_ack_at=Bestätigt um
-view_alert_details_field_recovery_info=Recovery Info~
-view_alert_definition_for_type=View Template~
+view_alert_details_field_recovery_info=Info zur Erholung
+view_alert_definition_for_type=Vorlage ansehen
view_alert_definition_for_group=View Group Definition~
-view_alert_definitions_table_title_group=Group Alert Definitions~
-view_alert_definitions_table_title_resource=Resource Alert Definitions~
+view_alert_definitions_table_title_group=Alarm-Definitionen für Gruppen
+view_alert_definitions_table_title_resource=Alarm-Definitionen für Ressourcen
view_alert_definitions_loadFailed=Failed to fetch alert definition data~
view_alert_definitions_loadFailed_single=Failed to fetch data for alert definition with id {0}~
view_alert_definitions_enable_confirm=Enable the selected alert definition(s)?~
@@ -546,31 +540,31 @@ view_alert_definitions_disable_failure=Failed to disable the selected alert defi
view_alert_definitions_delete_confirm=Delete the selected alert definition(s)?~
view_alert_definitions_delete_success=Successfully deleted {0} alert definitions~
view_alert_definitions_delete_failure=Failed to deleted the selected alert definitions~
-view_alert_definitions_create_success=Alert definition successfully created~
-view_alert_definitions_create_failure=Alert definition creation failed~
-view_alert_definitions_update_success=Alert definition successfully updated~
-view_alert_definitions_update_failure=Alert definition update failed~
-view_alert_definition_condition_editor_option_label=Condition Type~
+view_alert_definitions_create_success=Alarm-Definition erfolgreich angelegt
+view_alert_definitions_create_failure=Anlegen der Alarm-Definition fehlgeschlagen
+view_alert_definitions_update_success=Alarm-Definition erfolgreich aktualisiert
+view_alert_definitions_update_failure=Aktualisieren der Alarm-Definition fehlgeschlagen
+view_alert_definition_condition_editor_option_label=Typ der Bedingung
view_alert_definition_condition_editor_option_availability=Änderung der Verfügbarkeit
-view_alert_definition_condition_editor_option_metric_threshold=Measurement Absolute Value Threshold~
-view_alert_definition_condition_editor_option_metric_baseline=Measurement Baseline Threshold~
-view_alert_definition_condition_editor_option_metric_change=Measurement Value Change~
+view_alert_definition_condition_editor_option_metric_threshold=Absoluter Metrikschwellwert
+view_alert_definition_condition_editor_option_metric_baseline=Schwelle des Referenzbands
+view_alert_definition_condition_editor_option_metric_change=Wert der Metrik ändert sich
view_alert_definition_condition_editor_option_metric_calltime_threshold=Call Time Value Threshold~
-view_alert_definition_condition_editor_option_metric_calltime_change=Call Time Value Change~
-view_alert_definition_condition_editor_option_metric_trait_change=Trait Value Change~
-view_alert_definition_condition_editor_option_operation=Operation Execution~
-view_alert_definition_condition_editor_option_resource_configuration=Resource Configuration Change~
+view_alert_definition_condition_editor_option_metric_calltime_change=Änderung des Call-Time-Werts
+view_alert_definition_condition_editor_option_metric_trait_change=Änderung des Trait-Werts
+view_alert_definition_condition_editor_option_operation=Ausführung der Operation
+view_alert_definition_condition_editor_option_resource_configuration=Änderung der Konfiguration der Ressource
view_alert_definition_condition_editor_option_event=Event Detection~
view_alert_definition_condition_editor_avilability_tooltip=Specify the availability state change that will trigger the condition.~
-view_alert_definition_condition_editor_avilability_value=Verfügbarkeit~
+view_alert_definition_condition_editor_avilability_value=Verfügbarkeit
view_alert_definition_condition_editor_avilability_option_up=Wird verfügbar
view_alert_definition_condition_editor_avilability_option_down=Wird unverfügbar
view_alert_definition_condition_editor_metric_common_definition_not_found=Should have found metric definition - something is wrong~
view_alert_definition_condition_editor_metric_threshold_tooltip=Specify the threshold value that, when violated, triggers the condition. The value you specify is an absolute value with an optional units specifier.~
view_alert_definition_condition_editor_metric_threshold_name=Metrik
-view_alert_definition_condition_editor_metric_threshold_value=Metric Value~
+view_alert_definition_condition_editor_metric_threshold_value=Wert der Metrik
view_alert_definition_condition_editor_metric_threshold_value_tooltip=The threshold value of the metric that will trigger the condition when compared using the selected comparator.~
-view_alert_definition_condition_editor_metric_threshold_comparator=Comparator~
+view_alert_definition_condition_editor_metric_threshold_comparator=Komparator
view_alert_definition_condition_editor_metric_threshold_comparator_less=Kleiner als
view_alert_definition_condition_editor_metric_threshold_comparator_equal=Gleich
view_alert_definition_condition_editor_metric_threshold_comparator_greater=Größer als
@@ -578,18 +572,18 @@ view_alert_definition_condition_editor_metric_threshold_comparator_tooltip=How a
view_alert_definition_condition_editor_metric_baseline_tooltip=Specify the baseline value that must be violated to trigger the condition. The value you specify is a percentage of the given baseline value.~
view_alert_definition_condition_editor_metric_baseline_percentage=Baseline Percentage~
view_alert_definition_condition_editor_metric_baseline_percentage_tooltip=A collected metric value will trigger this condition when compared to this percentage of the selected baseline value using the selected comparator~
-view_alert_definition_condition_editor_metric_baseline_value=Baseline~
+view_alert_definition_condition_editor_metric_baseline_value=Referenzband~
view_alert_definition_condition_editor_metric_change_tooltip=Specify the metric whose value must change to trigger the condition.~
view_alert_definition_condition_editor_metric_calltime_threshold_tooltip=Specify the calltime threshold value that, when violated, triggers the condition. The value you specify is an absolute value with an optional units specifier. You also must specify which calltime limit to compare the value with (minimum, maximum or average calltime value).~
view_alert_definition_condition_editor_metric_calltime_common_name=Call Time Metric~
view_alert_definition_condition_editor_metric_calltime_common_limit=Call Time Limit~
view_alert_definition_condition_editor_metric_calltime_common_limit_tooltip=The calltime limit value that is to be compared with the given value~
-view_alert_definition_condition_editor_metric_calltime_common_regex=Regular Expression~
+view_alert_definition_condition_editor_metric_calltime_common_regex=Regulärer Ausdruck
view_alert_definition_condition_editor_metric_calltime_common_regex_tooltip=If specified, this is a regular expression that must match a call destination in order to trigger the condition.~
-view_alert_definition_condition_editor_metric_calltime_common_comparator=Comparator~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_shrinks=Shrinks~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_grows=Grows~
-view_alert_definition_condition_editor_metric_calltime_common_comparator_changes=Changes~
+view_alert_definition_condition_editor_metric_calltime_common_comparator=Komparator
+view_alert_definition_condition_editor_metric_calltime_common_comparator_shrinks=Schrumpft
+view_alert_definition_condition_editor_metric_calltime_common_comparator_grows=Wächst
+view_alert_definition_condition_editor_metric_calltime_common_comparator_changes=Ändert sich
view_alert_definition_condition_editor_metric_calltime_common_comparator_tooltip=How a collected calltime value should be compared to the given calltime limit~
view_alert_definition_condition_editor_metric_calltime_threshold_value=Call Time Value~
view_alert_definition_condition_editor_metric_calltime_threshold_value_tooltip=The threshold value of the metric that will trigger the condition when compared using the selected comparator.~
@@ -621,11 +615,11 @@ view_alert_definition_condition_editor_common_max=Maximum
view_alert_definition_notification_editor_title_add=Benachrichtigung hinzufügen
view_alert_definition_notification_editor_title_edit=Benachrichtigung bearbeiten
view_alert_definition_notification_editor_sender=Notification Sender~
-view_alert_definition_notification_editor_none_available=No alert senders available~
+view_alert_definition_notification_editor_none_available=Keine Alarm-Sender verfügbar
view_alert_definition_notification_editor_loadFailed=Cannot get alert senders~
view_alert_definition_notification_editor_loadFailed_single=Cannot get alert sender configuration definition~
view_alert_definition_notification_editor_saveFailed=Cannot save the notification configuration~
-view_alert_definition_notification_editor_field_sender=Sender~
+view_alert_definition_notification_editor_field_sender=Sender
view_alert_definition_notification_editor_field_configuration=Konfiguration
view_alert_definition_notification_editor_field_configuration_not_loaded=Unbekannt
view_alert_definition_notification_editor_field_configuration_loadFailed=Failed to get notification configuration preview~
@@ -657,12 +651,12 @@ view_alert_definition_notification_role_editor_saveFailed=Cannot save the select
view_alert_definition_notification_user_editor_loadFailed=Cannot determine current users - starting empty~
view_alert_definition_notification_user_editor_restoreFailed=Cannot use current users - starting empty~
view_alert_definition_notification_user_editor_saveFailed=Cannot save the selected users~
-view_alert_definition_recovery_editor_disable_when_fired=Disable When Fired~
+view_alert_definition_recovery_editor_disable_when_fired=Nach dem Auslösen inaktiv schalten
view_alert_definition_recovery_editor_disable_when_fired_tooltip=Indicates if this alert will be disabled after it fires. Once disabled, the alert can be manually re-enabled or a recovery alert can be set up to automatically re-enable it. If this alert is a recovery alert itself, this setting cannot be turned on.~
view_alert_definition_recovery_editor_recovery_alert=Recover Alert~
view_alert_definition_recovery_editor_recovery_alert_tooltip=The target alert that will be recovered (i.e. re-enabled) after this alert triggers. Do not select an alert here if you are not defining a recovery alert.~
view_alert_definition_recovery_editor_loadFailed=Cannot build recovery menu~
-view_alert_definition_recovery_editor_none_available=None~
+view_alert_definition_recovery_editor_none_available=Keiner
view_alert_common_tab_general=Allgemeine Eigenschaften
view_alert_common_tab_conditions=Bedingungen
view_alert_common_tab_conditions_modal_title=Bedingung hinzufügen
@@ -673,49 +667,49 @@ view_alert_common_tab_conditions_value=Wert
view_alert_common_tab_conditions_type_availability=Änderung der Verfügbarkeit
view_alert_common_tab_conditions_type_availability_down=Wurde unverfügbar
view_alert_common_tab_conditions_type_availability_up=Wurde wieder verfügbar
-view_alert_common_tab_conditions_type_metric_threshold=Metric Value Exceeds Threshold~
-view_alert_common_tab_conditions_type_metric_calltime_threshold=Call Time Value Exceeds Threshold~
+view_alert_common_tab_conditions_type_metric_threshold=Metrik überschreitet Schwellwert
+view_alert_common_tab_conditions_type_metric_calltime_threshold=Call-Time überschreitet Schwellwert
view_alert_common_tab_conditions_type_metric_calltime_destination=with call destination matching~
-view_alert_common_tab_conditions_type_metric_calltime_change=Call Time Value Changes~
-view_alert_common_tab_conditions_type_metric_calltime_change_verb=by at least~
-view_alert_common_tab_conditions_type_metric_calltime_delta_grows=Grows~
-view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks=Shrinks~
-view_alert_common_tab_conditions_type_metric_calltime_delta_other=Changes~
-view_alert_common_tab_conditions_type_metric_baseline=Metric Value Exceeds Baseline~
-view_alert_common_tab_conditions_type_metric_baseline_verb=of~
-view_alert_common_tab_conditions_type_metric_change=Metric Value Change~
-view_alert_common_tab_conditions_type_metric_trait_change=Trait Change~
-view_alert_common_tab_conditions_type_operation=Operation Execution~
-view_alert_common_tab_conditions_type_operation_status=with result status~
+view_alert_common_tab_conditions_type_metric_calltime_change=Call-Time-Wert ändert sich
+view_alert_common_tab_conditions_type_metric_calltime_change_verb=um mindestens
+view_alert_common_tab_conditions_type_metric_calltime_delta_grows=Wächst
+view_alert_common_tab_conditions_type_metric_calltime_delta_shrinks=Schrumpft
+view_alert_common_tab_conditions_type_metric_calltime_delta_other=Ändert sich
+view_alert_common_tab_conditions_type_metric_baseline=Metrik überschreitet Referenzband
+view_alert_common_tab_conditions_type_metric_baseline_verb=von
+view_alert_common_tab_conditions_type_metric_change=Wert der Metrik ändert sich
+view_alert_common_tab_conditions_type_metric_trait_change=Trait-Änderung
+view_alert_common_tab_conditions_type_operation=Ausführung der Operation
+view_alert_common_tab_conditions_type_operation_status=mit Ergebnis-Status
view_alert_common_tab_conditions_type_resource_configuration=Resource Configuration Change~
view_alert_common_tab_conditions_type_event=Event Detection~
view_alert_common_tab_conditions_type_event_matching=with event source matching~
view_alert_common_tab_conditions_recovery_enabled=Triggered ''{0}'' to be re-enabled~
-view_alert_common_tab_conditions_recovery_disabled=This alert caused its alert definition to be disabled~
+view_alert_common_tab_conditions_recovery_disabled=Dieser Alarm hat seine Definition deaktiviert.
view_alert_common_tab_notifications=Benachrichtigung
view_alert_common_tab_notifications_sender=Sender
view_alert_common_tab_notifications_status=Status
view_alert_common_tab_notifications_message=Nachricht
view_alert_common_tab_dampening=Dämpfung
view_alert_common_tab_dampening_category_none=Keine
-view_alert_common_tab_dampening_category_none_tooltip=Dampening is disabled. Every time the condition set is true, an alert will be triggered.~
-view_alert_common_tab_dampening_category_consecutive_count=Consecutive~
-view_alert_common_tab_dampening_category_consecutive_count_tooltip=An alert is triggered once every X occurrences the condition set is true consecutively.~
-view_alert_common_tab_dampening_category_partial_count=Last N Evaluations~
-view_alert_common_tab_dampening_category_partial_count_tooltip=An alert is triggered once every X occurrences the condition set is true during the last N evaluations of the condition set.~
-view_alert_common_tab_dampening_category_duration_count=Time Period~
-view_alert_common_tab_dampening_category_duration_count_tooltip=An alert is triggered once every X occurrences the condition set is true within a given time period.~
-view_alert_common_tab_dampening_consecutive_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip=The number of times the condition set must be consecutively true before the alert is triggered~
-view_alert_common_tab_dampening_partial_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_partial_occurrences_label_tooltip=The number of times the condition set must be true during the last N evaluations before the alert is triggered.~
-view_alert_common_tab_dampening_partial_evalatuions_label=Evaluations~
-view_alert_common_tab_dampening_partial_evalatuions_label_tooltip=The total number of times the condition set will be tested to see if the given number of occurrences are true.~
-view_alert_common_tab_dampening_duration_occurrences_label=Occurrences~
-view_alert_common_tab_dampening_duration_occurrences_label_tooltip=The number of times the condition set must be true during the given time period before the alert is triggered.~
-view_alert_common_tab_dampening_duration_period_label=Time Period~
-view_alert_common_tab_dampening_duration_period_label_tooltip=The time span in which the condition set will be tested to see if the given number of occurrences are true.~
-view_alert_common_tab_recovery=Recovery~
+view_alert_common_tab_dampening_category_none_tooltip=Dämpfung ist abgeschaltet. Jedes Mal wenn die Bedingungen zutreffen wird ein Alarm ausgelöst.
+view_alert_common_tab_dampening_category_consecutive_count=Aufeinanderfolgend
+view_alert_common_tab_dampening_category_consecutive_count_tooltip=Ein Alarm wird ausgelöst, wenn bei X aufeinanderfolgenden Werten die Bedingungen zutreffen.
+view_alert_common_tab_dampening_category_partial_count=Letzt N Auswertungen
+view_alert_common_tab_dampening_category_partial_count_tooltip=Ein Alarm wird ausgelöst, wenn die Bedingungen X-Mal innerhalb der letzten N Werte zutreffen.
+view_alert_common_tab_dampening_category_duration_count=Zeitraum
+view_alert_common_tab_dampening_category_duration_count_tooltip=Ein Alarm wird ausgelöst, wenn die Bedingungen X-Mal innerhalb des gegebenen Zeitraums zutreffen.
+view_alert_common_tab_dampening_consecutive_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip=Anzahl wie oft die Bedingungen aufeinandefolgend wahr sein müssen, befor der Alarm ausgelöst wird.
+view_alert_common_tab_dampening_partial_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_partial_occurrences_label_tooltip=Anzahl wie oft die Bedingungen innerhalb der letzten N Auswertungen wahr sein müssen, bevor der Alarm ausgelöst wird.
+view_alert_common_tab_dampening_partial_evalatuions_label=Auswertungen
+view_alert_common_tab_dampening_partial_evalatuions_label_tooltip=Anzahl wie oft die Bedingungen ausgewertet werden, um zu prüfen, ob sie 'Vorkommen' mal zutreffen.
+view_alert_common_tab_dampening_duration_occurrences_label=Anzahl Vorkommen
+view_alert_common_tab_dampening_duration_occurrences_label_tooltip=Anzahl wie oft die Bedingungen im gegebenen Zeitraum zutreffen müssen, um den Alarm auszulösen.
+view_alert_common_tab_dampening_duration_period_label=Zeitraum
+view_alert_common_tab_dampening_duration_period_label_tooltip=Der Zeitraum in dem die Bedingungen geprüft werden, ob sie 'Vorkommen' mal zutreffen.
+view_alert_common_tab_recovery=Erholung
view_alert_common_tab_invalid_condition_category=Invalid condition category - please report this as a bug: {0}~
view_alert_common_tab_invalid_dampening_category=Invalid dampening category - please report this as a bug: {0}~
view_alert_common_tab_invalid_time_units=Ungültige Zeiteinheit - bitte berichten Sie diesen Fehler: {0}
@@ -730,18 +724,18 @@ view_autoDiscoveryQ_unignore=Ignorieren aufheben
view_autoDiscoveryQ_new=Neu
view_autoDiscoveryQ_newAndIgnored=Neu und Ignoriert
view_autoDiscoveryQ_importFailure=Konnte die Ressourcen nicht importieren
-view_autoDiscoveryQ_importSuccessful=You have successfully imported the selected resources.~
-view_autoDiscoveryQ_ignoreFailure=Failed to ignore resources~
-view_autoDiscoveryQ_ignoreSuccessful=You have successfully ignored the selected resources.~
-view_autoDiscoveryQ_unignoreFailure=Failed to unignore resources~
-view_autoDiscoveryQ_unignoreSuccessful=You have successfully unignored the selected resources.~
-view_autoDiscoveryQ_noperm=(Required manage inventory permissions missing. See Administrator to change)~
+view_autoDiscoveryQ_importSuccessful=Sie haben die ausgewählten Ressourcen erfolgreich importiert
+view_autoDiscoveryQ_ignoreFailure=Konnte die Ressourcen nicht ignorieren
+view_autoDiscoveryQ_ignoreSuccessful=Sie haben die ausgewählten Ressourcen erfolgreich ignoriert
+view_autoDiscoveryQ_unignoreFailure=Konnte das Ignorieren für die Ressourcen nicht aufheben.
+view_autoDiscoveryQ_unignoreSuccessful=Sie haben erfolgreich das Ignorieren der ausgewählten Ressourcen aufgehoben.
+view_autoDiscoveryQ_noperm=(Die erforderlichen "manage inventory" Rechte fehlen. Kontaktieren Sie den Administrator)
view_autoDiscoveryQ_noItems=Keine Einträge gefunden
-view_autoDiscoveryQ_field_parentId=Parent ID~
+view_autoDiscoveryQ_field_parentId=Eltern-ID
view_autoDiscoveryQ_field_name=Ressourcen-Name
-view_autoDiscoveryQ_field_key=Resource Key~
-view_autoDiscoveryQ_field_discoveryTime=Discovery Time~
-view_autoDiscoveryQ_field_inventoryStatus=Inventory Status~
+view_autoDiscoveryQ_field_key=Ressourcen-Schlüssel
+view_autoDiscoveryQ_field_discoveryTime=Zeitpunkt des Auffindens
+view_autoDiscoveryQ_field_inventoryStatus=Inventar-Status
view_autoDiscoveryQ_loadFailure=Failed to load the inventory discovery queue~
#==================== Bundles ======================
@@ -759,7 +753,7 @@ view_bundle_bundleVersions=Bundle-Versionen
view_bundle_deploy=Deploy
view_bundle_deployed=Deployed
view_bundle_deployDir=Deploy-Verzeichnis
-view_bundle_deployments=Deployments~
+view_bundle_deployments=Deployments
view_bundle_destinations=Ziele
view_bundle_files=Dateien
view_bundle_latestVersion=Aktuelle Version
@@ -1006,11 +1000,7 @@ view_dashboards_title=Dashboard
view_dashboards_confirm1=Sind Sie sicher, dass Sie löschen möchten
view_dashboardsManager_error1=Failed to add new dashboard~
# // dup in common
-view_dashboardsManager_inventory_title=Inventarübersicht
-view_dashboardsManager_mashup_title=RHQ Neuigkeiten
-view_dashboardsManager_message_title=Willkommen bei RHQ
view_dashboardsManager_message_title_details=<h1>Willkommen bei RHQ</h1>\n<p>Das RHQ-Projekt is an abstraction and plug-in based systems management suite that provides extensible and integrated systems management for multiple products and platforms across a set of core features. The project is designed with layered modules that provide a flexible architecture for deployment. It delivers a core user interface that delivers audited and historical management across an entire enterprise. A Server/Agent architecture provides remote management and plugins implement all specific support for managed products.</p>\n <p>This default dashboard can be edited by clicking the (edit mode) button above.</p>~
-view_dashboardsManager_tagcloud_title=Tag-Wolke
view_portlet_autodiscovery_config_platform_selection = Number of platforms to display~
view_portlet_autodiscovery_help_msg = This portlet offers the ability to import newly discovered resources into the inventory for monitoring and management or to ignore them from further action.~
view_portlet_autodiscovery_title = Discovery-Warteschlange
@@ -1026,7 +1016,7 @@ view_portlet_graph_help_msg = This Portlet supports the graphing of a resource m
view_portlet_graph_help_title = Graph Portlet~
view_portlet_graph_help_unconfigured=This graph is unconfigured, click the settings button to configure.~
view_portlet_graph_title = Resource Graph~
-view_portlet_inventory_error1=Failed to retrieve inventory summary~
+view_portlet_inventory_error1=Konnte die Inventarübersicht nicht laden
view_portlet_mashup_config_title=MashupPorlet Configuration~
view_portlet_mashup_config_title_desc=The configuration settings for the mashup portlet.~
view_portlet_mashup_help=This portlet can include a web page via an HTTP request into an iframe on the dashboard.~
@@ -1034,7 +1024,7 @@ view_portlet_mashup_unconfigured=Page address not yet configured, click the sett
view_portlet_message_config_title=MessagePortlet Configuration~
view_portlet_message_config_title_desc=The configuration settings for the message portlet.~
view_portlet_message_help=This portlet can display an HTML message on the dashboard.~
-view_portlet_message_title=Message~
+view_portlet_message_title=Nachricht
view_portlet_message_unconfigured=Message not yet configured, click the settings button to setup this portlet.~
view_portlet_operations_config_completed_maximum=Maximum number of Completed operations to display.~
view_portlet_operations_config_completed_enable=Whether to enable completed operations results grouping for dashboard.~
@@ -1064,7 +1054,7 @@ view_portlet_recentAlerts_config_priority_label = priority Alerts,~
view_portlet_recentAlerts_config_when=innerhalb der letzten
view_portlet_recentAlerts_help_msg = Displays recent alerts fired on resources visible to the current user login.~
# // dup in common
-view_portlet_recentAlerts_title = Kürzliche Alarme
+view_portlet_recentAlerts_title = Frische Alarme
view_portlet_recentlyAdded_approved_platforms=recently approved platforms on dashboard.~
view_portlet_recentlyAdded_error1=Failed to load recently added resources~
view_portlet_recentlyAdded_help_msg=This portlet displays resources that have recently been imported into the inventory.~
@@ -1076,11 +1066,9 @@ view_portlet_tagCloud_title=Tag-Wolke
#=================== Inventory =====================
view_inventory_adq = Discovery-Warteschlange
view_inventory_sectionHelp = In diesem Abschnitt können neu gefundene Ressourcen, sowie Ressourcen und Gruppen im Inventar angesehen und verwaltet werden.
-view_inventory_cannotGetGlobalPerms = Could not determine global permissions - assuming none.~
view_inventory_problemGroups=Gruppen mit Problemen
view_inventory_collectionInterval=Erfassungs-Intervall
view_inventory_mixed=gemischt
-view_inventory_downServers=Nicht-verfügbare Server
view_inventory_groups = Gruppen
view_inventory_allGroups = Alle Gruppen
view_inventory_allResources = Alle Ressourcen
@@ -1151,7 +1139,7 @@ view_tree_common_contextMenu_editPluginConfiguration=Edit [{0}] Plugin Configura
view_tree_common_contextMenu_editResourceConfiguration=Edit [{0}] Resource Configuration~
view_tree_common_contextMenu_operations=Operations~
view_tree_common_contextMenu_operations_loadFailed=Failure to start wizard for running operations~
-view_tree_common_contextMenu_measurements=Measurements~
+view_tree_common_contextMenu_measurements=Metriken
view_tree_common_contextMenu_addChartToDashboard=Diagramm zum Dashboard [{0}] hinzufügen
view_tree_common_contextMenu_resourceGraph = Resource Metric Graph~
view_tree_common_contextMenu_groupGraph = Group Metric Graph~
@@ -1224,7 +1212,6 @@ view_dynagroup_expression=Ausdruck
view_dynagroup_recursive=Rekursiv
view_dynagroup_loadDefinitionFailure=Konnte die Gruppen-Definition [{0}] nicht laden
view_dynagroup_loadDefinitionMissing=There is no group definition with the ID of [{0}]~
-view_dynagroup_permUnknown=Could not determine if you have the proper permissions - access is denied~
view_dynagroup_permDenied=You do not have permission to view group definitions~
view_dynagroup_definitions=DynaGroup-Definitionen
view_group_membership_saveFailure=Failed to update membership of group [{0}]~
@@ -1427,8 +1414,8 @@ view_aboutBox_version = Version:
#--------------
view_core_error_1 = Konnte keine Alarminformationen laden
view_core_loggedOut = Ausgeloggt
-view_core_recentAlerts = [{0}] kürzliche Alarme
-view_core_uncaught = Globally uncaught exception~
+view_core_recentAlerts = [{0}] frische Alarme
+view_core_uncaught = Es ist eine nicht abgefangene Ausnahme aufgetreten.
# Login
#--------------
@@ -1474,7 +1461,7 @@ common_title_address=Adresse
common_title_component_errors=Fehler der Komponente
common_title_show_more=Mehr anzeigen...
view_inventory_summary_agent_error1=Fehler beim Ermitteln des Agent, der dies Ressource managt
-view_inventory_summary_agent_error2=Fehler beim Kontaktieren des Agent, der dies Ressource managt
+view_inventory_summary_agent_error2=Fehler beim Kontaktieren des Agent, der diese Ressource managt
view_inventory_summary_agent_fullEnpoint=Vollständiger Kommunikationsendpunkt
view_inventory_summary_agent_fullEnpoint_err1=Es ist kein entfernter Endpunkt mit dieser Ressource assoziiert
view_inventory_summary_agent_last_title=Zeitpunkt des letzten Verfügbarkeitsberichts
@@ -1596,7 +1583,7 @@ widget_recordEditor_error_permissionCreate=Sie haben nicht die nötigen Rechte,
widget_recordEditor_warn_validation=Ein oder mehrere Felder haben ungültige Werte. Diese [{0}] kann nicht gesichert werden bis die Werte korrigiert wurden.
widget_resourceFactoryWizard_infoStep_loadFail=Konnte die verfügbaren Architekturen nicht ermitteln
widget_typeCache_loadFail=Konnte die Metadaten für den Ressourcen-Typ nicht laden
-widget_typeTree_badTemplateType=Ungültige URL. Unbekannter Template-Type [{0}]
+widget_typeTree_badTemplateType=Ungültige URL. Unbekannter Vorlagen-Typ [{0}]
widget_typeTree_badTypeId=Ungültige URL. Unbekannte Ressource-Typ-ID [{0}]
widget_typeTree_loadFail=Konnte die Ressource-Typen nicht laden
dataSource_bundle_loadFailed=Konnte die Bundle-Daten nicht laden
@@ -1661,6 +1648,41 @@ view_alert_definition_notification_cliScript_editor_script=Skript
view_alert_definition_notification_cliScript_editor_thisUser=Aktueller Benutzer
view_autoDiscoveryQ_confirmSelect=Sollen auch die Kinder der Platform ausgewählt werden?
view_autoDiscoveryQ_showStatus=Zeige
+common_title_count=Anzahl
+common_title_resource_key=Ressourcen-Schlüssel
+common_title_resource_type=Ressourcen-Typ
+common_title_results_count=Anzahl Ergebnisse
+common_title_results_count_tooltip=Zeige diese Anzahl Ergebnisse an
+common_title_stop=Stop
+common_title_sort_order=Sortierreihenfolge
+common_title_sort_order_tooltip=Legt die Sortierreihenfolge für Ergebnisse fest.
+common_title_metric_chart=Metrik-Diagramm
+common_title_operation_status=Status der Operation
+common_title_recent_bundle_deployments=Kürzliche Bundle-Deployments
+common_title_recent_configuration_updates=Frische Konfigurationsaktualisierungen
+common_title_recent_event_counts=Anzahl frischer Events
+common_title_recent_measurements=Frische Messwerte
+common_title_recent_oob_metrics=Kürzlich aus dem Ruder gelaufene Metriken
+dataSource_users_invalidEmailAddress=Ungültige E-Mail-Adresse
+dataSource_users_passwordsDoNotMatch=Passworte stimmen nicht überein.
+view_alerts_field_ack_status_ack=Best.\\ ({0})
+view_alerts_field_ack_status_ackHover=Bestätigt durch {0} um {1}
+view_alerts_field_ack_status_noAck=Unbest.
+view_alerts_field_ack_status_noAckHover=Noch nicht bestätigt
+view_core_noRecentAlerts=Es liegen keine frischen Alarme vor
+view_dynagroup_compatible=Kompatible
+view_dynagroup_mixed=Gemischt
+view_inventory_summary_agent_error3=Sie haben nicht die Rechte, um die Details für diesen Agent anzusehen.
+view_inventory_unavailableServers=Nichtverfügbare Server
+view_messageCenter_clearAllMessages=Alle Nachrichten löschen
+view_messageCenter_lastNMessages=Letzte {0} Nachrichten
+view_messageCenter_messageBarShowDetails=Details zeigen
+view_messageCenter_stackTraceFollows=--- STACK TRACE FOLGT ---
+view_operationHistoryDetails_noResults=Diese Operation liefert keine Ergebnisse zurück.
+view_operationScheduleDetails_enterParametersBelow=Geben Sie die Parameter unten an...
+view_operationScheduleDetails_field_description=Beschreibung
+view_operationScheduleDetails_field_parameters=Parameter
+view_operationScheduleDetails_noParameters=Diese Operation benötigt keine Parameter.
13 years, 1 month
[rhq] Branch 'ie-fragment-fix' - 12 commits - modules/enterprise modules/helpers
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java | 175 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java | 77 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java | 96 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java | 20 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java | 20 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp | 29 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java | 12
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 68 ++-
modules/helpers/pluginGen/src/main/resources/component.ftl | 3
17 files changed, 478 insertions(+), 71 deletions(-)
New commits:
commit d73636b65b0e07ff7941e8bcbd1a24b1639d4012
Merge: 3b311fb 34a417e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 27 10:11:43 2011 -0400
Merge branch 'master' into ie-fragment-fix
commit 34a417ec03c5278c3aaf79d878bcdf2f824e57f2
Merge: 1bba9e4 acdaf3f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:23:12 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 1bba9e4a61e82160afc7924e167f3da56187cabb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:22:40 2011 +0200
BZ-698320 Make '=' stateful, as otherwise the counter is not reset when the condition is not true.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
index 09d3e81..bd5aabc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
@@ -27,8 +27,8 @@ public enum AlertConditionOperator {
* absolute value comparison operators
*/
LESS_THAN_OR_EQUAL_TO(Type.STATEFUL), //
- LESS_THAN(Type.STATEFUL), //
- EQUALS(Type.STATELESS), //
+ LESS_THAN(Type.STATEFUL), //
+ EQUALS(Type.STATEFUL), //
REGEX(Type.STATELESS), // more flexible form of EQUALS
GREATER_THAN(Type.STATEFUL), //
GREATER_THAN_OR_EQUAL_TO(Type.STATEFUL), //
@@ -56,17 +56,17 @@ public enum AlertConditionOperator {
}
public enum Type {
- /*
- * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
+ /*
+ * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
* condition threshold is met, stateful cache elements are disabled until the threshold is crossed once again
* into the expected range;
*/
STATEFUL,
/*
- * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
+ * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
* worried about being able to suppress sliding-scale conditions once a threshold is meet, mark your operator
- * as stateful
+ * as stateful
*/
STATELESS,
commit acdaf3fed4df4adaf5dadcbedc95f1cc736e2479
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 27 07:42:08 2011 -0400
pkg history group/resource portlet link fix.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
index 83f047b..7e02ec9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
@@ -30,7 +30,6 @@ import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -231,7 +230,9 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
String title = history.getPackageVersion().getFileName() + ":";
String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + groupId
+ "&selectedHistoryId=" + history.getId();
- LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ //spinder 4/27/11: diabling links as they point into portal.war content pages
+ // LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ StaticTextItem link = AbstractActivityView.newTextItem(title);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(history.getTimestamp()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
index 3ead00a..6071704 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
@@ -22,7 +22,6 @@ import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -120,7 +119,9 @@ public class ResourcePkgHistoryPortlet extends GroupPkgHistoryPortlet {
String title = history.getPackageVersion().getFileName() + ":";
String destination = "/rhq/resource/content/audit-trail-item.xhtml?id=" + resourceId
+ "&selectedHistoryId=" + history.getId();
- LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ //spinder 4/27/11: diabling links as they point into portal.war content pages
+ // LinkItem link = AbstractActivityView.newLinkItem(title, destination);
+ StaticTextItem link = AbstractActivityView.newTextItem(title);
StaticTextItem time = AbstractActivityView.newTextItem(GwtRelativeDurationConverter
.format(history.getTimestamp()));
commit 8e53d0bf2d74f06f299a8c7fb0e1115a8765fa27
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Apr 27 03:57:31 2011 -0400
-converted iframe of Group>Monitor>Table page to gwt.
-reenabled compare metric functionality from monitor>tables.
-commented out regions of CompareMetrics for better iframing in coreGui
-i18n messages for the new widgets.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 6e7415f..1ffc4db 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -657,8 +657,16 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
public static class ChartViewWindow extends LocatableWindow {
public ChartViewWindow(String locatorId, String title) {
+ this(locatorId, title, null);
+ }
+
+ public ChartViewWindow(String locatorId, String title, String windowTitle) {
super(locatorId);
- setTitle(CHART_TITLE + ": " + title);
+ if ((windowTitle != null) && (!windowTitle.trim().isEmpty())) {
+ setTitle(windowTitle + ": " + title);
+ } else {
+ setTitle(CHART_TITLE + ": " + title);
+ }
setShowMinimizeButton(true);
setShowMaximizeButton(true);
setShowCloseButton(true);
@@ -680,6 +688,7 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
}
}
});
+
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index 8cb6a1d..e980129 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -60,11 +60,14 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.G
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.HistoryGroupPluginConfigurationView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.MembersView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.GroupMeasurementTableView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.GroupMembersHealthView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.traits.TraitsView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history.GroupOperationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.schedule.GroupOperationScheduleListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.ActivityView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* Right panel of the Resource Group view (#ResourceGroup/*).
@@ -275,8 +278,18 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- return new FullHTMLPane(monitorTables.extendLocatorId("View"),
- "/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId);
+ // return new FullHTMLPane(monitorTables.extendLocatorId("View"),
+ // "/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId);
+ //gwt version of group table view.
+ LocatableVLayout groupTableView = new LocatableVLayout(monitorTables
+ .extendLocatorId("monitorTable"));
+ GroupMeasurementTableView metrics = new GroupMeasurementTableView(monitorTables
+ .extendLocatorId("ViewMetrics"), groupComposite, groupId);
+ GroupMembersHealthView memberHealth = new GroupMembersHealthView(monitorTables
+ .extendLocatorId("ViewHealth"), groupId, false);
+ groupTableView.addMember(metrics);
+ groupTableView.addMember(memberHealth);
+ return groupTableView;
}
};
updateSubTab(this.monitoringTab, this.monitorTables, visible, true, viewFactory);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java
new file mode 100644
index 0000000..0511e9a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableDataSource.java
@@ -0,0 +1,175 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Set;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.ui.MetricDisplaySummary;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.MeasurementTableDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPreferences;
+import org.rhq.enterprise.gui.coregui.client.util.preferences.UserPreferences;
+
+/**
+ * A simple data source to read in metric data summaries for a resource.
+ * This doesn't support paging - everything is returned in one query. Since
+ * the number of metrics per resource is relatively small (never more than tens of them),
+ * we just load them all in at once.
+ *
+ * @author John Mazzitelli
+ * @author Simeon PInder
+ */
+public class GroupMeasurementTableDataSource extends MeasurementTableDataSource {
+
+ public static final String FIELD_MEMBERS_REPORTING = "membersReporting";
+
+ private int groupId;
+ private ResourceGroupComposite groupComposite;
+
+ public GroupMeasurementTableDataSource(ResourceGroupComposite groupComposite, int groupId) {
+ super(groupId);
+ this.groupComposite = groupComposite;
+ this.groupId = groupId;
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+
+ ListGridField memberCountField = new ListGridField(FIELD_MEMBERS_REPORTING, MSG
+ .common_title_members_reporting());
+ memberCountField.setWidth("15%");
+ fields.add(memberCountField);
+
+ ListGridField nameField = new ListGridField(FIELD_METRIC_LABEL, MSG.common_title_name());
+ //launching modal window, not normal link so javascript target set.
+ nameField.setType(ListGridFieldType.LINK);
+ nameField.setTarget("javascript");
+ nameField.setWidth("30%");
+ fields.add(nameField);
+
+ ListGridField alertsField = new ListGridField(FIELD_ALERT_COUNT, MSG.view_resource_monitor_table_alerts());
+ alertsField.setWidth("10%");
+ fields.add(alertsField);
+
+ ListGridField minField = new ListGridField(FIELD_MIN_VALUE, MSG.view_resource_monitor_table_min());
+ minField.setWidth("15%");
+ fields.add(minField);
+
+ ListGridField maxField = new ListGridField(FIELD_MAX_VALUE, MSG.view_resource_monitor_table_max());
+ maxField.setWidth("15%");
+ fields.add(maxField);
+
+ ListGridField avgField = new ListGridField(FIELD_AVG_VALUE, MSG.view_resource_monitor_table_avg());
+ avgField.setWidth("15%");
+ fields.add(avgField);
+
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MetricDisplaySummary from) {
+ MeasurementUtility.formatSimpleMetrics(from);
+
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_METRIC_LABEL, from.getLabel());
+ record.setAttribute(FIELD_ALERT_COUNT, String.valueOf(from.getAlertCount()));
+ record.setAttribute(FIELD_MIN_VALUE, getMetricStringValue(from.getMinMetric()));
+ record.setAttribute(FIELD_MAX_VALUE, getMetricStringValue(from.getMaxMetric()));
+ record.setAttribute(FIELD_AVG_VALUE, getMetricStringValue(from.getAvgMetric()));
+ record.setAttribute(FIELD_METRIC_DEF_ID, from.getDefinitionId());
+ record.setAttribute(FIELD_METRIC_SCHED_ID, from.getScheduleId());
+ record.setAttribute(FIELD_METRIC_UNITS, from.getUnits());
+ record.setAttribute(FIELD_METRIC_NAME, from.getMetricName());
+ record.setAttribute(FIELD_MEMBERS_REPORTING, from.getNumberCollecting());
+ return record;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final Criteria unused) {
+ final ResourceGroupComposite groupComposite = this.groupComposite;
+ final ResourceGroup group = groupComposite.getResourceGroup();
+ // Load the fully fetched ResourceType.
+ ResourceType groupType = group.getResourceType();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ groupType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.measurements, ResourceTypeRepository.MetadataType.events,
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ group.setResourceType(type);
+ //metric definitions
+ Set<MeasurementDefinition> definitions = type.getMetricDefinitions();
+
+ //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
+ final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition definition : definitions) {
+ measurementDefMap.put(definition.getDisplayName(), definition);
+ }
+ //bundle definition ids for asynch call.
+ int[] definitionArrayIds = new int[definitions.size()];
+ final String[] displayOrder = new String[definitions.size()];
+ measurementDefMap.keySet().toArray(displayOrder);
+ //sort the charting data ex. Free Memory, Free Swap Space,..System Load
+ Arrays.sort(displayOrder);
+
+ //organize definitionArrayIds for ordered request on server.
+ int index = 0;
+ for (String definitionToDisplay : displayOrder) {
+ definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay).getId();
+ }
+
+ UserPreferences prefs = UserSessionManager.getUserPreferences();
+ MeasurementUserPreferences mprefs = new MeasurementUserPreferences(prefs);
+ ArrayList<Long> range = mprefs.getMetricRangePreferences().getBeginEndTimes();
+
+ //now retrieve metric display sumamries
+ GWTServiceLookup.getMeasurementChartsService().getMetricDisplaySummariesForCompatibleGroup(groupId,
+ definitionArrayIds, Long.valueOf(range.get(0)).longValue(),
+ Long.valueOf(range.get(1)).longValue(), false,
+ new AsyncCallback<ArrayList<MetricDisplaySummary>>() {
+ @Override
+ public void onSuccess(ArrayList<MetricDisplaySummary> result) {
+ ArrayList<MetricDisplaySummary> validSummaries = new ArrayList<MetricDisplaySummary>();
+ for (MetricDisplaySummary mds : result) {
+ if (mds.getValuesPresent()) {//include only populated datapoints.
+ validSummaries.add(mds);
+ }
+ }
+ response.setData(buildRecords(validSummaries));
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Cannot load metrics", caught);
+ }
+ });
+ }
+ });
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
new file mode 100644
index 0000000..69f990c
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
@@ -0,0 +1,77 @@
+/*
+ * 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.inventory.groups.detail.monitoring.table;
+
+import java.util.ArrayList;
+
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.events.CellClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellClickHandler;
+
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.components.measurement.UserPreferencesMeasurementRangeEditor;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+
+/**
+ * Views a resource's measurements in a tabular view.
+ *
+ * @author John Mazzitelli
+ * @author Simeon Pinder
+ */
+public class GroupMeasurementTableView extends Table<GroupMeasurementTableDataSource> {
+
+ private final int groupId;
+
+ public GroupMeasurementTableView(String locatorId, ResourceGroupComposite groupComposite, int groupId) {
+ super(locatorId);
+ this.groupId = groupId;
+ setDataSource(new GroupMeasurementTableDataSource(groupComposite, groupId));
+ //disable fields used when is full screen
+ setShowFooterRefresh(false);
+ setTitle(MSG.common_title_numeric_metrics());
+ }
+
+ protected void configureTable() {
+ ArrayList<ListGridField> fields = getDataSource().getListGridFields();
+
+ //add cell click handler to execute on Table data entries.
+ getListGrid().addCellClickHandler(new CellClickHandler() {
+ @Override
+ public void onCellClick(CellClickEvent event) {
+ Record record = event.getRecord();
+ String title = record.getAttribute(GroupMeasurementTableDataSource.FIELD_METRIC_LABEL);
+ ChartViewWindow window = new ChartViewWindow("MeasurementTableFrame", title);
+ //Ex. /resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId=10141&m=10172
+ //generate and include iframed content
+ String defId = record.getAttribute(GroupMeasurementTableDataSource.FIELD_METRIC_DEF_ID);
+ String destination = "/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId=";
+ destination += groupId + "&m=" + defId;
+ FullHTMLPane iframe = new FullHTMLPane("MeasurementTableFrameView", destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+ setListGridFields(fields.toArray(new ListGridField[getDataSource().getListGridFields().size()]));
+ addExtraWidget(new UserPreferencesMeasurementRangeEditor(extendLocatorId("range")), true);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
new file mode 100644
index 0000000..30617a8
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
@@ -0,0 +1,96 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.inventory.groups.detail.monitoring.table;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.MembersView;
+
+/**
+ * The content pane for the group Monitoring>Tables subtab.
+ *
+ * @author Jay Shaughnessy
+ * @author Simeon Pinder
+ */
+public class GroupMembersHealthView extends MembersView {
+
+ private int groupId;
+ private boolean canModifyMembers;
+
+ public GroupMembersHealthView(String locatorId, int groupId, boolean canModifyMembers) {
+ super(locatorId, groupId, false);
+ this.canModifyMembers = canModifyMembers;
+ this.groupId = groupId;
+ setShowFilterForm(false);
+ setShowFooterRefresh(false);
+ //diable search view
+ setHideSearchBar(true);
+ setTitle(MSG.common_title_group_member_health());
+ }
+
+ @Override
+ protected void configureTable() {
+ List<ListGridField> fields = createFields();
+ //add extra list grid field for alerts
+ setListGridFields(fields.toArray(new ListGridField[fields.size()]));
+
+ //add chart selected metric action
+ addTableAction(extendLocatorId("chartValues"), MSG.common_title_compare_metrics(), new TableAction() {
+ @Override
+ public boolean isEnabled(ListGridRecord[] selection) {
+ return selection != null && selection.length > 1;
+ }
+
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ if (selection == null || selection.length == 0) {
+ return;
+ }
+ // keyed on metric name - string[0] is the metric label, [1] is the units
+ final HashMap<String, String[]> scheduleNamesAndUnits = new HashMap<String, String[]>();
+ int[] resourceIds = new int[selection.length];
+ int i = 0;
+ for (ListGridRecord record : selection) {
+ Integer defId = record.getAttributeAsInt(FIELD_ID);
+ resourceIds[i++] = defId.intValue();
+ }
+
+ //build portal.war chart page to iFrame
+ String destination = "/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
+ for (int rId : resourceIds) {
+ destination += "&r=" + rId;
+ }
+ ChartViewWindow window = new ChartViewWindow(extendLocatorId("CompareWindow"), "", MSG
+ .common_title_compare_metrics());
+ //generate and include iframed content
+ FullHTMLPane iframe = new FullHTMLPane(extendLocatorId("View"), destination);
+ window.addItem(iframe);
+ window.show();
+ }
+ });
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
index 8228061..8913ab7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableDataSource.java
@@ -112,7 +112,7 @@ public class MeasurementTableDataSource extends RPCDataSource<MetricDisplaySumma
return record;
}
- private String getMetricStringValue(MetricDisplayValue value) {
+ protected String getMetricStringValue(MetricDisplayValue value) {
return (value != null) ? value.toString() : "";
}
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 e51c083..e586fe3 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
@@ -107,6 +107,7 @@ common_title_category = Category
common_title_change_refresh_time=Refresh Interval
common_title_columns = Columns
common_title_configuration = Configuration
+common_title_compare_metrics = Compare Metrics
common_title_compatibleGroups = Compatible Groups
common_title_compatibleGroups_total = Compatible Group Total
common_title_component_errors = Component Errors
@@ -130,6 +131,7 @@ common_title_generalProp = General Properties
common_title_group = Group
common_title_groups = Groups
common_title_group_def_total = Group Definition Total
+common_title_group_member_health = Group Member Health
common_title_icon =
common_title_id = ID
common_title_id_parent = Parent ID
@@ -142,6 +144,7 @@ common_title_lastUpdated = Last Updated
common_title_lastUpdatedBy = Last Updated By
common_title_ldapGroups = LDAP Groups
common_title_mashup = Mashup
+common_title_members_reporting = Members Reporting
common_title_message = Message
common_title_metric = Metric
common_title_metric_chart = Metric Chart
@@ -149,6 +152,7 @@ common_title_mixedGroups = Mixed Groups
common_title_mixedGroups_total = Mixed Group Total
common_title_name = Name
common_title_new_dashboard = New Dashboard
+common_title_numeric_metrics = Numeric Metrics
common_title_numeric_type = Numeric Type
common_title_operation_status = Operation Status
common_title_operations = Operations
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
index 379c720..4a2949c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/visibility/CompareMetrics.jsp
@@ -68,18 +68,18 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
symbol="LAST_KEY"
var="last"/>
<!-- COMPARE METRICS TITLE Need to bring this back once we get the groupname in the params-->
-<%--<c:set var="titleName" value="${CompareMetricsForm.name}" />--%>
+<%--<c:set var="titleName" value="${CompareMetricsForm.name}" />
<tiles:insert definition=".page.title.resource.generic">
<tiles:put name="titleKey" value="resource.common.monitor.visibility.CompareMetricsTitle"/>
- <tiles:put name="titleName" beanName="titleName" />
-</tiles:insert>
-<html:form action="/resource/common/monitor/visibility/CompareMetrics">
+ <tiles:put name="titleName" beanName="titleName" />
+</tiles:insert>--%>
+<!--<html:form action="/resource/common/monitor/visibility/CompareMetrics">-->
-<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
+<!--<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
<fmt:message key="resource.common.monitor.visibility.CompareMetricsReturnLink">
<fmt:param value="${TitleParam}"/>
</fmt:message>
-</html:link>
+</html:link>-->
<tiles:insert definition=".header.tab">
<tiles:put name="tabKey" value="resource.common.monitor.visibility.CompareMetricsTab"/>
</tiles:insert>
@@ -136,8 +136,13 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
</c:url>
<tr class="ListRow">
<td class="ListCellCheckbox"> </td>
- <td width="1%" class="ListCellCheckbox"><a href="<c:out value="${chartUrl}" />"><html:img page="/images/icon_chart.gif" width="10" height="10" alt="" border="0"/></a></td>
- <td class="ListCell"><a href="<c:out value="${chartUrl}" />"><c:out value="${metricList.key.displayName}" /></a></td>
+ <td width="1%" class="ListCellCheckbox"><!--<a href="<c:out value="${chartUrl}" />">-->
+ <html:img page="/images/icon_chart.gif" width="10" height="10" alt="" border="0"/>
+ <!--</a> --></td>
+ <td class="ListCell">
+ <!--<a href="<c:out value="${chartUrl}" />">-->
+ <c:out value="${metricList.key.displayName}" />
+ <!--</a>--></td>
<td class="ListCellRight" nowrap> </td>
<td class="ListCellRight" nowrap> </td>
<td class="ListCellRight" nowrap> </td>
@@ -154,9 +159,9 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
<td class="ListCellCheckbox"> </td>
<td width="1%" class="ListCellCheckbox"> </td>
<td class="ListCell">
- <a href="<c:out value="${singleResourceSingleMetricChartUrl}"/>">
+ <!--<a href="<c:out value="${singleResourceSingleMetricChartUrl}"/>">-->
<c:out value="${rmds.resource.name}"/>
- </a>
+ <!--</a>-->
</td>
<td class="ListCellRight" width="%5" nowrap><c:out value="${rmds.metrics[min].valueFmt}" /></td>
<c:choose>
@@ -181,11 +186,11 @@ widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>')
<tiles:put name="useCurrentButton" value="true"/>
</tiles:insert>
</div>
-<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
+<!--<html:link href="/rhq/group/monitor/tables.xhtml?groupId=${groupId}&category=COMPATIBLE">
<fmt:message key="resource.common.monitor.visibility.CompareMetricsReturnLink">
<fmt:param value="${TitleParam}"/>
</fmt:message>
-</html:link>
+</html:link>-->
<html:hidden property="groupId"/>
<html:hidden property="category"/>
commit 9fa27ab58dfd8ce9eb94e346ada11a96620c2e96
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 17:48:07 2011 -0400
[BZ 699542 - Intermittent Serialization issues with Hibernate types]
This is a fix that I think solves the issue. It introduces changes
and logging that indicate that a potential problem in HibernateDetcahUtility
has been identified and avoided. In short we treated System.identityHashCode()
as if it guaranteed unique values, which it may not. We now handle the
situation whete the identity hash may in fact not be unique among the set
of objects being scrubbed.
The logging will be tuned down in a subsequent commit but for now dumps out
the objects that have the same hash but are not the same.
diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
index dcc6643..deddb02 100644
--- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
+++ b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
@@ -57,33 +57,51 @@ public class HibernateDetachUtility {
public static void nullOutUninitializedFields(Object value, SerializationType serializationType) throws Exception {
long start = System.currentTimeMillis();
- Set<Integer> checkedObjs = new HashSet<Integer>();
- nullOutUninitializedFields(value, checkedObjs, 0, serializationType);
+ Map<Integer, Object> checkedObjects = new HashMap<Integer, Object>();
+ nullOutUninitializedFields(value, checkedObjects, 0, serializationType);
long duration = System.currentTimeMillis() - start;
if (duration > 1000) {
- LOG.info("Detached [" + checkedObjs.size() + "] objects in [" + duration + "]ms");
+ LOG.info("Detached [" + checkedObjects.size() + "] objects in [" + duration + "]ms");
} else {
- LOG.debug("Detached [" + checkedObjs.size() + "] objects in [" + duration + "]ms");
+ LOG.debug("Detached [" + checkedObjects.size() + "] objects in [" + duration + "]ms");
}
+ // help the garbage collector be clearing these before we leave
+ checkedObjects.clear();
}
- private static void nullOutUninitializedFields(Object value, Set<Integer> nulledObjects, int depth,
+ private static void nullOutUninitializedFields(Object value, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
if (depth > 50) {
LOG.warn("Getting different object hierarchies back from calls: " + value.getClass().getName());
return;
}
- if ((value == null) || nulledObjects.contains(System.identityHashCode(value))) {
+ if (null == value) {
return;
}
- nulledObjects.add(System.identityHashCode(value));
+ // System.identityHashCode is a hash code, and therefore not guaranteed to be unique. And we've seen this
+ // be the case. So, we use it to try and avoid duplicating work, but handle the case when two objects may
+ // have an identity crisis.
+ Integer valueIdentity = System.identityHashCode(value);
+ Object checkedObject = checkedObjects.get(valueIdentity);
+
+ if (null == checkedObject) {
+ checkedObjects.put(valueIdentity, value);
+
+ } else if (value == checkedObject) {
+ return;
+
+ } else {
+ // TODO: this can be tuned down to debug after we're done evaluating this logic
+ LOG.warn("UNEQUAL IDENTITY HASHCODE [" + valueIdentity + "]\n\tCurrent : " + value.getClass().getName()
+ + "\n\t" + value + "\n\tPrevious: " + checkedObject.getClass().getName() + "\n\t" + checkedObject);
+ }
if (value instanceof Object[]) {
Object[] objArray = (Object[]) value;
for (int i = 0; i < objArray.length; i++) {
- nullOutUninitializedFields(objArray[i], nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(objArray[i], checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof List) {
@@ -96,7 +114,7 @@ public class HibernateDetachUtility {
val = replace;
i.set(replace);
}
- nullOutUninitializedFields(val, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(val, checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof Collection) {
@@ -110,14 +128,14 @@ public class HibernateDetachUtility {
replacementItems.add(replacementItem);
item = replacementItem;
}
- nullOutUninitializedFields(item, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(item, checkedObjects, depth + 1, serializationType);
}
collection.removeAll(itemsToBeReplaced);
collection.addAll(replacementItems); // watch out! if this collection is a Set, HashMap$MapSet doesn't support addAll. See BZ 688000
} else if (value instanceof Map) {
for (Object key : ((Map) value).keySet()) {
- nullOutUninitializedFields(((Map) value).get(key), nulledObjects, depth + 1, serializationType);
- nullOutUninitializedFields(key, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(((Map) value).get(key), checkedObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(key, checkedObjects, depth + 1, serializationType);
}
} else if (value instanceof Enum) {
// don't need to detach enums, treat them as special objects
@@ -127,17 +145,17 @@ public class HibernateDetachUtility {
if (serializationType == SerializationType.JAXB) {
XmlAccessorType at = value.getClass().getAnnotation(XmlAccessorType.class);
if (at != null && at.value() == XmlAccessType.FIELD) {
- nullOutFieldsByFieldAccess(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(value, checkedObjects, depth, serializationType);
} else {
- nullOutFieldsByAccessors(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByAccessors(value, checkedObjects, depth, serializationType);
}
} else if (serializationType == SerializationType.SERIALIZATION) {
- nullOutFieldsByFieldAccess(value, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(value, checkedObjects, depth, serializationType);
}
}
- private static void nullOutFieldsByFieldAccess(Object object, Set<Integer> nulledObjects, int depth,
+ private static void nullOutFieldsByFieldAccess(Object object, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
Class tmpClass = object.getClass();
@@ -147,11 +165,11 @@ public class HibernateDetachUtility {
tmpClass = tmpClass.getSuperclass();
}
- nullOutFieldsByFieldAccess(object, fieldsToClean, nulledObjects, depth, serializationType);
+ nullOutFieldsByFieldAccess(object, fieldsToClean, checkedObjects, depth, serializationType);
}
- private static void nullOutFieldsByFieldAccess(Object object, List<Field> classFields, Set<Integer> nulledObjects,
- int depth, SerializationType serializationType) throws Exception {
+ private static void nullOutFieldsByFieldAccess(Object object, List<Field> classFields,
+ Map<Integer, Object> checkedObjects, int depth, SerializationType serializationType) throws Exception {
boolean accessModifierFlag = false;
for (Field field : classFields) {
@@ -176,7 +194,7 @@ public class HibernateDetachUtility {
String className = fieldValue.getClass().getName();
className = className.substring(0, className.indexOf("_$$_"));
if (!replacement.getClass().getName().contains("hibernate")) {
- nullOutUninitializedFields(replacement, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(replacement, checkedObjects, depth + 1, serializationType);
field.set(object, replacement);
} else {
@@ -236,7 +254,7 @@ public class HibernateDetachUtility {
replacement = new ArrayList((List) fieldValue);
} else if (fieldValue instanceof Set) {
ArrayList l = new ArrayList((Set) fieldValue); // cannot recurse Sets, see BZ 688000
- nullOutUninitializedFields(l, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(l, checkedObjects, depth + 1, serializationType);
replacement = new HashSet(l); // convert it back to a Set since that's the type of the real collection, see BZ 688000
needToNullOutFields = false;
} else if (fieldValue instanceof Collection) {
@@ -245,7 +263,7 @@ public class HibernateDetachUtility {
setField(object, field.getName(), replacement);
if (needToNullOutFields) {
- nullOutUninitializedFields(replacement, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(replacement, checkedObjects, depth + 1, serializationType);
}
}
@@ -253,7 +271,7 @@ public class HibernateDetachUtility {
if (fieldValue != null
&& (fieldValue.getClass().getName().contains("org.rhq") || fieldValue instanceof Collection
|| fieldValue instanceof Object[] || fieldValue instanceof Map))
- nullOutUninitializedFields((fieldValue), nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields((fieldValue), checkedObjects, depth + 1, serializationType);
}
}
if (accessModifierFlag) {
@@ -282,7 +300,7 @@ public class HibernateDetachUtility {
return replacement;
}
- private static void nullOutFieldsByAccessors(Object value, Set<Integer> nulledObjects, int depth,
+ private static void nullOutFieldsByAccessors(Object value, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
// Null out any collections that aren't loaded
BeanInfo bi = Introspector.getBeanInfo(value.getClass(), Object.class);
@@ -318,7 +336,7 @@ public class HibernateDetachUtility {
} else {
if ((propertyValue instanceof Collection)
|| ((propertyValue != null) && propertyValue.getClass().getName().startsWith("org.rhq.core.domain"))) {
- nullOutUninitializedFields(propertyValue, nulledObjects, depth + 1, serializationType);
+ nullOutUninitializedFields(propertyValue, checkedObjects, depth + 1, serializationType);
}
}
}
commit da7bcb054f3c0b7deed1a679bdc15a1049c7770e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:37:05 2011 -0400
Don't trap throwables, let them get passed up so we can detect problems
thrown in HbernateDetach (for example) as opposed to deferring issues to
the serialization step.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
index 7433805..8e1499b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
@@ -18,8 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.server.util;
-import org.rhq.enterprise.server.util.HibernateDetachUtility;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
@@ -27,6 +25,8 @@ import java.io.ObjectOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.enterprise.server.util.HibernateDetachUtility;
+
/**
* @author Greg Hinkle
*/
@@ -34,21 +34,19 @@ public class SerialUtility {
private static Log log = LogFactory.getLog(SerialUtility.class);
- public static <T> T prepare(T value, String message) {
+ public static <T> T prepare(T value, String message) throws Exception {
long start = System.currentTimeMillis();
- try {
- HibernateDetachUtility.nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION);
- if (log.isDebugEnabled())
- log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) +
- "ms, Size is: " + serialSize(value));
- } catch (Exception e) {
- e.printStackTrace();
+ HibernateDetachUtility
+ .nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION);
+ if (log.isDebugEnabled()) {
+ log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start)
+ + "ms, Size is: " + serialSize(value));
}
+
return value;
}
-
public static int serialSize(Object value) {
try {
commit 2ccc5f0c36132b169ac736015c1ce5a40e530cf6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:35:56 2011 -0400
Make sure the slsb calls are wrapped in try/catch and throw
appropriate exceptions.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
index ad42c8c..1b844aa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
@@ -142,15 +142,23 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
}
public ResourceOperationSchedule getResourceOperationSchedule(int scheduleId) throws RuntimeException {
- ResourceOperationSchedule resourceOperationSchedule = operationManager.getResourceOperationSchedule(
- getSessionSubject(), scheduleId);
- return SerialUtility.prepare(resourceOperationSchedule, "getResourceOperationSchedule");
+ try {
+ ResourceOperationSchedule resourceOperationSchedule = operationManager.getResourceOperationSchedule(
+ getSessionSubject(), scheduleId);
+ return SerialUtility.prepare(resourceOperationSchedule, "getResourceOperationSchedule");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
}
public GroupOperationSchedule getGroupOperationSchedule(int scheduleId) throws RuntimeException {
- GroupOperationSchedule groupOperationSchedule = operationManager.getGroupOperationSchedule(getSessionSubject(),
- scheduleId);
- return SerialUtility.prepare(groupOperationSchedule, "getGroupOperationSchedule");
+ try {
+ GroupOperationSchedule groupOperationSchedule = operationManager.getGroupOperationSchedule(
+ getSessionSubject(), scheduleId);
+ return SerialUtility.prepare(groupOperationSchedule, "getGroupOperationSchedule");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
}
public void unscheduleResourceOperation(ResourceOperationSchedule resourceOperationSchedule)
commit 3279b49d5fc317070669bf049c9d051a5639eb18
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 26 14:34:50 2011 -0400
make sure initial data load happens for portlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
index 0624311..f88774f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
@@ -104,7 +104,7 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
//disable the refresh timer for this run
currentlyLoading = true;
initializeUi();
- redraw();
+ loadData();
}
/**Defines layout for the portlet page.
commit 62875f0309b333009c97c18b00e03e8fa6d3d178
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 26 12:55:18 2011 -0400
BZ 697699 - do not set autoFitData on the listgrid - it appears to trigger a bug in smartgwt when the list is empty
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 7c8fcc9..3e4b27b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -36,7 +36,6 @@ import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.SortSpecifier;
-import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.SelectionStyle;
@@ -88,8 +87,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.VERSION;
-
/**
* A tabular view of set of data records from an {@link RPCDataSource}.
*
@@ -255,7 +252,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
listGrid.setSelectionType(getDefaultSelectionStyle());
if (flexRowDisplay) {
- listGrid.setAutoFitData(Autofit.HORIZONTAL);
+ //listGrid.setAutoFitData(Autofit.HORIZONTAL); // do NOT set this - smartgwt appears to have a problem that causes it to eat CPU
listGrid.setWrapCells(true);
listGrid.setFixedRecordHeights(false);
}
commit ab5402c8d9990f27c568b593445ff97a0018be35
Merge: 8889b7e 2bbcd54
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Apr 26 17:46:34 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 8889b7e262efba9537bc1df237e8d1aef812e85f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 20 09:54:21 2011 +0200
Put resource context into a local variable for later use.
diff --git a/modules/helpers/pluginGen/src/main/resources/component.ftl b/modules/helpers/pluginGen/src/main/resources/component.ftl
index 56effd8..1b3dda1 100644
--- a/modules/helpers/pluginGen/src/main/resources/component.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/component.ftl
@@ -98,6 +98,8 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
private static final int CHANGEME = 1; // TODO remove or change this
+ private ResourceContext<#if props.parentType??><${props.parentType}></#if> context;
+
<#if props.events>
public static final String DUMMY_EVENT = "${props.name}DummyEvent"; // Same as in Plugin-Descriptor
@@ -139,6 +141,7 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
*/
public void start(ResourceContext<#if props.parentType??><${props.parentType}></#if> context) throws InvalidPluginConfigurationException, Exception {
+ this.context = context;
Configuration conf = context.getPluginConfiguration();
// TODO add code to start the resource / connection to it
13 years, 1 month
[rhq] Branch 'ie-fragment-fix' - modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/ViewLink.java | 110 ++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ViewLinkItem.java | 22 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java | 34 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 124 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHStack.java | 60 ++++
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 32 +-
8 files changed, 305 insertions(+), 82 deletions(-)
New commits:
commit 3b311fb8c43b00e87fb525f6de9a4cfb1aa83323
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Apr 27 10:06:11 2011 -0400
more work on converting raw links to SmartGWT widgets
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/ViewLink.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/ViewLink.java
new file mode 100644
index 0000000..459c4d9
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/ViewLink.java
@@ -0,0 +1,110 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.components;
+
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.MouseOutEvent;
+import com.smartgwt.client.widgets.events.MouseOutHandler;
+import com.smartgwt.client.widgets.events.MouseOverEvent;
+import com.smartgwt.client.widgets.events.MouseOverHandler;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLFlow;
+
+/**
+ * A link to another view within coregui.war. Clicking on the link will navigate to the view via the GWT history API
+ * to avoid a page reload.
+ *
+ * @author Ian Springer
+ */
+public class ViewLink extends LocatableHTMLFlow {
+
+ private static final String DEFAULT_MOUSE_OUT_STYLE_NAME = "viewLink";
+ private static final String DEFAULT_MOUSE_OVER_STYLE_NAME = "viewLinkHover";
+
+ private String viewPath;
+ private String mouseOverStyleName;
+ private String mouseOutStyleName;
+
+ public ViewLink(String locatorId, String linkText, final String viewPath) {
+ super(locatorId);
+
+ this.viewPath = viewPath;
+ this.mouseOutStyleName = DEFAULT_MOUSE_OUT_STYLE_NAME;
+ this.mouseOverStyleName = DEFAULT_MOUSE_OVER_STYLE_NAME;
+
+ setWidth100();
+ setHeight(25);
+ setContents(linkText);
+
+ addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ CoreGUI.goToView(viewPath);
+ }
+ });
+
+ addMouseOverHandler(new MouseOverHandler() {
+ public void onMouseOver(MouseOverEvent event) {
+ if (mouseOutStyleName != null && mouseOverStyleName != null) {
+ setStyleName(mouseOverStyleName);
+ markForRedraw();
+ }
+ }
+ });
+
+ addMouseOutHandler(new MouseOutHandler() {
+ public void onMouseOut(MouseOutEvent event) {
+ if (mouseOutStyleName != null && mouseOverStyleName != null) {
+ setStyleName(mouseOutStyleName);
+ markForRedraw();
+ }
+ }
+ });
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ setStyleName(getMouseOutStyleName());
+ }
+
+ public String getMouseOverStyleName() {
+ return this.mouseOverStyleName;
+ }
+
+ public void setMouseOverStyleName(String mouseOverStyleName) {
+ this.mouseOverStyleName = mouseOverStyleName;
+ }
+
+ public String getMouseOutStyleName() {
+ return this.mouseOutStyleName;
+ }
+
+ public void setMouseOutStyleName(String mouseOutStyleName) {
+ this.mouseOutStyleName = mouseOutStyleName;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + "[" + getContents() + " -> " + this.viewPath + "]";
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ViewLinkItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ViewLinkItem.java
new file mode 100644
index 0000000..0576cb5
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ViewLinkItem.java
@@ -0,0 +1,22 @@
+package org.rhq.enterprise.gui.coregui.client.components.form;
+
+import com.smartgwt.client.widgets.form.fields.CanvasItem;
+
+/**
+ *
+ */
+public class ViewLinkItem extends CanvasItem {
+
+ public ViewLinkItem(String name, String title) {
+ super(name, title);
+ // TODO
+ }
+
+ public ViewLinkItem(String name) {
+ super(name);
+ }
+
+ public ViewLinkItem() {
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
index b1dec1d..49ca4b8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection.java
@@ -24,11 +24,10 @@ package org.rhq.enterprise.gui.coregui.client.components.table;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.InlineHyperlink;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.AnimationEffect;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.AnimationCallback;
import com.smartgwt.client.widgets.Canvas;
@@ -38,13 +37,14 @@ import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.Layout;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.DetailsView;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.components.ViewLink;
import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
@@ -135,15 +135,19 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
@Override
protected void configureTable() {
if (isDetailsEnabled()) {
-/*
+
ListGrid grid = getListGrid();
// Make the value of some specific field a link to the details view for the corresponding record.
ListGridField field = (grid != null) ? grid.getField(getDetailsLinkColumnName()) : null;
if (field != null) {
- field.setCellFormatter(getDetailsLinkColumnCellFormatter());
+ //field.setCellFormatter(getDetailsLinkColumnCellFormatter());
+ field.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ return "";
+ }
+ });
}
-*/
setListGridDoubleClickHandler(new DoubleClickHandler() {
@Override
@@ -410,23 +414,25 @@ public abstract class TableSection<DS extends RPCDataSource> extends Table<DS> i
@Override
protected Canvas createRecordComponent(ListGridRecord record, Integer colNum) {
- Canvas canvas;
+ Layout component;
String fieldName = this.getFieldName(colNum);
if (fieldName.equals(getDetailsLinkColumnName())) {
- canvas = new LocatableHLayout(extendLocatorId(fieldName + getRecordIndex(record)));
+ component = new LocatableHLayout(extendLocatorId(fieldName + getRecordIndex(record)));
+ component.setWidth100();
+ component.setHeight(25);
+ component.setMargin(getCellPadding());
+ component.setOverflow(Overflow.HIDDEN);
Integer recordId = getId(record);
String detailsViewPath = getBasePath() + "/" + recordId;
String recordValue = record.getAttribute(getDetailsLinkColumnName());
String formattedValue = (escapeHtmlInDetailsLinkColumn) ? StringUtility.escapeHtml(recordValue.toString())
: recordValue.toString();
- formattedValue = "***" + formattedValue + "***";
- // TODO: Make the below Hyperlink Locatable.
- InlineHyperlink hyperlink = new InlineHyperlink(formattedValue, detailsViewPath);
- canvas.addChild(hyperlink);
+ ViewLink viewLink = new ViewLink(extendLocatorId("ViewLink"), formattedValue, detailsViewPath);
+ component.addMember(viewLink);
} else {
- canvas = null;
+ component = null;
}
- return canvas;
+ return component;
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 58fd490..6ec69f5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -23,27 +23,35 @@ import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Hyperlink;
import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.Layout;
+import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
+import org.rhq.enterprise.gui.coregui.client.components.ViewLink;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
import org.rhq.enterprise.gui.coregui.client.help.HelpView;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import org.rhq.enterprise.gui.coregui.client.report.ReportTopView;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHStack;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableLabel;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author Greg Hinkle
* @author Joseph Marques
@@ -80,7 +88,7 @@ public class MenuBarView extends LocatableVLayout {
markForRedraw();
}
- // When redrawing, ensire the correct session infor is displayed
+ // When redrawing, ensure the correct session info is displayed
@Override
public void markForRedraw() {
String currentDisplayName = userLabel.getContents();
@@ -92,7 +100,7 @@ public class MenuBarView extends LocatableVLayout {
super.markForRedraw();
}
- private Canvas getLogoSection() {
+ private Img getLogoSection() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
logo.addClickHandler(new ClickHandler() {
@@ -103,51 +111,10 @@ public class MenuBarView extends LocatableVLayout {
return logo;
}
- private Canvas getLinksSection() {
- final HTMLFlow linksPane = new HTMLFlow();
- linksPane.setContents(setupLinks());
-
- History.addValueChangeHandler(new ValueChangeHandler<String>() {
- public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
- String first = stringValueChangeEvent.getValue().split("/")[0];
-
- if ("Resource".equals(first)) {
- first = "Inventory";
- }
-
- currentlySelectedSection = first;
- linksPane.setContents(setupLinks());
- linksPane.markForRedraw();
- }
- });
- return linksPane;
- }
-
- private String setupLinks() {
- // TODO: Replace the below HTML with SmartGWT widgets.
- StringBuilder headerString = new StringBuilder(
- "<table style=\"height: 34px;\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
-
- headerString.append("<td style=\"width: 1px;\"><img src=\"images/header/header_bg_line.png\"/></td>");
- for (ViewName sectionName : SECTIONS) {
-
- String styleClass = "TopSectionLink";
- if (sectionName.getName().equals(currentlySelectedSection)) {
- styleClass = "TopSectionLinkSelected";
- }
-
- // Set explicit identifiers because the generated scLocator is not getting picked up by Selenium.
- headerString.append("<td style=\"vertical-align:middle\" id=\"").append(sectionName).append("\" class=\"")
- .append(styleClass).append("\" onclick=\"window.location.href='#").append(sectionName).append("'\" >");
- headerString.append(sectionName.getTitle());
- headerString.append("</td>\n");
-
- headerString.append("<td style=\"width: 1px;\"><img src=\"images/header/header_bg_line.png\"/></td>");
- }
-
- headerString.append("</tr></table>");
-
- return headerString.toString();
+ private LinkBar getLinksSection() {
+ LinkBar linksSection = new LinkBar();
+ History.addValueChangeHandler(linksSection);
+ return linksSection;
}
private Canvas getActionsSection() {
@@ -173,4 +140,63 @@ public class MenuBarView extends LocatableVLayout {
return layout;
}
+ class LinkBar extends LocatableHStack implements ValueChangeHandler<String> {
+ private final Map<String, LocatableVLayout> sectionNameToViewLinkMap = new HashMap<String, LocatableVLayout>();
+
+ LinkBar() {
+ super(MenuBarView.this.extendLocatorId("LinkBar"));
+
+ setWidth100();
+ setHeight(34);
+
+ Img divider = new Img("images/header/header_bg_line.png");
+ divider.setWidth(1);
+ addMember(divider);
+
+ for (ViewName sectionName : SECTIONS) {
+ LocatableVLayout viewLinkContainer = new LocatableVLayout(extendLocatorId(sectionName.getName()));
+ viewLinkContainer.setAlign(VerticalAlignment.CENTER);
+ ViewLink viewLink = new ViewLink(extendLocatorId(sectionName.getName()), sectionName.getTitle(),
+ sectionName.getName());
+ viewLink.setStyleName(null);
+ viewLink.setMouseOutStyleName(null);
+ viewLink.setMouseOverStyleName(null);
+ this.sectionNameToViewLinkMap.put(sectionName.getName(), viewLinkContainer);
+ viewLinkContainer.addMember(viewLink);
+ updateViewLinkStyle(sectionName.getName());
+ addMember(viewLinkContainer);
+
+ divider = new Img("images/header/header_bg_line.png");
+ divider.setWidth(1);
+ addMember(divider);
+ }
+ }
+
+ @Override
+ public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
+ String viewPath = stringValueChangeEvent.getValue();
+ String topViewId = viewPath.split("/")[0];
+ if ("Resource".equals(topViewId)) {
+ topViewId = InventoryView.VIEW_ID.getName();
+ }
+ currentlySelectedSection = topViewId;
+
+ for (String sectionName : this.sectionNameToViewLinkMap.keySet()) {
+ updateViewLinkStyle(sectionName);
+ }
+ }
+
+ private void updateViewLinkStyle(String sectionName) {
+ String styleClass;
+ if (sectionName.equals(currentlySelectedSection)) {
+ styleClass = "TopSectionLinkSelected";
+ } else {
+ styleClass = "TopSectionLink";
+ }
+ LocatableVLayout viewLinkContainer = this.sectionNameToViewLinkMap.get(sectionName);
+ viewLinkContainer.setStyleName(styleClass);
+ viewLinkContainer.markForRedraw();
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
index fccff5b..cb5f03f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
@@ -57,7 +57,8 @@ public class AlertDefinitionReportView extends Table<AlertDefinitionReportView.D
@Override
protected void configureTable() {
ListGrid listGrid = getListGrid();
- listGrid.setFields(getDataSource().getListGridFields().toArray(new ListGridField[0]));
+ ArrayList<ListGridField> listGridFields = getDataSource().getListGridFields();
+ listGrid.setFields(listGridFields.toArray(new ListGridField[listGridFields.size()]));
setListGridDoubleClickHandler(new DoubleClickHandler() {
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
index 0eb0057..f1fa548 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
@@ -133,7 +133,7 @@ public class ResourceInstallReport extends LocatableVLayout implements Bookmarka
return value.toString();
}
- return "<a href=\"" + url + "\">" + value.toString() + "</a>";
+ return "<a href=\"" + url + "\">" + value + "</a>";
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHStack.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHStack.java
new file mode 100644
index 0000000..0a27e0b
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHStack.java
@@ -0,0 +1,60 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.layout.HStack;
+
+/**
+ * Wrapper for a SmartGWT {@link HStack} that sets the ID for use with Selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableHStack extends HStack implements Locatable {
+
+ private String locatorId;
+
+ /**
+ * <pre>
+ * ID Format: "simpleClassname_locatorId"
+ * </pre>
+ * @param locatorId not null or empty.
+ */
+ public LocatableHStack(String locatorId) {
+ super();
+ init(locatorId);
+ }
+
+ /**
+ * <pre>
+ * ID Format: "simpleClassname_locatorId"
+ * </pre>
+ * @param locatorId not null or empty.
+ * @param membersMargin
+ */
+ public LocatableHStack(String locatorId, int membersMargin) {
+ super(membersMargin);
+ init(locatorId);
+ }
+
+ private void init(String locatorId) {
+ this.locatorId = locatorId;
+ SeleniumUtility.setID(this, locatorId);
+ }
+
+ public String getLocatorId() {
+ return locatorId;
+ }
+
+ public String extendLocatorId(String extension) {
+ return this.locatorId + "_" + extension;
+ }
+
+ public void destroyMembers() {
+ SeleniumUtility.destroyMembers(this);
+ }
+
+ @Override
+ public void destroy() {
+ destroyMembers();
+ super.destroy();
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index f6befb0..aebf32b 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -1,17 +1,12 @@
-/*body {
- background-color: white;
- color: black;
- font-family: Arial, sans-serif;
- font-size: small;
- margin: 8px;
-}*/
-
body, p, td, th, option, input, textarea, select {
- color: #000000;
font-family: tahoma, verdana, sans-serif !important;
font-size: 11px !important;
}
+body {
+ color: #000000;
+}
+
img {
border-style: none;
}
@@ -27,13 +22,13 @@ hr {
width: 100%;
}
-a, a:link, a:visited, a:hover {
+a, a:link, a:visited, a:hover, .viewLink, .viewLinkHover {
color: #4A5D75 !important;
font-weight: bold !important;
text-decoration: none !important;
}
-a:hover {
+a:hover, .viewLinkHover {
text-decoration: underline !important;
}
@@ -97,22 +92,25 @@ a:hover {
}
-.TopSectionLink, .topsectionlinkselected {
+.TopSectionLink, .TopSectionLinkSelected {
vertical-align: bottom;
padding:5px;
padding-left: 15px;
padding-right: 15px;
cursor: pointer;
- font-size: 10pt;
- font-weight: bold;
- text-decoration: none;
- color: #4A5D75;
+ font-size: 10pt !important;
+ font-weight: bold !important;
+ text-decoration: none !important;
+}
+
+.TopSectionLink {
+ color: #4A5D75 !important;
}
.TopSectionLinkSelected {
background-image: url('images/header/header_bg_selected.png');
- color: white;
+ color: #FFFFFF !important;
}
.BreadCrumb {
13 years, 1 month
[rhq] 4 commits - modules/enterprise modules/helpers
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java | 12 +++++-----
modules/helpers/pluginGen/src/main/resources/component.ftl | 3 ++
2 files changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 34a417ec03c5278c3aaf79d878bcdf2f824e57f2
Merge: 1bba9e4 acdaf3f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:23:12 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 1bba9e4a61e82160afc7924e167f3da56187cabb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 27 15:22:40 2011 +0200
BZ-698320 Make '=' stateful, as otherwise the counter is not reset when the condition is not true.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
index 09d3e81..bd5aabc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/AlertConditionOperator.java
@@ -27,8 +27,8 @@ public enum AlertConditionOperator {
* absolute value comparison operators
*/
LESS_THAN_OR_EQUAL_TO(Type.STATEFUL), //
- LESS_THAN(Type.STATEFUL), //
- EQUALS(Type.STATELESS), //
+ LESS_THAN(Type.STATEFUL), //
+ EQUALS(Type.STATEFUL), //
REGEX(Type.STATELESS), // more flexible form of EQUALS
GREATER_THAN(Type.STATEFUL), //
GREATER_THAN_OR_EQUAL_TO(Type.STATEFUL), //
@@ -56,17 +56,17 @@ public enum AlertConditionOperator {
}
public enum Type {
- /*
- * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
+ /*
+ * stateful is used to support a sliding scale of values, usually a number line; once the stateful operator's
* condition threshold is met, stateful cache elements are disabled until the threshold is crossed once again
* into the expected range;
*/
STATEFUL,
/*
- * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
+ * stateless can be used for anything stateful can, but will never be disabled in the cache; so, if you're
* worried about being able to suppress sliding-scale conditions once a threshold is meet, mark your operator
- * as stateful
+ * as stateful
*/
STATELESS,
commit ab5402c8d9990f27c568b593445ff97a0018be35
Merge: 8889b7e 2bbcd54
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Apr 26 17:46:34 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 8889b7e262efba9537bc1df237e8d1aef812e85f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Apr 20 09:54:21 2011 +0200
Put resource context into a local variable for later use.
diff --git a/modules/helpers/pluginGen/src/main/resources/component.ftl b/modules/helpers/pluginGen/src/main/resources/component.ftl
index 56effd8..1b3dda1 100644
--- a/modules/helpers/pluginGen/src/main/resources/component.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/component.ftl
@@ -98,6 +98,8 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
private static final int CHANGEME = 1; // TODO remove or change this
+ private ResourceContext<#if props.parentType??><${props.parentType}></#if> context;
+
<#if props.events>
public static final String DUMMY_EVENT = "${props.name}DummyEvent"; // Same as in Plugin-Descriptor
@@ -139,6 +141,7 @@ public class ${props.componentClass} implements ResourceComponent<#if props.pare
*/
public void start(ResourceContext<#if props.parentType??><${props.parentType}></#if> context) throws InvalidPluginConfigurationException, Exception {
+ this.context = context;
Configuration conf = context.getPluginConfiguration();
// TODO add code to start the resource / connection to it
13 years, 1 month