.classpath
| 16
dev/null
|binary
etc/agentspawn/src/main/resources/template-configuration.xml
| 2
etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml
| 2
etc/apt/pom.xml
| 2
etc/cli-scripts/reset_apache_props.js
| 102 +
etc/cli-scripts/reset_conn_props.js
| 240 ----
etc/cli-scripts/reset_jboss_agent_props.js
| 110 ++
etc/cli-scripts/util.js
| 95 +
etc/dev-utils/jdk.sh
| 26
etc/samples/perspectives/sample-perspective/app/pom.xml
| 9
etc/samples/perspectives/sample-perspective/perspective/pom.xml
| 4
etc/standalone-pc/standalone.sh
| 2
modules/cli-tests/pom.xml
| 2
modules/common/ant-bundle/pom.xml
| 2
modules/common/filetemplate-bundle/pom.xml
| 2
modules/common/jboss-as/pom.xml
| 2
modules/common/pom.xml
| 2
modules/core/client-api/pom.xml
| 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
| 109 +-
modules/core/comm-api/pom.xml
| 2
modules/core/dbutils/pom.xml
| 10
modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
| 2
modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
| 42
modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
| 29
modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java
| 17
modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
| 137 ++
modules/core/dbutils/src/main/scripts/dbsetup-build.xml
| 2
modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml
| 3
modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml
| 2
modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
| 20
modules/core/dbutils/src/main/scripts/dbsetup/dashboard-schema.xml
| 28
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
| 13
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
| 227 +++-
modules/core/domain/pom.xml
| 102 +
modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
| 20
modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java
| 46
modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
| 12
modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java
| 2
modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
| 121 ++
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java
| 3
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java
| 4
modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java
| 3
modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java
| 69 -
modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java
| 107 ++
modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java
| 12
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
| 13
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
| 6
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
| 127 ++
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
| 34
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java
| 162 +++
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java
| 7
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
| 12
modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
| 215 ++++
modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
| 170 +++
modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
| 34
modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java
| 46
modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java
| 25
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementData.java
| 4
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java
| 3
modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
| 51
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java
| 7
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java
| 9
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
| 165 +--
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
| 22
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
| 38
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java
| 58 -
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
| 91 +
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java
| 237 ++++
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java
| 65 -
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java
| 4
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
| 99 +
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java
| 62 +
modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
| 18
modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java
| 2
modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
| 14
modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java
| 2
modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java
| 30
modules/core/domain/src/test/java/org/rhq/core/domain/resource/test/ResourceErrorTest.java
| 4
modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java
| 8
modules/core/gui/pom.xml
| 2
modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java
| 17
modules/core/native-system/ant-run.xml
| 2
modules/core/native-system/pom.xml
| 2
modules/core/plugin-api/pom.xml
| 2
modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java
| 47
modules/core/plugin-container/pom.xml
| 37
modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
| 23
modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java
| 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
| 170 +--
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
| 21
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
| 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java
| 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java
| 170 +--
modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
| 47
modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java
| 155 +++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
| 7
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTest.java
| 35
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/DiscComponent.java
| 54 +
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/ResComponent.java
| 46
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml
| 18
modules/core/plugin-validator/pom.xml
| 20
modules/core/plugindoc/pom.xml
| 2
modules/core/pom.xml
| 2
modules/core/util/pom.xml
| 9
modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java
| 52 -
modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
| 4
modules/enterprise/agent/ant-run.xml
| 2
modules/enterprise/agent/pom.xml
| 7
modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
| 24
modules/enterprise/agent/src/etc/rhq-agent.sh
| 14
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java
| 16
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
| 7
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
| 13
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
| 91 +
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
| 32
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java
| 10
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java
| 65 +
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java
| 8
modules/enterprise/agent/src/main/resources/agent-configuration.xml
| 9
modules/enterprise/agent/src/test/resources/test-agent-configuration.xml
| 2
modules/enterprise/agent/src/test/resources/test-agent1-cfg-mvn.xml
| 2
modules/enterprise/agent/src/test/resources/test-agent2-cfg-mvn.xml
| 2
modules/enterprise/agent/src/test/resources/test-agent2-configuration.xml
| 2
modules/enterprise/agentupdate/pom.xml
| 2
modules/enterprise/comm/pom.xml
| 7
modules/enterprise/gui/base-perspective-jar/pom.xml
| 4
modules/enterprise/gui/base-perspective-war/pom.xml
| 2
modules/enterprise/gui/content_http-war/pom.xml
| 2
modules/enterprise/gui/coregui/pom.xml
| 50
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
| 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
| 29
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
| 41
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
| 151 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
| 45
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
| 106 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
| 27
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
| 44
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
| 71 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
| 377 +++++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
| 135 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleResourceGroupSelector.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
| 78 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
| 79 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
| 194 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java
| 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
| 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
| 153 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
| 125 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
| 160 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java
| 194 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
| 69 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
| 135 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
| 112 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
| 244 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java
| 57 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java
| 108 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
| 112 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
| 126 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
| 116 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
| 117 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
| 176 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java
| 57 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java
| 108 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java
| 87 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
| 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
| 51
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
| 41
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
| 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
| 27
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/bundle/revert/AbstractBundleRevertWizard.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
| 39
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
| 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java
| 101 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
| 355 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
| 177 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
| 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
| 62 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/lookup/ResourceLookupComboBoxItem.java
| 63 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
| 309 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
| 73 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
| 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
| 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
| 134 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
| 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
| 77 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
| 85 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java
| 82 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
| 57 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
| 66 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/ConfigurablePortlet.java
| 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/CustomSettingsPortlet.java
| 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
| 208 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
| 268 ++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/OldDashboardView.java
| 265 -----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
| 94 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/Portlet.java
| 84 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletHelpWindow.java
| 100 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java
| 114 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletView.java
| 36
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
| 194 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
| 112 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
| 123 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
| 167 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryView.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
| 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
| 87 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
| 79 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardManager.java
| 58 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardStore.java
| 58 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredDashboard.java
| 77 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredPortlet.java
| 109 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
| 68 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
| 47
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
| 59 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
| 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
| 30
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
| 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
| 29
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
| 147 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
| 66 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
| 217 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
| 145 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
| 117 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
| 86 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
| 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
| 45
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
| 297 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
| 195 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
| 139 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeDatasource.java
| 329 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
| 111 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
| 131 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
| 45
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsDataSource.java
| 58 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsView.java
| 48
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java
| 241 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
| 51
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
| 59 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
| 247 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
| 63 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
| 167 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
| 90 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java
| 360 +++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java
| 514 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
| 274 ++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
| 164 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
| 70 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
| 355 +++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
| 149 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java
| 145 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
| 68 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
| 138 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
| 134 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java
| 99 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
| 81 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceScheduledMetricDatasource.java
| 153 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
| 107 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
| 131 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
| 46
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsDataSource.java
| 58 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsView.java
| 45
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
| 111 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
| 55 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
| 190 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
| 51
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewForm.java
| 298 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
| 120 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
| 100 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
| 42
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
| 85 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java
| 283 -----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
| 41
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
| 158 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java
| 115 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
| 79 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java
| 247 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
| 280 -----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
| 383 +++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
| 154 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java
| 61 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
| 104 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
| 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java
| 158 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java
| 301 -----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java
| 166 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
| 196 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
| 67 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableDynamicForm.java
| 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableIButton.java
| 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
| 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTransferImgButton.java
| 47
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTreeGrid.java
| 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java
| 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java
| 109 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AuthorizationGWTServiceImpl.java
| 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java
| 69 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DashboardGWTServiceImpl.java
| 59 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/EventGWTServiceImpl.java
| 65 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
| 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
| 80 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
| 71 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
| 41
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
| 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java
| 11
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 19
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
| 22
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
| 32
modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/alert/Flag_blue_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/DEBUG_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/ERROR_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/FATAL_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/INFO_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_warning_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_warning_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
|binary
modules/enterprise/gui/installer-war/pom.xml
| 8
modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java
| 279 +----
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_de.properties
| 82 +
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_fr.properties
| 47
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
| 69 +
modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
| 1
modules/enterprise/gui/pom.xml
| 2
modules/enterprise/gui/portal-war/pom.xml
| 16
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
| 8
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
| 8
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java
| 9
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java
| 4
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java
| 7
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
| 10
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
| 21
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java
| 7
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java
| 22
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java
| 103 +-
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java
| 4
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
| 31
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
| 35
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java
| 10
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java
| 14
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java
| 42
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java
| 4
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
| 4
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java
| 1
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java
| 1
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java
| 7
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/tables/resource/ResourceMetricsTableUIBean.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
| 4
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java
| 5
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java
| 11
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java
| 1
modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
| 10
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml
| 60 +
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml
| 45
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml
| 26
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml
| 15
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
| 15
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml
| 88 +
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml
| 119 ++
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml
| 106 ++
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml
| 183 +++
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml
| 211 ++++
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml
| 491 +++++++++
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml
| 26
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml
| 73 +
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml
| 89 +
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
| 33
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
| 16
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
| 26
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp
| 3
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
| 115 --
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
| 2
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
| 28
modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp
| 90 +
modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp
| 4
modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
| 1
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png
|binary
modules/enterprise/gui/portal-war/src/main/webapp/index.html
| 9
modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js
| 25
modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
| 2
modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
| 4
modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
| 2
modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp
| 2
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
| 15
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp
| 3
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
| 13
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml
| 108 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-add-map.xhtml
| 32
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml
| 155 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml
| 28
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml
| 21
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml
| 41
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml
| 29
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml
| 22
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml
| 268 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
| 6
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml
| 23
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
| 22
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml
| 26
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
| 158 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml
| 46
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
| 3
modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml
| 39
modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml
| 126 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml
| 177 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml
| 45
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml
| 69 +
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml
| 18
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml
| 281 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml
| 10
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml
| 55 +
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml
| 19
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml
| 19
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml
| 4
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
| 3
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
| 64 +
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml
| 19
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml
| 15
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml
| 153 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml
| 128 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml
| 293 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
| 235 ++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml
| 118 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml
| 173 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml
| 106 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml
| 41
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml
| 288 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml
| 290 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml
| 113 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml
| 138 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml
| 162 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml
| 168 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml
| 291 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml
| 203 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml
| 130 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml
| 206 ++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
| 34
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
| 31
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml
| 26
modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml
| 310 ++++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml
| 161 +++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml
| 210 ++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml
| 25
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml
| 18
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml
| 26
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml
| 27
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml
| 23
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml
| 27
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml
| 33
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml
| 37
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml
| 20
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml
| 112 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml
| 17
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml
| 31
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml
| 14
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml
| 38
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml
| 19
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml
| 27
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml
| 270 +++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml
| 122 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml
| 73 +
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml
| 104 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml
| 14
modules/enterprise/gui/webdav-war/pom.xml
| 2
modules/enterprise/gui/webdav-war/webdav-war.iml
| 169 ---
modules/enterprise/pom.xml
| 2
modules/enterprise/remoting/ant-run.xml
| 2
modules/enterprise/remoting/cli/pom.xml
| 8
modules/enterprise/remoting/cli/src/etc/build.xml
| 8
modules/enterprise/remoting/client-api/pom.xml
| 3
modules/enterprise/remoting/pom.xml
| 2
modules/enterprise/remoting/webservices/pom.xml
| 2
modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
| 15
modules/enterprise/server/container-lib/pom.xml
| 2
modules/enterprise/server/container/pom.xml
| 2
modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
| 5
modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
| 12
modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml
| 3
modules/enterprise/server/ear/pom.xml
| 2
modules/enterprise/server/jar/pom.xml
| 21
modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
| 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java
| 15
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
| 78 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
| 44
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
| 111 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java
| 26
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java
| 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
| 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
| 230 +++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
| 177 +--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java
| 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
| 34
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
| 16
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
| 150 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerBean.java
| 100 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerLocal.java
| 33
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerRemote.java
| 50
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
| 71 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java
| 84 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java
| 22
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java
| 127 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
| 366 +++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
| 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
| 32
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerLocal.java
| 15
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
| 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
| 150 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
| 27
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
| 16
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
| 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
| 13
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java
| 275 -----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java
| 79 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java
| 28
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java
| 79 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
| 103 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java
| 104 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java
| 15
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
| 68 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
| 112 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
| 95 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
| 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
| 192 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java
| 57 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
| 74 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
| 40
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
| 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java
| 47
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
| 45
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
| 127 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
| 17
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
| 18
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
| 90 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
| 117 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
| 21
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
| 81 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
| 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
| 46
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java
| 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java
| 14
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java
| 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
| 143 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/security/UntrustedSSLProtocolSocketFactory.java
| 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
| 39
modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties
| 9
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java
| 38
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java
| 32
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java
| 57 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/DistributionManagerBeanTest.java
| 9
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
| 256 ++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java
| 1
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
| 3
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java
| 2
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
| 12
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3PerformanceTest.java
| 101 +
modules/enterprise/server/license-gen/jar/pom.xml
| 2
modules/enterprise/server/license-gen/maven-plugin/pom.xml
| 2
modules/enterprise/server/plugins/alert-email/pom.xml
| 3
modules/enterprise/server/plugins/alert-irc/pom.xml
| 6
modules/enterprise/server/plugins/alert-microblog/pom.xml
| 26
modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
| 42
modules/enterprise/server/plugins/alert-mobicents/pom.xml
| 5
modules/enterprise/server/plugins/alert-operations/pom.xml
| 3
modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
| 3
modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml
| 2
modules/enterprise/server/plugins/alert-roles/pom.xml
| 3
modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml
| 2
modules/enterprise/server/plugins/alert-scriptlang/pom.xml
| 6
modules/enterprise/server/plugins/alert-sms/pom.xml
| 6
modules/enterprise/server/plugins/alert-snmp/pom.xml
| 3
modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
| 2
modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
| 2
modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
| 2
modules/enterprise/server/plugins/alert-subject/pom.xml
| 3
modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml
| 2
modules/enterprise/server/plugins/ant-bundle/pom.xml
| 2
modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
| 3
modules/enterprise/server/plugins/cobbler/pom.xml
| 3
modules/enterprise/server/plugins/disk/pom.xml
| 2
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
| 2
modules/enterprise/server/plugins/groovy-script/pom.xml
| 229 ++++
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy
| 10
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
| 65 +
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorException.groovy
| 22
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
| 38
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/FetchDelegate.groovy
| 12
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
| 45
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptException.groovy
| 22
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
| 91 +
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
| 38
modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
| 15
modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
| 74 +
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
| 67 +
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
| 12
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
| 7
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializerTest.groovy
| 33
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
| 116 ++
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
| 57 +
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
| 126 ++
modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
| 88 +
modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_mgr.groovy
| 4
modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_nonexistent_mgr.groovy
| 3
modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
| 17
modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/throw_exception.groovy
| 3
modules/enterprise/server/plugins/jboss-software/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
| 4
modules/enterprise/server/plugins/perspectives/core/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
| 29
modules/enterprise/server/plugins/perspectives/policy/pom.xml
| 2
modules/enterprise/server/plugins/pom.xml
| 3
modules/enterprise/server/plugins/rhnhosted/pom.xml
| 4
modules/enterprise/server/plugins/url/pom.xml
| 2
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
| 2
modules/enterprise/server/plugins/yum/pom.xml
| 2
modules/enterprise/server/pom.xml
| 2
modules/enterprise/server/safe-invoker/pom.xml
| 2
modules/enterprise/server/sars/agent-sar/pom.xml
| 2
modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml
| 2
modules/enterprise/server/sars/pom.xml
| 2
modules/enterprise/server/xml-schemas/pom.xml
| 2
modules/helpers/bundleGen/pom.xml
| 79 +
modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
| 167 +++
modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java
| 97 +
modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
| 273 +++++
modules/helpers/bundleGen/src/main/resources/bundleGen.properties
| 5
modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
| 5
modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties
| 2
modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
| 35
modules/helpers/bundleGen/src/main/resources/deployMain.ftl
| 60 +
modules/helpers/bundleGen/src/main/resources/questions.dtd
| 50
modules/helpers/perftest-data-gen/install_files.sh
| 11
modules/helpers/perftest-data-gen/pom.xml
| 43
modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
| 108 ++
modules/helpers/pluginAnnotations/pom.xml
| 6
modules/helpers/pluginGen/pom.xml
| 6
modules/helpers/pluginGen/src/main/resources/pom.ftl
| 2
modules/helpers/pom.xml
| 4
modules/helpers/rtfilter/pom.xml
| 2
modules/jopr/pom.xml
| 4
modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
| 2
modules/plugins/aliases/pom.xml
| 2
modules/plugins/ant-bundle/pom.xml
| 2
modules/plugins/apache/pom.xml
| 31
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
| 12
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
| 12
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
| 143 +-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
| 111 ++
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
| 37
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
| 10
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
| 2
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
| 16
modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
| 2
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
| 134 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
| 172 +++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
| 16
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
| 47
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
| 125 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
| 21
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
| 23
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
| 109 ++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
| 228 ++++
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
| 75 +
modules/plugins/apache/src/test/resources/httpd.aug
| 58 +
modules/plugins/apache/src/test/resources/httpd.conf
| 41
modules/plugins/apache/src/test/resources/included.conf
| 13
modules/plugins/apache/src/test/resources/loadconfig/Apache
| 2
modules/plugins/apache/src/test/resources/loadconfig/Directory0
| 2
modules/plugins/apache/src/test/resources/loadconfig/Directory1
| 2
modules/plugins/apache/src/test/resources/loadconfig/Directory2
| 2
modules/plugins/apache/src/test/resources/loadconfig/IfModule
| 2
modules/plugins/apache/src/test/resources/loadconfig/IfModule0
| 2
modules/plugins/apache/src/test/resources/loadconfig/IfModule1
| 2
modules/plugins/apache/src/test/resources/nested.conf
| 12
modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
| 58 +
modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
| 10
modules/plugins/apache/src/test/resources/updateconfig/included.conf
| 4
modules/plugins/apache/src/test/resources/updateconfig/nested.conf
| 3
modules/plugins/augeas/pom.xml
| 4
modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java
| 19
modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java
| 16
modules/plugins/byteman/pom.xml
| 4
modules/plugins/cobbler/pom.xml
| 2
modules/plugins/cron/pom.xml
| 2
modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java
| 2
modules/plugins/database/pom.xml
| 2
modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java
| 4
modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java
| 39
modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java
| 11
modules/plugins/filetemplate-bundle/pom.xml
| 2
modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java
| 25
modules/plugins/grub/pom.xml
| 2
modules/plugins/hadoop/pom.xml
| 161 +++
modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java
| 47
modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopDiscovery.java
| 64 +
modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
| 136 ++
modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceDiscovery.java
| 135 ++
modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
| 70 +
modules/plugins/hardware/pom.xml
| 2
modules/plugins/hibernate/pom.xml
| 2
modules/plugins/hosts/pom.xml
| 2
modules/plugins/hudson/pom.xml
| 3
modules/plugins/iis/pom.xml
| 2
modules/plugins/iptables/pom.xml
| 2
modules/plugins/irc/pom.xml
| 18
modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java
| 134 ++
modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java
| 53 +
modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java
| 134 --
modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java
| 53 -
modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
| 80 -
modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml
| 20
modules/plugins/jboss-as-5/pom.xml
| 2
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
| 87 -
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
| 78 -
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JmxConnectionHelper.java
| 14
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java
| 2
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java
| 14
modules/plugins/jboss-as/pom.xml
| 2
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java
| 8
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
| 14
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java
| 17
modules/plugins/jboss-cache-v3/pom.xml
| 2
modules/plugins/jboss-cache/pom.xml
| 2
modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java
| 64 +
modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java
| 143 ++
modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java
| 64 -
modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java
| 143 --
modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml
| 106 +-
modules/plugins/jdbctrace/pom.xml
| 2
modules/plugins/jira/pom.xml
| 2
modules/plugins/jmx/pom.xml
| 2
modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java
| 52 +
modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java
| 12
modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
| 3
modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
| 1
modules/plugins/kickstart/pom.xml
| 2
modules/plugins/lsof/pom.xml
| 2
modules/plugins/mysql/pom.xml
| 2
modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
| 25
modules/plugins/netservices/pom.xml
| 4
modules/plugins/onewire/pom.xml
| 2
modules/plugins/oracle/pom.xml
| 2
modules/plugins/perftest/pom.xml
| 2
modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
| 13
modules/plugins/platform/pom.xml
| 2
modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
| 90 -
modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java
| 12
modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java
| 146 ++
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
| 94 +
modules/plugins/pom.xml
| 34
modules/plugins/postfix/pom.xml
| 2
modules/plugins/postgres/pom.xml
| 2
modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
| 22
modules/plugins/raw-config-test/pom.xml
| 5
modules/plugins/rhq-agent/pom.xml
| 2
modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
| 1
modules/plugins/rhq-agent/src/test/resources/test-agent-configuration.xml
| 2
modules/plugins/rhq-server/pom.xml
| 2
modules/plugins/samba/pom.xml
| 2
modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java
| 5
modules/plugins/script/pom.xml
| 2
modules/plugins/script2/pom.xml
| 2
modules/plugins/services/pom.xml
| 25
modules/plugins/snmptrapd/pom.xml
| 30
modules/plugins/sshd/pom.xml
| 2
modules/plugins/sudoers/pom.xml
| 2
modules/plugins/tomcat/pom.xml
| 2
modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
| 1
modules/plugins/twitter/pom.xml
| 16
modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java
| 25
modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/TwitterComponent.java
| 23
modules/plugins/validate-all-plugins/pom.xml
| 2
modules/plugins/virt/pom.xml
| 3
modules/pom.xml
| 18
modules/test-utils/pom.xml
| 2
pom.xml
| 257 ++++-
release.sh
| 56 -
939 files changed, 36771 insertions(+), 10007 deletions(-)
New commits:
commit 0cd6acd2fe93a35a9b2cdbde0828c416ac49f67d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 24 17:48:01 2010 +0200
Make tests work with the changed test plugin jars location, added tests for upgrade
failure reporting.
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 19c1d95..adb3989 100644
---
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -43,6 +43,8 @@ import org.rhq.core.clientapi.server.discovery.InventoryReport;
import org.rhq.core.domain.discovery.ResourceSyncInfo;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceError;
+import org.rhq.core.domain.resource.ResourceErrorType;
import org.rhq.core.domain.resource.ResourceType;
/**
@@ -137,6 +139,11 @@ public class FakeServerInventory {
resource.setResourceKey(request.getNewResourceKey());
}
+ if (request.getUpgradeErrorMessage() != null) {
+ ResourceError error = new ResourceError(resource,
ResourceErrorType.UPGRADE, request.getUpgradeErrorMessage(),
request.getUpgradeErrorStackTrace(), request.getTimestamp());
+ resource.getResourceErrors().add(error);
+ }
+
ResourceUpgradeResponse resp = new ResourceUpgradeResponse();
resp.setResourceId(resource.getId());
resp.setUpgradedResourceName(resource.getName());
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTest.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTest.java
index 202e0c0..244d2f2 100644
---
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTest.java
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/ResourceUpgradeTest.java
@@ -69,8 +69,9 @@ import org.rhq.core.pc.plugin.FileSystemPluginFinder;
@Test(sequential = true, invocationCount = 1)
public class ResourceUpgradeTest {
- private static final String PLUGIN_V1_FILENAME =
"resource-upgrade-test-plugin-1.0.0.jar";
- private static final String PLUGIN_V2_FILENAME =
"resource-upgrade-test-plugin-2.0.0.jar";
+ private static final String PLUGIN_V1_FILENAME =
"/resource-upgrade-test-plugin-1.0.0.jar";
+ private static final String PLUGIN_V2_FILENAME =
"/resource-upgrade-test-plugin-2.0.0.jar";
+ private static final String FAILING_PLUGIN_FILE_NAME =
"/resource-upgrade-test-plugin-3.0.0.jar";
private static final String PLUGINS_DIR_NAME = "plugins";
private static final String DATA_DIR_NAME = "data";
@@ -101,6 +102,7 @@ public class ResourceUpgradeTest {
public void sanityCheck() {
verifyPluginExists(PLUGIN_V1_FILENAME);
verifyPluginExists(PLUGIN_V2_FILENAME);
+ verifyPluginExists(FAILING_PLUGIN_FILE_NAME);
}
@BeforeClass(dependsOnMethods = "sanityCheck")
@@ -227,6 +229,35 @@ public class ResourceUpgradeTest {
executeTestWithPlugins(Collections.singleton(PLUGIN_V2_FILENAME), false, test);
}
+ @Test
+ public void testUpgradeFailureHandling() throws Exception {
+ currentServerSideInventory = new FakeServerInventory();
+ initialSyncAndDiscovery(InventoryStatus.COMMITTED);
+
+ TestPayload test = new TestPayload() {
+ public void test(Resource resourceUpgradeTestResource) {
+ assertTrue(resourceUpgradeTestResource.getResourceErrors().size() > 0,
"There should be upgrade errors persisted on the server side.");
+ }
+
+ @SuppressWarnings("unchecked")
+ public Expectations getExpectations(Mockery context) throws Exception {
+ return new Expectations() {
+ {
+ defineDefaultExpectations(this);
+
+ between(1,
4).of(currentDiscoveryServerService).mergeInventoryReport(with(any(InventoryReport.class)));
+
will(currentServerSideInventory.mergeInventoryReport(InventoryStatus.COMMITTED));
+
+
oneOf(currentDiscoveryServerService).upgradeResources(with(any(Set.class)));
+ will(currentServerSideInventory.upgradeResources());
+ }
+ };
+ }
+ };
+
+ executeTestWithPlugins(Collections.singleton(FAILING_PLUGIN_FILE_NAME), false,
test);
+ }
+
private void initialSyncAndDiscovery(final InventoryStatus requiredInventoryStatus)
throws Exception {
cleanDataDir();
executeTestWithPlugins(Collections.singleton(PLUGIN_V1_FILENAME), true, new
TestPayload() {
commit 90b602f22c280ee63deb7e51470db1fcda9b79a1
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 24 17:46:58 2010 +0200
Final touches on the Server side error reporting.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
index cc63040..e63978a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
@@ -24,7 +24,6 @@ import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.GroupStartOpen;
import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
@@ -33,7 +32,6 @@ import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.CellClickEvent;
import com.smartgwt.client.widgets.grid.events.CellClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
@@ -92,9 +90,10 @@ public class OverviewView extends VLayout implements
ResourceSelectListener {
w.setWidth(640);
w.setHeight(480);
w.centerInPage();
+ w.setCanDragResize(true);
VLayout layout = new VLayout(10);
- layout.setLayoutAlign(Alignment.CENTER);
+ layout.setDefaultLayoutAlign(Alignment.CENTER);
layout.setLayoutMargin(10);
w.addItem(layout);
@@ -109,7 +108,6 @@ public class OverviewView extends VLayout implements
ResourceSelectListener {
w.destroy();
}
});
- ok.setAlign(Alignment.CENTER);
layout.addMember(ok);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
index 4957fc7..1843f2b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
@@ -90,7 +90,7 @@ public class ResourceErrorsDataSource extends
RPCDataSource<ResourceError> {
ListGridRecord record = new ListGridRecord();
record.setAttribute(DETAIL_ID, from.getDetail());
- record.setAttribute(ERROR_TYPE_ID, from.getErrorType());
+ record.setAttribute(ERROR_TYPE_ID, from.getErrorType().toString());
record.setAttribute(SUMMARY_ID, from.getSummary());
record.setAttribute(TIME_OCCURED_ID, new Date(from.getTimeOccurred()));
commit f0b6cda14af2bce898dd6af66b4bb2627a836d72
Merge: d689f70... 66234db...
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 24 13:25:05 2010 +0200
Merge branch 'master' into resource-upgrade
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 1ea9630,950d28c..4f3f3ce
---
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
@@@ -18,8 -18,8 +18,9 @@@
*/
package org.rhq.enterprise.gui.coregui.client.util;
+import java.util.Arrays;
import java.util.Collection;
+ import java.util.List;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@@ -172,13 -173,16 +174,20 @@@ public abstract class RPCDataSource<T>
return response;
}
- public void addFields(Collection<DataSourceField> fields) {
+ /**
+ * Add the specified fields to this data source. When the data source is associated
with a
+ * {@link com.smartgwt.client.widgets.grid.ListGrid}, the fields will be displayed
in the order they are specified
+ * here.
+ *
+ * @param fields the fields to be added
+ */
+ public void addFields(List<DataSourceField> fields) {
for (DataSourceField field : fields) {
- addField(field);
+ addField(field);
}
}
+
+ public void addFields(DataSourceField... fields) {
+ addFields(Arrays.asList(fields));
+ }
}
commit d689f70de060cdb776cea923f759f0e5de226955
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 24 13:17:24 2010 +0200
Upgrade errors (and other resource errors) shown in the summary tab. Not everything
seems to work yet.
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
index 9532920..aca9c90 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
@@ -41,7 +41,7 @@ public class ResourceUpgradeRequest extends ResourceUpgradeReport {
private String upgradeErrorMessage;
private String upgradeErrorStackTrace;
private long timestamp;
-
+
public ResourceUpgradeRequest(int resourceId) {
this.resourceId = resourceId;
}
@@ -74,14 +74,37 @@ public class ResourceUpgradeRequest extends ResourceUpgradeReport {
public long getTimestamp() {
return timestamp;
}
-
+
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
-
+
public void setErrorProperties(Throwable t) {
- upgradeErrorMessage = t.getMessage();
+ upgradeErrorMessage = null;
+ upgradeErrorStackTrace = null;
+
+ //first try to extract an error message from the exception
+ //or some of its parents
+ Throwable p = t;
+ while (upgradeErrorMessage == null && p != null) {
+ upgradeErrorMessage = p.getMessage();
+ if (upgradeErrorMessage == null) {
+ upgradeErrorMessage = p.getLocalizedMessage();
+ }
+ p = p.getCause();
+ }
+
+ //ok, we have no error messages. But we have to supply something
+ //as the message, so let's use the class name as a last resort.
+ if (upgradeErrorMessage == null) {
+ if (t.getClass().getCanonicalName() != null) {
+ upgradeErrorMessage = t.getClass().getCanonicalName();
+ } else if (t.getClass().getName() != null) {
+ upgradeErrorMessage = t.getClass().getName();
+ }
+ }
+ //print the stack trace into a string
StringWriter string = new StringWriter();
PrintWriter w = new PrintWriter(string);
t.printStackTrace(w);
diff --git
a/modules/core/domain/src/test/java/org/rhq/core/domain/resource/test/ResourceErrorTest.java
b/modules/core/domain/src/test/java/org/rhq/core/domain/resource/test/ResourceErrorTest.java
index 8fdc2f7..6630d4b 100644
---
a/modules/core/domain/src/test/java/org/rhq/core/domain/resource/test/ResourceErrorTest.java
+++
b/modules/core/domain/src/test/java/org/rhq/core/domain/resource/test/ResourceErrorTest.java
@@ -92,7 +92,7 @@ public class ResourceErrorTest extends AbstractEJB3Test {
q.setParameter("resourceId", newResource.getId());
assert q.getResultList().size() == 2;
- q =
em.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE);
+ q =
em.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPES);
q.setParameter("resourceId", newResource.getId());
q.setParameter("errorType",
ResourceErrorType.INVALID_PLUGIN_CONFIGURATION);
assert q.getResultList().size() == 2;
@@ -129,7 +129,7 @@ public class ResourceErrorTest extends AbstractEJB3Test {
assert errors.get(0).getDetail().equals("test detail");
assert errors.get(0).getTimeOccurred() == 12345;
- q =
em.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE);
+ q =
em.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPES);
q.setParameter("resourceId", newResource.getId());
q.setParameter("errorType",
ResourceErrorType.INVALID_PLUGIN_CONFIGURATION);
errors = q.getResultList();
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index a4ca249..4b09ef8 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -163,26 +163,39 @@
<id>process-test-classes</id>
<phase>process-test-classes</phase>
<configuration>
- <tasks>
- <echo>Assembling the two resource upgrade test
plugins</echo>
- <copy
toDir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v1/META-INF">
+ <tasks unless="maven.test.skip">
+ <echo>Assembling the resource upgrade test plugins</echo>
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/v1/META-INF">
<fileset
file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/v1/rhq-plugin.xml"
/>
</copy>
- <jar
destfile="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/resource-upgrade-test-plugin-1.0.0.jar">
- <fileset
dir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v1"
includes="*.class,**/rhq-plugin.xml" />
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/v1/org/rhq/core/pc/upgrade/plugins/v1">
+ <fileset
file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v1/*.class"
/>
+ </copy>
+ <jar
destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-1.0.0.jar">
+ <fileset
dir="${project.build.testOutputDirectory}/tmp/v1"
includes="**/*.class,**/rhq-plugin.xml" />
</jar>
- <copy
toDir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v2/META-INF">
+
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/v2/META-INF">
<fileset
file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/v2/rhq-plugin.xml"
/>
</copy>
- <jar
destfile="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/resource-upgrade-test-plugin-2.0.0.jar">
- <fileset
dir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v2"
includes="*.class,**/rhq-plugin.xml" />
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/v2/org/rhq/core/pc/upgrade/plugins/v2">
+ <fileset
file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v2/*.class"
/>
+ </copy>
+ <jar
destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-2.0.0.jar">
+ <fileset
dir="${project.build.testOutputDirectory}/tmp/v2"
includes="**/*.class,**/rhq-plugin.xml" />
</jar>
- <copy
toDir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/failing/META-INF">
+
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/failing/META-INF">
<fileset
file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml"
/>
</copy>
- <jar
destfile="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/resource-upgrade-test-plugin-3.0.0.jar">
- <fileset
dir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/failing"
includes="*.class,**/rhq-plugin.xml" />
+ <copy
toDir="${project.build.testOutputDirectory}/tmp/failing/org/rhq/core/pc/upgrade/plugins/failing">
+ <fileset
file="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/failing/*.class"
/>
+ </copy>
+ <jar
destfile="${project.build.testOutputDirectory}/resource-upgrade-test-plugin-3.0.0.jar">
+ <fileset
dir="${project.build.testOutputDirectory}/tmp/failing"
includes="**/*.class,**/rhq-plugin.xml" />
</jar>
+
+ <delete
dir="${project.build.testOutputDirectory}/tmp"/>
</tasks>
</configuration>
<goals>
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 f92e7d5..c06d0c2 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
@@ -28,6 +28,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageControl;
@@ -64,5 +65,7 @@ public interface ResourceGWTService extends RemoteService {
void ignoreResources(Integer[] resourceIds);
void unignoreResources(Integer[] resourceIds);
+
+ List<ResourceError> findResourceErrors(int resourceId);
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
index 2fff538..cc63040 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
@@ -18,20 +18,22 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary;
-import java.util.ArrayList;
-import java.util.List;
-
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.ResourceComposite;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.GroupStartOpen;
+import com.smartgwt.client.widgets.HTMLPane;
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
-import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
+import com.smartgwt.client.widgets.grid.events.CellClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellClickHandler;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
/**
@@ -62,41 +64,59 @@ public class OverviewView extends VLayout implements
ResourceSelectListener {
public void onResourceSelected(ResourceComposite resourceComposite) {
addMember(new OverviewForm(resourceComposite));
- ListGrid errorsGrid = buildErrorListGrid(resourceComposite);
- if (errorsGrid != null) {
- addMember(errorsGrid);
- }
+ buildErrorListGrid(resourceComposite);
}
- private static ListGrid buildErrorListGrid(ResourceComposite resourceComposite) {
+ private void buildErrorListGrid(ResourceComposite resourceComposite) {
final Resource resource = resourceComposite.getResource();
- ListGrid errorsGrid = null;
- if (resource.getResourceErrors() != null &&
resource.getResourceErrors().size() > 0) {
- errorsGrid = new ListGrid();
-
- ListGridField summaryField = new ListGridField("summary",
"Errors");
- summaryField.addRecordClickHandler(new RecordClickHandler() {
-
- @Override
- public void onRecordClick(RecordClickEvent event) {
- String detail = event.getRecord().getAttribute("detail");
- SC.say("Error details", detail);
- }
- });
-
- errorsGrid.setFields(summaryField);
-
- List<ListGridRecord> errorList = new
ArrayList<ListGridRecord>();
- for (ResourceError error : resource.getResourceErrors()) {
- ListGridRecord record = new ListGridRecord();
- record.setAttribute("summary", error.getSummary());
- record.setAttribute("detail", error.getDetail());
- errorList.add(record);
+ Table errorsGrid = new Table("Errors");
+
+ errorsGrid.setShowFooter(false);
+//
errorsGrid.getListGrid().setGroupByField(ResourceErrorsDataSource.ERROR_TYPE_ID);
+// errorsGrid.getListGrid().setGroupStartOpen(GroupStartOpen.ALL);
+// errorsGrid.getListGrid().setShowGroupSummary(true);
+
+ errorsGrid.setDataSource(new ResourceErrorsDataSource(resource.getId()));
+
+ //hide only works after we set the datasource
+ errorsGrid.getListGrid().hideField(ResourceErrorsDataSource.DETAIL_ID);
+
+ errorsGrid.getListGrid().addCellClickHandler(new CellClickHandler() {
+ public void onCellClick(CellClickEvent event) {
+ ListGridRecord record = event.getRecord();
+ final Window w = new Window();
+ w.setTitle("Error Details");
+ w.setIsModal(true);
+ w.setShowMinimizeButton(false);
+ w.setShowModalMask(true);
+ w.setWidth(640);
+ w.setHeight(480);
+ w.centerInPage();
+
+ VLayout layout = new VLayout(10);
+ layout.setLayoutAlign(Alignment.CENTER);
+ layout.setLayoutMargin(10);
+
+ w.addItem(layout);
+
+ HTMLPane details = new HTMLPane();
+ details.setContents("<pre>" +
record.getAttribute(ResourceErrorsDataSource.DETAIL_ID) + "</pre>");
+ layout.addMember(details);
+
+ IButton ok = new IButton("Ok");
+ ok.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ w.destroy();
+ }
+ });
+ ok.setAlign(Alignment.CENTER);
+
+ layout.addMember(ok);
+
+ w.show();
}
-
- errorsGrid.setRecords(errorList.toArray(new
ListGridRecord[errorList.size()]));
- }
-
- return errorsGrid;
+ });
+
+ addMember(errorsGrid);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
new file mode 100644
index 0000000..4957fc7
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ResourceErrorsDataSource.java
@@ -0,0 +1,100 @@
+/*
+ * 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.Date;
+import java.util.List;
+
+import org.rhq.core.domain.resource.ResourceError;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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;
+
+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.fields.DataSourceDateField;
+import com.smartgwt.client.data.fields.DataSourceDateTimeField;
+import com.smartgwt.client.data.fields.DataSourceEnumField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+/**
+ *
+ * @author Lukas Krejci
+ */
+public class ResourceErrorsDataSource extends RPCDataSource<ResourceError> {
+
+ public static final String SUMMARY_ID = "summary";
+ public static final String DETAIL_ID = "detail";
+ public static final String ERROR_TYPE_ID = "errorType";
+ public static final String TIME_OCCURED_ID = "timeOccured";
+
+ ResourceGWTServiceAsync resourceService;
+ int resourceId;
+
+ public ResourceErrorsDataSource(int resourceId) {
+ resourceService = GWTServiceLookup.getResourceService();
+ this.resourceId = resourceId;
+
+ addFields(new DataSourceTextField(SUMMARY_ID, "Summary"),
+ new DataSourceTextField(DETAIL_ID, "Detailed Message"),
+ new DataSourceEnumField(ERROR_TYPE_ID, "Error Type"), new
DataSourceDateTimeField(TIME_OCCURED_ID, "Time"));
+ }
+
+ /* (non-Javadoc)
+ * @see
org.rhq.enterprise.gui.coregui.client.util.RPCDataSource#executeFetch(com.smartgwt.client.data.DSRequest,
com.smartgwt.client.data.DSResponse)
+ */
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+ resourceService.findResourceErrors(resourceId, new
AsyncCallback<List<ResourceError>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+ "Failed to find resource errors for resource with id: " +
resourceId, caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(List<ResourceError> result) {
+ response.setData(buildRecords(result));
+ processResponse(request.getRequestId(), response);
+ };
+ });
+ }
+
+ public ResourceError copyValues(ListGridRecord from) {
+ //This is read-only datasource, so no need to implement this.
+ return null;
+ }
+
+ public ListGridRecord copyValues(ResourceError from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute(DETAIL_ID, from.getDetail());
+ record.setAttribute(ERROR_TYPE_ID, from.getErrorType());
+ record.setAttribute(SUMMARY_ID, from.getSummary());
+ record.setAttribute(TIME_OCCURED_ID, new Date(from.getTimeOccurred()));
+
+ return record;
+ }
+
+}
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 1b6f6cd..1ea9630 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
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.util;
+import java.util.Arrays;
import java.util.Collection;
import com.smartgwt.client.data.DSRequest;
@@ -176,4 +177,8 @@ public abstract class RPCDataSource<T> extends DataSource {
addField(field);
}
}
+
+ public void addFields(DataSourceField... fields) {
+ addFields(Arrays.asList(fields));
+ }
}
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 c10254e..b933248 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
@@ -35,6 +35,7 @@ import
org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageControl;
@@ -215,4 +216,8 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
discoveryBoss.unignoreResources(getSessionSubject(), resourceIds);
}
+ public List<ResourceError> findResourceErrors(int resourceId) {
+ return
SerialUtility.prepare(resourceManager.findResourceErrors(getSessionSubject(),
resourceId),
+ "ResourceService.getResourceErrors");
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index b773384..a480fb7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -486,7 +486,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
private ResourceUpgradeResponse upgradeResource(@NotNull Resource resource,
ResourceUpgradeRequest upgradeRequest, boolean allowGenericPropertiesUpgrade) {
if (upgradeRequest.getUpgradeErrorMessage() != null) {
ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
upgradeRequest.getUpgradeErrorMessage(), upgradeRequest.getUpgradeErrorStackTrace(),
upgradeRequest.getTimestamp());
- entityManager.persist(error);
+ resourceManager.addResourceError(error);
return null;
}
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 5a4cf92..29672cc 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
@@ -1708,6 +1708,21 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
return query.getResultList();
}
+ @NotNull
+ @SuppressWarnings("unchecked")
+ public List<ResourceError> findResourceErrors(Subject user, int resourceId) {
+ // do authz check
+ if (!authorizationManager.canViewResource(user, resourceId)) {
+ throw new PermissionException("User [" + user + "] does not
have permission to view resource ["
+ + resourceId + "]");
+ }
+
+ // we passed authz check, now get the errors
+ Query query =
entityManager.createNamedQuery(ResourceError.QUERY_FIND_BY_RESOURCE_ID);
+ query.setParameter("resourceId", resourceId);
+ return query.getResultList();
+ }
+
public void addResourceError(ResourceError resourceError) {
Subject overlord = subjectManager.getOverlord();
Resource resource;
@@ -1718,9 +1733,10 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
}
if (resourceError.getErrorType() ==
ResourceErrorType.INVALID_PLUGIN_CONFIGURATION
- || resourceError.getErrorType() == ResourceErrorType.AVAILABILITY_CHECK) {
- // there should be at most one invalid plugin configuration error and one
availability check error per
- // resource, so delete any currently existing ones before we add this new
one
+ || resourceError.getErrorType() == ResourceErrorType.AVAILABILITY_CHECK
+ || resourceError.getErrorType() == ResourceErrorType.UPGRADE) {
+ // there should be at most one invalid plugin configuration error,
availability check
+ // or upgrade error per resource, so delete any currently existing ones
before we add this new one
List<ResourceError> doomedErrors =
resource.getResourceErrors(resourceError.getErrorType());
// there should only ever be at most 1, but loop through the list just in
case something got screwed up
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
index a2f26ff..b84a104 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
@@ -319,6 +319,17 @@ public interface ResourceManagerLocal {
List<ResourceError> findResourceErrors(Subject user, int resourceId,
ResourceErrorType errorType);
/**
+ * Returns all the errors that have occurred for the given resource.
+ *
+ * @param user the user asking to see the errors
+ * @param resourceId the resource whose errors are to be returned
+ *
+ * @return the list of resource errors
+ */
+ @NotNull
+ List<ResourceError> findResourceErrors(Subject user, int resourceId);
+
+ /**
* Indicates an error occurred on a resource. The given error will be associated with
the resource found in the
* error.
*
commit 66234dbf61b0ae04d40786a00185a3321bd43e93
Merge: 3023ab1... 9decb0a...
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 23 00:42:39 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 9decb0a2e1342a5e935d2c05330f9d23dbc95242
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 24 00:06:08 2010 -0400
various minor fixes and tweaks
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 3369352..90b795e 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
@@ -20,13 +20,11 @@ package org.rhq.enterprise.gui.coregui.client.alert;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.DataClass;
@@ -60,8 +58,6 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
* @author Ian Springer
*/
public class AlertDataSource extends RPCDataSource<Alert> {
- private static final DateTimeFormat DATE_TIME_FORMAT =
DateTimeFormat.getMediumDateTimeFormat();
-
private AlertGWTServiceAsync alertService = GWTServiceLookup.getAlertService();
protected AlertDataSource() {
@@ -107,7 +103,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
DataSourceTextField priorityField = new
DataSourceTextField(AlertCriteria.SORT_FIELD_PRIORITY, "Priority", 15);
fields.add(priorityField);
- DataSourceTextField ctimeField = new
DataSourceTextField(AlertCriteria.SORT_FIELD_CTIME, "Creation Time");
+ DataSourceIntegerField ctimeField = new
DataSourceIntegerField(AlertCriteria.SORT_FIELD_CTIME, "Creation Time");
fields.add(ctimeField);
DataSourceBooleanField boolField = new DataSourceBooleanField("ack",
"Ack'd");
@@ -132,15 +128,12 @@ public class AlertDataSource extends RPCDataSource<Alert> {
public void onSuccess(Void blah) {
CoreGUI.getMessageCenter().notify(
new Message("Deleted [" + alertIds.length + "]
alerts", Message.Severity.Info));
- System.out.println("Deleted Alerts with id's: " +
Arrays.toString(alertIds) + ".");
alertsView.refresh();
}
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(
- "Failed to delete Alerts with id's: " +
Arrays.toString(alertIds), caught);
- System.err.println("Failed to delete Alerts with id's " +
Arrays.toString(alertIds) + " - cause: "
- + caught);
+ "Failed to delete alerts with id's: " +
Arrays.toString(alertIds), caught);
}
});
}
@@ -159,7 +152,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
public void onSuccess(PageList<Alert> result) {
long fetchTime = System.currentTimeMillis() - start;
- System.out.println(result.size() + " Alerts fetched in: " +
fetchTime + "ms");
+ System.out.println(result.size() + " alerts fetched in: " +
fetchTime + "ms");
response.setData(buildRecords(result));
// For paging to work, we have to specify size of full result set.
@@ -206,7 +199,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
record.setAttribute("resourceName",
from.getAlertDefinition().getResource().getName());
record.setAttribute("name", from.getAlertDefinition().getName());
record.setAttribute("priority",
from.getAlertDefinition().getPriority().name());
- record.setAttribute("ctime", DATE_TIME_FORMAT.format(new
Date(from.getCtime())));
+ record.setAttribute("ctime", from.getCtime());
if (from.getAcknowledgeTime() > 0) {
record.setAttribute("ack", "true");
}
@@ -264,7 +257,6 @@ public class AlertDataSource extends RPCDataSource<Alert> {
dc.setAttribute("message", log.getMessage());
notifications[i++] = dc;
-
}
record.setAttribute("notificationLogs", notifications);
return record;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index 8983ffe..83d3481 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -44,6 +44,7 @@ import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
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.components.table.TimestampCellFormatter;
/**
* A view that displays a paginated table of fired {@link org.rhq.core.domain.alert.Alert
alert}s, along with the
@@ -101,7 +102,9 @@ public class AlertsView extends Table {
listGrid.getField("resourceName").setWidth("20%");
// listGrid.getField("recoveryInfo").setWidth("20%");
listGrid.getField("priority").setWidth("7%");
- listGrid.getField("ctime").setWidth("13%");
+ ListGridField ctimeField = listGrid.getField("ctime");
+ ctimeField.setWidth("13%");
+ ctimeField.setCellFormatter(new TimestampCellFormatter());
listGrid.getField("ack").setWidth("5%");
listGrid.getField("resourceName").setCellFormatter(new CellFormatter()
{
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
index 3b92ea4..d529087 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
@@ -48,7 +48,6 @@ public abstract class AbstractMeasurementDataTraitDataSource extends
RPCDataSour
protected AbstractMeasurementDataTraitDataSource() {
setCanMultiSort(true);
-
List<DataSourceField> fields = createFields();
addFields(fields);
}
@@ -56,6 +55,8 @@ public abstract class AbstractMeasurementDataTraitDataSource extends
RPCDataSour
protected List<DataSourceField> createFields() {
List<DataSourceField> fields = new ArrayList<DataSourceField>();
+ // Note: The fields
+
DataSourceIntegerField idField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.SORT_FIELD_SCHEDULE_ID,
"Id");
idField.setHidden(true);
@@ -67,14 +68,14 @@ public abstract class AbstractMeasurementDataTraitDataSource extends
RPCDataSour
// TODO: Include description from metric def?
- DataSourceIntegerField timestampField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP,
- "Last Changed");
- fields.add(timestampField);
-
DataSourceTextField valueField = new
DataSourceTextField(MeasurementDataTraitCriteria.SORT_FIELD_VALUE,
"Value");
fields.add(valueField);
+ DataSourceIntegerField timestampField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP,
+ "Last Changed");
+ fields.add(timestampField);
+
return fields;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
index fb30a06..47bfa5f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
@@ -53,6 +54,9 @@ public abstract class AbstractMeasurementDataTraitListView extends Table
{
super.onInit();
ListGrid listGrid = getListGrid();
+ listGrid.setSelectionType(SelectionStyle.SINGLE);
+
+ // Set widths and cell formatters on the fields.
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_NAME).setWidth("20%");
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_VALUE).setWidth("60%");
ListGridField timestampField =
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
index 55379d1..bcb0f00 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -57,6 +57,8 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
super.onInit();
ListGrid listGrid = getListGrid();
+
+ // Set widths and cell formatters on the fields.
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%");
@@ -67,6 +69,7 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
intervalField.setCellFormatter(new MillisecondsCellFormatter());
intervalField.setWidth("25%");
+ // Add action buttons and widgets.
addTableAction("Enable", Table.SelectionEnablement.ANY, null, new
TableAction() {
public void executeAction(ListGridRecord[] selection) {
getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this);
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 1b6f6cd..950d28c 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
@@ -19,6 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.util;
import java.util.Collection;
+import java.util.List;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@ -36,6 +37,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
* Base GWT-RPC oriented DataSource class.
*
* @author Greg Hinkle
+ * @author Ian Springer
*/
public abstract class RPCDataSource<T> extends DataSource {
@@ -171,9 +173,16 @@ public abstract class RPCDataSource<T> extends DataSource {
return response;
}
- public void addFields(Collection<DataSourceField> fields) {
+ /**
+ * Add the specified fields to this data source. When the data source is associated
with a
+ * {@link com.smartgwt.client.widgets.grid.ListGrid}, the fields will be displayed in
the order they are specified
+ * here.
+ *
+ * @param fields the fields to be added
+ */
+ public void addFields(List<DataSourceField> fields) {
for (DataSourceField field : fields) {
- addField(field);
+ addField(field);
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
index 410853f..7e2eef4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
@@ -30,6 +30,7 @@ public class Message {
protected Date fired = new Date();
protected Severity severity;
+ // TODO: Add Debug severity?
public enum Severity { Info, Warning, Error };
public Message(String title, Severity severity) {
@@ -43,6 +44,4 @@ public class Message {
this.severity = severity;
}
-
-
}
commit 3023ab1440402effbdae2b366ac05f44a58ae5d1
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 23 00:42:17 2010 -0400
Adding initial support for setting up user-defined classpath
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy
new file mode 100644
index 0000000..584c364
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy
@@ -0,0 +1,10 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.codehaus.groovy.control.CompilerConfiguration
+
+class ClasspathInitializer {
+
+ def initClasspath(String paths, String libDirs, scriptClassLoader) {
+ paths.eachLine { scriptClassLoader.addClasspath(it.trim()) }
+ }
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index fc34aa0..6c9c44d 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -52,10 +52,13 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
compilerConfig.scriptBaseClass = RHQScript.class.name
def scriptName = parameters.getSimpleValue("script", null)
+ def paths = parameters.getSimpleValue("classpath", '')
log.debug("Preparing to execute script, $scriptName")
def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig)
+ new ClasspathInitializer().initClasspath(paths, null, scriptClassLoader)
+
def scriptRoots = new URL[1]
scriptRoots[0] = new File(scriptName).toURI().toURL()
def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
index 86a2e3a..fe6e665 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -27,9 +27,22 @@
<!--</c:simple-property>-->
<!--</c:map-property>-->
<!--</c:list-property>-->
+ <c:simple-property name="classpath"
+ type="longString"
+ required="false"
+ description="A list of classpath entries. Each
entry must be placed on its own line.
+ This can refer to class directories,
groovy source directories, and JAR
+ files."/>
+ <c:simple-property name="libDirs"
+ displayName="Library Directories"
+ type="longString"
+ required="false"
+ description="A list of JAR file directories. Each
path must be placed on its own
+ line. Each JAR file found in a directory
will be added to the
+ classspath."/>
</serverplugin:parameters>
<serverplugin:results>
- <c:simple-property name="results"/>
+ <c:simple-property name="results"
type="longString"/>
</serverplugin:results>
</serverplugin:control>
</serverplugin:plugin-component>
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializerTest.groovy
new file mode 100644
index 0000000..028f72c
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializerTest.groovy
@@ -0,0 +1,33 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.testng.annotations.Test
+
+import static org.testng.Assert.*
+
+class ClasspathInitializerTest {
+
+ @Test
+ void addPathsToClasspathInSpecifiedOrder() {
+ def paths = """
+ /foo/scripts
+ /foo/classes
+ /foo/lib/dep1.jar
+ /foo/lib/dep2.jar
+ """.trim()
+
+ def expected = ['/foo/scripts', '/foo/classes',
'/foo/lib/dep1.jar', '/foo/lib/dep2.jar']
+ def actual = []
+
+ def classLoader = [addClasspath: {String path -> actual << path }]
+
+ new ClasspathInitializer().initClasspath(paths, '', classLoader)
+
+ assertEquals(actual, expected, "Failed to add paths or add them in correct order
to classpath")
+ }
+
+// @Test
+// void addJarsInEachLibDirToClasspath() {
+//
+// }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 6900943..0b2b90c 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -99,6 +99,11 @@ class ScriptRunnerTest {
)
}
+ @Test
+ void addPathsToScriptClasspath() {
+
+ }
+
def executeScript(String script) {
def params = new Configuration()
params.put(new PropertySimple('script', getScriptPath(script)))
commit 3247f3ba5b2cc365e787f720505e695059074c42
Author: John Sanda <jsanda(a)redhat.com>
Date: Sun Aug 22 21:45:33 2010 -0400
Fixing compilation error
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index 6c2c7f1..96dcdd2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Set;
import javax.ejb.Stateless;
+import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
@@ -76,6 +77,7 @@ import org.rhq.core.domain.criteria.Criteria;
import org.rhq.core.domain.criteria.EventCriteria;
import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
import org.rhq.core.domain.criteria.InstalledPackageCriteria;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.criteria.OperationDefinitionCriteria;
@@ -575,6 +577,10 @@ public class WebservicesManagerBean implements WebservicesRemote {
return measurementDataManager.getAggregate(subject, scheduleId, startTime,
endTime);
}
+ public PageList<MeasurementDataTrait> findTraitsByCriteria(Subject subject,
MeasurementDataTraitCriteria criteria) {
+ return measurementDataManager.findTraitsByCriteria(subject, criteria);
+ }
+
//MEASUREMENTDATAMANAGER: END ----------------------------------
//MEASUREMENTDEFINITIONMANAGER: BEGIN ----------------------------------
commit 9354219518ccaf95c7cc5bee0e5c73c456d1b424
Author: John Sanda <jsanda(a)redhat.com>
Date: Sun Aug 22 21:37:06 2010 -0400
Adding logging
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index 7dcc19b..b2cf489 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -14,6 +14,8 @@ class CriteriaGenerator {
def clazz
def criteria
+ log.debug("Preparing to generate $className")
+
try {
clazz = Class.forName(className)
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index 033c149..534c050 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -1,9 +1,12 @@
package org.rhq.enterprise.server.plugins.groovy
import org.rhq.enterprise.server.util.LookupUtil
+import org.apache.commons.logging.LogFactory
class RHQScript extends Script {
+ static def log = LogFactory.getLog(RHQScript)
+
Map entityMap = [:]
Object run() {
@@ -17,6 +20,7 @@ class RHQScript extends Script {
return LookupUtil."$method"()
}
catch (MissingMethodException e) {
+ log.warn("Could not find a manager SLSB under the name $name", e)
throw new RHQScriptException("Unable to locate $name", e)
}
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 3937c51..fc34aa0 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -13,24 +13,31 @@ import org.rhq.enterprise.server.plugin.pc.ControlResults
import org.rhq.enterprise.server.plugin.pc.ScheduledJobInvocationContext
import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
+import org.apache.commons.logging.LogFactory
class ScriptRunner implements ServerPluginComponent, ControlFacet {
+ static def log = LogFactory.getLog(ScriptRunner)
+
String entityPackagePrefix = "org.rhq.core.domain"
Map entityMap = [:]
void initialize(ServerPluginContext context) {
- def reflections = new Reflections(new ConfigurationBuilder()
- .setUrls(ClasspathHelper.getUrlsForPackagePrefix(entityPackagePrefix))
- .setScanners(new TypeAnnotationsScanner()));
+ log.debug("Initializing plugin")
+ log.debug("Preparing to scan classpath for entities and build entity map
cache")
+
+ def reflections = new Reflections(new ConfigurationBuilder()
+ .setUrls(ClasspathHelper.getUrlsForPackagePrefix(entityPackagePrefix))
+ .setScanners(new TypeAnnotationsScanner()));
def classes = reflections.getTypesAnnotatedWith(Entity.class)
+ log.debug("Found ${classes.size()} entities")
+
classes.each { entityMap << [(it.simpleName.toString()): it] }
}
void start() {
-
}
void stop() {
@@ -38,7 +45,6 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
}
void shutdown() {
-
}
ControlResults invoke(String name, Configuration parameters) {
@@ -47,6 +53,8 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
def scriptName = parameters.getSimpleValue("script", null)
+ log.debug("Preparing to execute script, $scriptName")
+
def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig)
def scriptRoots = new URL[1]
scriptRoots[0] = new File(scriptName).toURI().toURL()
@@ -63,9 +71,11 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
try {
def scriptResult = script.run()
+ log.debug("Finished executing $scriptName")
results.complexResults.put(new PropertySimple("results", scriptResult))
}
catch (Throwable t) {
+ log.warn("An error occurred while executing $scriptName", t)
results.error = t
}
commit bd5c6b8622181643df09c1c775b2861f313efd1b
Merge: fdc507c... 2fee0bd...
Author: John Sanda <jsanda(a)redhat.com>
Date: Sun Aug 22 21:19:48 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 2fee0bd59336c0ca99782ea2580c81bfe894d615
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 23 19:12:50 2010 -0400
implement Resource and group Monitoring>Traits subtabs
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
new file mode 100644
index 0000000..2fd4dcf
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
@@ -0,0 +1,127 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.criteria;
+
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.util.PageOrdering;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+/**
+ * RHQ {@link Criteria} object for filtered, sortable queries of {@link
MeasurementDataTrait} data sets.
+ *
+ * @author Ian Springer
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@SuppressWarnings("unused")
+public class MeasurementDataTraitCriteria extends Criteria {
+ private static final long serialVersionUID = 1L;
+
+ // sort fields
+ public static final String SORT_FIELD_SCHEDULE_ID = "scheduleId";
+ public static final String SORT_FIELD_TIMESTAMP = "timestamp";
+ public static final String SORT_FIELD_NAME = "name";
+ public static final String SORT_FIELD_VALUE = "value";
+
+ // filter fields
+ public static final String FILTER_FIELD_SCHEDULE_ID = "scheduleId";
+ public static final String FILTER_FIELD_RESOURCE_ID = "resourceId";
+ public static final String FILTER_FIELD_GROUP_ID = "groupId";
+ public static final String FILTER_FIELD_MAX_TIMESTAMP = "maxTimestamp";
+
+ private Integer filterScheduleId; // requires overrides
+ private Integer filterResourceId; // requires overrides
+ private Integer filterGroupId; // requires overrides
+ private Boolean filterMaxTimestamp; // requires overrides
+
+ private boolean fetchSchedule;
+
+ private PageOrdering sortScheduleId; // requires overrides
+ private PageOrdering sortTimestamp; // requires overrides
+ private PageOrdering sortName; // requires overrides
+
+ public MeasurementDataTraitCriteria() {
+ filterOverrides.put(FILTER_FIELD_SCHEDULE_ID, "id.scheduleId = ?");
+ filterOverrides.put(FILTER_FIELD_RESOURCE_ID, "schedule.resource.id =
?");
+ filterOverrides.put(FILTER_FIELD_GROUP_ID, "schedule.resource.id IN "
//
+ + "( SELECT res.id " //
+ + " FROM Resource res " //
+ + " JOIN res.implicitGroups ig " //
+ + " WHERE ig.id = ? )");
+ filterOverrides.put(FILTER_FIELD_MAX_TIMESTAMP, "id.timestamp = " //
+ + "( SELECT MAX(mdt.id.timestamp) "
+ + " FROM MeasurementDataTrait mdt "
+ + " WHERE mdt.id.scheduleId = id.scheduleId )");
+
+ sortOverrides.put(SORT_FIELD_SCHEDULE_ID, "id.scheduleId");
+ sortOverrides.put(SORT_FIELD_TIMESTAMP, "id.timestamp");
+ sortOverrides.put(SORT_FIELD_NAME, "schedule.definition.displayName");
+ }
+
+ @Override
+ public Class getPersistentClass() {
+ return MeasurementDataTrait.class;
+ }
+
+ public void addFilterScheduleId(Integer filterScheduleId) {
+ this.filterScheduleId = filterScheduleId;
+ }
+
+ public void addFilterResourceId(Integer filterResourceId) {
+ if (this.filterGroupId != null) {
+ throw new IllegalArgumentException("This criteria cannot be filtered by
both a Resource id and a group id.");
+ }
+ this.filterResourceId = filterResourceId;
+ }
+
+ public void addFilterGroupId(Integer filterGroupId) {
+ if (this.filterResourceId != null) {
+ throw new IllegalArgumentException("This criteria cannot be filtered by
both a Resource id and a group id.");
+ }
+ this.filterGroupId = filterGroupId;
+ }
+
+ public void addFilterMaxTimestamp(Boolean filterMaxTimestamp) {
+ this.filterMaxTimestamp = filterMaxTimestamp;
+ }
+
+ public void fetchSchedule(boolean fetchSchedule) {
+ this.fetchSchedule = fetchSchedule;
+ }
+
+ public void addSortScheduleId(PageOrdering sortScheduleId) {
+ addSortField(SORT_FIELD_SCHEDULE_ID);
+ this.sortScheduleId = sortScheduleId;
+ }
+
+ public void addSortTimestamp(PageOrdering sortTimestamp) {
+ addSortField(SORT_FIELD_TIMESTAMP);
+ this.sortTimestamp = sortTimestamp;
+ }
+
+ public void addSortName(PageOrdering sortName) {
+ addSortField(SORT_FIELD_NAME);
+ this.sortName = sortName;
+ }
+}
\ No newline at end of file
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementData.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementData.java
index 7fefa3e..7c96309 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementData.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementData.java
@@ -96,6 +96,10 @@ public abstract class MeasurementData implements Serializable {
this.name = name;
}
+ public MeasurementSchedule getSchedule() {
+ return schedule;
+ }
+
public abstract Object getValue();
@Override
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
new file mode 100644
index 0000000..9d0952b
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TimestampCellFormatter.java
@@ -0,0 +1,34 @@
+package org.rhq.enterprise.gui.coregui.client.components.table;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import java.util.Date;
+
+/**
+ * Formats a timestamp (i.e. milliseconds since Epoch).
+ *
+ * @author Ian Springer
+ */
+public class TimestampCellFormatter implements CellFormatter {
+ private static final DateTimeFormat DATE_TIME_FORMAT =
DateTimeFormat.getMediumDateTimeFormat();
+
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value == null) {
+ return "";
+ }
+ long longValue;
+ if (value instanceof Long) {
+ longValue = (Long)value;
+ } else if (value instanceof Integer) {
+ longValue = (Integer)value;
+ } else if (value instanceof String) {
+ longValue = Long.parseLong((String)value);
+ } else {
+ throw new IllegalArgumentException("value parameter is not a Long, an
Integer, or a String.");
+ }
+ Date date = new Date(longValue);
+ return DATE_TIME_FORMAT.format(date);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index cf1a9a2..9297d96 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -24,6 +24,7 @@ import java.util.Set;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
@@ -74,4 +75,6 @@ public interface MeasurementDataGWTService extends RemoteService {
void updateSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds, long collectionInterval);
+ PageList<MeasurementDataTrait>
findTraitsByCriteria(MeasurementDataTraitCriteria criteria);
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
new file mode 100644
index 0000000..3b92ea4
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitDataSource.java
@@ -0,0 +1,146 @@
+/*
+ * 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.common;
+
+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.DSResponse;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.*;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A server-side SmartGWT DataSource for reading {@link MeasurementDataTrait trait
data}.
+ *
+ * @author Ian Springer
+ */
+public abstract class AbstractMeasurementDataTraitDataSource extends
RPCDataSource<MeasurementDataTrait> {
+ private MeasurementDataGWTServiceAsync measurementService =
GWTServiceLookup.getMeasurementDataService();
+
+ protected AbstractMeasurementDataTraitDataSource() {
+ setCanMultiSort(true);
+
+ List<DataSourceField> fields = createFields();
+ addFields(fields);
+ }
+
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = new ArrayList<DataSourceField>();
+
+ DataSourceIntegerField idField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.SORT_FIELD_SCHEDULE_ID,
+ "Id");
+ idField.setHidden(true);
+ fields.add(idField);
+
+ DataSourceTextField nameField = new
DataSourceTextField(MeasurementDataTraitCriteria.SORT_FIELD_NAME,
+ "Trait");
+ fields.add(nameField);
+
+ // TODO: Include description from metric def?
+
+ DataSourceIntegerField timestampField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP,
+ "Last Changed");
+ fields.add(timestampField);
+
+ DataSourceTextField valueField = new
DataSourceTextField(MeasurementDataTraitCriteria.SORT_FIELD_VALUE,
+ "Value");
+ fields.add(valueField);
+
+ return fields;
+ }
+
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+ final long startTime = System.currentTimeMillis();
+
+ final MeasurementDataTraitCriteria criteria = getCriteria(request);
+
+ this.measurementService.findTraitsByCriteria(criteria, new
AsyncCallback<PageList<MeasurementDataTrait>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to fetch traits for
criteria " + criteria,
+ caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<MeasurementDataTrait> result) {
+ long fetchDuration = System.currentTimeMillis() - startTime;
+ System.out.println(result.size() + " traits fetched in: " +
fetchDuration + "ms");
+
+ response.setData(buildRecords(result));
+ // For paging to work, we have to specify size of full result set.
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ protected MeasurementDataTraitCriteria getCriteria(DSRequest request) {
+ MeasurementDataTraitCriteria criteria = new MeasurementDataTraitCriteria();
+
+ Criteria requestCriteria = request.getCriteria();
+ if (requestCriteria != null) {
+ Map values = requestCriteria.getValues();
+ for (Object key : values.keySet()) {
+ String fieldName = (String) key;
+ if
(fieldName.equals(MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID)) {
+ Integer resourceId = (Integer) values.get(fieldName);
+ criteria.addFilterResourceId(resourceId);
+ } else if
(fieldName.equals(MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID)) {
+ Integer groupId = (Integer) values.get(fieldName);
+ criteria.addFilterGroupId(groupId);
+ }
+ }
+ }
+
+ criteria.setPageControl(getPageControl(request));
+ return criteria;
+ }
+
+ @Override
+ public MeasurementDataTrait copyValues(ListGridRecord from) {
+ return null;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementDataTrait from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_SCHEDULE_ID,
from.getScheduleId());
+ record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP,
from.getTimestamp());
+ record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_NAME,
from.getSchedule().getDefinition().getDisplayName());
+ record.setAttribute(MeasurementDataTraitCriteria.SORT_FIELD_VALUE,
from.getValue());
+
+ // TODO: resourceId and resourceGroupId (in subclasses)
+
+ return record;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
new file mode 100644
index 0000000..fb30a06
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java
@@ -0,0 +1,62 @@
+/*
+ * 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.common;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
+
+/**
+ * A view that displays a non-paginated table of {@link
org.rhq.core.domain.measurement.MeasurementDataTrait trait}s,
+ * along with the ability to sort those traits.
+ *
+ * @author Ian Springer
+ */
+public abstract class AbstractMeasurementDataTraitListView extends Table {
+ private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] { new
SortSpecifier(
+ MeasurementDataTraitCriteria.SORT_FIELD_NAME, SortDirection.ASCENDING) };
+
+ public AbstractMeasurementDataTraitListView(String title,
AbstractMeasurementDataTraitDataSource dataSource,
+ Criteria criteria, String[] excludedFieldNames) {
+ super(title, criteria, SORT_SPECIFIERS, excludedFieldNames);
+ setDataSource(dataSource);
+ }
+
+ @Override
+ public AbstractMeasurementDataTraitDataSource getDataSource() {
+ return (AbstractMeasurementDataTraitDataSource) super.getDataSource();
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ ListGrid listGrid = getListGrid();
+
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_NAME).setWidth("20%");
+
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_VALUE).setWidth("60%");
+ ListGridField timestampField =
listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_TIMESTAMP);
+ timestampField.setWidth("20%");
+ timestampField.setCellFormatter(new TimestampCellFormatter());
+ }
+}
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 a9a6989..5f05bef 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
@@ -43,6 +43,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedH
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.traits.TraitsView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.OverviewView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -91,7 +92,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
summaryTab.registerSubTabs("Overview", "Timeline");
monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
- monitoringTab.registerSubTabs("Graphs", "Tables",
"Schedules", "Call Time");
+ monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
inventoryTab.registerSubTabs("Members", "Connection
Settings");
@@ -138,6 +139,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
+ groupId));
monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId="
+ groupId));
+ monitoringTab.updateSubTab("Traits", new TraitsView(groupId));
monitoringTab.updateSubTab("Schedules", new SchedulesView(groupId));
//new FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId="
+ groupId));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsDataSource.java
new file mode 100644
index 0000000..a9abcaf
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsDataSource.java
@@ -0,0 +1,58 @@
+/*
+ * 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.monitoring.traits;
+
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementDataTraitDataSource;
+
+import java.util.List;
+
+/**
+ * A DataSource for reading traits for the current group.
+ *
+ * @author Ian Springer
+ */
+public class TraitsDataSource extends AbstractMeasurementDataTraitDataSource {
+ private int groupId;
+
+ public TraitsDataSource(int groupId) {
+ this.groupId = groupId;
+ }
+
+ @Override
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = super.createFields();
+ DataSourceField groupIdField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID,
+ "Group Id");
+ groupIdField.setHidden(true);
+ fields.add(groupIdField);
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementDataTrait from) {
+ ListGridRecord record = super.copyValues(from);
+ record.setAttribute(MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID,
this.groupId);
+ return record;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsView.java
new file mode 100644
index 0000000..e071fe8
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/traits/TraitsView.java
@@ -0,0 +1,48 @@
+/*
+ * 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.monitoring.traits;
+
+import com.smartgwt.client.data.Criteria;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementDataTraitListView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.traits.TraitsDataSource;
+
+/**
+ * The group Monitoring>Traits subtab.
+ *
+ * @author Ian Springer
+ */
+public class TraitsView extends AbstractMeasurementDataTraitListView {
+
+ private static final String TITLE = "Traits";
+
+ private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID };
+
+ public TraitsView(int groupId) {
+ super(TITLE, new TraitsDataSource(groupId), createCriteria(groupId),
EXCLUDED_FIELD_NAMES);
+ // TODO (ips): add column for Resource name
+ // TODO (ips): group rows by trait
+ }
+
+ private static Criteria createCriteria(int groupId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(MeasurementDataTraitCriteria.FILTER_FIELD_GROUP_ID,
groupId);
+ return criteria;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 5c0671c..d6a7d8b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -44,6 +44,7 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.traits.TraitsView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
@@ -141,8 +142,8 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); //
new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id="
+ resource.getId()));
- monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id="
- + resource.getId()));
+ monitoringTab.updateSubTab("Traits", new
TraitsView(resource.getId()));
+ //new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
monitoringTab.updateSubTab("Availability", new FullHTMLPane(
"/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
monitoringTab.updateSubTab("Schedules", new
SchedulesView(resource.getId()));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsDataSource.java
new file mode 100644
index 0000000..77cb4bb
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsDataSource.java
@@ -0,0 +1,58 @@
+/*
+ * 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.resource.detail.monitoring.traits;
+
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementDataTraitDataSource;
+
+import java.util.List;
+
+/**
+ * A DataSource for reading traits for the current Resource.
+ *
+ * @author Ian Springer
+ */
+public class TraitsDataSource extends AbstractMeasurementDataTraitDataSource {
+ private int resourceId;
+
+ public TraitsDataSource(int resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ @Override
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = super.createFields();
+ DataSourceField resourceIdField = new
DataSourceIntegerField(MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID,
+ "Resource Id");
+ resourceIdField.setHidden(true);
+ fields.add(resourceIdField);
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementDataTrait from) {
+ ListGridRecord record = super.copyValues(from);
+ record.setAttribute(MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID,
this.resourceId);
+ return record;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsView.java
new file mode 100644
index 0000000..8ae344c
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/traits/TraitsView.java
@@ -0,0 +1,45 @@
+/*
+ * 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.resource.detail.monitoring.traits;
+
+import com.smartgwt.client.data.Criteria;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementDataTraitListView;
+
+/**
+ * The Resource Monitoring>Traits subtab.
+ *
+ * @author Ian Springer
+ */
+public class TraitsView extends AbstractMeasurementDataTraitListView {
+
+ private static final String TITLE = "Traits";
+
+ private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID };
+
+ public TraitsView(int resourceId) {
+ super(TITLE, new TraitsDataSource(resourceId), createCriteria(resourceId),
EXCLUDED_FIELD_NAMES);
+ }
+
+ private static Criteria createCriteria(int resourceId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(MeasurementDataTraitCriteria.FILTER_FIELD_RESOURCE_ID,
resourceId);
+ return criteria;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index 52b5619..78232b6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.server.gwt;
import java.util.List;
import java.util.Set;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
@@ -136,6 +137,10 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
collectionInterval);
}
+ public PageList<MeasurementDataTrait>
findTraitsByCriteria(MeasurementDataTraitCriteria criteria) {
+ return
SerialUtility.prepare(dataManager.findTraitsByCriteria(getSessionSubject(), criteria),
+ "MeasurementDataService.findTraitsByCriteria");
+ }
}
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 b3b4eff..3fece05 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
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -55,6 +55,7 @@ import org.rhq.core.db.DatabaseType;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.db.Postgresql83DatabaseType;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
@@ -69,6 +70,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.OrderingField;
+import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.core.server.PersistenceUtility;
import org.rhq.core.util.collection.ArrayUtils;
@@ -88,6 +90,8 @@ import
org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor;
import org.rhq.enterprise.server.measurement.uibean.MetricDisplaySummary;
import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
+import org.rhq.enterprise.server.util.CriteriaQueryRunner;
/**
* A manager for {@link MeasurementData}s.
@@ -823,6 +827,32 @@ public class MeasurementDataManagerBean implements
MeasurementDataManagerLocal,
return result;
}
+ public PageList<MeasurementDataTrait> findTraitsByCriteria(Subject subject,
MeasurementDataTraitCriteria criteria) {
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+
+ 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());
+ }
+ }
+
+ CriteriaQueryRunner<MeasurementDataTrait> queryRunner = new
CriteriaQueryRunner(criteria, generator,
+ this.entityManager);
+ PageList<MeasurementDataTrait> results = queryRunner.execute();
+
+ // Fetch the definitions, so the results include the trait names.
+ for (MeasurementDataTrait result : results) {
+ result.getSchedule().getDefinition();
+ }
+
+ return results;
+ }
+
private MeasurementDataManagerUtility getConnectedUtilityInstance() {
return MeasurementDataManagerUtility.getInstance(rhqDs);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerLocal.java
index de557d0..7e4d87c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerLocal.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,8 @@ import java.util.Set;
import javax.ejb.Local;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
@@ -37,6 +39,7 @@ import
org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowCo
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.common.EntityContext;
import org.rhq.enterprise.server.measurement.uibean.MetricDisplaySummary;
@@ -150,6 +153,16 @@ public interface MeasurementDataManagerLocal {
List<MeasurementDataTrait> findCurrentTraitsForResource(Subject subject, int
resourceId, DisplayType displayType);
/**
+ * Finds traits that match the specified {@link MeasurementDataTraitCriteria
criteria}.
+ *
+ * @param subject the user that is requesting the traits
+ * @param criteria the criteria by which to filter the traits
+ *
+ * @return the traits that match the specified {@link MeasurementDataTraitCriteria
criteria}; never null
+ */
+ PageList<MeasurementDataTrait> findTraitsByCriteria(Subject subject,
MeasurementDataTraitCriteria criteria);
+
+ /**
* Get live metrics for a given MeasurementSchedule
*
* @param sched MeasurementSchedule to obtain the data for
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
index 6549d2c..032f8f9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -29,10 +29,12 @@ import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
+import org.rhq.core.domain.util.PageList;
import
org.rhq.enterprise.server.jaxb.adapter.MeasurementDataNumericHighLowCompositeAdapter;
import org.rhq.enterprise.server.system.ServerVersion;
@@ -60,6 +62,11 @@ public interface MeasurementDataManagerRemote {
@WebParam(name = "displayType") DisplayType displayType);
@WebMethod
+ PageList<MeasurementDataTrait> findTraitsByCriteria( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "criteria") MeasurementDataTraitCriteria criteria);
+
+ @WebMethod
Set<MeasurementData> findLiveData(//
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId, //
commit 593d4cf0d05238b64584c14d9955f403e01f4f40
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 23 13:05:15 2010 -0400
bz 626497 - add rhq.agent.server.alias to be able to change the name of the server
alias to look up (default is "rhqserver").
if you don't define it (e.g. comment it out of the config xml), the DNS lookup is
never performed thus forcing the user to configure the server bind address explicitly
diff --git a/etc/agentspawn/src/main/resources/template-configuration.xml
b/etc/agentspawn/src/main/resources/template-configuration.xml
index 3a0d65a..4992b96 100644
--- a/etc/agentspawn/src/main/resources/template-configuration.xml
+++ b/etc/agentspawn/src/main/resources/template-configuration.xml
@@ -15,7 +15,7 @@ RHQ Agent Configuration - Default Template For Agent Spawn Utility
<map />
<node name="spawn"> <!-- TO BE OVERRIDDEN -->
<map>
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.name" value="127.0.0.1"/>
<!-- TO BE OVERRIDDEN -->
diff --git a/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml
b/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml
index 7d8110e..69b74f3 100644
--- a/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml
+++ b/etc/agentspawn/src/scripts/agentcopy-agent-configuration.xml
@@ -9,7 +9,7 @@
<map />
<node name="@@@AGENT_NODE@@@">
<map>
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.name"
value="agentcopy-@@@AGENT_NODE@@@"/>
<entry key="rhq.agent.server.transport"
value="@@@rhq.agent.server.transport@@(a)" />
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java
index ae41e6f..11a2981 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java
@@ -200,9 +200,17 @@ public class AgentConfiguration {
public String getServerBindAddress() {
String address =
m_preferences.get(AgentConfigurationConstants.SERVER_BIND_ADDRESS, null);
if (address == null) {
- try {
- address =
InetAddress.getByName("rhqserver").getCanonicalHostName();
- } catch (Exception e1) {
+ String alias = m_preferences.get(AgentConfigurationConstants.SERVER_ALIAS,
null);
+ if (alias != null) {
+ try {
+ address = InetAddress.getByName(alias).getCanonicalHostName();
+ } catch (Exception e1) {
+ LOG.debug(AgentI18NResourceKeys.SERVER_ALIAS_UNKNOWN, alias, e1);
+ address = null;
+ }
+ }
+
+ if (address == null) {
try {
address = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e2) {
@@ -1413,7 +1421,7 @@ public class AgentConfiguration {
try {
m_preferences.flush();
} catch (Exception e) {
- LOG.warn(LOG.getMsgString(AgentI18NResourceKeys.CANNOT_STORE_PREFERENCES),
changedPreference, e);
+ LOG.warn(AgentI18NResourceKeys.CANNOT_STORE_PREFERENCES, changedPreference,
e);
}
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
index c32d04b..6f21139 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
@@ -58,7 +58,7 @@ public interface AgentConfigurationConstants {
/**
* This is the current schema version that our agent configuration knows about.
*/
- int CURRENT_CONFIG_SCHEMA_VERSION = 5;
+ int CURRENT_CONFIG_SCHEMA_VERSION = 6;
/**
* Flag to indicate if the agent's configuration has been setup.
@@ -112,6 +112,11 @@ public interface AgentConfigurationConstants {
String DEFAULT_SERVER_TRANSPORT_PARAMS =
"/jboss-remoting-servlet-invoker/ServerInvokerServlet";
/**
+ * The DNS alias for the RHQ Server - used when the server IP address is not
explicitly set.
+ */
+ String SERVER_ALIAS = PROPERTY_NAME_PREFIX + "server.alias";
+
+ /**
* The flag that, if <code>true</code>, will tell the agent to attempt to
auto-detect the JON Server coming online
* and going offline.
*/
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
index 562a487..6c0a2ce 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
@@ -58,6 +58,7 @@ public class AgentConfigurationUpgrade extends PreferencesUpgrade {
list.add(new Step2to3()); // goes from v2 to v3
list.add(new Step3to4()); // goes from v3 to v4
list.add(new Step4to5()); // goes from v4 to v5
+ list.add(new Step5to6());
return list;
}
@@ -126,4 +127,16 @@ public class AgentConfigurationUpgrade extends PreferencesUpgrade {
}
}
}
+
+ static class Step5to6 extends PreferencesUpgradeStep {
+ public int getSupportedConfigurationSchemaVersion() {
+ return 6;
+ }
+
+ public void upgrade(Preferences preferences) {
+ // This new schema version added rhq.server.alias - to support backwards
compatibility, we want
+ // to set this to "rhqserver" which will cause the same behavior
that was exhibited in previous versions
+ preferences.put(AgentConfigurationConstants.SERVER_ALIAS,
"rhqserver");
+ }
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index eadb493..7920df0 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -28,6 +28,9 @@ import mazz.i18n.annotation.I18NResourceBundle;
*/
@I18NResourceBundle(baseName = "agent-messages", defaultLocale =
"en")
public interface AgentI18NResourceKeys {
+ @I18NMessage("The configured server alias [{0}] cannot be resolved - will use
localhost address. Cause: {1}")
+ String SERVER_ALIAS_UNKNOWN = "AgentConfiguration.server-alias-unknown";
+
@I18NMessage("Specified bad console type [{0}]")
String AGENT_INPUT_READER_FACTORY_BAD_TYPE =
"AgentMain.input-reader-factory-bad-type";
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java
index 985c764..faf3692 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java
@@ -78,6 +78,16 @@ public interface AgentSetupInstructions {
+ "and all the different values allowed for the specific transport being
used.") })
String SETUP_INSTRUCTION_SERVERTRANSPORTPARAMS_HELP =
"PromptCommand.setup.instruction.serveruri.transportparams.help";
+ // SERVER ALIAS
+ String SETUP_INSTRUCTION_SERVERALIAS_PREF =
AgentConfigurationConstants.SERVER_ALIAS;
+ String SETUP_INSTRUCTION_SERVERALIAS_DEFAULT = null;
+ @I18NMessages( { @I18NMessage("RHQ Server Alias") })
+ String SETUP_INSTRUCTION_SERVERALIAS_PROMPT =
"PromptCommand.setup.instruction.serveralias.prompt";
+ @I18NMessages( { @I18NMessage("If the RHQ Server hostname or IP address was not
set,\\n\\\n"
+ + "this DNS alias name will be looked up and used as the RHQ Server
host.\\n\\\n"
+ + "Not setting this preference will disable this DNS alias lookup
feature") })
+ String SETUP_INSTRUCTION_SERVERALIAS_HELP =
"PromptCommand.setup.instruction.serveralias.help";
+
// SERVER AUTO-DETECTION
String SETUP_INSTRUCTION_SERVERAUTODETECT_PREF =
AgentConfigurationConstants.SERVER_AUTO_DETECTION;
String SETUP_INSTRUCTION_SERVERAUTODETECT_DEFAULT = Boolean
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java
index 4c9226a..7c8152a 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java
@@ -81,7 +81,8 @@ public class SetupPromptCommand implements AgentPromptCommand {
if (args.length == 1) {
performBasicSetup(agent.getConfiguration().getPreferences(), new
AgentPromptInfo(agent), agent.getOut());
} else if ((args.length == 2) &&
args[1].equals(MSG.getMsg(AgentI18NResourceKeys.SETUP_ADVANCED))) {
- performAdvancedSetup(agent.getConfiguration().getPreferences(), new
AgentPromptInfo(agent), agent.getOut());
+ performAdvancedSetup(agent.getConfiguration().getPreferences(), new
AgentPromptInfo(agent), agent
+ .getOut());
} else if ((args.length == 2) &&
args[1].equals(MSG.getMsg(AgentI18NResourceKeys.SETUP_ALL))) {
performAllSetup(agent.getConfiguration().getPreferences(), new
AgentPromptInfo(agent), agent.getOut());
} else {
@@ -248,6 +249,11 @@ public class SetupPromptCommand implements AgentPromptCommand {
.getMsg(AgentSetupInstructions.SETUP_INSTRUCTION_SERVERTRANSPORTPARAMS_PROMPT), SETUPMSG
.getMsg(AgentSetupInstructions.SETUP_INSTRUCTION_SERVERTRANSPORTPARAMS_HELP)));
+ instr.add(new
DefaultSetupInstruction(AgentSetupInstructions.SETUP_INSTRUCTION_SERVERALIAS_PREF,
+ AgentSetupInstructions.SETUP_INSTRUCTION_SERVERALIAS_DEFAULT, null, SETUPMSG
+ .getMsg(AgentSetupInstructions.SETUP_INSTRUCTION_SERVERALIAS_PROMPT),
SETUPMSG
+ .getMsg(AgentSetupInstructions.SETUP_INSTRUCTION_SERVERALIAS_HELP)));
+
instr.add(new
SecurityEnabledSetupInstruction(ServiceContainerConfigurationConstants.CONNECTOR_TRANSPORT,
AgentSetupInstructions.SETUP_INSTRUCTION_SERVERCLIENTAUTHMODE_PREF,
AgentSetupInstructions.SETUP_INSTRUCTION_SERVERCLIENTAUTHMODE_DEFAULT,
diff --git a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
index f36b459..66e1d59 100644
--- a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
+++ b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
@@ -59,7 +59,7 @@ commands named "config", "setconfig" and
"setup" and the command line options
file conforms to. This is the schema for the rhq.agent
preferences.
-->
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<!--
_______________________________________________________________
@@ -106,6 +106,7 @@ commands named "config", "setconfig" and
"setup" and the command line options
rhq.agent.server.bind-address
rhq.agent.server.bind-port
rhq.agent.server.transport-params
+ rhq.agent.server.alias
The RHQ Server endpoint configuration.
@@ -114,8 +115,9 @@ commands named "config", "setconfig" and
"setup" and the command line options
to separate the transport parameters.
Note that the server address is left undefined - the agent
- will default to the DNS alias of "rhqserver" and if that is not
- defined, it will default to the localhost or 127.0.0.1.
+ will default to the DNS alias (see rhq.agent.server.alias)
+ and if that is not defined, it will default to the localhost
+ or 127.0.0.1.
-->
<entry key="rhq.agent.server.transport"
value="servlet" />
<entry key="rhq.agent.server.bind-port"
value="7080" />
@@ -123,6 +125,7 @@ commands named "config", "setconfig" and
"setup" and the command line options
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
-->
<entry key="rhq.agent.server.transport-params"
value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
+ <entry key="rhq.agent.server.alias"
value="rhqserver" />
<!--
_______________________________________________________________
diff --git a/modules/enterprise/agent/src/test/resources/test-agent-configuration.xml
b/modules/enterprise/agent/src/test/resources/test-agent-configuration.xml
index e832f13..a3da93e 100644
--- a/modules/enterprise/agent/src/test/resources/test-agent-configuration.xml
+++ b/modules/enterprise/agent/src/test/resources/test-agent-configuration.xml
@@ -29,7 +29,7 @@
<!-- the "real" settings -->
<entry key="rhq.agent.name"
value="jboss-on" />
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.server.transport"
value="socket" />
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
diff --git a/modules/enterprise/agent/src/test/resources/test-agent1-cfg-mvn.xml
b/modules/enterprise/agent/src/test/resources/test-agent1-cfg-mvn.xml
index 84187f9..2d8c91f 100644
--- a/modules/enterprise/agent/src/test/resources/test-agent1-cfg-mvn.xml
+++ b/modules/enterprise/agent/src/test/resources/test-agent1-cfg-mvn.xml
@@ -29,7 +29,7 @@
<!-- the "real" settings -->
<entry key="rhq.agent.name"
value="jboss-on" />
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.server.transport"
value="socket" />
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
diff --git a/modules/enterprise/agent/src/test/resources/test-agent2-cfg-mvn.xml
b/modules/enterprise/agent/src/test/resources/test-agent2-cfg-mvn.xml
index 2dd7334..7321e5b 100644
--- a/modules/enterprise/agent/src/test/resources/test-agent2-cfg-mvn.xml
+++ b/modules/enterprise/agent/src/test/resources/test-agent2-cfg-mvn.xml
@@ -48,7 +48,7 @@
<!-- the "real" settings -->
<entry key="rhq.agent.name"
value="jboss-on" />
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.server.transport"
value="socket" />
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
diff --git a/modules/enterprise/agent/src/test/resources/test-agent2-configuration.xml
b/modules/enterprise/agent/src/test/resources/test-agent2-configuration.xml
index 6a7aaff..d5b4738 100644
--- a/modules/enterprise/agent/src/test/resources/test-agent2-configuration.xml
+++ b/modules/enterprise/agent/src/test/resources/test-agent2-configuration.xml
@@ -18,7 +18,7 @@
<!-- the "real" settings -->
<entry key="rhq.agent.name"
value="jboss-on2" />
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.server.transport"
value="socket" />
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
diff --git
a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml
b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml
index b2702cd..68e8719 100644
---
a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml
+++
b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml
@@ -23,7 +23,7 @@ Embedded RHQ Agent Configuration
file conforms to. This is the schema for the rhq.agent
preferences.
-->
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<!--
_______________________________________________________________
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 dbfdfe2..df799fe 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
@@ -379,6 +379,7 @@
</c:constraint>
</c:simple-property>
<c:simple-property name="rhq.agent.server.transport-params"
type="string" activationPolicy="restart" required="false"
default="/jboss-remoting-servlet-invoker/ServerInvokerServlet"
displayName="RHQ Server Transport Parameters" description="Custom set of
transport parameters used when sending commands to the RHQ Server. Please see the
documentation for more information on transport params." />
+ <c:simple-property name="rhq.agent.server.alias"
type="string" activationPolicy="restart" required="false"
default="rhqserver" displayName="RHQ Server Alias"
description="If the RHQ Server IP address is not defined, this is the DNS alias name
that will be looked up to determine the RHQ Server IP address." />
<c:simple-property name="rhq.communications.connector.transport"
type="string" activationPolicy="restart" required="true"
default="socket" displayName="Agent Transport Protocol"
description="The transport protocol used to receive commands from the RHQ Server.
e.g. socket, sslsocket. If you want secure communications, you must use an SSL-enabled
transport">
<c:property-options>
<c:option name="socket" value="socket"
default="true" />
diff --git a/modules/plugins/rhq-agent/src/test/resources/test-agent-configuration.xml
b/modules/plugins/rhq-agent/src/test/resources/test-agent-configuration.xml
index 7dc685c..a5209a8 100644
--- a/modules/plugins/rhq-agent/src/test/resources/test-agent-configuration.xml
+++ b/modules/plugins/rhq-agent/src/test/resources/test-agent-configuration.xml
@@ -18,7 +18,7 @@
<!-- the "real" settings -->
<entry key="rhq.agent.name"
value="jboss-on" />
- <entry key="rhq.agent.configuration-schema-version"
value="5" />
+ <entry key="rhq.agent.configuration-schema-version"
value="6" />
<entry key="rhq.agent.configuration-setup-flag"
value="true" />
<entry key="rhq.agent.server.transport"
value="socket" />
<entry key="rhq.agent.server.bind-address"
value="127.0.0.1" />
commit fdc507c69f1ac14bf1c457b03098931f094385fd
Author: John Sanda <jsanda(a)redhat.com>
Date: Sun Aug 22 06:28:23 2010 -0400
Adding logic to handle script exceptions
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 28f2056..3937c51 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -58,10 +58,16 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
// Calling setEntityMap() worked though.
//script.entityMap = entityMap
script.setEntityMap(entityMap)
- def scriptResult = script.run()
- ControlResults results = new ControlResults()
- results.complexResults.put(new PropertySimple("results", scriptResult))
+ def results = new ControlResults()
+
+ try {
+ def scriptResult = script.run()
+ results.complexResults.put(new PropertySimple("results", scriptResult))
+ }
+ catch (Throwable t) {
+ results.error = t
+ }
return results;
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 0924ab7..6900943 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -16,6 +16,7 @@ import org.testng.annotations.BeforeMethod
import org.testng.annotations.Test
import static org.testng.Assert.assertEquals
import static org.testng.Assert.assertTrue
+import static org.testng.Assert.assertNotNull
import org.rhq.core.domain.test.TestEntity
class ScriptRunnerTest {
@@ -54,9 +55,13 @@ class ScriptRunnerTest {
}
}
- @Test(expectedExceptions = [RHQScriptException])
void throwExceptionWhenManagerAccessedDoesNotExist() {
- executeScript('access_nonexistent_mgr.groovy')
+ def result = executeScript('access_nonexistent_mgr.groovy')
+ assertEquals(
+ result.error,
+ "$RHQScriptException.name: Unable to locate NonexistentManager",
+ "Expected error to be set when script tries to access nonexistent
manager"
+ )
}
@Test
@@ -83,6 +88,17 @@ class ScriptRunnerTest {
}
}
+ @Test
+ void handleScriptExceptions() {
+ def result = executeScript('throw_exception.groovy')
+
+ assertEquals(
+ "$result.error",
+ "$RuntimeException.name: script failed!",
+ "error property should be set when script throws an exception"
+ )
+ }
+
def executeScript(String script) {
def params = new Configuration()
params.put(new PropertySimple('script', getScriptPath(script)))
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/throw_exception.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/throw_exception.groovy
new file mode 100644
index 0000000..728e2ed
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/throw_exception.groovy
@@ -0,0 +1,3 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+throw new RuntimeException("script failed!")
commit c88a6b75de474c9d123523260a12aa176712ad01
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 09:36:35 2010 -0400
Adding opencsv test dependency that was missing from server/jar
diff --git a/modules/enterprise/gui/webdav-war/webdav-war.iml
b/modules/enterprise/gui/webdav-war/webdav-war.iml
deleted file mode 100644
index 2147216..0000000
--- a/modules/enterprise/gui/webdav-war/webdav-war.iml
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module relativePaths="true"
MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE"
version="4">
- <component name="FacetManager">
- <facet type="web" name="Web">
- <configuration>
- <descriptors>
- <deploymentDescriptor name="web.xml"
url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml"
optional="false" version="2.5" />
- </descriptors>
- <webroots>
- <root url="file://$MODULE_DIR$/src/main/webapp"
relative="/" />
- <root
url="file://$MODULE_DIR$//home/ghinkle/projects/jbosson/rhq/modules/enterprise/gui/webdav-war/src/main/webapp"
relative="/" />
- <root
url="file://$MODULE_DIR$//home/ghinkle/projects/jbosson/rhq/modules/enterprise/gui/webdav-war/src/main/webapp-filtered"
relative="/" />
- </webroots>
- <building>
- <setting name="EXPLODED_URL"
value="file://$MODULE_DIR$/../../../../../out/exploded/webdav-warWeb" />
- <setting name="EXPLODED_ENABLED" value="true" />
- <setting name="JAR_URL" value="file://" />
- <setting name="JAR_ENABLED" value="false" />
- <setting name="EXCLUDE_EXPLODED_DIRECTORY" value="true"
/>
- </building>
- <packaging>
- <containerElement type="library" name="Maven:
i18nlog:i18nlog:1.0.9" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="module" name="rhq-core-gui">
- <attribute name="method" value="5" />
- <attribute name="URI"
value="/WEB-INF/lib/rhq-core-gui-1.2.0-SNAPSHOT.jar" />
- </containerElement>
- <containerElement type="library" name="Maven:
org.richfaces.framework:richfaces-api:3.3.0.GA" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
commons-collections:commons-collections:3.2" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
commons-beanutils:commons-beanutils:1.6.1" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
org.richfaces.framework:richfaces-impl:3.3.0.GA" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
commons-digester:commons-digester:1.8" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
org.richfaces.ui:richfaces-ui:3.3.0.GA" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
ettrema:milton-api:1.2" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
ettrema:milton-servlet:1.2" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
org.slf4j:slf4j-jdk14:1.5.6" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
org.slf4j:slf4j-api:1.5.6" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="library" name="Maven:
javax.servlet:jstl:1.1.2" level="project">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/lib/" />
- </containerElement>
- <containerElement type="module" name="webdav-war">
- <attribute name="method" value="1" />
- <attribute name="URI" value="/WEB-INF/classes" />
- </containerElement>
- </packaging>
- </configuration>
- </facet>
- </component>
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5"
inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="library" name="Maven:
commons-logging:commons-logging:1.1.0.jboss" level="project" />
- <orderEntry type="library" exported="" name="Maven:
i18nlog:i18nlog:1.0.9" level="project" />
- <orderEntry type="library" name="Maven:
javax.xml.bind:jaxb-api:2.1" level="project" />
- <orderEntry type="library" name="Maven:
javax.xml.stream:stax-api:1.0-2" level="project" />
- <orderEntry type="library" name="Maven:
javax.activation:activation:1.1" level="project" />
- <orderEntry type="library" name="Maven: log4j:log4j:1.2.14"
level="project" />
- <orderEntry type="library" name="Maven:
org.testng:testng:jdk15:5.7" level="project" />
- <orderEntry type="library" name="Maven: junit:junit:3.8.1"
level="project" />
- <orderEntry type="library" name="Maven:
org.jetbrains:annotations:7.0.2" level="project" />
- <orderEntry type="module" module-name="rhq-core-domain" />
- <orderEntry type="module" module-name="rhq-core-util" />
- <orderEntry type="library" name="Maven: jdom:jdom:1.0"
level="project" />
- <orderEntry type="module" module-name="rhq-core-gui"
exported="" />
- <orderEntry type="library" exported="" name="Maven:
org.richfaces.framework:richfaces-api:3.3.0.GA" level="project" />
- <orderEntry type="library" exported="" name="Maven:
commons-collections:commons-collections:3.2" level="project" />
- <orderEntry type="library" exported="" name="Maven:
commons-beanutils:commons-beanutils:1.6.1" level="project" />
- <orderEntry type="library" exported="" name="Maven:
org.richfaces.framework:richfaces-impl:3.3.0.GA" level="project" />
- <orderEntry type="library" exported="" name="Maven:
commons-digester:commons-digester:1.8" level="project" />
- <orderEntry type="library" exported="" name="Maven:
org.richfaces.ui:richfaces-ui:3.3.0.GA" level="project" />
- <orderEntry type="module" module-name="rhq-enterprise-server"
/>
- <orderEntry type="module" module-name="rhq-enterprise-comm"
/>
- <orderEntry type="module" module-name="rhq-core-comm-api"
/>
- <orderEntry type="library" name="Maven:
dom4j:dom4j:1.6.1-jboss" level="project" />
- <orderEntry type="library" name="Maven:
gnu-getopt:getopt:1.0.13" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-common:1.2.0.GA" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-jmx:4.2.1.GA" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-remoting:2.2.1.GA" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-serialization:1.0.3.GA" level="project" />
- <orderEntry type="library" name="Maven:
oswego-concurrent:concurrent:1.3.4-jboss" level="project" />
- <orderEntry type="module" module-name="rhq-core-client-api"
/>
- <orderEntry type="library" name="Maven:
com.sun.xml.bind:jaxb-impl:2.1.6" level="project" />
- <orderEntry type="module" module-name="rhq-core-dbutils"
/>
- <orderEntry type="library" name="Maven: ant:ant:1.6.5"
level="project" />
- <orderEntry type="library" name="Maven:
commons-httpclient:commons-httpclient:3.0.1" level="project" />
- <orderEntry type="library" name="Maven:
commons-codec:commons-codec:1.2" level="project" />
- <orderEntry type="library" name="Maven:
commons-validator:commons-validator:1.1.4" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-cache:1.4.1.SP3" level="project" />
- <orderEntry type="library" name="Maven: jboss:jbpm:3.1.1"
level="project" />
- <orderEntry type="library" name="Maven:
org.snmp4j:snmp4j:1.8.2" level="project" />
- <orderEntry type="library" name="Maven:
postgresql:postgresql:8.3-604.jdbc3" level="project" />
- <orderEntry type="library" name="Maven: rss4j:rss4j:0.92-on.2"
level="project" />
- <orderEntry type="library" exported="" name="Maven:
org.slf4j:slf4j-jdk14:1.5.6" level="project" />
- <orderEntry type="library" exported="" name="Maven:
org.slf4j:slf4j-api:1.5.6" level="project" />
- <orderEntry type="library" name="Maven:
hibernate:hibernate3:3.2.r14201-2" level="project" />
- <orderEntry type="library" name="Maven:
hibernate-annotations:hibernate-annotations:3.2.1.GA" level="project"
/>
- <orderEntry type="library" name="Maven:
javax.persistence:persistence-api:1.0" level="project" />
- <orderEntry type="library" exported="" name="Maven:
javax.servlet:jstl:1.1.2" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-ejb-api:4.2.1.GA" level="project" />
- <orderEntry type="library" name="Maven:
jboss:jboss-j2ee:4.2.1.GA" level="project" />
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root
url="jar://$M2_REPO$/com/ettrema/milton-api/1.4.1/milton-api-1.4.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root
url="jar://$M2_REPO$/com/ettrema/milton-servlet/1.4.1/milton-servlet-1.4.1.jar!/"
/>
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- </component>
-</module>
-
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index b0b3484..04d3557 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -393,6 +393,13 @@
<version>${version}</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
commit aa341e76cdb545e6651c332094e29446204942bc
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 08:59:16 2010 -0400
Adding groovy script plugin to build
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 07be817..5ff09b2 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -83,6 +83,7 @@
<module>filetemplate-bundle</module>
<module>ant-bundle</module>
<module>validate-all-serverplugins</module>
+ <module>groovy-script</module>
</modules>
</project>
commit 876398c1751c450495a23d3d6e88810cf6553f37
Merge: 81667f2... 51dd587...
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 08:34:42 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 81667f27c16d39d1b1b49c8350b8413b049b5186
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 00:38:35 2010 -0400
Re-enabling test
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 877f5b0..0924ab7 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -16,6 +16,7 @@ import org.testng.annotations.BeforeMethod
import org.testng.annotations.Test
import static org.testng.Assert.assertEquals
import static org.testng.Assert.assertTrue
+import org.rhq.core.domain.test.TestEntity
class ScriptRunnerTest {
@@ -58,8 +59,14 @@ class ScriptRunnerTest {
executeScript('access_nonexistent_mgr.groovy')
}
- @Test(enabled = false)
+ @Test
void createCriteriaAccordingToSpec() {
+ scriptRunner.entityMap << [TestEntity: TestEntity.class]
+
+ def testMgr = {}
+ def lookupUtil = new MockFor(LookupUtil)
+ lookupUtil.demand.getTestEntityManager { testMgr }
+
def expectedCriteria = new TestEntityCriteria()
expectedCriteria.id = 1
expectedCriteria.name = 'Test'
@@ -69,9 +76,11 @@ class ScriptRunnerTest {
expectedCriteria.addSortId(PageOrdering.DESC)
expectedCriteria.addSortName(PageOrdering.DESC)
- def result = executeScript('create_criteria.groovy')
+ lookupUtil.use {
+ def result = executeScript('create_criteria.groovy')
- assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to generate
criteria correctly')
+ assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to
generate criteria correctly')
+ }
}
def executeScript(String script) {
commit 29f040e5b56ff2dee9533816fc755707c71c2b11
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 00:33:53 2010 -0400
Adding test to verify that the entity map cache is populated
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 922facf..28f2056 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -16,11 +16,13 @@ import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
class ScriptRunner implements ServerPluginComponent, ControlFacet {
+ String entityPackagePrefix = "org.rhq.core.domain"
+
Map entityMap = [:]
void initialize(ServerPluginContext context) {
def reflections = new Reflections(new ConfigurationBuilder()
-
.setUrls(ClasspathHelper.getUrlsForPackagePrefix("org.rhq.core.domain"))
+ .setUrls(ClasspathHelper.getUrlsForPackagePrefix(entityPackagePrefix))
.setScanners(new TypeAnnotationsScanner()));
def classes = reflections.getTypesAnnotatedWith(Entity.class)
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
index 04b21b4..7f02ba7 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
@@ -1,5 +1,8 @@
package org.rhq.core.domain.test
+import javax.persistence.Entity
+
+@Entity
class TestEntity {
Integer id
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
index 312ea47..79703ee 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
@@ -1,4 +1,7 @@
package org.rhq.core.domain.test
+import javax.persistence.Entity
+
+@Entity
class TestEntityWithoutCriteria {
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 24170ed..877f5b0 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -1,25 +1,21 @@
package org.rhq.enterprise.server.plugins.groovy
-import org.testng.annotations.Test
import groovy.mock.interceptor.MockFor
-import org.rhq.enterprise.server.util.LookupUtil
+import javax.persistence.Entity
+import org.reflections.Reflections
+import org.reflections.scanners.TypeAnnotationsScanner
+import org.reflections.util.ClasspathHelper
+import org.reflections.util.ConfigurationBuilder
import org.rhq.core.domain.configuration.Configuration
import org.rhq.core.domain.configuration.PropertySimple
-
-import static org.testng.Assert.*
-import org.rhq.enterprise.server.plugin.pc.ControlResults
import org.rhq.core.domain.criteria.TestEntityCriteria
-import org.testng.annotations.BeforeClass
-import org.rhq.core.domain.test.TestEntity
import org.rhq.core.domain.util.PageOrdering
+import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.enterprise.server.util.LookupUtil
import org.testng.annotations.BeforeMethod
-import org.reflections.Reflections
-import javax.persistence.Entity
-import org.reflections.scanners.SubTypesScanner
-import org.reflections.scanners.TypeAnnotationsScanner
-import org.reflections.scanners.ResourcesScanner
-import org.reflections.util.ClasspathHelper
-import org.reflections.util.ConfigurationBuilder
+import org.testng.annotations.Test
+import static org.testng.Assert.assertEquals
+import static org.testng.Assert.assertTrue
class ScriptRunnerTest {
@@ -28,7 +24,17 @@ class ScriptRunnerTest {
@BeforeMethod
void setup() {
scriptRunner = new ScriptRunner()
- scriptRunner.entityMap << [TestEntity: TestEntity.class]
+ }
+
+ @Test
+ void populateEntityMap() {
+ scriptRunner.entityPackagePrefix = 'org.rhq.core.domain.test'
+ scriptRunner.initialize(null)
+
+ assertEquals(scriptRunner.entityMap.size(), 2, "Expected to entityMap to contain
two entries")
+ assertTrue(scriptRunner.entityMap.containsKey('TestEntity'), "Expected
to find <TestEntity> in entity map")
+ assertTrue(scriptRunner.entityMap.containsKey('TestEntityWithoutCriteria'),
+ "Expected to find <TestEntityWithoutCriteria> in entity map")
}
@Test
@@ -68,17 +74,6 @@ class ScriptRunnerTest {
assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to generate
criteria correctly')
}
- @Test
- void scanClasspath() {
- Reflections reflections = new Reflections(new ConfigurationBuilder()
-
.setUrls(ClasspathHelper.getUrlsForPackagePrefix("org.rhq.core.domain"))
- .setScanners(new TypeAnnotationsScanner()));
- def classes = reflections.getTypesAnnotatedWith(Entity.class)
-
- println "Found ${classes.size()} entities"
- assertTrue(classes.size() > 5, "Found ${classes.size()} entities")
- }
-
def executeScript(String script) {
def params = new Configuration()
params.put(new PropertySimple('script', getScriptPath(script)))
commit 47ade1fdd82c7d11b64a48db422d8ba9055f188a
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Aug 21 00:07:11 2010 -0400
Adding logic to dynamically generate entity map
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml
b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 22b86e0..1abb9b3 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -54,6 +54,11 @@
<version>4.2.3.GA</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ <version>0.9.5-RC2</version>
+ </dependency>
</dependencies>
<build>
@@ -74,8 +79,32 @@
<artifactItem>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>1.7.1</version>
+ <version>1.7.3</version>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
</artifactItem>
+ <artifactItem>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ </artifactItem>
+ <artifactItem>
+
<groupId>com.google.collections</groupId>
+
<artifactId>google-collections</artifactId>
+ <version>1.0</version>
+ </artifactItem>
+ <artifactItem>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.8.0.GA</version>
+ </artifactItem>
</artifactItems>
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
</configuration>
@@ -189,4 +218,12 @@
</profile>
</profiles>
+
+ <repositories>
+ <repository>
+ <id>reflections-repo</id>
+ <name>Reflections Maven2 Repository</name>
+ <
url>http://reflections.googlecode.com/svn/repo</url>
+ </repository>
+ </repositories>
</project>
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 5245756..922facf 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -1,25 +1,30 @@
package org.rhq.enterprise.server.plugins.groovy
+import javax.persistence.Entity
import org.codehaus.groovy.control.CompilerConfiguration
+import org.reflections.Reflections
+import org.reflections.scanners.TypeAnnotationsScanner
+import org.reflections.util.ClasspathHelper
+import org.reflections.util.ConfigurationBuilder
import org.rhq.core.domain.configuration.Configuration
import org.rhq.core.domain.configuration.PropertySimple
import org.rhq.enterprise.server.plugin.pc.ControlFacet
import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.enterprise.server.plugin.pc.ScheduledJobInvocationContext
import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
-import org.rhq.core.domain.resource.Resource
-import org.rhq.core.domain.resource.ResourceType
-import org.rhq.enterprise.server.plugin.pc.ScheduledJobInvocationContext
class ScriptRunner implements ServerPluginComponent, ControlFacet {
- Map entityMap = [
- Resource: Resource.class,
- ResourceType: ResourceType.class
- ]
+ Map entityMap = [:]
void initialize(ServerPluginContext context) {
+ def reflections = new Reflections(new ConfigurationBuilder()
+
.setUrls(ClasspathHelper.getUrlsForPackagePrefix("org.rhq.core.domain"))
+ .setScanners(new TypeAnnotationsScanner()));
+ def classes = reflections.getTypesAnnotatedWith(Entity.class)
+ classes.each { entityMap << [(it.simpleName.toString()): it] }
}
void start() {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index c8a00d6..24170ed 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -13,6 +13,13 @@ import org.testng.annotations.BeforeClass
import org.rhq.core.domain.test.TestEntity
import org.rhq.core.domain.util.PageOrdering
import org.testng.annotations.BeforeMethod
+import org.reflections.Reflections
+import javax.persistence.Entity
+import org.reflections.scanners.SubTypesScanner
+import org.reflections.scanners.TypeAnnotationsScanner
+import org.reflections.scanners.ResourcesScanner
+import org.reflections.util.ClasspathHelper
+import org.reflections.util.ConfigurationBuilder
class ScriptRunnerTest {
@@ -61,6 +68,17 @@ class ScriptRunnerTest {
assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to generate
criteria correctly')
}
+ @Test
+ void scanClasspath() {
+ Reflections reflections = new Reflections(new ConfigurationBuilder()
+
.setUrls(ClasspathHelper.getUrlsForPackagePrefix("org.rhq.core.domain"))
+ .setScanners(new TypeAnnotationsScanner()));
+ def classes = reflections.getTypesAnnotatedWith(Entity.class)
+
+ println "Found ${classes.size()} entities"
+ assertTrue(classes.size() > 5, "Found ${classes.size()} entities")
+ }
+
def executeScript(String script) {
def params = new Configuration()
params.put(new PropertySimple('script', getScriptPath(script)))
commit 4e8ae3349ff28b025741a1c3bb0d1a827c0feff8
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Aug 20 15:14:27 2010 +0200
first stab at the errors display GUI.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewForm.java
new file mode 100644
index 0000000..074b3c9
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewForm.java
@@ -0,0 +1,298 @@
+/*
+ * 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.Collections;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.List;
+
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.DisplayType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+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.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
+import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
+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.util.message.Message;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.HeaderItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+
+/**
+ * The Resource Summary>Overview tab, the form with resource data.
+ *
+ * @author Greg Hinkle
+ * @author Ian Springer
+ */
+public class OverviewForm extends EnhancedDynamicForm {
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+ private ResourceComposite resourceComposite;
+
+ public OverviewForm(ResourceComposite resourceComposite) {
+ this.resourceComposite = resourceComposite;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ setLeft("10%");
+ setWidth("80%");
+
+ if (this.resourceComposite != null) {
+ setResource(this.resourceComposite);
+ }
+ }
+
+ public void setResource(ResourceComposite resourceComposite) {
+
+ this.resourceComposite = resourceComposite;
+ Resource resource = resourceComposite.getResource();
+
+ // Load metric defs.
+
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ try {
+ buildForm(type);
+ loadTraitValues();
+ } catch (Exception e) {
+ SC.say("Form load failure");
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ private void loadTraitValues() {
+ final Resource resource = resourceComposite.getResource();
+ GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource(
+ resource.getId(),
+ DisplayType.SUMMARY,
+ new AsyncCallback<List<MeasurementDataTrait>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load traits
for " + resource + ".",
+ caught);
+ }
+
+ public void onSuccess(List<MeasurementDataTrait> result) {
+ // TODO: Implement this method.
+ for (MeasurementDataTrait trait : result) {
+ String formId = trait.getName().replaceAll("\\.",
"_").replaceAll(" ", "__");
+ FormItem item = getItem(formId);
+
+ if (item != null) {
+ setValue(formId, trait.getValue());
+ }
+ }
+ markForRedraw();
+ }
+ }
+ );
+
+ }
+
+ 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);
+ }
+ }
+
+ Collections.sort(traits, new Comparator<MeasurementDefinition>() {
+ public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
+ return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
+
+ List<FormItem> formItems = new ArrayList<FormItem>();
+
+ HeaderItem headerItem = new HeaderItem("header", "Summary");
+ headerItem.setValue("Summary");
+ formItems.add(headerItem);
+
+ StaticTextItem typeItem = new StaticTextItem("type",
"Type");
+ typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
+ typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
+ formItems.add(typeItem);
+
+ final Resource resource = this.resourceComposite.getResource();
+ boolean modifiable =
this.resourceComposite.getResourcePermission().isInventory();
+
+ final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ nameItem.setName("name");
+ nameItem.setTitle("Name");
+ nameItem.setValue(resource.getName());
+ if (nameItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newName) {
+ final String oldName = resource.getName();
+ if (newName.equals(oldName)) {
+ return;
+ }
+ resource.setName(newName);
+ OverviewForm.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
+ + resource.getId()
+ + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setName(oldName);
+ nameItem.setValue(oldName);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(nameItem);
+
+ final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ descriptionItem.setName("description");
+ descriptionItem.setTitle("Description");
+ descriptionItem.setValue(resource.getDescription());
+ if (descriptionItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
+ togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newDescription) {
+ final String oldDescription = resource.getDescription();
+ if (newDescription.equals(oldDescription)) {
+ return;
+ }
+ resource.setDescription(newDescription);
+ OverviewForm.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
+ + resource.getId()
+ + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setDescription(oldDescription);
+ descriptionItem.setValue(oldDescription);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(descriptionItem);
+
+ final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ locationItem.setName("location");
+ locationItem.setTitle("Location");
+ locationItem.setValue(resource.getLocation());
+ if (locationItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newLocation) {
+ final String oldLocation = resource.getLocation();
+ if (newLocation.equals(oldLocation)) {
+ return;
+ }
+ resource.setLocation(newLocation);
+ OverviewForm.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
+ + resource.getId()
+ + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setLocation(oldLocation);
+ locationItem.setValue(oldLocation);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(locationItem);
+
+
+ StaticTextItem versionItem = new StaticTextItem("version",
"Version");
+ formItems.add(versionItem);
+
+ StaticTextItem parentItem = new StaticTextItem("parent",
"Parent");
+ formItems.add(parentItem);
+
+ for (MeasurementDefinition trait : traits) {
+ String id = trait.getDisplayName().replaceAll("\\.",
"_").replaceAll(" ", "__");
+
+ StaticTextItem item = new StaticTextItem(id, trait.getDisplayName());
+ item.setTooltip(trait.getDescription());
+ formItems.add(item);
+// item.setValue("?");
+ }
+
+// SectionItem section = new SectionItem("Summary",
"Summary");
+// section.setTitle("Summary");
+// section.setDefaultValue("Summary");
+// section.setCanCollapse(true);
+// section.setCellStyle("HidablePlainSectionHeader");
+// section.setItemIds(itemIds.toArray(new String[itemIds.size()]));
+// formItems.add(0, section);
+
+ formItems.add(new SpacerItem());
+ setItems(formItems.toArray(new FormItem[formItems.size()]));
+
+ setValue("type", type.getName() + " (" + type.getPlugin() +
")");
+ setValue("name", resource.getName());
+ setValue("description", resource.getDescription());
+ setValue("location", resource.getLocation());
+ setValue("version", (resource.getVersion() != null) ?
resource.getVersion() : "<i>none</i>");
+ Resource parentResource = resource.getParentResource();
+ setValue("parent", parentResource != null ?
+ ("<a href=\"#Resource/" + parentResource.getId() +
"\">" +
+ parentResource.getName() + "</a>") :
"<i>none</i>");
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
index ac2abc2..2fff538 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
@@ -19,53 +19,35 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
import java.util.List;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.HeaderItem;
-import com.smartgwt.client.widgets.form.fields.SpacerItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.DisplayType;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
-import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
-import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
-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.ResourceSelectListener;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+import com.smartgwt.client.util.SC;
+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.grid.events.RecordClickEvent;
+import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
+import com.smartgwt.client.widgets.layout.VLayout;
/**
* The Resource Summary>Overview tab.
*
- * @author Greg Hinkle
- * @author Ian Springer
+ * @author Lukas Krejci
*/
-public class OverviewView extends EnhancedDynamicForm implements ResourceSelectListener
{
+public class OverviewView extends VLayout implements ResourceSelectListener {
- private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
private ResourceComposite resourceComposite;
-
public OverviewView(ResourceComposite resourceComposite) {
super();
this.resourceComposite = resourceComposite;
}
-
@Override
protected void onDraw() {
super.onDraw();
@@ -78,225 +60,43 @@ public class OverviewView extends EnhancedDynamicForm implements
ResourceSelectL
}
}
-
public void onResourceSelected(ResourceComposite resourceComposite) {
-
- this.resourceComposite = resourceComposite;
- Resource resource = resourceComposite.getResource();
-
- // Load metric defs.
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- try {
- buildForm(type);
- loadTraitValues();
- } catch (Exception e) {
- SC.say("Form load failure");
- e.printStackTrace();
- }
- }
- });
+ addMember(new OverviewForm(resourceComposite));
+ ListGrid errorsGrid = buildErrorListGrid(resourceComposite);
+ if (errorsGrid != null) {
+ addMember(errorsGrid);
+ }
}
- private void loadTraitValues() {
+ private static ListGrid buildErrorListGrid(ResourceComposite resourceComposite) {
final Resource resource = resourceComposite.getResource();
- GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource(
- resource.getId(),
- DisplayType.SUMMARY,
- new AsyncCallback<List<MeasurementDataTrait>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load traits
for " + resource + ".",
- caught);
- }
-
- public void onSuccess(List<MeasurementDataTrait> result) {
- // TODO: Implement this method.
- for (MeasurementDataTrait trait : result) {
- String formId = trait.getName().replaceAll("\\.",
"_").replaceAll(" ", "__");
- FormItem item = getItem(formId);
-
- if (item != null) {
- setValue(formId, trait.getValue());
- }
- }
- markForRedraw();
- }
- }
- );
-
- }
-
- 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);
- }
- }
-
- Collections.sort(traits, new Comparator<MeasurementDefinition>() {
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
-
- List<FormItem> formItems = new ArrayList<FormItem>();
-
- HeaderItem headerItem = new HeaderItem("header", "Summary");
- headerItem.setValue("Summary");
- formItems.add(headerItem);
+ ListGrid errorsGrid = null;
+ if (resource.getResourceErrors() != null &&
resource.getResourceErrors().size() > 0) {
+ errorsGrid = new ListGrid();
- StaticTextItem typeItem = new StaticTextItem("type",
"Type");
- typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
- typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
- formItems.add(typeItem);
+ ListGridField summaryField = new ListGridField("summary",
"Errors");
+ summaryField.addRecordClickHandler(new RecordClickHandler() {
- final Resource resource = this.resourceComposite.getResource();
- boolean modifiable =
this.resourceComposite.getResourcePermission().isInventory();
-
- final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- nameItem.setName("name");
- nameItem.setTitle("Name");
- nameItem.setValue(resource.getName());
- if (nameItem instanceof TogglableTextItem) {
- TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
- togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newName) {
- final String oldName = resource.getName();
- if (newName.equals(oldName)) {
- return;
- }
- resource.setName(newName);
- OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
- + resource.getId()
- + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setName(oldName);
- nameItem.setValue(oldName);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
- + resource.getId() + " was changed
from \""
- + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
- }
- });
+ @Override
+ public void onRecordClick(RecordClickEvent event) {
+ String detail = event.getRecord().getAttribute("detail");
+ SC.say("Error details", detail);
}
});
- }
- formItems.add(nameItem);
-
- final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- descriptionItem.setName("description");
- descriptionItem.setTitle("Description");
- descriptionItem.setValue(resource.getDescription());
- if (descriptionItem instanceof TogglableTextItem) {
- TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
- togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newDescription) {
- final String oldDescription = resource.getDescription();
- if (newDescription.equals(oldDescription)) {
- return;
- }
- resource.setDescription(newDescription);
- OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
- + resource.getId()
- + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setDescription(oldDescription);
- descriptionItem.setValue(oldDescription);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
- + resource.getId() + " was changed
from \""
- + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(descriptionItem);
- final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- locationItem.setName("location");
- locationItem.setTitle("Location");
- locationItem.setValue(resource.getLocation());
- if (locationItem instanceof TogglableTextItem) {
- TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem;
- togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newLocation) {
- final String oldLocation = resource.getLocation();
- if (newLocation.equals(oldLocation)) {
- return;
- }
- resource.setLocation(newLocation);
- OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
- + resource.getId()
- + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setLocation(oldLocation);
- locationItem.setValue(oldLocation);
- }
+ errorsGrid.setFields(summaryField);
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
- + resource.getId() + " was changed
from \""
- + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(locationItem);
-
-
- StaticTextItem versionItem = new StaticTextItem("version",
"Version");
- formItems.add(versionItem);
-
- StaticTextItem parentItem = new StaticTextItem("parent",
"Parent");
- formItems.add(parentItem);
-
- for (MeasurementDefinition trait : traits) {
- String id = trait.getDisplayName().replaceAll("\\.",
"_").replaceAll(" ", "__");
+ List<ListGridRecord> errorList = new
ArrayList<ListGridRecord>();
+ for (ResourceError error : resource.getResourceErrors()) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute("summary", error.getSummary());
+ record.setAttribute("detail", error.getDetail());
+ errorList.add(record);
+ }
- StaticTextItem item = new StaticTextItem(id, trait.getDisplayName());
- item.setTooltip(trait.getDescription());
- formItems.add(item);
-// item.setValue("?");
+ errorsGrid.setRecords(errorList.toArray(new
ListGridRecord[errorList.size()]));
}
-// SectionItem section = new SectionItem("Summary",
"Summary");
-// section.setTitle("Summary");
-// section.setDefaultValue("Summary");
-// section.setCanCollapse(true);
-// section.setCellStyle("HidablePlainSectionHeader");
-// section.setItemIds(itemIds.toArray(new String[itemIds.size()]));
-// formItems.add(0, section);
-
- formItems.add(new SpacerItem());
- setItems(formItems.toArray(new FormItem[formItems.size()]));
-
- setValue("type", type.getName() + " (" + type.getPlugin() +
")");
- setValue("name", resource.getName());
- setValue("description", resource.getDescription());
- setValue("location", resource.getLocation());
- setValue("version", (resource.getVersion() != null) ?
resource.getVersion() : "<i>none</i>");
- Resource parentResource = resource.getParentResource();
- setValue("parent", parentResource != null ?
- ("<a href=\"#Resource/" + parentResource.getId() +
"\">" +
- parentResource.getName() + "</a>") :
"<i>none</i>");
+ return errorsGrid;
}
}
commit d266142e299215832de65b40be45e40862f56128
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Aug 20 15:14:04 2010 +0200
adding a test plugin that fails the upgrade so that we can add the tests for handling
that scenario
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 4b4524a..a4ca249 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -177,6 +177,12 @@
<jar
destfile="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/resource-upgrade-test-plugin-2.0.0.jar">
<fileset
dir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/v2"
includes="*.class,**/rhq-plugin.xml" />
</jar>
+ <copy
toDir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/failing/META-INF">
+ <fileset
file="${project.build.testSourceDirectory}/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml"
/>
+ </copy>
+ <jar
destfile="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/resource-upgrade-test-plugin-3.0.0.jar">
+ <fileset
dir="${project.build.testOutputDirectory}/org/rhq/core/pc/upgrade/plugins/failing"
includes="*.class,**/rhq-plugin.xml" />
+ </jar>
</tasks>
</configuration>
<goals>
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/DiscComponent.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/DiscComponent.java
new file mode 100644
index 0000000..54153e6
--- /dev/null
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/DiscComponent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.core.pc.upgrade.plugins.failing;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.rhq.core.domain.resource.ResourceUpgradeReport;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.core.pluginapi.upgrade.ResourceUpgradeContext;
+import org.rhq.core.pluginapi.upgrade.ResourceUpgradeFacet;
+
+/**
+ *
+ * @author Lukas Krejci
+ */
+public class DiscComponent implements
ResourceDiscoveryComponent<ResourceComponent>,
+ ResourceUpgradeFacet<ResourceComponent> {
+
+ private static final String RESOURCE_KEY = "resource-key-failing";
+ private static final String RESOURCE_NAME = "resource-name-failing";
+ private static final String RESOURCE_DESCRIPTION =
"resource-description-failing";
+
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext<ResourceComponent> context)
+ throws InvalidPluginConfigurationException, Exception {
+ return Collections.singleton(new
DiscoveredResourceDetails(context.getResourceType(), RESOURCE_KEY,
+ RESOURCE_NAME, null, RESOURCE_DESCRIPTION,
context.getDefaultPluginConfiguration(), null));
+ }
+
+ public ResourceUpgradeReport upgrade(ResourceUpgradeContext<ResourceComponent>
inventoriedResource) {
+ throw new RuntimeException("Failing the upgrade purposefully.");
+ }
+}
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/ResComponent.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/ResComponent.java
new file mode 100644
index 0000000..4c33adc
--- /dev/null
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/ResComponent.java
@@ -0,0 +1,46 @@
+/*
+ * 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.core.pc.upgrade.plugins.failing;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+/**
+ *
+ * @author Lukas Krejci
+ */
+public class ResComponent implements ResourceComponent<ResourceComponent> {
+ private static final Log log = LogFactory.getLog(ResComponent.class);
+
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+ public void start(ResourceContext<ResourceComponent> context) throws
InvalidPluginConfigurationException, Exception {
+ log.info("~~~ starting the resource upgrade test failing component with
resource key: " + context.getResourceKey());
+ }
+
+ public void stop() {
+ }
+}
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml
new file mode 100644
index 0000000..9e750d1
--- /dev/null
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/plugins/failing/rhq-plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="ResourceUpgradeTest"
+ displayName="Resource Upgrade Test"
+ description="Resource Upgrade Test"
+ package="org.rhq.core.pc.upgrade.plugins.failing"
+ version="3.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <server name="Resource"
+ discovery="DiscComponent"
+ class="ResComponent"
+ singleton="true" />
+
+</plugin>
+
commit 51dd587b1ea111526c7ab426f0198cf3b71a04dc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 15:10:09 2010 +0200
Implement linking of resource types to parents (at least a start).
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
index 58603ea..a289960 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
@@ -57,6 +57,7 @@ public class AvailabilityInsertPurgeTest extends
AbstractEJB3PerformanceTest {
private Map<Integer,Integer> pluginsTranslationTable = new
HashMap<Integer,Integer>();
private Map<Integer,Integer> resourceTypeTranslationTable = new
HashMap<Integer,Integer>();
+ private Map<Integer,Integer> childParentTypeMap = new HashMap<Integer,
Integer>();
public void testOne() throws Exception {
setup();
@@ -166,9 +167,9 @@ public class AvailabilityInsertPurgeTest extends
AbstractEJB3PerformanceTest {
}
private void setupResourceTypes() {
- // TODO first pull in the parentResourceTypes.csv file to get a mapping for
them.
- String descriptorFile = "perftest/resourceTypes.csv";
+ // first pull in the parentResourceTypes.csv file to get a mapping for them.
+ String descriptorFile = "perftest/parentResourceTypes.csv";
URL descriptorUrl =
this.getClass().getClassLoader().getResource(descriptorFile);
FileReader fr = null;
try {
@@ -180,6 +181,39 @@ public class AvailabilityInsertPurgeTest extends
AbstractEJB3PerformanceTest {
}
try {
CSVReader reader = new CSVReader(fr,',','"',1);
+ List<String[]> lines = reader.readAll();
+ System.out.println("# of lines: " + lines.size());
+ for (String[] line: lines) {
+ Integer typeId = Integer.parseInt(line[0]);
+ Integer parentTypeId = Integer.parseInt(line[1]);
+ childParentTypeMap.put(typeId,parentTypeId);
+ }
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ finally {
+ try {
+ fr.close();
+ } catch (IOException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ }
+ }
+
+ // now the ResourceTypes themselves
+
+ descriptorFile = "perftest/resourceTypes.csv";
+ descriptorUrl = this.getClass().getClassLoader().getResource(descriptorFile);
+ fr = null;
+ try {
+ String fileName = descriptorUrl.getFile();
+ fr = new FileReader(fileName);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ return;
+ }
+ try {
+ CSVReader reader = new CSVReader(fr,',','"',1);
List<String[]> lines = reader.readAll();
System.out.println("# of lines: " + lines.size());
@@ -188,7 +222,7 @@ public class AvailabilityInsertPurgeTest extends
AbstractEJB3PerformanceTest {
continue; // comment
int originalId = Integer.parseInt(line[0]);
- ResourceType parentType = null; // TODO get from parent-child table
+ ResourceType parentType = findResourceType(originalId);
ResourceCategory category = ResourceCategory.valueOf(line[2]);
ResourceType rt = new ResourceType(line[1],line[3],category,parentType);
getEntityManager().persist(rt);
@@ -209,4 +243,14 @@ public class AvailabilityInsertPurgeTest extends
AbstractEJB3PerformanceTest {
}
}
+
+ private ResourceType findResourceType(int originalId) {
+
+ if (childParentTypeMap.containsKey(originalId)) {
+ int id = childParentTypeMap.get(originalId);
+ int translatedId = resourceTypeTranslationTable.get(id);
+ ResourceType parentType =
getEntityManager().find(ResourceType.class,translatedId);
+ }
+ return null;
+ }
}
commit 6a4c52d2c965cb68fbcb40b9ccfe5256cccd2c01
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 14:38:25 2010 +0200
Prototypical work for the PerfTests
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
new file mode 100644
index 0000000..58603ea
--- /dev/null
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/performance/test/AvailabilityInsertPurgeTest.java
@@ -0,0 +1,212 @@
+/*
+ * 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.server.performance.test;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import au.com.bytecode.opencsv.CSVReader;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.plugin.Plugin;
+import org.rhq.core.domain.resource.Agent;
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.enterprise.server.test.AbstractEJB3PerformanceTest;
+
+import org.testng.annotations.Test;
+
+/**
+ * Performance test the availabilities subsystem
+ *
+ * @author Heiko W. Rupp
+ */
+@Test(groups = "PERF")
+public class AvailabilityInsertPurgeTest extends AbstractEJB3PerformanceTest {
+
+ private final Log log = LogFactory.getLog(AvailabilityInsertPurgeTest.class);
+
+ /*
+ * we need to replace the ids in the csv files with the ids that we get back from
the
+ * databse in relations. So store them as pair <csv-id,new entity-id>
+ */
+ private Map<Integer,Integer> agentsTranslationTable = new
HashMap<Integer,Integer>();
+ private Map<Integer,Integer> pluginsTranslationTable = new
HashMap<Integer,Integer>();
+ private Map<Integer,Integer> resourceTypeTranslationTable = new
HashMap<Integer,Integer>();
+
+
+ public void testOne() throws Exception {
+ setup();
+ startTiming();
+
+ Thread.sleep(1234);
+
+ endTiming();
+
+ commitTimings();
+
+ }
+
+ private void setup() {
+ setupAgents();
+ setupPlugins();
+ setupResourceTypes();
+ // TODO set up resources
+
+ }
+
+ private void setupAgents() {
+ String descriptorFile = "perftest/agents.csv";
+ URL descriptorUrl =
this.getClass().getClassLoader().getResource(descriptorFile);
+ FileReader fr = null;
+ try {
+ String fileName = descriptorUrl.getFile();
+ fr = new FileReader(fileName);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ return;
+ }
+ try {
+ CSVReader reader = new CSVReader(fr,',','"',1); // Skip
1st line, use " as quote char and , as separator
+
+ List<String[]> lines = reader.readAll();
+ System.out.println("# of lines: " + lines.size());
+ for (String[] line : lines) {
+ if (line[0].startsWith("#"))
+ continue; // comment
+
+ int originalId = Integer.parseInt(line[0]);
+ Agent agent = new
Agent(line[1],line[2],Integer.parseInt(line[3]),line[5],line[4]);// TODO more
information?
+ getEntityManager().persist(agent);
+ int id = agent.getId();
+
+ agentsTranslationTable.put(originalId,id);
+
+
+ }
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ finally {
+ try {
+ fr.close();
+ } catch (IOException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ }
+ }
+
+ }
+
+ private void setupPlugins() {
+ String descriptorFile = "perftest/plugins.csv";
+ URL descriptorUrl =
this.getClass().getClassLoader().getResource(descriptorFile);
+ FileReader fr = null;
+ try {
+ String fileName = descriptorUrl.getFile();
+ fr = new FileReader(fileName);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ return;
+ }
+ try {
+ CSVReader reader = new CSVReader(fr,',','"',1);
+
+ List<String[]> lines = reader.readAll();
+ System.out.println("# of lines: " + lines.size());
+ for (String[] line : lines) {
+ if (line[0].startsWith("#"))
+ continue; // comment
+
+ int originalId = Integer.parseInt(line[0]);
+ Plugin plugin = new Plugin(line[1],line[5],line[6]);
+ plugin.setDisplayName(line[2]);
+ plugin.setVersion(line[3]);
+ plugin.setAmpsVersion(line[4]);
+ getEntityManager().persist(plugin);
+
+ int id = plugin.getId();
+ pluginsTranslationTable.put(originalId,id);
+ }
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ finally {
+ try {
+ fr.close();
+ } catch (IOException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ }
+ }
+
+ }
+ private void setupResourceTypes() {
+
+ // TODO first pull in the parentResourceTypes.csv file to get a mapping for
them.
+
+ String descriptorFile = "perftest/resourceTypes.csv";
+ URL descriptorUrl =
this.getClass().getClassLoader().getResource(descriptorFile);
+ FileReader fr = null;
+ try {
+ String fileName = descriptorUrl.getFile();
+ fr = new FileReader(fileName);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ return;
+ }
+ try {
+ CSVReader reader = new CSVReader(fr,',','"',1);
+
+ List<String[]> lines = reader.readAll();
+ System.out.println("# of lines: " + lines.size());
+ for (String[] line : lines) {
+ if (line[0].startsWith("#"))
+ continue; // comment
+
+ int originalId = Integer.parseInt(line[0]);
+ ResourceType parentType = null; // TODO get from parent-child table
+ ResourceCategory category = ResourceCategory.valueOf(line[2]);
+ ResourceType rt = new ResourceType(line[1],line[3],category,parentType);
+ getEntityManager().persist(rt);
+
+ int id = rt.getId();
+ resourceTypeTranslationTable.put(originalId,id);
+ }
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ finally {
+ try {
+ fr.close();
+ } catch (IOException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ }
+ }
+
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3PerformanceTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3PerformanceTest.java
new file mode 100644
index 0000000..05b3495
--- /dev/null
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3PerformanceTest.java
@@ -0,0 +1,101 @@
+/*
+ * 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.server.test;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Helper that introduces timing functionality on top of the Abstract EJB tests.
+ *
+ * @author Heiko W. Rupp
+ */
+public class AbstractEJB3PerformanceTest extends AbstractEJB3Test {
+
+ private static final Log log = LogFactory.getLog("TIMING_INFO");
+
+
+ private static final String DEFAULT = "-default-";
+ private Map<String,Long> timings = new HashMap<String, Long>();
+ private Map<String,Long> startTime = new HashMap<String, Long>();
+
+
+ protected void startTiming(String name) {
+ long now = System.currentTimeMillis();
+ startTime.put(name,now);
+
+ }
+
+ protected void endTiming(String name) {
+
+ boolean found = startTime.containsKey(name);
+ assert found : "No start time information for name [" + name + "]
found - did you call startTiming()?";
+
+
+ long now = System.currentTimeMillis();
+ long start = startTime.get(name);
+ long duration = (now - start);
+ if (timings.containsKey(name)) {
+ long timing = timings.get(name);
+ timing+=duration;
+ timings.put(name,timing);
+ }
+ else {
+ timings.put(name,duration);
+ }
+ }
+
+ protected void startTiming() {
+ startTiming(DEFAULT);
+ }
+
+ protected void endTiming() {
+ endTiming(DEFAULT);
+ }
+
+
+ protected void commitTimings() {
+
+ Set<Map.Entry<String,Long>> data = timings.entrySet();
+ for (Map.Entry<String,Long> item : data) {
+ log.info(":| " + item.getKey() + " => " +
item.getValue());
+ }
+ timings.clear();
+ startTime.clear();
+ }
+
+ protected void assertTiming(String name, long maxDuration) {
+
+ boolean found = timings.containsKey(name);
+ assert found : "No timing information for name [" + name + "]
found";
+
+ long duration = timings.get(name);
+
+ assert duration < maxDuration : "Execution took longer than given max (
" + duration + " > " + maxDuration + ")";
+
+ }
+
+ protected void assertTiming(long maxDuration) {
+ assertTiming(DEFAULT,maxDuration);
+ }
+}
commit 74d0107cf4038dc3e307a384f25efd54bea22b93
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 14:37:57 2010 +0200
Create dir if not there.
diff --git a/modules/helpers/perftest-data-gen/install_files.sh
b/modules/helpers/perftest-data-gen/install_files.sh
index 0a33154..3513612 100644
--- a/modules/helpers/perftest-data-gen/install_files.sh
+++ b/modules/helpers/perftest-data-gen/install_files.sh
@@ -4,4 +4,8 @@ set -x
pwd
-cp target/*.csv ../../enterprise/server/jar/src/test/resources/perftest/
\ No newline at end of file
+if [ ! -d ../../enterprise/server/jar/src/test/resources/perftest/ ]
+then
+ mkdir -p ../../enterprise/server/jar/src/test/resources/perftest/
+fi
+cp target/*.csv ../../enterprise/server/jar/src/test/resources/perftest/
commit 5ecc0338f2129d34de47c80f670ac1478efe92f5
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 14:23:41 2010 +0200
Add table and OrderBy column
diff --git a/modules/helpers/perftest-data-gen/pom.xml
b/modules/helpers/perftest-data-gen/pom.xml
index dceeb22..b9dafce 100644
--- a/modules/helpers/perftest-data-gen/pom.xml
+++ b/modules/helpers/perftest-data-gen/pom.xml
@@ -40,5 +40,4 @@
</dependency>
</dependencies>
-
</project>
\ No newline at end of file
diff --git
a/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
index 4e0857e..f51973f 100644
---
a/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
+++
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
@@ -42,11 +42,13 @@ public class DataGen {
private static final String DOTCSV = ".csv";
private static final String[][] props = {//
-
{"agents","RHQ_Agent","id,name,address,port,agenttoken,remote_endpoint"},
-
{"plugins","RHQ_Plugin","id,name,display_name,version,amps_version"},
-
{"resourceTypes","RHQ_resource_type","id,name,category,plugin"},
// TODO parent / child types?
-
{"resources","RHQ_resource","id,uuid,resource_key,name,resource_type_id,parent_resource_id"}
// TODO child resources?
- };
+ // filename , table , columns , oderby column
+
{"agents","RHQ_Agent","id,name,address,port,agenttoken,remote_endpoint","id"},
+
{"plugins","RHQ_Plugin","id,name,display_name,version,amps_version,path,md5","id"},
+
{"resourceTypes","RHQ_resource_type","id,name,category,plugin","id"},
+
{"parentResourceTypes","RHQ_RESOURCE_TYPE_PARENTS","resource_type_id,parent_resource_type_id",null},
+
{"resources","RHQ_resource","id,uuid,resource_key,name,resource_type_id,parent_resource_id","id"}
// TODO child resources?
+ };
public static void main(String[] args) {
@@ -83,12 +85,17 @@ public class DataGen {
String fileName = prop[0];
String tableName = prop[1];
String columns = prop[2];
+ String orderBy = prop[3];
+
File agents = new File(TARGET + fileName + DOTCSV);
System.out.println("Writing file: " + agents.getAbsolutePath());
CSVWriter writer = new CSVWriter(new FileWriter(agents));
Statement stm = conn.createStatement();
- String query = "SELECT " + columns + " FROM " + tableName;
+ String query = "SELECT " + columns + " FROM " + tableName ;
+ if (orderBy!=null) {
+ query += " ORDER BY " + orderBy + " ASC";
+ }
System.out.println(" using query: [" + query + "]");
System.out.flush();
ResultSet rs = stm.executeQuery(query);
commit fce93b5bcb146d746b35f786bebc0b35ab9bc7a2
Merge: 660a61e... 462e15f...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 12:58:23 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 660a61e8f9e2796b69e39922406353bf227bd448
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 20 12:57:56 2010 +0200
Be less loud on exceptions when talking to MySQL.
diff --git
a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
index f50fbc0..4f1045e 100644
---
a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
+++
b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
@@ -62,7 +62,10 @@ public class MySqlDiscoveryComponent implements
ResourceDiscoveryComponent, Manu
ProcessInfo procInfo = result.getProcessInfo();
-
servers.add(createResourceDetails(context,context.getDefaultPluginConfiguration(),procInfo));
+ DiscoveredResourceDetails resourceDetails = createResourceDetails(context,
context.getDefaultPluginConfiguration(), procInfo);
+ if (resourceDetails!=null) {
+ servers.add(resourceDetails);
+ }
}
return servers;
@@ -78,14 +81,22 @@ public class MySqlDiscoveryComponent implements
ResourceDiscoveryComponent, Manu
}
protected static DiscoveredResourceDetails
createResourceDetails(ResourceDiscoveryContext discoveryContext,
- Configuration pluginConfiguration,
- ProcessInfo processInfo) {
+ Configuration pluginConfiguration, ProcessInfo processInfo) {
+
String key = buildUrl(pluginConfiguration);
String db =
pluginConfiguration.getSimple(DB_CONFIGURATION_PROPERTY).getStringValue();
String name = "MySql [" + db + "]";
- String version = getVersion(pluginConfiguration);
- return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, version,
- DEFAULT_RESOURCE_DESCRIPTION, pluginConfiguration, processInfo);
+ try {
+ String version = getVersion(pluginConfiguration);
+ return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, version,
+ DEFAULT_RESOURCE_DESCRIPTION, pluginConfiguration, processInfo);
+ } catch (Exception e) {
+ log.warn("Getting details failed: " + e.getMessage());
+ if (e.getCause()!=null) {
+ log.warn(" caused by: " + e.getCause().getMessage());
+ }
+ }
+ return null;
}
protected static String buildUrl(Configuration config) {
@@ -104,7 +115,7 @@ public class MySqlDiscoveryComponent implements
ResourceDiscoveryComponent, Manu
version = conn.getMetaData().getDatabaseProductVersion();
} catch (SQLException e) {
// TODO GH: How to put this back to the server while inventorying this
resource in an unconfigured state
- log.info("Exception detecting mysql instance version", e);
+ log.info("Exception detecting mysql instance version" +
e.getMessage());
}
return version;
}
commit 6dde2f7be37f23a5e8a9b25ccf66e99541fd3bc7
Merge: d58520e... 462e15f...
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Aug 20 12:50:39 2010 +0200
Merge branch 'master' into resource-upgrade
commit d58520e4a31ab38e03151e827488776d4dcca93f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Aug 20 12:46:29 2010 +0200
Added agent and server side support for upgrade error reporting.
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
index f055e8c..9532920 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/upgrade/ResourceUpgradeRequest.java
@@ -23,6 +23,9 @@
package org.rhq.core.clientapi.agent.upgrade;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
import org.rhq.core.domain.resource.ResourceUpgradeReport;
/**
@@ -34,44 +37,95 @@ public class ResourceUpgradeRequest extends ResourceUpgradeReport {
private static final long serialVersionUID = 1L;
- private int resourceId;
+ private final int resourceId;
+ private String upgradeErrorMessage;
+ private String upgradeErrorStackTrace;
+ private long timestamp;
- public ResourceUpgradeRequest() {
-
+ public ResourceUpgradeRequest(int resourceId) {
+ this.resourceId = resourceId;
}
public ResourceUpgradeRequest(int resourceId, ResourceUpgradeReport report) {
- setResourceId(resourceId);
- setNewDescription(report.getNewDescription());
- setNewName(report.getNewName());
- setNewResourceKey(report.getNewResourceKey());
+ this.resourceId = resourceId;
+ fillInFromReport(report);
}
-
+
public int getResourceId() {
return resourceId;
}
- public void setResourceId(int resourceId) {
- this.resourceId = resourceId;
+ public String getUpgradeErrorMessage() {
+ return upgradeErrorMessage;
+ }
+
+ public void setUpgradeErrorMessage(String upgradeErrorMessage) {
+ this.upgradeErrorMessage = upgradeErrorMessage;
+ }
+
+ public String getUpgradeErrorStackTrace() {
+ return upgradeErrorStackTrace;
+ }
+
+ public void setUpgradeErrorStackTrace(String upgradeErrorStackTrace) {
+ this.upgradeErrorStackTrace = upgradeErrorStackTrace;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
}
+ public void setTimestamp(long timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public void setErrorProperties(Throwable t) {
+ upgradeErrorMessage = t.getMessage();
+
+ StringWriter string = new StringWriter();
+ PrintWriter w = new PrintWriter(string);
+ t.printStackTrace(w);
+ w.close();
+
+ upgradeErrorStackTrace = string.toString();
+ }
+
+ public void fillInFromReport(ResourceUpgradeReport report) {
+ setNewDescription(report.getNewDescription());
+ setNewName(report.getNewName());
+ setNewResourceKey(report.getNewResourceKey());
+ }
+
+ @Override
+ public boolean hasSomethingToUpgrade() {
+ return super.hasSomethingToUpgrade() || upgradeErrorMessage != null ||
upgradeErrorStackTrace != null;
+ }
+
@Override
public int hashCode() {
return 31 * resourceId;
}
-
+
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
-
+
if (!(other instanceof ResourceUpgradeRequest)) {
return false;
}
-
+
ResourceUpgradeRequest r = (ResourceUpgradeRequest) other;
-
+
return r.getResourceId() == resourceId;
}
+
+ @Override
+ public String toString() {
+ return "ResourceUpgradeRequest[resourceId = '" + resourceId +
"', newResourceKey = '" + getNewResourceKey()
+ + "', newName = '" + getNewName() + "',
newDescription = '" + getNewDescription()
+ + "', upgradeErrorMessage = '" + upgradeErrorMessage +
"', upgradeErrorStackTrace = '"
+ + upgradeErrorStackTrace + "']";
+ }
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java
index 1435cc3..8fcedb7 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java
@@ -36,5 +36,10 @@ public enum ResourceErrorType {
/**
* An exception was thrown by the Resource component's getAvailablity() method
the last time it was called.
*/
- AVAILABILITY_CHECK
+ AVAILABILITY_CHECK,
+
+ /**
+ * There was an attempt to upgrade the resource on the agent but it failed.
+ */
+ UPGRADE
}
\ No newline at end of file
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 728b2e3..3af9b84 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -1202,14 +1202,14 @@ public class InventoryManager extends AgentService implements
ContainerService,
return resourceContainer.updateAvailability(availabilityType);
}
- public void mergeResourceFromUpgrade(Set<ResourceUpgradeRequest>
upgradeReports) {
+ public void mergeResourceFromUpgrade(Set<ResourceUpgradeRequest>
upgradeRequests) {
Set<ResourceUpgradeResponse> serverUpdates = null;
try {
ServerServices serverServices = this.configuration.getServerServices();
if (serverServices != null) {
DiscoveryServerService discoveryServerService =
serverServices.getDiscoveryServerService();
- serverUpdates = discoveryServerService.upgradeResources(upgradeReports);
+ serverUpdates =
discoveryServerService.upgradeResources(upgradeRequests);
}
} catch (Exception e) {
log.error("Failed to process resource upgrades on the server.",
e);
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
index 5b33fe1..025ba3a 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java
@@ -82,12 +82,10 @@ public class ResourceUpgradeDelegate {
* @return true if the resource was queued for upgrade, false otherwise
* @throws PluginContainerException on error
*/
- public boolean processAndQueue(ResourceContainer resourceContainer) throws
PluginContainerException {
+ public void processAndQueue(ResourceContainer resourceContainer) throws
PluginContainerException {
if (enabled) {
- return executeResourceUpgradeFacetAndStoreRequest(resourceContainer);
+ executeResourceUpgradeFacetAndStoreRequest(resourceContainer);
}
-
- return false;
}
public void sendRequests() {
@@ -100,7 +98,7 @@ public class ResourceUpgradeDelegate {
}
@SuppressWarnings("unchecked")
- private <T extends ResourceComponent> boolean
executeResourceUpgradeFacetAndStoreRequest(
+ private <T extends ResourceComponent> void
executeResourceUpgradeFacetAndStoreRequest(
ResourceContainer resourceContainer) throws PluginContainerException {
ResourceComponent<T> parentResourceComponent =
resourceContainer.getResourceContext()
@@ -118,36 +116,47 @@ public class ResourceUpgradeDelegate {
if (!(discoveryComponent instanceof ResourceUpgradeFacet)) {
//well, there's no point in continuing if the resource doesn't
support the facet
- return false;
+ return;
}
ResourceUpgradeContext<ResourceComponent<T>> upgradeContext =
inventoryManager.createResourceUpgradeContext(
resource, parentResourceComponent, discoveryComponent);
- ResourceUpgradeReport upgradeReport;
+ ResourceUpgradeRequest request = new ResourceUpgradeRequest(resource.getId());
+
+ request.setTimestamp(System.currentTimeMillis());
+
+ ResourceUpgradeReport upgradeReport = null;
try {
upgradeReport =
inventoryManager.invokeDiscoveryComponentResourceUpgradeFacet(resource.getResourceType(),
discoveryComponent, upgradeContext);
} catch (Throwable t) {
log.error("ResourceUpgradeFacet threw an exception while upgrading
resource [" + resource + "]", t);
- return false;
+ request.setErrorProperties(t);
}
- if (upgradeReport == null || !upgradeReport.hasSomethingToUpgrade()) {
- return false;
- }
+ if (upgradeReport != null && upgradeReport.hasSomethingToUpgrade()) {
+ String upgradeErrors = null;
+ if ((upgradeErrors = checkUpgradeValid(resource, upgradeReport)) != null) {
+ String errorString = "Upgrading the resource [" + resource +
"] using these updates [" + upgradeReport
+ + "] would render the inventory invalid because of the following
reasons: " + upgradeErrors;
+
+ log.error(errorString);
+
+ IllegalStateException ex = new IllegalStateException(errorString);
+ ex.fillInStackTrace();
+
+ request.setErrorProperties(ex);
+ } else {
+ request.fillInFromReport(upgradeReport);
+ }
- String upgradeErrors = null;
- if ((upgradeErrors = checkUpgradeValid(resource, upgradeReport)) != null) {
- log.error("Upgrading the resource [" + resource + "] using
these updates [" + upgradeReport
- + "] would render the inventory invalid because of the following
reasons: " + upgradeErrors);
- return false;
}
//everything went ok, let's queue a upgrade request that will be sent to the
server
- requests.add(new ResourceUpgradeRequest(resource.getId(), upgradeReport));
-
- return true;
+ if (request.hasSomethingToUpgrade()) {
+ requests.add(request);
+ }
}
private String checkUpgradeValid(Resource resource, ResourceUpgradeReport
upgradeReport) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index 304cbad..b773384 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -58,6 +58,8 @@ import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.ProductVersion;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceError;
+import org.rhq.core.domain.resource.ResourceErrorType;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
import org.rhq.core.domain.util.PageControl;
@@ -422,7 +424,9 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
Resource existingResource = this.entityManager.find(Resource.class,
request.getResourceId());
if (existingResource != null) {
ResourceUpgradeResponse upgradedData = upgradeResource(existingResource,
request, allowGenericPropertiesUpgrade);
- result.add(upgradedData);
+ if (upgradedData != null) {
+ result.add(upgradedData);
+ }
}
}
return result;
@@ -475,18 +479,24 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
/**
* @param existingResource
- * @param upgradeReport
+ * @param upgradeRequest
* @param allowGenericPropertiesUpgrade name and description are only upgraded if
this is true
* @return true if the resource was changed, false otherwise
*/
- private ResourceUpgradeResponse upgradeResource(@NotNull Resource resource,
ResourceUpgradeReport upgradeReport, boolean allowGenericPropertiesUpgrade) {
+ private ResourceUpgradeResponse upgradeResource(@NotNull Resource resource,
ResourceUpgradeRequest upgradeRequest, boolean allowGenericPropertiesUpgrade) {
+ if (upgradeRequest.getUpgradeErrorMessage() != null) {
+ ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
upgradeRequest.getUpgradeErrorMessage(), upgradeRequest.getUpgradeErrorStackTrace(),
upgradeRequest.getTimestamp());
+ entityManager.persist(error);
+ return null;
+ }
+
ResourceUpgradeResponse ret = new ResourceUpgradeResponse();
ret.setResourceId(resource.getId());
- String resourceKey = upgradeReport.getNewResourceKey();
- String name = upgradeReport.getNewName();
+ String resourceKey = upgradeRequest.getNewResourceKey();
+ String name = upgradeRequest.getNewName();
// String version = upgradeReport.getNewVersion();
- String description = upgradeReport.getNewDescription();
+ String description = upgradeRequest.getNewDescription();
// Configuration pluginConfiguration =
upgradeReport.getNewPluginConfiguration();
// Configuration resourceConfiguration =
upgradeReport.getNewResourceConfiguration();
commit 3f7dceb114149a0cbfb45229032f99b5cb402dbb
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Aug 19 16:53:14 2010 -0400
Adding an exec method to generated criteria to fetch query results and iterate over
them
An exec method is dynamically added to the generated criteria. It invokes the
corresponding
manager SLSB and iterates over the results passing each returned entity into the
closure that
is passed to exec. Here is an example to illustrate:
criteria(Resource) {
filter = [resourceType: 'JBossAS Server']
fetch {
resourceType
pluginConfigurationUpdates
}
sort { currentAvailability.desc }
}.exec(subject) { resource ->
// do stuff with each resource object returned
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index 56da79c..7dcc19b 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -2,6 +2,8 @@ package org.rhq.enterprise.server.plugins.groovy
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory
+import org.rhq.core.domain.auth.Subject
+import org.rhq.enterprise.server.util.LookupUtil
class CriteriaGenerator {
@@ -39,6 +41,15 @@ class CriteriaGenerator {
criteria.caseSensitive = spec.caseSensitive
criteria.strict = spec.strict
+ def mgr = LookupUtil."get${spec.criteriaType.simpleName}Manager"()
+
+ criteria.metaClass {
+ exec { Subject subject, Closure closure ->
+ def results =
mgr."find${spec.criteriaType.simpleName}sByCriteria"(subject, criteria)
+ results.each { closure(it) }
+ }
+ }
+
return criteria
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 67b8527..5245756 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -9,6 +9,7 @@ import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
import org.rhq.core.domain.resource.Resource
import org.rhq.core.domain.resource.ResourceType
+import org.rhq.enterprise.server.plugin.pc.ScheduledJobInvocationContext
class ScriptRunner implements ServerPluginComponent, ControlFacet {
@@ -58,5 +59,7 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
return results;
}
+ void executeScript(ScheduledJobInvocationContext context) {
+ }
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
index 31d21a5..86a2e3a 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -31,6 +31,31 @@
<serverplugin:results>
<c:simple-property name="results"/>
</serverplugin:results>
- </serverplugin:control>
+ </serverplugin:control>
</serverplugin:plugin-component>
+
+ <!--<serverplugin:scheduled-jobs>-->
+ <!--<c:list-property name="jobs">-->
+ <!--<c:map-property name="executeScript">-->
+ <!--<c:simple-property name="enabled"
type="boolean" required="true" default="false"
summary="true"/>-->
+ <!--<c:simple-property name="scheduleType"
type="string" required="true" default="cron"
summary="true">-->
+ <!--<c:property-options>-->
+ <!--<c:option value="periodic"/>-->
+ <!--<c:option value="cron"
default="true"/>-->
+ <!--</c:property-options>-->
+ <!--</c:simple-property>-->
+ <!--<c:simple-property name="scheduleTrigger"
type="string" required="true" default="0 0/30 * * * ?"
summary="true"/>-->
+ <!--<c:simple-property name="concurrent"
type="boolean" required="true" default="false"
summary="false" readOnly="true"/>-->
+ <!--<c:simple-property name="clustered"
type="boolean" required="true" default="false"
summary="false" readOnly="true"/>-->
+ <!--</c:map-property>-->
+ <!--</c:list-property>-->
+ <!--</serverplugin:scheduled-jobs>-->
+
+ <serverplugin:plugin-configuration>
+ <c:group name="cobblerServerConnection">
+ <c:simple-property name="url" type="string"
required="true" default="http://127.0.0.1:80" description="The
URL where the Cobbler server is found" />
+ <c:simple-property name="username" type="string"
required="true" default="testing" description="The username that
this plugin will use when logging into the Cobbler server" />
+ <c:simple-property name="password" type="password"
required="true" default="testing" description="The password that
this plugin will use when logging into the Cobbler server" />
+ </c:group>
+ </serverplugin:plugin-configuration>
</generic-plugin>
\ No newline at end of file
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index 54243a4..08b5c7b 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -7,15 +7,30 @@ import static org.testng.Assert.*
import org.rhq.core.domain.criteria.TestEntityCriteria
import org.rhq.core.domain.test.TestEntityWithoutCriteria
import org.rhq.core.domain.test.TestEntity
+import org.testng.annotations.BeforeMethod
+import groovy.mock.interceptor.MockFor
+import org.rhq.enterprise.server.util.LookupUtil
class CriteriaGeneratorTest {
+ def mockLookupUtil
+
+ @BeforeMethod
+ void setup() {
+ def fakeMgr = {}
+
+ mockLookupUtil = new MockFor(LookupUtil)
+ mockLookupUtil.demand.getTestEntityManager(0..1) { fakeMgr }
+ }
+
@Test
void theCriteriaTypeShouldMatchTheSpecifiedEntity() {
- def spec = new CriteriaSpec(TestEntity)
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def spec = new CriteriaSpec(TestEntity)
+ def criteria = new CriteriaGenerator().execute(spec)
- assertTrue(criteria instanceof TestEntityCriteria, "Expected an instance of
${TestEntityCriteria.name}")
+ assertTrue(criteria instanceof TestEntityCriteria, "Expected an instance of
${TestEntityCriteria.name}")
+ }
}
@Test(expectedExceptions = [CriteriaGeneratorException])
@@ -35,10 +50,12 @@ class CriteriaGeneratorTest {
name: expectedName
]
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def criteria = new CriteriaGenerator().execute(spec)
- assertEquals(criteria.id, expectedId, 'The <id> filter is wrong')
- assertEquals(criteria.name, expectedName, 'The <name> filter is
wrong')
+ assertEquals(criteria.id, expectedId, 'The <id> filter is wrong')
+ assertEquals(criteria.name, expectedName, 'The <name> filter is
wrong')
+ }
}
@Test
@@ -49,10 +66,12 @@ class CriteriaGeneratorTest {
resourceTypes
}
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def criteria = new CriteriaGenerator().execute(spec)
- assertTrue(criteria.fetchResources, 'Expected fetchResources to be
<true>')
- assertTrue(criteria.fetchResourceTypes, 'Expected fetchResourceTypes to be
<false>')
+ assertTrue(criteria.fetchResources, 'Expected fetchResources to be
<true>')
+ assertTrue(criteria.fetchResourceTypes, 'Expected fetchResourceTypes to be
<false>')
+ }
}
@Test
@@ -63,9 +82,11 @@ class CriteriaGeneratorTest {
id.asc
}
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def criteria = new CriteriaGenerator().execute(spec)
- assertEquals(criteria.orderingFieldNames, ['sortName', 'sortId'])
+ assertEquals(criteria.orderingFieldNames, ['sortName', 'sortId'])
+ }
}
@Test
@@ -73,9 +94,11 @@ class CriteriaGeneratorTest {
def spec = new CriteriaSpec(TestEntity)
spec.caseSensitive = true
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def criteria = new CriteriaGenerator().execute(spec)
- assertTrue(criteria.caseSensitive, "Expected the <caseSensitive> property
to be set to true")
+ assertTrue(criteria.caseSensitive, "Expected the <caseSensitive>
property to be set to true")
+ }
}
@Test
@@ -83,9 +106,11 @@ class CriteriaGeneratorTest {
def spec = new CriteriaSpec(TestEntity)
spec.strict = true
- def criteria = new CriteriaGenerator().execute(spec)
+ mockLookupUtil.use {
+ def criteria = new CriteriaGenerator().execute(spec)
- assertTrue(criteria.strict, "Expected the <strict> property to be set to
true")
+ assertTrue(criteria.strict, "Expected the <strict> property to be set to
true")
+ }
}
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
index 5c03608..a08d833 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
@@ -4,19 +4,54 @@ import org.testng.annotations.Test
import static org.testng.Assert.assertEquals
import static org.testng.Assert.assertTrue
import org.rhq.core.domain.test.TestEntity
+import org.rhq.enterprise.server.util.LookupUtil
+import groovy.mock.interceptor.MockFor
+import org.rhq.enterprise.server.resource.ResourceManagerLocal
+import org.rhq.core.domain.auth.Subject
+import org.rhq.core.domain.criteria.ResourceCriteria
+import org.rhq.core.domain.resource.Resource
class RHQScriptTest {
@Test
void buildCriteriaThatMatchesSpec() {
- def script = new RHQScript()
- def criteria = script.criteria(TestEntity) {
- filters = [id: 1]
- fetch = { resourceTypes }
+ def fakeMgr = {}
+ def lookupUtil = new MockFor(LookupUtil)
+ lookupUtil.demand.getTestEntityManager(1..1) { fakeMgr }
+
+ lookupUtil.use {
+ def script = new RHQScript()
+ def criteria = script.criteria(TestEntity) {
+ filters = [id: 1]
+ fetch { resourceTypes }
+ }
+
+ assertEquals(criteria.id, 1, "The criteria's id property is wrong")
+ assertTrue(criteria.fetchResourceTypes)
}
+ }
+
+ @Test(enabled = false)
+ void addExecMethodToCriteria() {
+ def resourceMgr = new MockFor(ResourceManagerLocal)
+ def mockLookupUtil = new MockFor(LookupUtil)
+
+ mockLookupUtil.demand.getResourceManager(1..1) { resourceMgr }
+ resourceMgr.demand.findResourcesByCriteria { subject, resourceCriteria -> [] }
- assertEquals(criteria.id, 1, "The criteria's id property is wrong")
- assertTrue(criteria.fetchResourceTypes)
+ def criteria
+
+ mockLookupUtil.use {
+ def script = new RHQScript()
+ criteria = script.criteria(Resource) {
+ filters = [id: 1]
+ fetch { resourceType }
+ }
+ }
+
+ resourceMgr.use {
+ criteria.exec(new Subject()) { }
+ }
}
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index deac8ed..c8a00d6 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -45,7 +45,7 @@ class ScriptRunnerTest {
executeScript('access_nonexistent_mgr.groovy')
}
- @Test
+ @Test(enabled = false)
void createCriteriaAccordingToSpec() {
def expectedCriteria = new TestEntityCriteria()
expectedCriteria.id = 1
commit 462e15fcb1978820f9c04619144f810b60b2aed8
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 19 15:08:42 2010 -0400
upgrade EMS from 1.2.15 to 1.2.15.1
diff --git a/pom.xml b/pom.xml
index 6271e7e..fc988a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
- <ems.version>1.2.15</ems.version>
+ <ems.version>1.2.15.1</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
<h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
commit 4c67d86d06cfae297d20ecc2969a302017b3790f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 19 12:47:02 2010 -0400
disable link from group op details page to resource op details
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
index 8c9834e..4f4d485 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
@@ -162,11 +162,14 @@
<h:outputText styleClass="headerText"
value="Name"/>
</f:facet>
+ <ui:remove>
<h:outputLink
value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml">
<f:param name="id"
value="#{resourceHistoryItem.resource.id}"/>
<f:param name="opId"
value="#{resourceHistoryItem.id}"/>
<h:outputText
value="#{resourceHistoryItem.operationDefinition.displayName}"/>
</h:outputLink>
+ </ui:remove>
+ <h:outputText
value="#{resourceHistoryItem.operationDefinition.displayName}"/>
</rich:column>
commit 19c1364252e04afde403a0413e0259a9f68d990e
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Aug 19 15:14:49 2010 +0200
Add John Sanda's blog.
diff --git a/pom.xml b/pom.xml
index 6271e7e..6f27b89 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1206,6 +1206,7 @@
</developer>
<developer>
<name>John Sanda</name>
+ <url>http://johnsanda.blogspot.com</url>
<timezone>-5</timezone>
</developer>
<developer>
commit d45fd8b2b3624846b7b0b27a79e3abde96a2d063
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Aug 19 14:51:33 2010 +0200
Add a script to copy the generated csv files over to the server tests.
diff --git a/modules/helpers/perftest-data-gen/install_files.sh
b/modules/helpers/perftest-data-gen/install_files.sh
new file mode 100644
index 0000000..0a33154
--- /dev/null
+++ b/modules/helpers/perftest-data-gen/install_files.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+pwd
+
+cp target/*.csv ../../enterprise/server/jar/src/test/resources/perftest/
\ No newline at end of file
commit ee41bb1a5c7fc1bb4f61d672f9865c971b4e5724
Merge: d516c7c... fe3c4a4...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Aug 19 10:36:41 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit fe3c4a473cfeaf90f417b9f0af73cc8e7aadb022
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 18 21:55:13 2010 -0400
fix summary>dashboard sub-tab linkage for resources
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
index c29deec..b857b35 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
@@ -46,7 +46,6 @@ public class DashboardView extends FullHTMLPane implements
ResourceSelectListene
@Override
public void onResourceSelected(ResourceComposite resourceComposite) {
this.resourceComposite = resourceComposite;
- setContentsURL("/rhq/resource/summary/summary-plain.xhtml?id="
- + resourceComposite.getResource().getId());
+ setContentsURL("/rhq/resource/summary/overview-plain.xhtml?id=" +
resourceComposite.getResource().getId());
}
}
commit 3c481d48a1ac583cd5b3cfef57e69e0a26b2c054
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 21:49:46 2010 -0400
Turning fetch property in criteria dsl into a method that takes literal property
names
There is no need now to delimit property names in string. The syntax now looks like,
criteria {
filters = [
resourceType: 'JBossAS',
currentAvailabilityType: DOWN
]
fetch {
alertDefinitions
pluginConfigurationUpdates
}
sort {
resourceCategory.asc
resourceTypeName.desc
}
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
index 1485236..2553bbe 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
@@ -28,4 +28,11 @@ class CriteriaSpec {
sortFields.addAll(sortSpec.delegate.sortFields)
}
+ def fetch(Closure fetchSpec) {
+ fetchSpec.resolveStrategy = Closure.DELEGATE_ONLY
+ fetchSpec.delegate = new FetchDelegate()
+ fetchSpec()
+ fetch.addAll(fetchSpec.delegate.propertiesToFetch)
+ }
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/FetchDelegate.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/FetchDelegate.groovy
new file mode 100644
index 0000000..050eea8
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/FetchDelegate.groovy
@@ -0,0 +1,12 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class FetchDelegate {
+
+ List propertiesToFetch = []
+
+ def propertyMissing(String name) {
+ propertiesToFetch << name
+ return this
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index b1cfa66..033c149 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -1,7 +1,5 @@
package org.rhq.enterprise.server.plugins.groovy
-import org.rhq.core.domain.resource.Resource
-import org.rhq.core.domain.resource.ResourceType
import org.rhq.enterprise.server.util.LookupUtil
class RHQScript extends Script {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index 3c9a6e6..54243a4 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -44,7 +44,10 @@ class CriteriaGeneratorTest {
@Test
void setTheFetchFields() {
def spec = new CriteriaSpec(TestEntity)
- spec.fetch = ['resources', 'resourceTypes']
+ spec.fetch {
+ resources
+ resourceTypes
+ }
def criteria = new CriteriaGenerator().execute(spec)
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
index 14c4548..5c03608 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
@@ -12,7 +12,7 @@ class RHQScriptTest {
def script = new RHQScript()
def criteria = script.criteria(TestEntity) {
filters = [id: 1]
- fetch = ['resourceTypes']
+ fetch = { resourceTypes }
}
assertEquals(criteria.id, 1, "The criteria's id property is wrong")
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
index 1583c78..f8ef330 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
@@ -5,7 +5,7 @@ testCriteria = criteria(TestEntity) {
id: 1,
name: 'Test'
]
- fetch = ['resources']
+ fetch { resources }
sort {
id.desc
name.desc
commit 1d42419fa7bb6d73bb38c2d954ec625c808e14e4
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 21:34:45 2010 -0400
Updating ScriptRunnerTest to verify latest criteria functionality
Also refactoring RHQScript so that the entityMap is injected into rather than creating
it
directly. This has a couple benefits. First, it helps with unit tests since we can
inject
fake, test entities during a test run. Secondly, we can create a single, non-static
entityMap in ScriptRunner (the plugin component) and initialize it at plugin
initialization
time.
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index a90701f..b1cfa66 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -6,10 +6,7 @@ import org.rhq.enterprise.server.util.LookupUtil
class RHQScript extends Script {
- static def entityMap = [
- Resource: Resource.class,
- ResourceType: ResourceType.class
- ]
+ Map entityMap = [:]
Object run() {
super.run()
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 19c0576..67b8527 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -7,9 +7,16 @@ import org.rhq.enterprise.server.plugin.pc.ControlFacet
import org.rhq.enterprise.server.plugin.pc.ControlResults
import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
+import org.rhq.core.domain.resource.Resource
+import org.rhq.core.domain.resource.ResourceType
class ScriptRunner implements ServerPluginComponent, ControlFacet {
+ Map entityMap = [
+ Resource: Resource.class,
+ ResourceType: ResourceType.class
+ ]
+
void initialize(ServerPluginContext context) {
}
@@ -38,7 +45,12 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
scriptEngine.config = compilerConfig
- def scriptResult = scriptEngine.run(scriptName, new Binding())
+ def script = (RHQScript) scriptEngine.createScript(scriptName, new Binding())
+ // Not sure why but assigning a value to the entityMap property was failing in unit
tests.
+ // Calling setEntityMap() worked though.
+ //script.entityMap = entityMap
+ script.setEntityMap(entityMap)
+ def scriptResult = script.run()
ControlResults results = new ControlResults()
results.complexResults.put(new PropertySimple("results", scriptResult))
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
index 46947a3..b6b2bcb 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
@@ -54,7 +54,13 @@ class TestEntityCriteria extends Criteria {
}
def String toString() {
- "TestEntityCriteria[id: $id, name: $name, fetchResources: $fetchResources,
fetchResourceTypes: $fetchResourceTypes]"
+ "TestEntityCriteria[id: $id, " +
+ "name: $name, ".toString() +
+ "fetchResources: $fetchResources, " +
+ "fetchResourceTypes: $fetchResourceTypes, " +
+ "caseSensitive: $caseSensitive, " +
+ "strict: $strict, " +
+ "sortFields: $orderingFieldNames]"
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 1b7ba47..deac8ed 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -11,12 +11,17 @@ import org.rhq.enterprise.server.plugin.pc.ControlResults
import org.rhq.core.domain.criteria.TestEntityCriteria
import org.testng.annotations.BeforeClass
import org.rhq.core.domain.test.TestEntity
+import org.rhq.core.domain.util.PageOrdering
+import org.testng.annotations.BeforeMethod
class ScriptRunnerTest {
- @BeforeClass
- void setupClass() {
- RHQScript.entityMap << [TestEntity: TestEntity.class]
+ ScriptRunner scriptRunner
+
+ @BeforeMethod
+ void setup() {
+ scriptRunner = new ScriptRunner()
+ scriptRunner.entityMap << [TestEntity: TestEntity.class]
}
@Test
@@ -45,39 +50,22 @@ class ScriptRunnerTest {
def expectedCriteria = new TestEntityCriteria()
expectedCriteria.id = 1
expectedCriteria.name = 'Test'
+ expectedCriteria.strict = true
+ expectedCriteria.caseSensitive = true
expectedCriteria.fetchResources = true
+ expectedCriteria.addSortId(PageOrdering.DESC)
+ expectedCriteria.addSortName(PageOrdering.DESC)
def result = executeScript('create_criteria.groovy')
-// assertEquals(
-// actualCriteria.id,
-// expectedCriteria.id,
-// 'The filter on the id property was not set correctly'
-// )
-// assertEquals(
-// actualCriteria.name,
-// expectedCriteria.name,
-// 'The filter on the name property was not set correctly'
-// )
-// assertEquals(
-// actualCriteria.fetchResources,
-// expectedCriteria.fetchResources,
-// 'The fetch flag for the resources property was not set correctly'
-// )
-// assertEquals(
-// actualCriteria.fetchResourceTypes,
-// expectedCriteria.fetchResourceTypes,
-// 'The fetch flag for the resourceTypes property was not set correctly'
-// )
assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to generate
criteria correctly')
}
def executeScript(String script) {
- def runner = new ScriptRunner()
def params = new Configuration()
params.put(new PropertySimple('script', getScriptPath(script)))
- return runner.invoke('execute', params)
+ return scriptRunner.invoke('execute', params)
}
String getScriptPath(String scriptName) {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
index 595a7d6..1583c78 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
@@ -6,6 +6,12 @@ testCriteria = criteria(TestEntity) {
name: 'Test'
]
fetch = ['resources']
+ sort {
+ id.desc
+ name.desc
+ }
+ caseSensitive = true
+ strict = true
}
return testCriteria.toString()
\ No newline at end of file
commit 132910516670d8972fbf50d94586e86a667fd638
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Aug 18 20:04:37 2010 -0400
remove superfluous call to ResourceManager.updateResource()
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
index dfab090..aac1143 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
@@ -29,7 +29,6 @@ import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
-import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
public class ConfigurationServerServiceImpl implements ConfigurationServerService {
@@ -66,7 +65,6 @@ public class ConfigurationServerServiceImpl implements
ConfigurationServerServic
public void persistUpdatedResourceConfiguration(int resourceId, Configuration
resourceConfiguration) {
ConfigurationManagerLocal configurationManager =
LookupUtil.getConfigurationManager();
SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();
- ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
Subject overlord = subjectManager.getOverlord();
ResourceConfigurationUpdate update =
configurationManager.persistNewResourceConfigurationUpdateHistory(
@@ -80,11 +78,7 @@ public class ConfigurationServerServiceImpl implements
ConfigurationServerServic
}
}
- Resource resource = update.getResource();
- Configuration configuration = update.getConfiguration().deepCopy(false); // clone
the config, zeroing out ids
-
- resourceManager.updateResource(overlord, resource); // update simple properties,
still need to merge config
- configurationManager.setResourceConfiguration(resource.getId(), configuration);
// now merge latest config
-
+ Configuration configuration = update.getConfiguration().deepCopy(false); //
clone the config, zeroing out ids
+ configurationManager.setResourceConfiguration(resourceId, configuration); // now
set it as the current config on the Resource
}
-}
\ No newline at end of file
+}
commit 95c1cc1064d30d7689d1577011a53678bb29e7f9
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 16:44:58 2010 -0400
Adding support for strict and caseSensitive flags
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index 8e07760..56da79c 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -35,6 +35,9 @@ class CriteriaGenerator {
}
spec.fetch.each { criteria."fetch${capitalize(it)}"(true) }
+ spec.sortFields.each { criteria."addSort${capitalize(it.name)}"(it.order)
}
+ criteria.caseSensitive = spec.caseSensitive
+ criteria.strict = spec.strict
return criteria
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
index 008a090..1485236 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
@@ -1,5 +1,8 @@
package org.rhq.enterprise.server.plugins.groovy
+import static org.rhq.core.domain.util.PageOrdering.ASC
+import static org.rhq.core.domain.util.PageOrdering.ASC
+
class CriteriaSpec {
Class criteriaType
@@ -8,10 +11,21 @@ class CriteriaSpec {
List fetch = []
+ List sortFields = []
+
+ Boolean caseSensitive = false
+
+ Boolean strict = false
+
CriteriaSpec(Class criteriaType) {
this.criteriaType = criteriaType
}
- //def propertyMissing
+ def sort(Closure sortSpec) {
+ sortSpec.resolveStrategy = Closure.DELEGATE_ONLY
+ sortSpec.delegate = new SortDelegate()
+ sortSpec()
+ sortFields.addAll(sortSpec.delegate.sortFields)
+ }
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
index 9b27562..19c0576 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -1,12 +1,12 @@
package org.rhq.enterprise.server.plugins.groovy
-import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
-import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
-import org.rhq.enterprise.server.plugin.pc.ControlFacet
-import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.codehaus.groovy.control.CompilerConfiguration
import org.rhq.core.domain.configuration.Configuration
import org.rhq.core.domain.configuration.PropertySimple
-import org.codehaus.groovy.control.CompilerConfiguration
+import org.rhq.enterprise.server.plugin.pc.ControlFacet
+import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
+import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
class ScriptRunner implements ServerPluginComponent, ControlFacet {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
index e42ffa4..6e4b9c3 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
@@ -1,11 +1,38 @@
package org.rhq.enterprise.server.plugins.groovy
-/**
- * Created by IntelliJ IDEA.
- * User: jsanda
- * Date: Aug 18, 2010
- * Time: 12:18:36 PM
- * To change this template use File | Settings | File Templates.
- */
+import static org.rhq.core.domain.util.PageOrdering.ASC
+import static org.rhq.core.domain.util.PageOrdering.DESC
+import org.rhq.core.domain.util.PageOrdering
+
class SortDelegate {
+
+ String currentField
+
+ def sortFields = []
+
+ def propertyMissing(String name) {
+ if (sortFields.size() > 0 && (name == 'asc' || name ==
'desc')) {
+ def sortField = sortFields[sortFields.size() - 1]
+ sortField.order = getOrder(name)
+ currentField = null
+ }
+ else {
+ currentField = name
+ sortFields << new SortField(name: currentField, order: ASC)
+ }
+ return this
+ }
+
+ PageOrdering getOrder(String order) {
+ if (order == 'asc') {
+ return ASC
+ }
+ else if (order == 'desc') {
+ return DESC
+ }
+ else {
+ throw new RHQScriptException("Unrecognized value for sort order: $order -
possible values are <asc> and <desc>")
+ }
+ }
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
index f077ced..46947a3 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
@@ -1,5 +1,7 @@
package org.rhq.core.domain.criteria
+import org.rhq.core.domain.util.PageOrdering
+
class TestEntityCriteria extends Criteria {
Integer id
@@ -10,10 +12,21 @@ class TestEntityCriteria extends Criteria {
boolean fetchResourceTypes
+ PageOrdering sortId
+
+ PageOrdering sortName
+
+ TestEntityCriteria() {
+ sortOverrides.put('sortId', 'id')
+ sortOverrides.put('sortName', 'name')
+ }
+
Class<?> getPersistentClass() {
TestEntityCriteria
}
+
+
void addFilterId(Integer id) {
this.id = id
}
@@ -30,6 +43,16 @@ class TestEntityCriteria extends Criteria {
fetchResourceTypes = fetch
}
+ void addSortId(PageOrdering order) {
+ addSortField('id')
+ sortId = order
+ }
+
+ void addSortName(PageOrdering order) {
+ addSortField('name')
+ sortName = order
+ }
+
def String toString() {
"TestEntityCriteria[id: $id, name: $name, fetchResources: $fetchResources,
fetchResourceTypes: $fetchResourceTypes]"
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index b5439a6..3c9a6e6 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -52,4 +52,37 @@ class CriteriaGeneratorTest {
assertTrue(criteria.fetchResourceTypes, 'Expected fetchResourceTypes to be
<false>')
}
+ @Test
+ void setTheSortFields() {
+ def spec = new CriteriaSpec(TestEntity)
+ spec.sort {
+ name.desc
+ id.asc
+ }
+
+ def criteria = new CriteriaGenerator().execute(spec)
+
+ assertEquals(criteria.orderingFieldNames, ['sortName', 'sortId'])
+ }
+
+ @Test
+ void setCaseSensitiveFlag() {
+ def spec = new CriteriaSpec(TestEntity)
+ spec.caseSensitive = true
+
+ def criteria = new CriteriaGenerator().execute(spec)
+
+ assertTrue(criteria.caseSensitive, "Expected the <caseSensitive> property
to be set to true")
+ }
+
+ @Test
+ void setStrictFlag() {
+ def spec = new CriteriaSpec(TestEntity)
+ spec.strict = true
+
+ def criteria = new CriteriaGenerator().execute(spec)
+
+ assertTrue(criteria.strict, "Expected the <strict> property to be set to
true")
+ }
+
}
commit 23419f815c97149f8028a525a27b55e5a3d32b61
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 18 15:49:20 2010 -0400
get rid of some compiler errors / warnings
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AuthorizationGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AuthorizationGWTServiceImpl.java
index ffbd94b..7218061 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AuthorizationGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AuthorizationGWTServiceImpl.java
@@ -35,32 +35,27 @@ public class AuthorizationGWTServiceImpl extends
AbstractGWTServiceImpl implemen
private AuthorizationManagerLocal authorizationManager =
LookupUtil.getAuthorizationManager();
public Set<Permission> getExplicitResourcePermissions(int resourceId) {
- return SerialUtility.prepare(
- new
HashSet(authorizationManager.getExplicitResourcePermissions(getSessionSubject(),
resourceId)),
- "AuthorizationManager.getExplicitResourcePermissions");
+ return SerialUtility.prepare(new
HashSet<Permission>(authorizationManager.getExplicitResourcePermissions(
+ getSessionSubject(), resourceId)),
"AuthorizationManager.getExplicitResourcePermissions");
}
public Set<Permission> getImplicitResourcePermissions(int resourceId) {
- return SerialUtility.prepare(
- new
HashSet(authorizationManager.getImplicitResourcePermissions(getSessionSubject(),
resourceId)),
- "AuthorizationManager.getImplicitResourcePermissions");
+ return SerialUtility.prepare(new
HashSet<Permission>(authorizationManager.getImplicitResourcePermissions(
+ getSessionSubject(), resourceId)),
"AuthorizationManager.getImplicitResourcePermissions");
}
public Set<Permission> getExplicitGroupPermissions(int groupId) {
- return SerialUtility.prepare(
- new
HashSet(authorizationManager.getExplicitGroupPermissions(getSessionSubject(), groupId)),
- "AuthorizationManager.getExplicitGroupPermissions");
+ return SerialUtility.prepare(new
HashSet<Permission>(authorizationManager.getExplicitGroupPermissions(
+ getSessionSubject(), groupId)),
"AuthorizationManager.getExplicitGroupPermissions");
}
public Set<Permission> getImplicitGroupPermissions(int groupId) {
- return SerialUtility.prepare(
- new
HashSet(authorizationManager.getImplicitGroupPermissions(getSessionSubject(), groupId)),
- "AuthorizationManager.getImplicitGroupPermissions");
+ return SerialUtility.prepare(new
HashSet<Permission>(authorizationManager.getImplicitGroupPermissions(
+ getSessionSubject(), groupId)),
"AuthorizationManager.getImplicitGroupPermissions");
}
public Set<Permission> getExplicitGlobalPermissions() {
- return SerialUtility.prepare(
- new
HashSet(authorizationManager.getExplicitGlobalPermissions(getSessionSubject())),
- "AuthorizationManager.getExplicitGlobalPermissions");
+ return SerialUtility.prepare(new HashSet<Permission>(authorizationManager
+ .getExplicitGlobalPermissions(getSessionSubject())),
"AuthorizationManager.getExplicitGlobalPermissions");
}
}
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 82ffd48..cac0892 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
@@ -244,7 +244,7 @@ public final class CriteriaQueryGenerator {
String returnValue = null;
if (value instanceof String) {
returnValue = "'" + prepareStringBindValue((String) value) +
"'";
- } else if (value instanceof Enum) {
+ } else if (value instanceof Enum<?>) {
// note: this strategy won't work for entities with multiple enums that
are persisted differently
EnumType type = getPersistenceEnumType(value.getClass());
if (type == EnumType.STRING) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 9d61cfd..61f613e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -637,7 +637,7 @@ public final class LookupUtil {
}
}
- @SuppressWarnings( { "unchecked", "unused" })
+ @SuppressWarnings("unchecked")
private static <T> T lookupRemote(Class<? super T> type) {
try {
return (T) lookup(getRemoteJNDIName(type));
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/security/UntrustedSSLProtocolSocketFactory.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/security/UntrustedSSLProtocolSocketFactory.java
index 1218e64..dca9282 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/security/UntrustedSSLProtocolSocketFactory.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/security/UntrustedSSLProtocolSocketFactory.java
@@ -24,10 +24,13 @@ import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
+
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
+
import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory;
/**
@@ -55,7 +58,7 @@ public class UntrustedSSLProtocolSocketFactory extends
SSLProtocolSocketFactory
if (!isRegistered()) {
if (untrustSSL == null) {
- untrustSSL = new Protocol("https", new
UntrustedSSLProtocolSocketFactory(), 443);
+ untrustSSL = new Protocol("https", (ProtocolSocketFactory) new
UntrustedSSLProtocolSocketFactory(), 443);
}
Protocol.registerProtocol("https", untrustSSL);
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/DistributionManagerBeanTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/DistributionManagerBeanTest.java
index e24f39c..037c071 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/DistributionManagerBeanTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/DistributionManagerBeanTest.java
@@ -63,21 +63,24 @@ public class DistributionManagerBeanTest extends AbstractEJB3Test {
assert distro == null;
}
+ @SuppressWarnings("unchecked")
public void testDistributionFiles() throws Exception {
String kslabel = "testCreateDeleteRepo";
String kspath = "/tmp";
- int id = distManager.createDistribution(overlord, kslabel, kspath,
distType).getId();
+ // don't get id, if not needed downstream
+ //int id = distManager.createDistribution(overlord, kslabel, kspath,
distType).getId();
+ distManager.createDistribution(overlord, kslabel, kspath, distType);
Distribution distro = distManager.getDistributionByLabel(kslabel);
DistributionFile distfile = new DistributionFile(distro, "vmlinux",
"d41d8cd98f00b204e9800998ecf8427e");
EntityManager em = getEntityManager();
em.persist(distfile);
- Query query = em.createNamedQuery(distfile.SELECT_BY_DIST_ID);
+ Query query = em.createNamedQuery(DistributionFile.SELECT_BY_DIST_ID);
query.setParameter("distId", distro.getId());
List<DistributionFile> results = query.getResultList();
assert results.size() != 0;
- Query querydel = em.createNamedQuery(distfile.DELETE_BY_DIST_ID);
+ Query querydel = em.createNamedQuery(DistributionFile.DELETE_BY_DIST_ID);
querydel.setParameter("distId", distro.getId());
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
index 7b958ef..fd3db2e 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
@@ -19,6 +19,7 @@
package org.rhq.enterprise.server.resource.group.definition.framework.test;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.testng.annotations.Test;
@@ -158,7 +159,7 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
public void testWellFormedExpressions() throws Exception {
String[][] successTestCases = getSuccessTestCases();
- List<Integer> suppressedCases = Arrays.asList();
+ List<Integer> suppressedCases = Collections.emptyList();
getTransactionManager().begin();
try {
commit b101eace8447eabe19f7b5363245e9f4f787c19a
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 14:48:36 2010 -0400
Refactoring logic SortDelegate.propertyMissing and adding more tests
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
index 61447b6..e38b421 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
@@ -1,11 +1,15 @@
package org.rhq.enterprise.server.plugins.groovy
-/**
- * Created by IntelliJ IDEA.
- * User: jsanda
- * Date: Aug 18, 2010
- * Time: 1:36:44 PM
- * To change this template use File | Settings | File Templates.
- */
+import org.rhq.core.domain.util.PageOrdering
+
class SortField {
+
+ String name
+
+ PageOrdering order
+
+ String toString() {
+ "SortField[name: $name, order: $order]"
+ }
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
index b7d2a08..70abb12 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
@@ -1,11 +1,88 @@
package org.rhq.enterprise.server.plugins.groovy
-/**
- * Created by IntelliJ IDEA.
- * User: jsanda
- * Date: Aug 18, 2010
- * Time: 12:47:35 PM
- * To change this template use File | Settings | File Templates.
- */
+import org.testng.annotations.Test
+
+import static org.rhq.core.domain.util.PageOrdering.ASC
+import static org.rhq.core.domain.util.PageOrdering.DESC
+import static org.testng.Assert.*
+import org.testng.annotations.BeforeMethod
+
class SortDelegateTest {
+
+ SortDelegate sort
+
+ @BeforeMethod
+ void setup() {
+ sort = new SortDelegate()
+ }
+
+ @Test
+ void addPropertyWithDefaultOrder() {
+ sort.username
+
+ assertSortFieldsEquals(
+ sort.sortFields,
+ [new SortField(name: 'username', order: ASC)],
+ "Expected sortFields to contain <username> with default order of
$ASC"
+ )
+ }
+
+ @Test
+ void addPropertyWithOrderSpecified() {
+ sort.username.desc
+
+ assertSortFieldsEquals(
+ sort.sortFields,
+ [new SortField(name: 'username', order: DESC)],
+ "Expected sortFields to contain <username> with sort order of
$DESC"
+ )
+ }
+
+ @Test
+ void addMultipleProperties() {
+ sort.username
+ sort.id
+
+ assertSortFieldsEquals(
+ sort.sortFields,
+ [new SortField(name: 'username', order: ASC), new SortField(name:
'id', order: ASC)],
+ "Failed to specify multiple sort fields with implied ordering"
+ )
+ }
+
+ @Test
+ void addMultiplePropertiesWithOrderSpecified() {
+ sort.username.desc
+ sort.id.asc
+
+ assertSortFieldsEquals(
+ sort.sortFields,
+ [new SortField(name: 'username', order: DESC), new SortField(name:
'id', order: ASC)],
+ "Failed to specify multiple sort fields with order specified for each
field"
+ )
+ }
+
+ @Test
+ void addMultiplePropertiesWithOrderSpecifiedForSome() {
+ sort.username.desc
+ sort.id
+
+ assertSortFieldsEquals(
+ sort.sortFields,
+ [new SortField(name: 'username', order: DESC), new SortField(name:
'id', order: ASC)],
+ "Failed to specify multiple sort fields with order specified for some of
them"
+ )
+ }
+
+ def assertSortFieldsEquals(List actual, List expected, String msg) {
+ assertEquals(actual.size(), expected.size(), "$msg -- Lists do not have the same
number of elements")
+
+ def index = 0
+ expected.each { expectedSortField ->
+ def actualSortField = actual[index++]
+ assertEquals(actualSortField.name, expectedSortField.name, "$msg -- sort
fields differ, actual: $actual, expected: $expected")
+ assertEquals(actualSortField.order, expectedSortField.order, "$msg -- sort
fields differ, actual: $actual, expected: $expected")
+ }
+ }
+
}
commit c334492346f6938e2877444a7dae1d11b5e0f2a3
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 14:26:45 2010 -0400
Initial commit for sort-related classes
The sort delegate allows for a syntax like,
sort {
username.asc
password.desc
}
where the order of sort fields is determined by the order in which the
property names are listed. An order can optionally be specified with
'asc' or 'desc' using the dot operator as illustrated above.
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml
b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 4691ce7..22b86e0 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -24,7 +24,7 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>1.7.1</version>
+ <version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
new file mode 100644
index 0000000..e42ffa4
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegate.groovy
@@ -0,0 +1,11 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jsanda
+ * Date: Aug 18, 2010
+ * Time: 12:18:36 PM
+ * To change this template use File | Settings | File Templates.
+ */
+class SortDelegate {
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
new file mode 100644
index 0000000..61447b6
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/SortField.groovy
@@ -0,0 +1,11 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jsanda
+ * Date: Aug 18, 2010
+ * Time: 1:36:44 PM
+ * To change this template use File | Settings | File Templates.
+ */
+class SortField {
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
new file mode 100644
index 0000000..b7d2a08
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/SortDelegateTest.groovy
@@ -0,0 +1,11 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jsanda
+ * Date: Aug 18, 2010
+ * Time: 12:47:35 PM
+ * To change this template use File | Settings | File Templates.
+ */
+class SortDelegateTest {
+}
commit 75c3c13a68f88836da805eac2acea1deb722d422
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 18 13:47:30 2010 -0400
modify ConfigurationServerServiceImpl to take into account new semantics for
ResourceManagerBean.updateResource
* remove call to 'resource.setResourceConfiguration(configuration)', it was
redundant with 'configurationManager.setResourceConfiguration(resource.getId(),
configuration)'
* update comments to accurately reflect what work is being done at which steps
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
index 6ae1e16..dfab090 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
@@ -81,10 +81,10 @@ public class ConfigurationServerServiceImpl implements
ConfigurationServerServic
}
Resource resource = update.getResource();
- // First clone the config, zeroing out all id's.
- Configuration configuration = update.getConfiguration().deepCopy(false);
- configurationManager.setResourceConfiguration(resource.getId(), configuration);
- resource.setResourceConfiguration(configuration);
- resourceManager.updateResource(overlord, resource);
+ Configuration configuration = update.getConfiguration().deepCopy(false); // clone
the config, zeroing out ids
+
+ resourceManager.updateResource(overlord, resource); // update simple properties,
still need to merge config
+ configurationManager.setResourceConfiguration(resource.getId(), configuration);
// now merge latest config
+
}
}
\ No newline at end of file
commit d516c7cc5eeb8c2d807ed1e11992d211b9dd50aa
Merge: 768bdc1... 36b0828...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 18 16:53:36 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 563c5f32e5212488904e0c52b28b879af0b36f08
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 18 10:48:16 2010 -0400
fix ResourceManagerRemote to use naming conventions established for remote API
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
index 01ed5a1..8f8604d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
@@ -109,8 +109,8 @@ public interface ResourceManagerRemote {
*/
@WebMethod
Resource updateResource( //
- @WebParam(name = "subject") Subject user, //
- @WebParam(name = "resource") Resource resource);
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "resource") Resource resource);
/**
* Removes these resources from inventory. The resources may subsequently be
rediscovered. Note that for
commit 36b0828833f339b27fbb8512fa4fdc362e3c5dd8
Merge: aaaac7d... d40f338...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:39:40 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit d40f338fe64cc2a24b08e85a80d83fff458109c7
Merge: 5f825b8... b53c54e...
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 10:28:47 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 5f825b8c325fefc97c32af51c7fd19139e8229ca
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 18 10:27:29 2010 -0400
Adding some generic utility functions for use in CLI scripts
diff --git a/etc/cli-scripts/util.js b/etc/cli-scripts/util.js
new file mode 100644
index 0000000..e0bb219
--- /dev/null
+++ b/etc/cli-scripts/util.js
@@ -0,0 +1,95 @@
+/**
+ * If obj is a JS array or a java.util.Collection, each element is passed to
+ * the callback function. If obj is a java.util.Map, each map entry is passed
+ * to the callback function as a key/value pair. If obj is none of the
+ * aforementioned types, it is treated as a generic object and each of its
+ * properties is passed to the callback function as a name/value pair.
+ */
+function foreach(obj, fn) {
+ if (obj instanceof Array) {
+ for (i in obj) {
+ fn(obj[i]);
+ }
+ }
+ else if (obj instanceof java.util.Collection) {
+ var iterator = obj.iterator();
+ while (iterator.hasNext()) {
+ fn(iterator.next());
+ }
+ }
+ else if (obj instanceof java.util.Map) {
+ var iterator = obj.entrySet().iterator()
+ while (iterator.hasNext()) {
+ var entry = iterator.next();
+ fn(entry.key, entry.value);
+ }
+ }
+ else { // assume we have a generic object
+ for (i in obj) {
+ fn(i, obj[i]);
+ }
+ }
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. The first match that is found is returned.
+ */
+function find(obj, fn) {
+ if (obj instanceof Array) {
+ for (i in obj) {
+ if (fn(obj[i])) {
+ return obj[i]
+ }
+ }
+ }
+ else if (obj instanceof java.util.Collection) {
+ var iterator = obj.iterator();
+ while (iterator.hasNext()) {
+ var next = iterator.next();
+ if (fn(next)) {
+ return next;
+ }
+ }
+ }
+ else if (obj instanceof java.util.Map) {
+ var iterator = obj.entrySet().iterator();
+ while (iterator.hasNext()) {
+ var entry = iterator.next();
+ if (fn(entry.key, entry.value)) {
+ return {key: entry.key, value: entry.value};
+ }
+ }
+ }
+ else {
+ for (i in obj) {
+ if (fn(i, obj[i])) {
+ return {key: i, value: obj[i]};
+ }
+ }
+ }
+ return null;
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. All of the matches are returned in a java.util.List.
+ */
+function findAll(obj, fn) {
+ var matches = java.util.ArrayList();
+ if ((obj instanceof Array) || (obj instanceof java.util.Collection)) {
+ foreach(obj, function(element) {
+ if (fn(element)) {
+ matches.add(element);
+ }
+ });
+ }
+ else {
+ foreach(obj, function(key, value) {
+ if (fn(theKey, theValue)) {
+ matches.add({key: theKey, value: theValue});
+ }
+ });
+ }
+ return matches;
+}
commit aaaac7d771794bc60510b105380bcc0d8482cbec
Merge: de55f13... b53c54e...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:20:20 2010 -0400
Merge branch 'master' into master-jay
commit de55f13450544b831725d912b97e50f110d1d698
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:11:54 2010 -0400
Prevent duplicate setting of the current resource [group]. This is a bit
of a leak and also causes ID conflict.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index c75f6e8..53d259b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -52,12 +52,10 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
private ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
-
public ResourceGroupTopView() {
}
-
@Override
protected void onInit() {
super.onInit();
@@ -73,37 +71,49 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
detailView = new ResourceGroupDetailView();
-// treeView.addResourceSelectListener(detailView);
+ // treeView.addResourceSelectListener(detailView);
setContent(detailView);
}
-
public void setSelectedGroup(final int groupId, final ViewPath view) {
+ // check if requested group is already the current group
+ if (null != currentGroup && currentGroup.getResourceGroup().getId() ==
groupId) {
+ return;
+ }
+
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
criteria.addFilterId(groupId);
//criteria.fetchTags(true);
- groupService.findResourceGroupCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceGroupComposite>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Group with id ["
+ groupId +
- "] does not exist or is not accessible.",
Message.Severity.Warning));
- caught.printStackTrace();
- CoreGUI.goTo(InventoryView.VIEW_PATH);
- }
-
- public void onSuccess(PageList<ResourceGroupComposite> result) {
- if (result.isEmpty()) {
- //noinspection ThrowableInstanceNeverThrown
- onFailure(new Exception("Group with id [" + groupId +
"] does not exist."));
- } else {
- currentGroup = result.get(0);
- treeView.setSelectedGroup(currentGroup.getResourceGroup().getId());
- detailView.onGroupSelected(currentGroup);
+ groupService.findResourceGroupCompositesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceGroupComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Group with id [" + groupId + "] does
not exist or is not accessible.",
+ Message.Severity.Warning));
+ caught.printStackTrace();
+ CoreGUI.goTo(InventoryView.VIEW_PATH);
}
- }
- });
- }
+ public void onSuccess(PageList<ResourceGroupComposite> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Group with id [" + groupId +
"] does not exist."));
+ } else {
+ // check if requested group is already the current group. This
can happen if
+ // renderView (or any callers) execute in quick succession on the
same resource group,
+ // because of the (async) delay in this call path
+ if (null != currentGroup &&
currentGroup.getResourceGroup().getId() == groupId) {
+ return;
+ }
+
+ currentGroup = result.get(0);
+
treeView.setSelectedGroup(currentGroup.getResourceGroup().getId());
+ detailView.onGroupSelected(currentGroup);
+ }
+ }
+ });
+ }
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
@@ -112,7 +122,6 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
contentCanvas.markForRedraw();
}
-
public void renderView(ViewPath viewPath) {
if (viewPath.isEnd()) {
// default detail view
@@ -121,14 +130,10 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
}
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
-
- if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId)
{
- // The previous history item did not already point to this group.
- setSelectedGroup(groupId, viewPath);
- }
+ setSelectedGroup(groupId, viewPath);
viewPath.next();
- this.detailView.renderView(viewPath);
+ this.detailView.renderView(viewPath);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
index 21806ab..cf285ea 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
@@ -26,7 +26,7 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
public interface ResourceSelectListener {
/**
- * An event handler that is called then the user selects a Resource.
+ * An event handler that is called when the user selects a Resource.
*
* @param resourceComposite a Resource composite for the Resource that was just
selected by the user; the Resource
* wrapped by the composite's ResourceType will be
mostly fetched.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
index 535cdca..b4f140b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
@@ -54,7 +54,6 @@ public class ResourceTopView extends HLayout implements BookmarkableView
{
private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
-
public ResourceTopView() {
}
@@ -73,23 +72,28 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
addMember(contentCanvas);
// created above
-// detailView = new ResourceDetailView();
+ // detailView = new ResourceDetailView();
treeView.addResourceSelectListener(detailView);
setContent(detailView);
}
-
public void setSelectedResource(final int resourceId, final ViewPath view) {
+ // Prevent multiple calls in a row for the same resource.
+ if (null != this.currentResource && currentResource.getResource().getId()
== resourceId) {
+ return;
+ }
+
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterId(resourceId);
criteria.fetchTags(true);
//criteria.fetchParentResource(true);
resourceService.findResourceCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceComposite>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
- "] does not exist or is not accessible.",
Message.Severity.Warning));
+ CoreGUI.getMessageCenter().notify(
+ new Message("Resource with id [" + resourceId + "]
does not exist or is not accessible.",
+ Message.Severity.Warning));
CoreGUI.goTo(InventoryView.VIEW_PATH);
}
@@ -106,7 +110,6 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
});
}
-
private void loadResourceType(final ResourceComposite resourceComposite, final
ViewPath view) {
final Resource resource = resourceComposite.getResource();
ResourceTypeRepository.Cache.getInstance().getResourceTypes(
@@ -122,13 +125,19 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
});
}
-
private void completeSetSelectedResource(ResourceComposite resourceComposite,
ViewPath viewPath) {
+ // Prevent multiple calls in a row for the same resource. This can happen if
renderView executes
+ // in quick succession on the same resource viewpath, because of the (async)
delay between
+ // setSelectedResource and this call
+ if (null != this.currentResource
+ && currentResource.getResource().getId() ==
resourceComposite.getResource().getId()) {
+ return;
+ }
+
this.currentResource = resourceComposite;
this.detailView.onResourceSelected(resourceComposite);
}
-
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
contentCanvas.getChildren()[0].destroy();
@@ -136,7 +145,6 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
contentCanvas.markForRedraw();
}
-
public void renderView(ViewPath viewPath) {
if (viewPath.isEnd()) {
// default detail view
@@ -145,11 +153,7 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
}
Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
-
- if (currentResource == null || currentResource.getResource().getId() !=
resourceId) {
- // The previous history item did not already point to this Resource.
- setSelectedResource(resourceId, viewPath);
- }
+ setSelectedResource(resourceId, viewPath);
this.treeView.renderView(viewPath);
commit 1e91147abf3db61eeb181efcb542a94967ee9e5b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:10:33 2010 -0400
Avoid NPE if currentAvail has yet to be set
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 1adee12..ecb4806 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
@@ -37,6 +37,7 @@ import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.ResourceAvailability;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceSubCategory;
@@ -105,27 +106,26 @@ public class ResourceTreeDatasource extends DataSource {
// Asume success
response.setStatus(0);
switch (request.getOperationType()) {
- case ADD:
- //executeAdd(request, response);
- break;
- case FETCH:
- executeFetch(requestId, request, response);
- break;
- case REMOVE:
- //executeRemove(lstRec);
- break;
- case UPDATE:
- //executeAdd(lstRec, false);
- break;
-
- default:
- break;
+ case ADD:
+ //executeAdd(request, response);
+ break;
+ case FETCH:
+ executeFetch(requestId, request, response);
+ break;
+ case REMOVE:
+ //executeRemove(lstRec);
+ break;
+ case UPDATE:
+ //executeAdd(lstRec, false);
+ break;
+
+ default:
+ break;
}
return request.getData();
}
-
public void executeFetch(final String requestId, final DSRequest request, final
DSResponse response) {
final long start = System.currentTimeMillis();
@@ -167,15 +167,17 @@ public class ResourceTreeDatasource extends DataSource {
private void processIncomingData(List<Resource> result, final DSResponse
response, final String requestId) {
- ResourceTypeRepository.Cache.getInstance().loadResourceTypes(result,
- EnumSet.of(ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory),
- new ResourceTypeRepository.ResourceTypeLoadedCallback() {
- public void onResourceTypeLoaded(List<Resource> result) {
- response.setData(build(result));
- processResponse(requestId, response);
- response.setStatus(DSResponse.STATUS_SUCCESS);
- }
- });
+ ResourceTypeRepository.Cache.getInstance().loadResourceTypes(
+ result,
+ EnumSet.of(ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.children,
+ ResourceTypeRepository.MetadataType.subCategory),
+ new ResourceTypeRepository.ResourceTypeLoadedCallback() {
+ public void onResourceTypeLoaded(List<Resource> result) {
+ response.setData(build(result));
+ processResponse(requestId, response);
+ response.setStatus(DSResponse.STATUS_SUCCESS);
+ }
+ });
}
/**
@@ -200,12 +202,11 @@ public class ResourceTreeDatasource extends DataSource {
HashMap<ResourceSubCategory, CategoryTreeNode> categories = new
HashMap<ResourceSubCategory, CategoryTreeNode>();
HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType,
TypeTreeNode>();
-
for (ResourceTreeNode node : nodes) {
built.add(node);
if (!types.containsKey(node.getResourceType())
- && node.getResourceType().getCategory() !=
ResourceCategory.PLATFORM) {
+ && node.getResourceType().getCategory() !=
ResourceCategory.PLATFORM) {
String parentResourceId =
String.valueOf(node.getResource().getParentResource().getId());
@@ -264,7 +265,6 @@ public class ResourceTreeDatasource extends DataSource {
}
}
-
public static class TypeTreeNode extends TreeNode {
private TypeTreeNode(String parentId, String parentResourceId, String type) {
@@ -288,7 +288,7 @@ public class ResourceTreeDatasource extends DataSource {
String id = String.valueOf(resource.getId());
String parentId = resource.getParentResource() == null ? null
- : (resource.getParentResource().getId() + "_" +
resource.getResourceType().getName());
+ : (resource.getParentResource().getId() + "_" +
resource.getResourceType().getName());
// System.out.println(id + " / " + parentId);
@@ -302,13 +302,14 @@ public class ResourceTreeDatasource extends DataSource {
setAttribute("name", resource.getName());
setAttribute("description", resource.getDescription());
+ ResourceAvailability currentAvail = resource.getCurrentAvailability();
setAttribute(
- "currentAvailability",
- resource.getCurrentAvailability().getAvailabilityType() ==
AvailabilityType.UP ? "/images/icons/availability_green_16.png"
- : "/images/icons/availability_red_16.png");
+ "currentAvailability",
+ (null != currentAvail && currentAvail.getAvailabilityType() ==
AvailabilityType.UP) ? "/images/icons/availability_green_16.png"
+ : "/images/icons/availability_red_16.png");
setIsFolder((resource.getResourceType().getChildResourceTypes() != null
&& !resource.getResourceType()
- .getChildResourceTypes().isEmpty()));
+ .getChildResourceTypes().isEmpty()));
}
public Resource getResource() {
commit 98b4e155771fe69e5aa325d938f554c10aa8bd16
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:08:35 2010 -0400
Selenium Work - Avoid having an Abstract class re-use the same name/title
for all of its subclasses. This causes ID conflicts. Let the subclasses
define unique names/titles.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
index 333b500..55379d1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -25,6 +25,7 @@ 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 org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.enterprise.gui.coregui.client.components.table.BooleanCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
@@ -37,15 +38,12 @@ import
org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
* @author Ian Springer
*/
public abstract class AbstractMeasurementScheduleListView extends Table {
- private static final String TITLE = "Metric Collection Schedules";
-
- private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{
- new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
SortDirection.ASCENDING)
- };
+ private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] { new
SortSpecifier(
+ MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) };
- public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource, Criteria criteria,
- String[] excludedFieldNames) {
- super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames);
+ public AbstractMeasurementScheduleListView(String title,
AbstractMeasurementScheduleDataSource dataSource,
+ Criteria criteria, String[] excludedFieldNames) {
+ super(title, criteria, SORT_SPECIFIERS, excludedFieldNames);
setDataSource(dataSource);
}
@@ -58,7 +56,7 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
protected void onInit() {
super.onInit();
- ListGrid listGrid = getListGrid();
+ ListGrid listGrid = getListGrid();
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%");
@@ -79,7 +77,7 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
}
});
- addExtraWidget(new UpdateCollectionIntervalWidget(this));
+ addExtraWidget(new UpdateCollectionIntervalWidget(this));
}
class MillisecondsCellFormatter implements CellFormatter {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
index a9b10f2..89273ff 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
@@ -19,6 +19,7 @@
package
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules;
import com.smartgwt.client.data.Criteria;
+
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
@@ -28,10 +29,12 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasuremen
* @author Ian Springer
*/
public class SchedulesView extends AbstractMeasurementScheduleListView {
+ private static final String TITLE = "Group Metric Collection Schedules";
+
private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID };
public SchedulesView(int resourceGroupId) {
- super(new SchedulesDataSource(resourceGroupId), createCriteria(resourceGroupId),
EXCLUDED_FIELD_NAMES);
+ super(TITLE, new SchedulesDataSource(resourceGroupId),
createCriteria(resourceGroupId), EXCLUDED_FIELD_NAMES);
}
private static Criteria createCriteria(int resourceGroupId) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
index 9b60119..ca4f159 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
@@ -19,6 +19,7 @@
package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules;
import com.smartgwt.client.data.Criteria;
+
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
@@ -28,10 +29,13 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasuremen
* @author Ian Springer
*/
public class SchedulesView extends AbstractMeasurementScheduleListView {
+
+ private static final String TITLE = "Metric Collection Schedules";
+
private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID };
public SchedulesView(int resourceId) {
- super(new SchedulesDataSource(resourceId), createCriteria(resourceId),
EXCLUDED_FIELD_NAMES);
+ super(TITLE, new SchedulesDataSource(resourceId), createCriteria(resourceId),
EXCLUDED_FIELD_NAMES);
}
private static Criteria createCriteria(int resourceId) {
commit 1c44909cf24b45241bc42baa231fba3ccff7cccc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Aug 18 10:06:15 2010 -0400
Selenium Work - Table now extends LocatableVLayout as opposed to VLayout
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 94b4199..43e45aa 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
@@ -41,18 +41,18 @@ 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.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* @author Greg Hinkle
* @author Ian Springer
*/
-public class Table extends VLayout {
+public class Table extends LocatableVLayout {
private static final SelectionEnablement DEFAULT_SELECTION_ENABLEMENT =
SelectionEnablement.ALWAYS;
@@ -127,7 +127,7 @@ public class Table extends VLayout {
public Table(String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers,
String[] excludedFieldNames,
boolean autoFetchData) {
- super();
+ super(tableTitle);
setWidth100();
setHeight100();
commit 768bdc1f7984816df30d8468fd85d747b025be29
Merge: efc3d35... b53c54e...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 18 11:39:01 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit deb3350d933143dbf5e5c6f76fb330f046a8aec5
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 17 23:58:38 2010 -0400
Adding test in ScriptRunnerTest to verify criteria dsl
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index 3d47f1e..a90701f 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -1,12 +1,12 @@
package org.rhq.enterprise.server.plugins.groovy
-import org.rhq.enterprise.server.util.LookupUtil
import org.rhq.core.domain.resource.Resource
import org.rhq.core.domain.resource.ResourceType
+import org.rhq.enterprise.server.util.LookupUtil
class RHQScript extends Script {
- def entityMap = [
+ static def entityMap = [
Resource: Resource.class,
ResourceType: ResourceType.class
]
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
index 9c83185..f077ced 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
@@ -30,4 +30,9 @@ class TestEntityCriteria extends Criteria {
fetchResourceTypes = fetch
}
+ def String toString() {
+ "TestEntityCriteria[id: $id, name: $name, fetchResources: $fetchResources,
fetchResourceTypes: $fetchResourceTypes]"
+ }
+
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
new file mode 100644
index 0000000..04b21b4
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntity.groovy
@@ -0,0 +1,9 @@
+package org.rhq.core.domain.test
+
+class TestEntity {
+
+ Integer id
+
+ String name
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
new file mode 100644
index 0000000..312ea47
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
@@ -0,0 +1,4 @@
+package org.rhq.core.domain.test
+
+class TestEntityWithoutCriteria {
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index 07d450d..b5439a6 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -5,8 +5,8 @@ import org.testng.annotations.Test
import static org.testng.Assert.*
import org.rhq.core.domain.criteria.TestEntityCriteria
-import org.rhq.org.rhq.core.domain.test.TestEntity
-import org.rhq.org.rhq.core.domain.test.TestEntityWithoutCriteria
+import org.rhq.core.domain.test.TestEntityWithoutCriteria
+import org.rhq.core.domain.test.TestEntity
class CriteriaGeneratorTest {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
index 84c7806..14c4548 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
@@ -1,9 +1,9 @@
package org.rhq.enterprise.server.plugins.groovy
import org.testng.annotations.Test
-import org.rhq.org.rhq.core.domain.test.TestEntity
-
-import static org.testng.Assert.*
+import static org.testng.Assert.assertEquals
+import static org.testng.Assert.assertTrue
+import org.rhq.core.domain.test.TestEntity
class RHQScriptTest {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index 1991b25..1b7ba47 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -8,9 +8,17 @@ import org.rhq.core.domain.configuration.PropertySimple
import static org.testng.Assert.*
import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.core.domain.criteria.TestEntityCriteria
+import org.testng.annotations.BeforeClass
+import org.rhq.core.domain.test.TestEntity
class ScriptRunnerTest {
+ @BeforeClass
+ void setupClass() {
+ RHQScript.entityMap << [TestEntity: TestEntity.class]
+ }
+
@Test
void lookupManagerWhenADynamicManagerPropertyIsAccessed() {
def fakeMgr = {}
@@ -32,6 +40,38 @@ class ScriptRunnerTest {
executeScript('access_nonexistent_mgr.groovy')
}
+ @Test
+ void createCriteriaAccordingToSpec() {
+ def expectedCriteria = new TestEntityCriteria()
+ expectedCriteria.id = 1
+ expectedCriteria.name = 'Test'
+ expectedCriteria.fetchResources = true
+
+ def result = executeScript('create_criteria.groovy')
+
+// assertEquals(
+// actualCriteria.id,
+// expectedCriteria.id,
+// 'The filter on the id property was not set correctly'
+// )
+// assertEquals(
+// actualCriteria.name,
+// expectedCriteria.name,
+// 'The filter on the name property was not set correctly'
+// )
+// assertEquals(
+// actualCriteria.fetchResources,
+// expectedCriteria.fetchResources,
+// 'The fetch flag for the resources property was not set correctly'
+// )
+// assertEquals(
+// actualCriteria.fetchResourceTypes,
+// expectedCriteria.fetchResourceTypes,
+// 'The fetch flag for the resourceTypes property was not set correctly'
+// )
+ assertScriptResultEquals(result, expectedCriteria.toString(), 'Failed to generate
criteria correctly')
+ }
+
def executeScript(String script) {
def runner = new ScriptRunner()
def params = new Configuration()
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
deleted file mode 100644
index 12ee6df..0000000
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.rhq.org.rhq.core.domain.test
-
-class TestEntity {
-
- Integer id
-
- String name
-
-}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
deleted file mode 100644
index 1ddcea2..0000000
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.rhq.org.rhq.core.domain.test
-
-class TestEntityWithoutCriteria {
-}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
new file mode 100644
index 0000000..595a7d6
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/create_criteria.groovy
@@ -0,0 +1,11 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+testCriteria = criteria(TestEntity) {
+ filters = [
+ id: 1,
+ name: 'Test'
+ ]
+ fetch = ['resources']
+}
+
+return testCriteria.toString()
\ No newline at end of file
commit 42a36978ba0640df8ce8b0835ac2d067801806be
Merge: 3217ce7... 7677e9f...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 17 22:48:52 2010 -0400
Merge branch 'master' into master-jay
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index aa4c428,d35ec53..94b4199
---
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
@@@ -389,6 -398,11 +402,11 @@@ public class Table extends VLayout
}
tableAction.actionButton.setDisabled(!enabled);
}
+ for (Canvas extraWidget : extraWidgets) {
+ if (extraWidget instanceof TableWidget) {
- ((TableWidget)extraWidget).refresh(this.listGrid);
++ ((TableWidget) extraWidget).refresh(this.listGrid);
+ }
+ }
this.tableInfo.setContents("Total: " + listGrid.getTotalRows() +
" (" + count + " selected)");
}
}
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 993e92b,d579c8c..a55b334
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@@ -98,9 -103,7 +103,8 @@@ public class GroupCreateWizard extends
public void onSuccess(ResourceGroup result) {
CoreGUI.getMessageCenter().notify(
new Message("Saved new group " + result.getName(),
Message.Severity.Info));
+
- // try and get the new group reflected in the UI.
- CoreGUI.refresh();
+ resourceGroupListView.refresh();
}
});
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index c519956,70c5445..4026e47
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@@ -33,8 -33,9 +33,8 @@@ import com.smartgwt.client.widgets.tree
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
- import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
+ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index a5dde2e,b56df20..280cb89
---
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,17 -18,6 +18,15 @@@
*/
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.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 java.util.List;
+import java.util.Map;
+
- import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@@ -49,15 -38,20 +47,12 @@@ import org.rhq.enterprise.gui.coregui.c
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;
- import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-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.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;
-
/**
* @author Greg Hinkle
*/
public class ResourceDatasource extends RPCDataSource<Resource> {
- private String query;
--
private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
public ResourceDatasource() {
@@@ -70,7 -60,7 +65,7 @@@
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID", 20);
idDataField.setPrimaryKey(true);
- DataSourceImageField iconField = new DataSourceImageField("icon");
- DataSourceImageField iconField = new
DataSourceImageField("icon","");
++ DataSourceImageField iconField = new DataSourceImageField("icon",
"");
iconField.setImageURLPrefix("types/");
DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(),
NAME.title(), 200);
@@@ -93,14 -83,7 +88,6 @@@
categoryDataField, availabilityDataField);
}
- public String getQuery() {
- return query;
- }
--
- public void setQuery(String query) {
- this.query = query;
- }
-
public void executeFetch(final DSRequest request, final DSResponse response) {
ResourceCriteria criteria = getFetchCriteria(request);
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 9a5993b,97a55db..98e5ab9
---
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
@@@ -115,10 -122,31 +122,30 @@@ public class ResourceSearchView extend
getListGrid().setFields(idField, iconField, nameField, descriptionField,
typeNameField, pluginNameField,
categoryField, availabilityField);
- addTableAction("Uninventory", Table.SelectionEnablement.ANY, "Are
you sure you want to delete # resources?",
- new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- getListGrid().removeSelectedData();
+ addTableAction("Uninventory", Table.SelectionEnablement.ANY,
+ "Are you sure you want to uninventory # resources?", new
TableAction() {
+ public void executeAction(ListGridRecord[] selections) {
+ int[] resourceIds = new int[selections.length];
+ int index = 0;
+ for (ListGridRecord selection : selections) {
+ resourceIds[index++] =
selection.getAttributeAsInt("id");
+ }
+ ResourceGWTServiceAsync resourceManager =
GWTServiceLookup.getResourceService();
+
+ resourceManager.uninventoryResources(resourceIds, new
AsyncCallback<List<Integer>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
uninventory selected resources", caught);
+ }
+
+ public void onSuccess(List<Integer> result) {
+ CoreGUI.getMessageCenter()
+ .notify(
+ new Message("Successfully uninventoried "
+ result.size() + " resources",
+ Severity.Info));
+
+ ResourceSearchView.this.refresh();
+ }
+ });
-
}
});
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 53909d1,d761dbd..8e51dd9
---
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
@@@ -88,10 -87,9 +88,9 @@@ public class MenuBarView extends VLayou
// loggedInAs.setWrap(false);
// loggedInAs.setValign(VerticalAlignment.CENTER);
// helpLayout.addMember(loggedInAs);
-
- topStrip.addMember(new Hyperlink("Help", "Help"));
- topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
- topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
+ topStrip.addMember(SeleniumUtility.setHtmlId(new Hyperlink("Help",
"Help")));
+ topStrip.addMember(SeleniumUtility.setHtmlId(new
Hyperlink("Preferences", "Preferences")));
+ topStrip.addMember(SeleniumUtility.setHtmlId(new Hyperlink("Log Out",
"LogOut")));
// helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
// topStrip.addMember(helpLayout);
commit b53c54eb2727ea1f98e103fee5f8d93e57a4c25d
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 17 18:49:23 2010 -0400
upgrade EMS from 1.2.14 to 1.2.15
diff --git a/pom.xml b/pom.xml
index bc895da..13e4cc8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
- <ems.version>1.2.14</ems.version>
+ <ems.version>1.2.15</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
<h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
commit 3217ce7871f55fd792b3c123ded5ab9d133b2350
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 17 16:43:05 2010 -0400
Selenium Integration Work
- Add "Locatable" widget class wrappers
- Add SeleniumUtility class
- Add explicit ID hooks to
- all Selectors
- several other places (but no where near all)
- Fixed issues with selector filters
- Worked around GWT bug
http://code.google.com/p/smartgwt/issues/detail?id=490
which breaks use of AdvancedCriteria.
- Fixed issues in the InventoryView stacks
- Added html hooks to MenuBar
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
index bf912cd..3fc37f4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java
@@ -18,12 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client;
-import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeView;
-import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
-
import com.smartgwt.client.types.Side;
import com.smartgwt.client.types.TabBarControls;
import com.smartgwt.client.widgets.Canvas;
@@ -35,6 +29,11 @@ import com.smartgwt.client.widgets.menu.events.ItemClickHandler;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
+import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeView;
+import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
+
/**
* @author Greg Hinkle
*/
@@ -45,7 +44,7 @@ public class DemoCanvas extends Canvas {
setWidth100();
setHeight100();
-
+
final TabSet topTabSet = new TabSet();
topTabSet.setTabBarPosition(Side.TOP);
topTabSet.setWidth100();//(1200);
@@ -60,10 +59,9 @@ public class DemoCanvas extends Canvas {
final Tab configTab = new Tab("Configuration Editor");
//Tab alertHistoryTab = new Tab("Alert History");
-
tagTab.setPane(new TagCloudView());
-
- selectorTab.setPane(new ResourceSelector());
+
+ selectorTab.setPane(new ResourceSelector("Demo Resource Selector"));
// Agent: resource (10005) type (10060)
// Raw: 10003 / 10023
@@ -93,18 +91,18 @@ public class DemoCanvas extends Canvas {
System.out.println("Loading: " + x);
topTabSet.removeTab(configTab);
switch (x) {
- case 0:
- configTab.setPane(new ConfigurationEditor(10005, 10060));
- break;
- case 1:
- configTab.setPane(new ConfigurationEditor(10003, 10023));
- break;
- case 2:
- configTab.setPane(new ConfigurationEditor(10002, 10022));
- break;
- case 3:
- configTab.setPane(new ConfigurationEditor(10149, 10134));
- break;
+ case 0:
+ configTab.setPane(new ConfigurationEditor(10005, 10060));
+ break;
+ case 1:
+ configTab.setPane(new ConfigurationEditor(10003, 10023));
+ break;
+ case 2:
+ configTab.setPane(new ConfigurationEditor(10002, 10022));
+ break;
+ case 3:
+ configTab.setPane(new ConfigurationEditor(10149, 10134));
+ break;
}
topTabSet.addTab(configTab, 0);
topTabSet.selectTab(0);
@@ -113,7 +111,8 @@ public class DemoCanvas extends Canvas {
}
});
- topTabSet.setTabBarControls(TabBarControls.TAB_SCROLLER,
TabBarControls.TAB_PICKER, new MenuButton("Config Resource",
configSelectMenu));
+ topTabSet.setTabBarControls(TabBarControls.TAB_SCROLLER,
TabBarControls.TAB_PICKER, new MenuButton(
+ "Config Resource", configSelectMenu));
addChild(topTabSet);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
index cca86be..5b76f3a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
@@ -18,15 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.roles;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.authz.Role;
-import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSCallback;
@@ -51,9 +45,15 @@ import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.VLayout;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.authz.Role;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
@@ -62,10 +62,8 @@ public class RoleEditView extends VLayout {
private Role roleBeingEdited;
-
private Label message = new Label("Select a role to edit...");
-
private VLayout editCanvas;
private HeaderLabel editLabel;
private DynamicForm form;
@@ -79,7 +77,6 @@ public class RoleEditView extends VLayout {
private Window editorWindow;
-
public RoleEditView() {
super();
setPadding(10);
@@ -121,13 +118,11 @@ public class RoleEditView extends VLayout {
groupSelectorItem.setTitleOrientation(TitleOrientation.TOP);
groupSelectorItem.setColSpan(2);
-
subjectSelectorItem = new CanvasItem("subjectSelectionCanvas",
"Assigned Subjects");
subjectSelectorItem.setCanvas(new Label("loading...")); //new
RoleSubjectSelector(null));
subjectSelectorItem.setTitleOrientation(TitleOrientation.TOP);
subjectSelectorItem.setColSpan(2);
-
SubmitItem saveButton = new SubmitItem("save", "Save");
saveButton.addClickHandler(new ClickHandler() {
@@ -144,14 +139,8 @@ public class RoleEditView extends VLayout {
}
});
-
- form.setItems(
- idItem,
- nameItem,
- permissionEditorItem,
- groupSelectorItem,
- subjectSelectorItem,
- saveButton, new ResetItem("reset", "Reset"));
+ form.setItems(idItem, nameItem, permissionEditorItem, groupSelectorItem,
subjectSelectorItem, saveButton,
+ new ResetItem("reset", "Reset"));
editCanvas.addMember(form);
@@ -168,24 +157,25 @@ public class RoleEditView extends VLayout {
permissionEditorItem.setParentForm(form);
permissionEditorItem.setPermissions((Set<Permission>)
record.getAttributeAsObject("permissions"));
- groupSelector = new
RoleResourceGroupSelector((Collection<ResourceGroup>)
record.getAttributeAsObject("resourceGroups"));
+ groupSelector = new RoleResourceGroupSelector("RoleEditor-Groups",
(Collection<ResourceGroup>) record
+ .getAttributeAsObject("resourceGroups"));
groupSelectorItem.setCanvas(groupSelector);
-
- subjectSelector = new RoleSubjectSelector((Collection<Subject>)
record.getAttributeAsObject("subjects"));
+ subjectSelector = new RoleSubjectSelector("RoleEditor-Subjects",
(Collection<Subject>) record
+ .getAttributeAsObject("subjects"));
subjectSelectorItem.setCanvas(subjectSelector);
} catch (Throwable t) {
t.printStackTrace();
}
-// markForRedraw();
+ // markForRedraw();
}
public void editNone() {
message.show();
editCanvas.hide();
-// markForRedraw();
+ // markForRedraw();
}
public void editNew() {
@@ -195,7 +185,6 @@ public class RoleEditView extends VLayout {
editLabel.setContents("Create Role");
-
editorWindow = new Window();
editorWindow.setTitle("Create Role");
editorWindow.setWidth(800);
@@ -209,7 +198,6 @@ public class RoleEditView extends VLayout {
}
-
public void save() {
System.out.println("Saving role");
@@ -230,18 +218,17 @@ public class RoleEditView extends VLayout {
roleId = Integer.parseInt(new
ListGridRecord(dsRequest.getData()).getAttribute("id"));
}
+ GWTServiceLookup.getRoleService().setAssignedResourceGroups(roleId,
groupIds,
+ new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to update
role's assigned groups", caught);
+ }
- GWTServiceLookup.getRoleService().setAssignedResourceGroups(
- roleId, groupIds,
- new AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
update role's assigned groups", caught);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Updated assigned groups", Message.Severity.Info));
- }
- });
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Updated assigned groups",
Message.Severity.Info));
+ }
+ });
HashSet<Integer> selectedSubjects =
subjectSelector.getSelection();
int[] subjectIds = new int[selectedSubjects.size()];
@@ -250,18 +237,16 @@ public class RoleEditView extends VLayout {
subjectIds[i++] = id;
}
+ GWTServiceLookup.getRoleService().setAssignedSubjects(roleId, subjectIds,
new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to update
role's assigned subjects", caught);
+ }
- GWTServiceLookup.getRoleService().setAssignedSubjects(
- roleId, subjectIds,
- new AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
update role's assigned subjects", caught);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Updated role assigned subjects", Message.Severity.Info));
- }
- });
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Updated role assigned subjects",
Message.Severity.Info));
+ }
+ });
if (editorWindow != null) {
editorWindow.destroy();
@@ -270,7 +255,6 @@ public class RoleEditView extends VLayout {
});
}
-
public DynamicForm getForm() {
return form;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleResourceGroupSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleResourceGroupSelector.java
index 8b7288f..12f5fde 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleResourceGroupSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleResourceGroupSelector.java
@@ -35,8 +35,8 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.Resour
*/
public class RoleResourceGroupSelector extends ResourceGroupSelector {
- public RoleResourceGroupSelector(Collection<ResourceGroup> groups) {
- super();
+ public RoleResourceGroupSelector(String id, Collection<ResourceGroup> groups)
{
+ super(id);
if (groups != null) {
ListGridRecord[] data = (new
ResourceGroupsDataSource()).buildRecords(groups);
setAssigned(data);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
index 4b8e940..42e4b2f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
@@ -38,21 +38,17 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class RoleSubjectSelector extends AbstractSelector<Subject> {
-
-
- public RoleSubjectSelector(Collection<Subject> subjects) {
- super();
+ public RoleSubjectSelector(String id, Collection<Subject> subjects) {
+ super(id);
if (subjects != null) {
ListGridRecord[] data = (new UsersDataSource()).buildRecords(subjects);
setAssigned(data);
}
}
-
-
@Override
protected DynamicForm getAvailableFilterForm() {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
@Override
@@ -62,22 +58,21 @@ public class RoleSubjectSelector extends
AbstractSelector<Subject> {
@Override
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
-
public class SelectedSubjectsDataSource extends UsersDataSource {
- @Override
- public ListGridRecord[] buildRecords(Collection<Subject> subjects) {
- ListGridRecord[] records = super.buildRecords(subjects);
- for (ListGridRecord record : records) {
- if (selection.contains(record.getAttributeAsInt("id"))) {
- record.setEnabled(false);
- }
- }
- return records;
- }
- }
+ @Override
+ public ListGridRecord[] buildRecords(Collection<Subject> subjects) {
+ ListGridRecord[] records = super.buildRecords(subjects);
+ for (ListGridRecord record : records) {
+ if (selection.contains(record.getAttributeAsInt("id"))) {
+ record.setEnabled(false);
+ }
+ }
+ return records;
+ }
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
index e554fef..146303a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
@@ -29,11 +29,8 @@ import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.authz.Role;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesDataSource;
import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
-import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
/**
@@ -41,20 +38,17 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class SubjectRoleSelector extends AbstractSelector<Role> {
-
- public SubjectRoleSelector(Collection<Role> roles) {
- super();
+ public SubjectRoleSelector(String id, Collection<Role> roles) {
+ super(id);
if (roles != null) {
ListGridRecord[] data = (new RolesDataSource()).buildRecords(roles);
setAssigned(data);
}
}
-
-
@Override
protected DynamicForm getAvailableFilterForm() {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
@Override
@@ -65,10 +59,9 @@ public class SubjectRoleSelector extends AbstractSelector<Role>
{
@Override
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
-
public class SelectedRolesDataSource extends RolesDataSource {
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
index 334315b..6042b4f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
@@ -18,12 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.users;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Role;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.HashSet;
+import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSCallback;
@@ -39,28 +35,27 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.ResetItem;
import com.smartgwt.client.widgets.form.fields.SectionItem;
-import com.smartgwt.client.widgets.form.fields.SubmitItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
-import java.util.HashSet;
-import java.util.Set;
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.authz.Role;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
public class UserEditView extends VLayout {
-
private Label message = new Label("Select a user to edit...");
-// private SubjectRolesEditorItem subjectRolesEditorItem ;
+ // private SubjectRolesEditorItem subjectRolesEditorItem ;
private VLayout editCanvas;
private HeaderLabel editLabel;
@@ -75,10 +70,9 @@ public class UserEditView extends VLayout {
private Window editorWindow;
private SubjectRoleSelector roleSelector;
-
public UserEditView() {
- dataSource = UsersDataSource.getInstance();
-
+ dataSource = UsersDataSource.getInstance();
+
setWidth100();
setHeight100();
@@ -99,42 +93,34 @@ public class UserEditView extends VLayout {
SectionItem userEditSection = new SectionItem("userEditSection",
"Edit User");
-
-// TextItem firstName = new TextItem("firstName", "First
Name");
-//
-// TextItem lastName = new TextItem("lastName", "Last Name");
-//
-// TextItem email = new TextItem("email", "Email Address");
-//
-//
-// BooleanItem enabled = new BooleanItem();
-// enabled.setName("enabled");
-// enabled.setTitle("Enabled");
-//
-// TextItem username = new TextItem("username", "Username");
-//
-// TextItem phone = new TextItem("phone", "Phone");
-
-
-// form.setField//s(userEditSection);
-
-
+ // TextItem firstName = new TextItem("firstName", "First
Name");
+ //
+ // TextItem lastName = new TextItem("lastName", "Last
Name");
+ //
+ // TextItem email = new TextItem("email", "Email
Address");
+ //
+ //
+ // BooleanItem enabled = new BooleanItem();
+ // enabled.setName("enabled");
+ // enabled.setTitle("Enabled");
+ //
+ // TextItem username = new TextItem("username",
"Username");
+ //
+ // TextItem phone = new TextItem("phone", "Phone");
+
+ // form.setField//s(userEditSection);
form.setUseAllDataSourceFields(true);
form.setDataSource(dataSource);
-
-
-
this.roleSelectionItem = new CanvasItem("selectRoles", "Select
Roles");
this.roleSelectionItem.setTitleOrientation(TitleOrientation.TOP);
this.roleSelectionItem.setColSpan(2);
-// roleSelectionItem.setCanvas(new SubjectRoleSelector(null));
+ // roleSelectionItem.setCanvas(new SubjectRoleSelector(null));
TextItem departmentItem = new TextItem("department");
departmentItem.setRequired(false);
-
IButton saveButton = new IButton("Save");
saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent)
{
@@ -172,11 +158,8 @@ public class UserEditView extends VLayout {
buttonLayout.addMember(resetButton);
buttonLayout.addMember(cancelButton);
-
-
form.setItems(departmentItem, roleSelectionItem);
-
editCanvas = new VLayout();
editCanvas.addMember(form);
@@ -200,27 +183,26 @@ public class UserEditView extends VLayout {
}
GWTServiceLookup.getRoleService().setAssignedSubjectRoles(subjectId,
roleIds,
- new AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to set
subject role assignments.",caught);
- }
+ new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to set
subject role assignments.", caught);
+ }
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Succesfully saved new user roles.", Message.Severity.Info));
- }
- });
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Succesfully saved new user
roles.", Message.Severity.Info));
+ }
+ });
}
});
}
-
public void editRecord(Record record) {
-// form.getDataSource().getField("username").setCanEdit(true );
+ // form.getDataSource().getField("username").setCanEdit(true );
-
- roleSelector = new SubjectRoleSelector((Set<Role>)
record.getAttributeAsObject("roles"));
+ roleSelector = new SubjectRoleSelector("UserEditor-Roles",
(Set<Role>) record.getAttributeAsObject("roles"));
roleSelectionItem.setCanvas(roleSelector);
try {
@@ -245,7 +227,7 @@ public class UserEditView extends VLayout {
subject = new Subject();
ListGridRecord r = dataSource.copyValues(subject);
editRecord(r);
-// form.getDataSource().getField("username").setCanEdit(false);
+ // form.getDataSource().getField("username").setCanEdit(false);
form.setSaveOperationType(DSOperationType.ADD);
editorWindow = new Window();
@@ -265,9 +247,6 @@ public class UserEditView extends VLayout {
UserEditView editView = new UserEditView();
editView.editNewInternal();
-
-
}
-
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
index aaca7be..1756582 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
@@ -47,8 +47,8 @@ public class BundleSelector extends AbstractSelector<Bundle> {
private BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
- public BundleSelector() {
- super();
+ public BundleSelector(String id) {
+ super(id);
}
protected DynamicForm getAvailableFilterForm() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
index 219d58f..e4281f6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
@@ -40,7 +40,7 @@ public class BundleSummaryStep extends AbstractWizardStep {
public Canvas getCanvas() {
- DynamicForm form = new DynamicForm();
+ DynamicForm form = getDynamicForm();
form.setNumCols(2);
form.setMargin(20);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
index 794a2c1..98490d6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
@@ -55,7 +55,7 @@ public class BundleUploadDataStep extends AbstractWizardStep {
}
public Canvas getCanvas() {
- final VLayout mainLayout = new VLayout();
+ final VLayout mainLayout = getVLayout();
mainLayout.setMargin(Integer.valueOf(20));
mainLayout.setWidth100();
mainLayout.setHeight(10);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
index 27f5a99..00f7b5b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
@@ -47,6 +47,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
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.LocatableDynamicForm;
public class BundleUploadDistroFileStep extends AbstractWizardStep {
@@ -128,7 +129,7 @@ public class BundleUploadDistroFileStep extends AbstractWizardStep {
urlTextItem.setRequired(false);
urlTextItem.setShowTitle(false);
urlTextItem.setWidth(400);
- DynamicForm urlForm = new DynamicForm();
+ DynamicForm urlForm = new LocatableDynamicForm("URL");
urlForm.setPadding(20);
urlForm.setWidth100();
urlForm.setItems(urlTextItem);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
index c96debc..b69f2ed 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
@@ -55,7 +55,7 @@ public class DeployStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (canvas == null) {
- canvas = new VLayout();
+ canvas = getVLayout();
canvas.setWidth100();
canvas.setHeight100();
canvas.setAlign(Alignment.CENTER);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
index 558d396..a2b2b97 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
@@ -52,7 +52,7 @@ public class GetDeploymentInfoStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
form.setWidth100();
form.setNumCols(2);
form.setColWidths("50%", "*");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
index 24ca6c7..c29ff74 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
@@ -47,7 +47,7 @@ public class GetDeploymentOptionsStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
form.setWidth100();
form.setNumCols(2);
form.setColWidths("50%", "*");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
index 407e3d9..1ca7062 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
@@ -59,7 +59,7 @@ public class GetDestinationStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (this.form == null) {
- this.form = new VLayout();
+ this.form = getVLayout();
this.valForm.setWidth100();
this.valForm.setNumCols(2);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
index 771e51d..2671e04 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
@@ -43,7 +43,7 @@ public class SelectBundleStep extends AbstractWizardStep {
}
public Canvas getCanvas() {
- this.selector = new BundleSelector();
+ this.selector = new BundleSelector(getName());
return this.selector;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
index a9529af..ef41a78 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
@@ -66,7 +66,7 @@ public class SelectBundleVersionStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
form.setWidth100();
form.setNumCols(2);
form.setColWidths("50%", "*");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java
index 75620bb..f8ec6dc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java
@@ -10,8 +10,8 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
public class PlatformResourceGroupSelector extends ResourceGroupSelector {
- public PlatformResourceGroupSelector() {
- super();
+ public PlatformResourceGroupSelector(String id) {
+ super(id);
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
index fd7264d..87002c3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
@@ -56,7 +56,8 @@ public class ConfirmationStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (layout == null) {
- layout = new VLayout(10);
+ layout = getVLayout();
+ layout.setMembersMargin(10);
BundleDeploymentCriteria c = new BundleDeploymentCriteria();
c.addFilterDestinationId(this.wizard.getDestination().getId());
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
index 0164035..f008b99 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
@@ -52,7 +52,7 @@ public class GetRevertInfoStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
form.setWidth100();
form.setNumCols(2);
form.setColWidths("50%", "*");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
index 41566e3..bf1413c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
@@ -55,7 +55,7 @@ public class RevertStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (canvas == null) {
- canvas = new VLayout();
+ canvas = getVLayout();
canvas.setWidth100();
canvas.setHeight100();
canvas.setAlign(Alignment.CENTER);
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 8f143ae..6029ada 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
@@ -18,31 +18,14 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.configuration;
-import org.rhq.core.domain.configuration.AbstractPropertyMap;
-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.configuration.RawConfiguration;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.configuration.definition.ConfigurationFormat;
-import org.rhq.core.domain.configuration.definition.PropertyDefinition;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionEnumeration;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
-import org.rhq.core.domain.configuration.definition.PropertyGroupDefinition;
-import org.rhq.core.domain.configuration.definition.PropertySimpleType;
-import org.rhq.core.domain.configuration.definition.constraint.Constraint;
-import org.rhq.core.domain.configuration.definition.constraint.IntegerRangeConstraint;
-import org.rhq.core.domain.configuration.definition.constraint.RegexConstraint;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.enterprise.gui.coregui.client.components.table.PropertyGrid;
-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.util.CanvasUtility;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Record;
@@ -85,7 +68,6 @@ import com.smartgwt.client.widgets.form.validator.RegExpValidator;
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.grid.SortNormalizer;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
@@ -97,7 +79,6 @@ import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.menu.IMenuButton;
import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuButton;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.MenuItemSeparator;
import com.smartgwt.client.widgets.menu.events.ClickHandler;
@@ -109,21 +90,37 @@ import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.rhq.core.domain.configuration.AbstractPropertyMap;
+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.configuration.RawConfiguration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.ConfigurationFormat;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionEnumeration;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertyGroupDefinition;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+import org.rhq.core.domain.configuration.definition.constraint.Constraint;
+import org.rhq.core.domain.configuration.definition.constraint.IntegerRangeConstraint;
+import org.rhq.core.domain.configuration.definition.constraint.RegexConstraint;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.enterprise.gui.coregui.client.components.table.PropertyGrid;
+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.util.CanvasUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* @author Greg Hinkle
*/
-public class ConfigurationEditor extends VLayout {
-
+public class ConfigurationEditor extends LocatableVLayout {
private ConfigurationGWTServiceAsync configurationService =
GWTServiceLookup.getConfigurationService();
@@ -154,7 +151,7 @@ public class ConfigurationEditor extends VLayout {
; // Need this extra semicolon for the qdox parser
public ConfigurationEditor() {
-
+ super("ConfigurationEditor");
}
public ConfigurationEditor(int resourceId, int resourceTypeId) {
@@ -162,6 +159,7 @@ public class ConfigurationEditor extends VLayout {
}
public ConfigurationEditor(int resourceId, int resourceTypeId, ConfigType configType)
{
+ super("ConfigurationEditor");
this.resourceId = resourceId;
this.resourceTypeId = resourceTypeId;
this.configType = configType;
@@ -169,11 +167,11 @@ public class ConfigurationEditor extends VLayout {
}
public ConfigurationEditor(ConfigurationDefinition definition, Configuration
configuration) {
+ super("ConfigurationEditor");
this.configuration = configuration;
this.definition = definition;
}
-
public Configuration getConfiguration() {
return configuration;
}
@@ -222,19 +220,19 @@ public class ConfigurationEditor extends VLayout {
}
});
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(new
Integer[]{resourceTypeId},
-
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypesLoadedCallback() {
- public void onTypesLoaded(HashMap<Integer,
ResourceType> types) {
- System.out.println("ConfigDef retreived in: " +
(System.currentTimeMillis() - start));
- definition =
types.get(resourceTypeId).getResourceConfigurationDefinition();
- if (definition == null) {
- loadingLabel.hide();
- showError("No configuration supported for this
resource");
- }
- reload();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(new Integer[]
{ resourceTypeId },
+
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypesLoadedCallback() {
+ public void onTypesLoaded(HashMap<Integer, ResourceType>
types) {
+ System.out.println("ConfigDef retreived in: " +
(System.currentTimeMillis() - start));
+ definition =
types.get(resourceTypeId).getResourceConfigurationDefinition();
+ if (definition == null) {
+ loadingLabel.hide();
+ showError("No configuration supported for this
resource");
}
- });
+ reload();
+ }
+ });
} else if (configType == ConfigType.plugin) {
configurationService.getPluginConfiguration(resourceId, new
AsyncCallback<Configuration>() {
@@ -248,50 +246,50 @@ public class ConfigurationEditor extends VLayout {
}
});
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(new
Integer[]{resourceTypeId},
EnumSet.of(ResourceTypeRepository.MetadataType.pluginConfigurationDefinition), new
ResourceTypeRepository.TypesLoadedCallback() {
- public void onTypesLoaded(HashMap<Integer, ResourceType> types)
{
- System.out.println("ConfigDef retreived in: " +
(System.currentTimeMillis() - start));
- definition =
types.get(resourceTypeId).getPluginConfigurationDefinition();
- if (definition == null) {
- showError("No configuration supported for this
resource");
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(new Integer[]
{ resourceTypeId },
+
EnumSet.of(ResourceTypeRepository.MetadataType.pluginConfigurationDefinition),
+ new ResourceTypeRepository.TypesLoadedCallback() {
+ public void onTypesLoaded(HashMap<Integer, ResourceType>
types) {
+ System.out.println("ConfigDef retreived in: " +
(System.currentTimeMillis() - start));
+ definition =
types.get(resourceTypeId).getPluginConfigurationDefinition();
+ if (definition == null) {
+ showError("No configuration supported for this
resource");
+ }
+ reload();
}
- reload();
- }
- });
+ });
}
} else {
reload();
}
}
-
public void reload() {
if (definition == null || configuration == null) {
// Wait for both to load
return;
}
-
originalConfiguration = configuration.deepCopy();
-
tabSet = new TabSet();
- if (definition.getConfigurationFormat() == ConfigurationFormat.RAW ||
definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED_AND_RAW) {
+ if (definition.getConfigurationFormat() == ConfigurationFormat.RAW
+ || definition.getConfigurationFormat() ==
ConfigurationFormat.STRUCTURED_AND_RAW) {
System.out.println("Loading files view");
Tab tab = new Tab("Files");
tab.setPane(buildRawPane());
tabSet.addTab(tab);
}
- if (definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED ||
definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED_AND_RAW) {
+ if (definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED
+ || definition.getConfigurationFormat() ==
ConfigurationFormat.STRUCTURED_AND_RAW) {
System.out.println("loading properties view");
Tab tab = new Tab("Properties");
tab.setPane(buildStructuredPane());
tabSet.addTab(tab);
}
-
for (Canvas c : getChildren()) {
c.destroy();
}
@@ -323,10 +321,9 @@ public class ConfigurationEditor extends VLayout {
fileTree.setData(files);
fileTree.setWidth(250);
-
DynamicForm form = new DynamicForm();
final TextAreaItem rawEditor = new TextAreaItem();
-// rawEditor.setValue("This is a test");
+ // rawEditor.setValue("This is a test");
rawEditor.setShowTitle(false);
form.setItems(rawEditor);
form.setHeight100();
@@ -351,13 +348,11 @@ public class ConfigurationEditor extends VLayout {
return layout;
}
-
protected VLayout buildStructuredPane() {
VLayout layout = new VLayout();
List<PropertyGroupDefinition> definitions =
definition.getGroupDefinitions();
-
final SectionStack sectionStack = new SectionStack();
sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
sectionStack.setWidth100();
@@ -365,17 +360,15 @@ public class ConfigurationEditor extends VLayout {
sectionStack.setScrollSectionIntoView(true);
sectionStack.setOverflow(Overflow.AUTO);
-
if (definition.getNonGroupedProperties().size() > 0) {
sectionStack.addSection(buildGroupSection(null));
}
for (PropertyGroupDefinition definition : definitions) {
-// System.out.println("building: " + definition.getDisplayName());
+ // System.out.println("building: " +
definition.getDisplayName());
sectionStack.addSection(buildGroupSection(definition));
}
-
Menu menu = new Menu();
for (SectionStackSection section : sectionStack.getSections()) {
MenuItem item = new MenuItem(section.getTitle());
@@ -404,7 +397,6 @@ public class ConfigurationEditor extends VLayout {
// TODO GH: Save button as saveListener() or remove the buttons from this form
and have
// the container provide them?
-
toolStrip = new ToolStrip();
toolStrip.setBackgroundImage(null);
@@ -414,8 +406,7 @@ public class ConfigurationEditor extends VLayout {
saveButton = new IButton("Save");
saveButton.setAlign(Alignment.CENTER);
saveButton.setDisabled(true);
-// toolStrip.addMember(saveButton);
-
+ // toolStrip.addMember(saveButton);
IButton resetButton = new IButton("Reset");
resetButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
@@ -424,8 +415,7 @@ public class ConfigurationEditor extends VLayout {
}
});
-
-// toolStrip.addMember(resetButton);
+ // toolStrip.addMember(resetButton);
toolStrip.addMember(new LayoutSpacer());
toolStrip.addMember(new IMenuButton("Jump to Section", menu));
@@ -436,7 +426,6 @@ public class ConfigurationEditor extends VLayout {
return layout;
}
-
public SectionStackSection buildGroupSection(PropertyGroupDefinition group) {
SectionStackSection section;
@@ -444,16 +433,18 @@ public class ConfigurationEditor extends VLayout {
section = new SectionStackSection("General Properties");
} else {
- section = new SectionStackSection("<div style=\"float:left;
font-weight: bold;\">" + group.getDisplayName() + "</div>" +
- (group.getDescription() != null
- ? ("<div style='padding-left: 50px; font-weight:
normal; font-size: smaller; float: right;'>" + group.getDescription() +
"</div>")
- : ""));
+ section = new SectionStackSection(
+ "<div style=\"float:left; font-weight:
bold;\">"
+ + group.getDisplayName()
+ + "</div>"
+ + (group.getDescription() != null ? ("<div
style='padding-left: 50px; font-weight: normal; font-size: smaller; float:
right;'>"
+ + group.getDescription() + "</div>")
+ : ""));
section.setExpanded(!group.isDefaultHidden());
}
- ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(
- ((group == null) ? definition.getNonGroupedProperties() :
definition.getPropertiesInGroup(group.getName()))
- );
+ ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(((group == null) ? definition
+ .getNonGroupedProperties() :
definition.getPropertiesInGroup(group.getName())));
Collections.sort(definitions, new PropertyDefinitionComparator());
DynamicForm form = buildPropertiesForm(definitions, configuration);
@@ -462,7 +453,6 @@ public class ConfigurationEditor extends VLayout {
return section;
}
-
private DynamicForm buildPropertiesForm(ArrayList<PropertyDefinition>
definitions, AbstractPropertyMap propertyMap) {
DynamicForm form = new DynamicForm();
form.setValuesManager(valuesManager);
@@ -482,13 +472,10 @@ public class ConfigurationEditor extends VLayout {
form.setCellPadding(5);
form.setColWidths(190, 28, 210);
-
ArrayList<FormItem> fields = new ArrayList<FormItem>();
-
boolean odd = true;
-
for (PropertyDefinition propertyDefinition : definitions) {
Property property = propertyMap.get(propertyDefinition.getName());
if (property == null) {
@@ -505,17 +492,18 @@ public class ConfigurationEditor extends VLayout {
return form;
}
-
- public void addItems(ArrayList<FormItem> fields, PropertyDefinition
propertyDefinition, Property property, boolean oddRow) {
+ public void addItems(ArrayList<FormItem> fields, PropertyDefinition
propertyDefinition, Property property,
+ boolean oddRow) {
StaticTextItem nameItem = new StaticTextItem();
nameItem.setStartRow(true);
- String title = "<b>" + (propertyDefinition.getDisplayName() !=
null ? propertyDefinition.getDisplayName() : propertyDefinition.getName()) +
"</b>";
+ String title = "<b>"
+ + (propertyDefinition.getDisplayName() != null ?
propertyDefinition.getDisplayName() : propertyDefinition
+ .getName()) + "</b>";
nameItem.setValue(title);
nameItem.setShowTitle(false);
nameItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
-
fields.add(nameItem);
FormItem valueItem = null;
@@ -523,7 +511,6 @@ public class ConfigurationEditor extends VLayout {
valueItem = buildSimpleField(fields, (PropertyDefinitionSimple)
propertyDefinition, oddRow, property);
fields.add(valueItem);
-
StaticTextItem descriptionItem = new StaticTextItem();
descriptionItem.setValue(propertyDefinition.getDescription());
descriptionItem.setShowTitle(false);
@@ -533,14 +520,16 @@ public class ConfigurationEditor extends VLayout {
} else if (propertyDefinition instanceof PropertyDefinitionList) {
if (((PropertyDefinitionList) propertyDefinition).getMemberDefinition()
instanceof PropertyDefinitionMap) {
// List of Maps is a specially supported case with summary fields as
columns in a table
- buildListOfMapsField(fields, (PropertyDefinitionMap)
((PropertyDefinitionList) propertyDefinition).getMemberDefinition(), oddRow,
(PropertyList) property);
+ buildListOfMapsField(fields, (PropertyDefinitionMap)
((PropertyDefinitionList) propertyDefinition)
+ .getMemberDefinition(), oddRow, (PropertyList) property);
}
} else if (propertyDefinition instanceof PropertyDefinitionMap) {
buildMapsField(fields, (PropertyDefinitionMap) propertyDefinition,
(PropertyMap) property);
}
}
- private void buildMapsField(ArrayList<FormItem> fields, PropertyDefinitionMap
propertyDefinitionMap, PropertyMap propertyMap) {
+ private void buildMapsField(ArrayList<FormItem> fields, PropertyDefinitionMap
propertyDefinitionMap,
+ PropertyMap propertyMap) {
// create the property grid
PropertyGrid propertyGrid = new PropertyGrid();
propertyGrid.getNameField().setName("Name");
@@ -554,7 +543,6 @@ public class ConfigurationEditor extends VLayout {
// set the editors and attribute name where to find the record type
propertyGrid.setEditorsMap("fieldType", editorsMap);
-
if (propertyMap != null) {
ListGridRecord[] records = new ListGridRecord[propertyMap.getMap().size()];
int i = 0;
@@ -572,19 +560,19 @@ public class ConfigurationEditor extends VLayout {
CanvasItem item = new CanvasItem();
item.setCanvas(propertyGrid);
-// item.setHeight(500);
+ // item.setHeight(500);
item.setColSpan(3);
item.setEndRow(true);
item.setShowTitle(false);
fields.add(item);
-
}
- private void buildListOfMapsField(ArrayList<FormItem> fields, final
PropertyDefinitionMap propertyDefinition, boolean oddRow, final PropertyList propertyList)
{
+ private void buildListOfMapsField(ArrayList<FormItem> fields, final
PropertyDefinitionMap propertyDefinition,
+ boolean oddRow, final PropertyList propertyList) {
final ListGrid summaryTable = new ListGrid();
-// summaryTable.setID("config_summaryTable_" +
propertyDefinition.getName());
+ // summaryTable.setID("config_summaryTable_" +
propertyDefinition.getName());
summaryTable.setAlternateRecordStyles(true);
summaryTable.setShowAllRecords(true);
summaryTable.setBodyOverflow(Overflow.VISIBLE);
@@ -592,7 +580,8 @@ public class ConfigurationEditor extends VLayout {
summaryTable.setAutoFitData(Autofit.HORIZONTAL);
ArrayList<ListGridField> fieldsList = new
ArrayList<ListGridField>();
- ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(propertyDefinition.getPropertyDefinitions().values());
+ ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(propertyDefinition
+ .getPropertyDefinitions().values());
Collections.sort(definitions, new PropertyDefinitionComparator());
for (PropertyDefinition subDef : definitions) {
@@ -606,12 +595,10 @@ public class ConfigurationEditor extends VLayout {
field.setType(ListGridFieldType.FLOAT);
}
-
fieldsList.add(field);
}
}
-
if (fieldsList.size() == 0) {
// An extra "feature of the config system". If no fields are
labeled summary, all are considered summary.
for (PropertyDefinition subDef : definitions) {
@@ -629,7 +616,7 @@ public class ConfigurationEditor extends VLayout {
ListGridField editField = new ListGridField("edit", 20);
editField.setType(ListGridFieldType.ICON);
-// editField.setIcon(Window.getImgURL("[SKIN]/actions/edit.png"));
+ //
editField.setIcon(Window.getImgURL("[SKIN]/actions/edit.png"));
editField.setCellIcon(Window.getImgURL("[SKIN]/actions/edit.png"));
editField.setCanEdit(false);
editField.setCanGroupBy(false);
@@ -638,16 +625,16 @@ public class ConfigurationEditor extends VLayout {
editField.addRecordClickHandler(new RecordClickHandler() {
public void onRecordClick(RecordClickEvent recordClickEvent) {
System.out.println("You want to edit: " +
recordClickEvent.getRecord());
- displayMapEditor(summaryTable, recordClickEvent.getRecord(),
propertyDefinition, propertyList, (PropertyMap)
recordClickEvent.getRecord().getAttributeAsObject("_RHQ_PROPERTY"));
+ displayMapEditor(summaryTable, recordClickEvent.getRecord(),
propertyDefinition, propertyList,
+ (PropertyMap)
recordClickEvent.getRecord().getAttributeAsObject("_RHQ_PROPERTY"));
}
});
fieldsList.add(editField);
-
if (!readOnly) {
ListGridField removeField = new ListGridField("remove", 20);
removeField.setType(ListGridFieldType.ICON);
-// removeField.setIcon(Window.getImgURL("[SKIN]/actions/remove.png"));
//"/images/tbb_delete.gif");
+ //
removeField.setIcon(Window.getImgURL("[SKIN]/actions/remove.png"));
//"/images/tbb_delete.gif");
removeField.setCellIcon(Window.getImgURL("[SKIN]/actions/remove.png"));
//"/images/tbb_delete.gif");
removeField.setCanEdit(false);
removeField.setCanFilter(true);
@@ -673,14 +660,11 @@ public class ConfigurationEditor extends VLayout {
fieldsList.add(removeField);
}
-
summaryTable.setFields(fieldsList.toArray(new
ListGridField[fieldsList.size()]));
-
ListGridRecord[] rows = buildSummaryRecords(propertyList, definitions);
summaryTable.setData(rows);
-
VLayout summaryTableHolder = new VLayout();
ToolStrip toolStrip = new ToolStrip();
@@ -695,13 +679,11 @@ public class ConfigurationEditor extends VLayout {
toolStrip.addMember(addRowButton);
-
summaryTableHolder.setMembers(summaryTable, toolStrip);
-
CanvasItem item = new CanvasItem();
item.setCanvas(summaryTableHolder);
-// item.setHeight(500);
+ // item.setHeight(500);
item.setColSpan(3);
item.setEndRow(true);
item.setShowTitle(false);
@@ -758,14 +740,14 @@ public class ConfigurationEditor extends VLayout {
return record;
}
-
- private FormItem buildSimpleField(ArrayList<FormItem> fields,
PropertyDefinitionSimple propertyDefinition, boolean oddRow, Property property) {
+ private FormItem buildSimpleField(ArrayList<FormItem> fields,
PropertyDefinitionSimple propertyDefinition,
+ boolean oddRow, Property property) {
final PropertySimple propertySimple = (PropertySimple) property;
FormItem valueItem = null;
-
- boolean isUnset = (property == null || propertySimple.getStringValue() == null)
&& propertyDefinition.isRequired() == false;
+ boolean isUnset = (property == null || propertySimple.getStringValue() == null)
+ && propertyDefinition.isRequired() == false;
CheckboxItem unsetItem = null;
if (!propertyDefinition.isRequired()) {
@@ -784,7 +766,6 @@ public class ConfigurationEditor extends VLayout {
fields.add(spacer);
}
-
List<PropertyDefinitionEnumeration> enumeratedValues =
propertyDefinition.getEnumeratedValues();
if (enumeratedValues != null && enumeratedValues.size() > 0) {
@@ -805,43 +786,44 @@ public class ConfigurationEditor extends VLayout {
} else {
switch (propertyDefinition.getType()) {
- case STRING:
- case FILE:
- case DIRECTORY:
- valueItem = new TextItem();
- valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
- break;
- case LONG_STRING:
- valueItem = new TextAreaItem();
- valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
- break;
- case PASSWORD:
- valueItem = new PasswordItem();
- valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
- break;
- case BOOLEAN:
- valueItem = new RadioGroupItem();
- LinkedHashMap<String, String> valMap = new
LinkedHashMap<String, String>();
- valMap.put("true", "Yes");
- valMap.put("false", "No");
- valueItem.setValueMap(valMap);
- valueItem.setValue(property == null ||
propertySimple.getStringValue() == null ? false : propertySimple.getBooleanValue());
- break;
- case INTEGER:
- case LONG:
- valueItem = new IntegerItem();
- if (property != null && propertySimple.getStringValue() !=
null)
- valueItem.setValue(propertySimple.getLongValue());
- break;
- case FLOAT:
- case DOUBLE:
- valueItem = new FloatItem();
- valueItem.setValue(property == null ||
propertySimple.getStringValue() == null ? 0 : propertySimple.getDoubleValue());
- break;
+ case STRING:
+ case FILE:
+ case DIRECTORY:
+ valueItem = new TextItem();
+ valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
+ break;
+ case LONG_STRING:
+ valueItem = new TextAreaItem();
+ valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
+ break;
+ case PASSWORD:
+ valueItem = new PasswordItem();
+ valueItem.setValue(property == null ? "" :
propertySimple.getStringValue());
+ break;
+ case BOOLEAN:
+ valueItem = new RadioGroupItem();
+ LinkedHashMap<String, String> valMap = new LinkedHashMap<String,
String>();
+ valMap.put("true", "Yes");
+ valMap.put("false", "No");
+ valueItem.setValueMap(valMap);
+ valueItem.setValue(property == null || propertySimple.getStringValue() ==
null ? false : propertySimple
+ .getBooleanValue());
+ break;
+ case INTEGER:
+ case LONG:
+ valueItem = new IntegerItem();
+ if (property != null && propertySimple.getStringValue() != null)
+ valueItem.setValue(propertySimple.getLongValue());
+ break;
+ case FLOAT:
+ case DOUBLE:
+ valueItem = new FloatItem();
+ valueItem.setValue(property == null || propertySimple.getStringValue() ==
null ? 0 : propertySimple
+ .getDoubleValue());
+ break;
}
}
-
valueItem.setRequired(propertyDefinition.isRequired());
if (propertyDefinition.getConstraints() != null) {
@@ -863,28 +845,25 @@ public class ConfigurationEditor extends VLayout {
}
}
-/*
- Click handlers seem to be turned off for disabled fields... need an alternative
- valueItem.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- System.out.println("Click in value field");
- clickEvent.getItem().setDisabled(false);
- unsetItem.setValue(false);
-
- }
- });
-*/
+ /*
+ Click handlers seem to be turned off for disabled fields... need an
alternative
+ valueItem.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ System.out.println("Click in value field");
+ clickEvent.getItem().setDisabled(false);
+ unsetItem.setValue(false);
+ }
+ });
+ */
valueItem.setShowTitle(false);
valueItem.setDisabled(isUnset || readOnly);
valueItem.setWidth(220);
valueItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
-
final FormItem finalValueItem = valueItem;
-
finalValueItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent changedEvent) {
propertySimple.setValue(changedEvent.getValue());
@@ -910,12 +889,11 @@ public class ConfigurationEditor extends VLayout {
return valueItem;
}
+ private void displayMapEditor(final ListGrid summaryTable, final Record
existingRecord,
+ PropertyDefinitionMap definition, final PropertyList list, PropertyMap map) {
- private void displayMapEditor(final ListGrid summaryTable, final Record
existingRecord, PropertyDefinitionMap definition, final PropertyList list, PropertyMap
map) {
-
-
- final ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(
- definition.getPropertyDefinitions().values());
+ final ArrayList<PropertyDefinition> definitions = new
ArrayList<PropertyDefinition>(definition
+ .getPropertyDefinitions().values());
Collections.sort(definitions, new PropertyDefinitionComparator());
@@ -923,7 +901,6 @@ public class ConfigurationEditor extends VLayout {
if (newRow)
map = new PropertyMap(definition.getName());
-
final PropertyMap finalMap = map;
final PropertyMap copy = finalMap.deepCopy(true);
@@ -944,7 +921,7 @@ public class ConfigurationEditor extends VLayout {
popup.centerInPage();
final IButton saveButton = new IButton("Save");
-// saveButton.setID("config_structured_button_save");
+ // saveButton.setID("config_structured_button_save");
saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
public void onClick(ClickEvent clickEvent) {
@@ -963,22 +940,22 @@ public class ConfigurationEditor extends VLayout {
for (PropertyDefinition subDef : definitions) {
PropertyDefinitionSimple subDefSimple =
(PropertyDefinitionSimple) subDef;
PropertySimple propertySimple = ((PropertySimple)
finalMap.get(subDefSimple.getName()));
- existingRecord.setAttribute(subDefSimple.getName(),
propertySimple != null ? propertySimple.getStringValue() : null);
+ existingRecord.setAttribute(subDefSimple.getName(),
propertySimple != null ? propertySimple
+ .getStringValue() : null);
}
summaryTable.updateData(existingRecord);
}
summaryTable.redraw();
-// ListGridRecord[] rows = buildSummaryRecords(list, definitions);
-// summaryTable.setData(rows);
-// summaryTable.redraw();
-// summaryTable.addData();
+ // ListGridRecord[] rows = buildSummaryRecords(list,
definitions);
+ // summaryTable.setData(rows);
+ // summaryTable.redraw();
+ // summaryTable.addData();
popup.destroy();
}
});
-
final IButton cancelButton = new IButton("Cancel");
cancelButton.addClickHandler(new
com.smartgwt.client.widgets.events.ClickHandler() {
public void onClick(ClickEvent clickEvent) {
@@ -999,16 +976,12 @@ public class ConfigurationEditor extends VLayout {
popup.show();
-
}
-
private static class PropertyDefinitionComparator implements
Comparator<PropertyDefinition> {
public int compare(PropertyDefinition o1, PropertyDefinition o2) {
return new Integer(o1.getOrder()).compareTo(o2.getOrder());
}
}
-
}
-
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
index f2c02f5..1b49027 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
@@ -20,7 +20,7 @@
* 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.components.form;
import java.util.ArrayList;
@@ -34,6 +34,8 @@ import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+
/**
* @author Greg Hinkle
*/
@@ -50,7 +52,7 @@ public class RadioGroupWithComponentsItem extends CanvasItem {
super(name, title);
this.valueMap = valueMap;
this.form = form;
- this.canvas = new RGWCCanvas();
+ this.canvas = new RGWCCanvas(title);
this.selected = null;
setCanvas(this.canvas);
}
@@ -67,8 +69,10 @@ public class RadioGroupWithComponentsItem extends CanvasItem {
return valueMap.get(this.selected);
}
- public class RGWCCanvas extends DynamicForm {
- public RGWCCanvas() {
+ public class RGWCCanvas extends LocatableDynamicForm {
+
+ public RGWCCanvas(String id) {
+ super(id);
setNumCols(3);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
index 8fc14b0..ecdf5eb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -38,7 +38,6 @@ import com.smartgwt.client.widgets.events.KeyPressHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
-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.grid.events.RecordDropEvent;
@@ -46,22 +45,26 @@ import com.smartgwt.client.widgets.grid.events.RecordDropHandler;
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.VLayout;
import com.smartgwt.client.widgets.layout.VStack;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTransferImgButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* @author Greg Hinkle
*/
-public abstract class AbstractSelector<T> extends VLayout {
+public abstract class AbstractSelector<T> extends LocatableVLayout {
protected HashSet<Integer> selection = new HashSet<Integer>();
protected ListGridRecord[] initialSelection;
-
- protected ListGrid availableGrid;
- protected ListGrid assignedGrid;
+ protected DynamicForm availableFilterForm;
+ protected HLayout hlayout;
+ protected LocatableListGrid availableGrid;
+ protected LocatableListGrid assignedGrid;
+ protected RPCDataSource<T> datasource;
protected TransferImgButton addButton;
protected TransferImgButton removeButton;
@@ -70,7 +73,12 @@ public abstract class AbstractSelector<T> extends VLayout {
protected Criteria latestCriteria;
- public AbstractSelector() {
+ public AbstractSelector(String id) {
+ super(id);
+ String safeId = getID();
+ hlayout = new HLayout();
+ availableGrid = new LocatableListGrid(safeId + "-availableGrid");
+ assignedGrid = new LocatableListGrid(safeId + "-assignedGrid");
}
public void setAssigned(ListGridRecord[] assignedRecords) {
@@ -91,25 +99,23 @@ public abstract class AbstractSelector<T> extends VLayout {
protected void onInit() {
super.onInit();
- final DynamicForm availableFilterForm = getAvailableFilterForm();
-
+ availableFilterForm = getAvailableFilterForm();
if (availableFilterForm != null) {
addMember(availableFilterForm);
}
- HLayout hlayout = new HLayout();
hlayout.setAlign(VerticalAlignment.BOTTOM);
- // LEFT SIDE
- availableGrid = new ListGrid();
+ // LEFT SIDE
availableGrid.setHeight(300);
availableGrid.setCanDragRecordsOut(true);
+ availableGrid.setCanAcceptDroppedRecords(true);
availableGrid.setDragTrackerMode(DragTrackerMode.ICON);
availableGrid.setTrackerImage(new
ImgProperties("types/Service_up_16.png", 16, 16));
availableGrid.setDragDataAction(DragDataAction.COPY);
- availableGrid.setDataSource(getDataSource());
+ datasource = getDataSource();
+ availableGrid.setDataSource(datasource);
availableGrid.setFetchDelay(700);
-
availableGrid.setAutoFetchData(true);
availableGrid.setFields(new ListGridField("icon", 50), new
ListGridField("name"));
@@ -139,12 +145,12 @@ public abstract class AbstractSelector<T> extends VLayout {
moveButtonStack.setAlign(VerticalAlignment.CENTER);
moveButtonStack.setWidth(40);
- addButton = new TransferImgButton(TransferImgButton.RIGHT);
+ addButton = new LocatableTransferImgButton(TransferImgButton.RIGHT);
addButton.setDisabled(true);
- removeButton = new TransferImgButton(TransferImgButton.LEFT);
+ removeButton = new LocatableTransferImgButton(TransferImgButton.LEFT);
removeButton.setDisabled(true);
- addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL);
- removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL);
+ addAllButton = new LocatableTransferImgButton(TransferImgButton.RIGHT_ALL);
+ removeAllButton = new LocatableTransferImgButton(TransferImgButton.LEFT_ALL);
removeAllButton.setDisabled(true);
moveButtonStack.addMember(addButton);
@@ -155,12 +161,11 @@ public abstract class AbstractSelector<T> extends VLayout {
hlayout.addMember(moveButtonStack);
// RIGHT SIDE
-
- assignedGrid = new ListGrid();
assignedGrid.setHeight(300);
assignedGrid.setCanReorderRecords(true);
assignedGrid.setCanDragRecordsOut(true);
-
+ assignedGrid.setDragTrackerMode(DragTrackerMode.ICON);
+ assignedGrid.setTrackerImage(new
ImgProperties("types/Service_up_16.png", 16, 16));
assignedGrid.setCanAcceptDroppedRecords(true);
ListGridField iconField = new ListGridField("icon", 50);
iconField.setType(ListGridFieldType.ICON);
@@ -236,6 +241,12 @@ public abstract class AbstractSelector<T> extends VLayout {
}
});
+ availableGrid.addRecordDropHandler(new RecordDropHandler() {
+ public void onRecordDrop(RecordDropEvent recordDropEvent) {
+ deselect(recordDropEvent.getDropRecords());
+ }
+ });
+
assignedGrid.addRecordDropHandler(new RecordDropHandler() {
public void onRecordDrop(RecordDropEvent recordDropEvent) {
select(recordDropEvent.getDropRecords());
@@ -250,7 +261,18 @@ public abstract class AbstractSelector<T> extends VLayout {
}
addMember(hlayout);
+ }
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ availableGrid.destroy();
+ assignedGrid.destroy();
+ addButton.destroy();
+ removeButton.destroy();
+ addAllButton.destroy();
+ removeAllButton.destroy();
+ availableFilterForm.destroy();
}
protected void updateButtons() {
@@ -266,6 +288,7 @@ public abstract class AbstractSelector<T> extends VLayout {
record.setEnabled(false);
selection.add(record.getAttributeAsInt("id"));
}
+ assignedGrid.markForRedraw();
}
protected void deselect(ListGridRecord[] records) {
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 2418783..aa4c428 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
@@ -34,11 +34,8 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent;
import com.smartgwt.client.widgets.grid.events.DataArrivedHandler;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -47,6 +44,8 @@ import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
/**
* @author Greg Hinkle
@@ -68,7 +67,6 @@ public class Table extends VLayout {
private String headerIcon;
-
private boolean showHeader = true;
private boolean showFooter = true;
@@ -124,7 +122,7 @@ public class Table extends VLayout {
}
public Table(String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers,
String[] excludedFieldNames,
- boolean autoFetchData) {
+ boolean autoFetchData) {
super();
setWidth100();
@@ -135,7 +133,7 @@ public class Table extends VLayout {
setTableTitle(tableTitle);
// Grid
- listGrid = new ListGrid();
+ listGrid = new LocatableListGrid(tableTitle);
if (criteria != null) {
listGrid.setInitialCriteria(criteria);
}
@@ -164,7 +162,6 @@ public class Table extends VLayout {
protected void onInit() {
super.onInit();
-
// NOTE: It is essential that we wait to hide any excluded fields until after
super.onDraw() is called, since
// super.onDraw() is what actually adds the fields to the ListGrid (based
on what fields are defined in
// the underlying datasource).
@@ -174,13 +171,10 @@ public class Table extends VLayout {
}
}
-
tableInfo.setWrap(false);
-
}
-
@Override
protected void onDraw() {
super.onDraw();
@@ -215,14 +209,14 @@ public class Table extends VLayout {
footer.removeMembers(footer.getMembers());
for (final TableActionInfo tableAction : tableActions) {
- IButton button = new IButton(tableAction.title);
+ IButton button = new LocatableIButton(tableAction.title);
button.setDisabled(true);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
if (tableAction.confirmMessage != null) {
String message =
tableAction.confirmMessage.replaceAll("\\#", String.valueOf(listGrid
- .getSelection().length));
+ .getSelection().length));
SC.ask(message, new BooleanCallback() {
public void execute(Boolean confirmed) {
@@ -244,10 +238,9 @@ public class Table extends VLayout {
footer.addMember(extraWidgetCanvas);
}
-
footer.addMember(new LayoutSpacer());
- IButton refreshButton = new IButton("Refresh");
+ IButton refreshButton = new LocatableIButton("Refresh");
refreshButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
listGrid.invalidateCache();
@@ -268,11 +261,9 @@ public class Table extends VLayout {
public void onDataArrived(DataArrivedEvent dataArrivedEvent) {
refreshTableInfo();
fieldSizes.clear();
- totalWidth = 0;
}
});
-
addMember(footer);
}
}
@@ -297,9 +288,7 @@ public class Table extends VLayout {
this.showFooter = showFooter;
}
- private int totalWidth;
private ArrayList<Integer> fieldSizes = new ArrayList<Integer>();
- private boolean autoSizing = false;
public void refresh(Criteria criteria) {
this.listGrid.invalidateCache();
@@ -311,7 +300,6 @@ public class Table extends VLayout {
this.listGrid.invalidateCache();
this.listGrid.markForRedraw();
}
-
public void setTableTitle(String titleString) {
if (titleString == null) {
@@ -334,10 +322,12 @@ public class Table extends VLayout {
title.markForRedraw();
}
+ @SuppressWarnings("unchecked")
public void setDataSource(RPCDataSource dataSource) {
listGrid.setDataSource(dataSource);
}
+ @SuppressWarnings("unchecked")
public RPCDataSource getDataSource() {
return (RPCDataSource) listGrid.getDataSource();
}
@@ -346,7 +336,6 @@ public class Table extends VLayout {
return listGrid;
}
-
public void setTitleComponent(Canvas canvas) {
this.titleComponent = canvas;
}
@@ -356,7 +345,7 @@ public class Table extends VLayout {
}
public void addTableAction(String title, SelectionEnablement enablement, String
confirmation,
- TableAction tableAction) {
+ TableAction tableAction) {
if (enablement == null) {
enablement = DEFAULT_SELECTION_ENABLEMENT;
}
@@ -383,20 +372,20 @@ public class Table extends VLayout {
for (TableActionInfo tableAction : tableActions) {
boolean enabled;
switch (tableAction.enablement) {
- case ALWAYS:
- enabled = true;
- break;
- case ANY:
- enabled = (count >= 1);
- break;
- case SINGLE:
- enabled = (count == 1);
- break;
- case MULTIPLE:
- enabled = (count > 1);
- break;
- default:
- throw new IllegalStateException("Unhandled
SelectionEnablement: " + tableAction.enablement.name());
+ case ALWAYS:
+ enabled = true;
+ break;
+ case ANY:
+ enabled = (count >= 1);
+ break;
+ case SINGLE:
+ enabled = (count == 1);
+ break;
+ case MULTIPLE:
+ enabled = (count > 1);
+ break;
+ default:
+ throw new IllegalStateException("Unhandled SelectionEnablement:
" + tableAction.enablement.name());
}
tableAction.actionButton.setDisabled(!enabled);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java
index 93b8428..691bb32 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java
@@ -24,9 +24,10 @@ import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
-import com.smartgwt.client.widgets.form.DynamicForm;
-public class DynamicCallbackForm extends DynamicForm implements
DynamicCallbackFormImplHost {
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+
+public class DynamicCallbackForm extends LocatableDynamicForm implements
DynamicCallbackFormImplHost {
private static int frameIndex = 0;
@@ -36,7 +37,7 @@ public class DynamicCallbackForm extends DynamicForm implements
DynamicCallbackF
private static DynamicCallbackFormImpl impl =
GWT.create(DynamicCallbackFormImpl.class);
public DynamicCallbackForm(String frameName) {
- super();
+ super(frameName);
this.frameName = frameName + (frameIndex++);
setTarget(this.frameName);
init();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
index 1fd87f8..d899ace 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
@@ -19,6 +19,11 @@
package org.rhq.enterprise.gui.coregui.client.components.wizard;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
public abstract class AbstractWizardStep implements WizardStep {
@@ -33,4 +38,20 @@ public abstract class AbstractWizardStep implements WizardStep {
public boolean previousPage() {
return true;
}
+
+ /**
+ * Convenience routine returns a DynamicForm tagged for Selenium
+ * @return the form
+ */
+ protected DynamicForm getDynamicForm() {
+ return new LocatableDynamicForm(getName());
+ }
+
+ /**
+ * Convenience routine returns a VLayout tagged for Selenium
+ * @return the VLayout
+ */
+ protected VLayout getVLayout() {
+ return new LocatableVLayout(getName());
+ }
}
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 a8ff10b..611ff82 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
@@ -36,11 +36,17 @@ import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
+
/**
* @author Greg Hinkle
*/
public class WizardView extends VLayout {
+ static private final String CANCEL = "Cancel";
+ static private final String NEXT = "Next";
+ static private final String PREVIOUS = "Previous";
+
private Window wizardWindow;
private Wizard wizard;
private int currentStep;
@@ -152,7 +158,7 @@ public class WizardView extends VLayout {
}
private void setupButtons() {
- cancelButton = new IButton("Cancel");
+ cancelButton = new LocatableIButton(CANCEL);
cancelButton.setDisabled(false);
cancelButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
@@ -160,7 +166,7 @@ public class WizardView extends VLayout {
closeDialog();
}
});
- previousButton = new IButton("Previous");
+ previousButton = new LocatableIButton(PREVIOUS);
previousButton.setDisabled(true);
previousButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
@@ -171,7 +177,7 @@ public class WizardView extends VLayout {
}
}
});
- nextButton = new IButton("Next");
+ nextButton = new LocatableIButton(NEXT);
nextButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
@@ -271,7 +277,7 @@ public class WizardView extends VLayout {
// Attempt to clean up canvases created in the steps
for (Canvas canvas : createdCanvases) {
- canvas.markForDestroy();
+ canvas.destroy();
}
wizardWindow.destroy();
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 8171d96..3b5df8b 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
@@ -42,14 +42,22 @@ import
org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
*/
public class ResourceGroupListView extends Table {
+ private static final String DEFAULT_TITLE = "Resource Groups";
+
public ResourceGroupListView() {
- super("Resource Groups");
+ this(DEFAULT_TITLE);
+ }
+
+ public ResourceGroupListView(String title) {
+ super(title);
setWidth100();
setHeight100();
}
- public ResourceGroupListView(Criteria criteria) {
- super("Resource Groups", criteria);
+ public ResourceGroupListView(Criteria criteria, String title) {
+ super(title, criteria);
+ setWidth100();
+ setHeight100();
}
@Override
@@ -102,7 +110,7 @@ public class ResourceGroupListView extends Table {
CoreGUI.getMessageCenter().notify(
new Message("Deleted resource group [" +
object.getName() + "]", Severity.Info));
- CoreGUI.refresh();
+ refresh();
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
index aaaaeaa..9de2407 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
@@ -56,6 +56,11 @@ public class ResourceGroupsDataSource extends
RPCDataSource<ResourceGroup> {
}
public ResourceGroupsDataSource() {
+
+ // TODO until
http://code.google.com/p/smartgwt/issues/detail?id=490 is fixed
always go to the server for data
+ this.setAutoCacheAllData(false);
+ this.setCacheAllData(false);
+
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID", 20);
idDataField.setPrimaryKey(true);
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 7c0156a..8656997 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
@@ -18,37 +18,21 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions;
-import org.rhq.enterprise.gui.coregui.client.components.table.Table;
-import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
-
-import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.util.BooleanCallback;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.IButton;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
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.grid.events.DataArrivedEvent;
-import com.smartgwt.client.widgets.grid.events.DataArrivedHandler;
-import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
-import com.smartgwt.client.widgets.grid.events.SelectionEvent;
-import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.toolbar.ToolStrip;
+
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
/**
* @author Greg Hinkle
*/
public class GroupDefinitionListView extends VLayout {
-
public GroupDefinitionListView() {
setWidth100();
@@ -62,29 +46,24 @@ public class GroupDefinitionListView extends VLayout {
table.getListGrid().setSelectionType(SelectionStyle.SIMPLE);
table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
-
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
ListGridField nameField = new ListGridField("name", "Name",
250);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
- return "<a href=\"#ResourceGroupDefinition/" +
listGridRecord.getAttribute("id") +"\">" + o +
"</a>";
+ return "<a href=\"#ResourceGroupDefinition/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
}
});
-
- ListGridField descriptionField = new ListGridField("description",
"Description");
-//// ListGridField typeNameField = new ListGridField("typeName",
"Type", 130);
-//// ListGridField pluginNameField = new ListGridField("pluginName",
"Plugin", 100);
-//// ListGridField categoryField = new ListGridField("category",
"Category", 60);
-////
-//// ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
-//
-// availabilityField.setAlign(Alignment.CENTER);
-// listGrid.setFields(idField, nameField, descriptionField, typeNameField,
pluginNameField, categoryField, availabilityField);
-
-
-
+ //ListGridField descriptionField = new ListGridField("description",
"Description");
+ //// ListGridField typeNameField = new ListGridField("typeName",
"Type", 130);
+ //// ListGridField pluginNameField = new
ListGridField("pluginName", "Plugin", 100);
+ //// ListGridField categoryField = new ListGridField("category",
"Category", 60);
+ ////
+ //// ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
+ //
+ // availabilityField.setAlign(Alignment.CENTER);
+ // listGrid.setFields(idField, nameField, descriptionField, typeNameField,
pluginNameField, categoryField, availabilityField);
addMember(table);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
index 032cc75..8a2a8cc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
@@ -50,7 +50,7 @@ public class GroupCreateStep extends AbstractWizardStep {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
form.setValuesManager(new ValuesManager());
form.setWidth100();
form.setNumCols(2);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 55d1588..993e92b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -82,7 +82,7 @@ public class GroupCreateWizard extends AbstractWizard {
}
public void cancel() {
- // TODO: Implement this method.
+ // Nothing to do. Group is persisted after the "Finish" button.
}
public boolean createGroup() {
@@ -98,7 +98,9 @@ public class GroupCreateWizard extends AbstractWizard {
public void onSuccess(ResourceGroup result) {
CoreGUI.getMessageCenter().notify(
new Message("Saved new group " + result.getName(),
Message.Severity.Info));
- // TODO: Implement this method.
+
+ // try and get the new group reflected in the UI.
+ CoreGUI.refresh();
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
index cc79abc..3a3048d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
@@ -46,7 +46,7 @@ public class GroupMembersStep extends AbstractWizardStep {
public Canvas getCanvas() {
ResourceType rt = wizard.getCompatibleGroupResourceType();
if ((selector == null) || (rt != requireType)) {
- selector = new ResourceSelector();
+ selector = new ResourceSelector(getName());
requireType = rt;
selector.setRequireType(rt);
}
@@ -54,7 +54,8 @@ public class GroupMembersStep extends AbstractWizardStep {
}
public boolean nextPage() {
- return wizard.createGroup();
+ wizard.createGroup();
+ return true; // last step
}
public String getName() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index 2e2617e..c519956 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@ -33,7 +33,6 @@ import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
@@ -42,6 +41,7 @@ import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionListView;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid;
/**
* @author Greg Hinkle
@@ -50,6 +50,22 @@ public class InventoryView extends HLayout implements BookmarkableView
{
public static final String VIEW_PATH = "Inventory";
+ private static final String SECTION_GROUPS = "Groups";
+ private static final String SECTION_RESOURCES = "Resources";
+
+ private static final String SUBSECTION_INVENTORY = "Inventory";
+ private static final String SUBSECTION_SAVED_SEARCHES = "Saved Searches";
+
+ private static final String PAGE_COMPATIBLE_GROUPS = "Compatible Groups";
+ private static final String PAGE_DOWN = "Down Servers";
+ private static final String PAGE_GROUPS = "All Groups";
+ private static final String PAGE_GROUP_DEFINITIONS = "Group Definitions";
+ private static final String PAGE_MIXED_GROUPS = "Mixed Groups";
+ private static final String PAGE_PLATFORMS = "Platforms";
+ private static final String PAGE_PROBLEM_GROUPS = "Problem Groups";
+ private static final String PAGE_RESOURCES = "All Resources";
+ private static final String PAGE_SERVERS = "Servers";
+ private static final String PAGE_SERVICES = "Services";
private ViewId currentSectionViewId;
private ViewId currentPageViewId;
@@ -58,7 +74,6 @@ public class InventoryView extends HLayout implements BookmarkableView
{
private Canvas currentContent;
private LinkedHashMap<String, TreeGrid> treeGrids = new
LinkedHashMap<String, TreeGrid>();
-
private SectionStack sectionStack;
@Override
@@ -92,7 +107,6 @@ public class InventoryView extends HLayout implements BookmarkableView
{
}
});
-
SectionStackSection section = new SectionStackSection(name);
section.setExpanded(true);
section.addItem(grid);
@@ -100,7 +114,6 @@ public class InventoryView extends HLayout implements BookmarkableView
{
sectionStack.addSection(section);
}
-
addMember(sectionStack);
addMember(contentCanvas);
@@ -119,34 +132,35 @@ public class InventoryView extends HLayout implements
BookmarkableView {
}
private SectionStackSection buildResourcesSection() {
- final SectionStackSection section = new
SectionStackSection("Resources");
+ final SectionStackSection section = new SectionStackSection(SECTION_RESOURCES);
section.setExpanded(true);
- final TreeNode allResources = new TreeNode("All Resources");
- final TreeNode onlyPlatforms = new TreeNode("Platforms");
+ final TreeNode allResources = new TreeNode(PAGE_RESOURCES);
+ final TreeNode onlyPlatforms = new TreeNode(PAGE_PLATFORMS);
onlyPlatforms.setIcon("types/Platform_up_16.png");
- final TreeNode onlyServers = new TreeNode("Servers");
+ final TreeNode onlyServers = new TreeNode(PAGE_SERVERS);
onlyServers.setIcon("types/Server_up_16.png");
- final TreeNode onlyServices = new TreeNode("Services");
+ final TreeNode onlyServices = new TreeNode(PAGE_SERVICES);
onlyServices.setIcon("types/Service_up_16.png");
- final TreeNode inventory = new TreeNode("Inventory", allResources,
onlyPlatforms, onlyServers, onlyServices);
+ final TreeNode inventory = new TreeNode(SUBSECTION_INVENTORY, allResources,
onlyPlatforms, onlyServers,
+ onlyServices);
- final TreeNode downServers = new TreeNode("Down Servers");
+ final TreeNode downServers = new TreeNode(PAGE_DOWN);
downServers.setIcon("types/Server_down_16.png");
- final TreeNode savedSearches = new TreeNode("Saved Searches",
downServers);
+ final TreeNode savedSearches = new TreeNode(SUBSECTION_SAVED_SEARCHES,
downServers);
- TreeGrid treeGrid = new TreeGrid();
+ TreeGrid treeGrid = new LocatableTreeGrid(SECTION_RESOURCES);
treeGrid.setShowHeader(false);
Tree tree = new Tree();
- tree.setRoot(new TreeNode("security", inventory, savedSearches));
+ tree.setRoot(new TreeNode(SECTION_RESOURCES, inventory, savedSearches));
treeGrid.setData(tree);
treeGrid.getTree().openAll();
- treeGrids.put("Resources", treeGrid);
+ treeGrids.put(SECTION_RESOURCES, treeGrid);
section.addItem(treeGrid);
@@ -154,28 +168,27 @@ public class InventoryView extends HLayout implements
BookmarkableView {
}
private SectionStackSection buildGroupsSection() {
- final SectionStackSection section = new SectionStackSection("Groups");
+ final SectionStackSection section = new SectionStackSection(SECTION_GROUPS);
section.setExpanded(true);
- final TreeNode allGroups = new TreeNode("All Groups");
- final TreeNode onlyCompatible = new TreeNode("Compatible Groups");
- final TreeNode onlyMixed = new TreeNode("Mixed Groups");
- final TreeNode groupGroupDefinitions = new TreeNode("Group
Definitions");
- final TreeNode inventory = new TreeNode("Inventory", allGroups,
onlyCompatible, onlyMixed,
- groupGroupDefinitions);
+ final TreeNode allGroups = new TreeNode(PAGE_GROUPS);
+ final TreeNode onlyCompatible = new TreeNode(PAGE_COMPATIBLE_GROUPS);
+ final TreeNode onlyMixed = new TreeNode(PAGE_MIXED_GROUPS);
+ final TreeNode groupGroupDefinitions = new TreeNode(PAGE_GROUP_DEFINITIONS);
+ final TreeNode inventory = new TreeNode(SECTION_GROUPS, allGroups,
onlyCompatible, onlyMixed,
+ groupGroupDefinitions);
- final TreeNode problemGroups = new TreeNode("Problem Groups");
- final TreeNode savedSearches = new TreeNode("Saved Searches",
problemGroups);
+ final TreeNode problemGroups = new TreeNode(PAGE_PROBLEM_GROUPS);
+ final TreeNode savedSearches = new TreeNode(SUBSECTION_SAVED_SEARCHES,
problemGroups);
- TreeGrid treeGrid = new TreeGrid();
+ TreeGrid treeGrid = new LocatableTreeGrid(SECTION_GROUPS);
treeGrid.setShowHeader(false);
Tree tree = new Tree();
- tree.setRoot(new TreeNode("clustering", inventory, savedSearches));
+ tree.setRoot(new TreeNode(SECTION_GROUPS, inventory, savedSearches));
treeGrid.setData(tree);
-
treeGrid.getTree().openAll();
- treeGrids.put("Groups", treeGrid);
+ treeGrids.put(SECTION_GROUPS, treeGrid);
section.addItem(treeGrid);
return section;
@@ -194,7 +207,6 @@ public class InventoryView extends HLayout implements BookmarkableView
{
this.currentContent = newContent;
}
-
private void renderContentView(ViewPath viewPath) {
currentSectionViewId = viewPath.getCurrent();
@@ -204,39 +216,41 @@ public class InventoryView extends HLayout implements
BookmarkableView {
String page = currentPageViewId.getPath();
Canvas content = null;
- if ("Resources".equals(section)) {
-
- if ("All Resources".equals(page)) {
- content = new ResourceSearchView();
- } else if ("Platforms".equals(page)) {
- content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name()));
- } else if ("Servers".equals(page)) {
- content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name()));
- } else if ("Services".equals(page)) {
- content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVICE.name()));
- } else if ("Down Servers".equals(page)) {
-
- Criteria criteria = new
Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
AvailabilityType.DOWN.name());
+ if (SECTION_RESOURCES.equals(section)) {
+
+ if (PAGE_RESOURCES.equals(page)) {
+ content = new ResourceSearchView(null, PAGE_RESOURCES);
+ } else if (PAGE_PLATFORMS.equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
+ ResourceCategory.PLATFORM.name()), PAGE_PLATFORMS);
+ } else if (PAGE_SERVERS.equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
+ ResourceCategory.SERVER.name()), PAGE_SERVERS);
+ } else if (PAGE_SERVICES.equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
+ ResourceCategory.SERVICE.name()), PAGE_SERVICES);
+ } else if (PAGE_DOWN.equals(page)) {
+ Criteria criteria = new
Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
+ ResourceCategory.PLATFORM.name());
criteria.addCriteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name());
- content = new ResourceSearchView(criteria);
+ content = new ResourceSearchView(criteria, PAGE_DOWN);
}
- } else if ("Groups".equals(section)) {
+ } else if (SECTION_GROUPS.equals(section)) {
- if ("All Groups".equals(page)) {
+ if (PAGE_GROUPS.equals(page)) {
content = new ResourceGroupListView();
- } else if ("Compatible Groups".equals(page)) {
- content = new ResourceGroupListView(new Criteria("category",
"compatible"));
- } else if ("Mixed Groups".equals(page)) {
- content = new ResourceGroupListView(new Criteria("category",
"mixed"));
- } else if ("Group Definitions".equals(page)) {
+ } else if (PAGE_COMPATIBLE_GROUPS.equals(page)) {
+ content = new ResourceGroupListView(new Criteria("category",
"compatible"), PAGE_COMPATIBLE_GROUPS);
+ } else if (PAGE_MIXED_GROUPS.equals(page)) {
+ content = new ResourceGroupListView(new Criteria("category",
"mixed"), PAGE_MIXED_GROUPS);
+ } else if (PAGE_GROUP_DEFINITIONS.equals(page)) {
content = new GroupDefinitionListView();
- } else if ("Problem Groups".equals(page)) {
- content = new ResourceGroupListView(new
Criteria("availability", "down"));
+ } else if (PAGE_PROBLEM_GROUPS.equals(page)) {
+ content = new ResourceGroupListView(new
Criteria("availability", "down"), PAGE_PROBLEM_GROUPS);
}
}
-
for (String name : treeGrids.keySet()) {
TreeGrid treeGrid = treeGrids.get(name);
@@ -251,15 +265,12 @@ public class InventoryView extends HLayout implements
BookmarkableView {
}
}
-
setContent(content);
-
if (content instanceof BookmarkableView) {
((BookmarkableView) content).renderView(viewPath.next().next());
}
-
}
public void renderView(ViewPath viewPath) {
@@ -280,6 +291,5 @@ public class InventoryView extends HLayout implements BookmarkableView
{
}
-
}
}
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 c0731b8..a5dde2e 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
@@ -26,6 +26,7 @@ import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceD
import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
import java.util.List;
+import java.util.Map;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -62,6 +63,10 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
public ResourceDatasource() {
super();
+ // TODO until
http://code.google.com/p/smartgwt/issues/detail?id=490 is fixed
always go to the server for data
+ this.setAutoCacheAllData(false);
+ this.setCacheAllData(false);
+
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID", 20);
idDataField.setPrimaryKey(true);
@@ -114,21 +119,24 @@ public class ResourceDatasource extends
RPCDataSource<Resource> {
});
}
+ @SuppressWarnings("unchecked")
protected ResourceCriteria getFetchCriteria(final DSRequest request) {
ResourceCriteria criteria = new ResourceCriteria();
criteria.setPageControl(getPageControl(request));
+ // TODO: This call is broken in 2.2,
http://code.google.com/p/smartgwt/issues/detail?id=490
+ // when using AdvancedCriteria
+ Map<String, Object> criteriaMap = request.getCriteria().getValues();
- if (request.getCriteria().getValues().get("parentId") != null) {
- criteria.addFilterParentResourceId(Integer.parseInt((String)
request.getCriteria().getValues().get(
- "parentId")));
+ if (criteriaMap.get("parentId") != null) {
+ criteria.addFilterParentResourceId(Integer.parseInt((String)
criteriaMap.get("parentId")));
}
- if (request.getCriteria().getValues().get("id") != null) {
+ if (criteriaMap.get("id") != null) {
criteria.addFilterId(Integer.parseInt(request.getCriteria().getAttribute("id")));
}
- if (request.getCriteria().getValues().get("resourceIds") != null) {
+ if (criteriaMap.get("resourceIds") != null) {
int[] ids =
request.getCriteria().getAttributeAsIntArray("resourceIds");
Integer[] oids = new Integer[ids.length];
for (int i = 0; i < ids.length; i++) {
@@ -138,48 +146,47 @@ public class ResourceDatasource extends
RPCDataSource<Resource> {
}
// Fetch member Resources of the group with the specified id.
- if (request.getCriteria().getValues().get("groupId") != null) {
- int groupId = Integer.parseInt((String)
request.getCriteria().getValues().get("groupId"));
+ if (criteriaMap.get("groupId") != null) {
+ int groupId = Integer.parseInt((String)
criteriaMap.get("groupId"));
criteria.addFilterImplicitGroupIds(groupId);
}
- if (request.getCriteria().getValues().get(NAME.propertyName()) != null) {
- criteria.addFilterName((String)
request.getCriteria().getValues().get(NAME.propertyName()));
+ if (criteriaMap.get(NAME.propertyName()) != null) {
+ criteria.addFilterName((String) criteriaMap.get(NAME.propertyName()));
}
- if (request.getCriteria().getValues().get(CATEGORY.propertyName()) != null) {
- criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String)
request.getCriteria().getValues()
- .get(CATEGORY.propertyName())).toUpperCase()));
+ if (criteriaMap.get(CATEGORY.propertyName()) != null) {
+ criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String)
criteriaMap.get(CATEGORY
+ .propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get(AVAILABILITY.propertyName()) != null)
{
- criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String)
request.getCriteria().getValues()
- .get(AVAILABILITY.propertyName())).toUpperCase()));
+ if (criteriaMap.get(AVAILABILITY.propertyName()) != null) {
+ criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String)
criteriaMap.get(AVAILABILITY
+ .propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) {
- criteria.addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get(
- TYPE.propertyName()))));
+ if (criteriaMap.get(TYPE.propertyName()) != null) {
+ criteria.addFilterResourceTypeId(Integer.parseInt(((String)
criteriaMap.get(TYPE.propertyName()))));
}
- if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) {
- criteria.addFilterPluginName((String)
request.getCriteria().getValues().get(PLUGIN.propertyName()));
+ if (criteriaMap.get(PLUGIN.propertyName()) != null) {
+ criteria.addFilterPluginName((String)
criteriaMap.get(PLUGIN.propertyName()));
}
- if (request.getCriteria().getValues().get("tag") != null) {
- criteria.addFilterTag((Tag)
request.getCriteria().getValues().get("tag"));
+ if (criteriaMap.get("tag") != null) {
+ criteria.addFilterTag((Tag) criteriaMap.get("tag"));
}
- if (request.getCriteria().getValues().get("tagNamespace") != null) {
- criteria.addFilterTagNamespace((String)
request.getCriteria().getValues().get("tagNamespace"));
+ if (criteriaMap.get("tagNamespace") != null) {
+ criteria.addFilterTagNamespace((String)
criteriaMap.get("tagNamespace"));
}
- if (request.getCriteria().getValues().get("tagSemantic") != null) {
- criteria.addFilterTagSemantic((String)
request.getCriteria().getValues().get("tagSemantic"));
+ if (criteriaMap.get("tagSemantic") != null) {
+ criteria.addFilterTagSemantic((String)
criteriaMap.get("tagSemantic"));
}
- if (request.getCriteria().getValues().get("tagName") != null) {
- criteria.addFilterTagName((String)
request.getCriteria().getValues().get("tagName"));
+ if (criteriaMap.get("tagName") != null) {
+ criteria.addFilterTagName((String) criteriaMap.get("tagName"));
}
return criteria;
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 1642c64..9a5993b 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
@@ -18,36 +18,27 @@
*/
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.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 java.util.ArrayList;
-import com.google.gwt.event.dom.client.KeyCodes;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
-import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
-import javax.persistence.Id;
-
-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.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;
-
/**
* @author Greg Hinkle
*/
@@ -90,24 +81,23 @@ public class ResourceSearchView extends Table {
setWidth100();
setHeight100();
-// DynamicForm searchPanel = new DynamicForm();
-// final TextItem searchBox = new TextItem("query", "Search
Resources");
-// searchBox.setValue("");
-// searchPanel.setWrapItemTitles(false);
-// searchPanel.setFields(searchBox);
-
+ // DynamicForm searchPanel = new DynamicForm();
+ // final TextItem searchBox = new TextItem("query", "Search
Resources");
+ // searchBox.setValue("");
+ // searchPanel.setWrapItemTitles(false);
+ // searchPanel.setFields(searchBox);
final ResourceDatasource datasource = new ResourceDatasource();
-// setTitleComponent(searchPanel);
+ // setTitleComponent(searchPanel);
setDataSource(datasource);
getListGrid().setSelectionType(SelectionStyle.SIMPLE);
-// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
- ListGridField iconField = new ListGridField("icon","", 40);
+ ListGridField iconField = new ListGridField("icon", "", 40);
ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(),
250);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
@@ -123,15 +113,14 @@ public class ResourceSearchView extends Table {
ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(),
AVAILABILITY.title(), 55);
availabilityField.setAlign(Alignment.CENTER);
getListGrid().setFields(idField, iconField, nameField, descriptionField,
typeNameField, pluginNameField,
- categoryField, availabilityField);
-
- addTableAction("Uninventory", Table.SelectionEnablement.ANY,
- "Are you sure you want to delete # resources?", new
TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- getListGrid().removeSelectedData();
- }
- });
+ categoryField, availabilityField);
+ addTableAction("Uninventory", Table.SelectionEnablement.ANY, "Are
you sure you want to delete # resources?",
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ getListGrid().removeSelectedData();
+ }
+ });
/*searchBox.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
@@ -153,13 +142,10 @@ public class ResourceSearchView extends Table {
});*/
}
-
-
public int getMatches() {
return this.getListGrid().getTotalRows();
}
-
public void addResourceSelectedListener(ResourceSelectListener listener) {
selectListeners.add(listener);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
index 0623308..7713a23 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
@@ -59,7 +59,7 @@ public class OperationSchedulingStep extends AbstractWizardStep
implements ItemC
if (form == null) {
valuesManager = new ValuesManager();
- form = new DynamicForm();
+ form = getDynamicForm();
form.setValuesManager(valuesManager);
form.setWrapItemTitles(false);
form.setErrorOrientation(FormErrorOrientation.RIGHT);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
index 14ec617..1be6813 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
@@ -46,7 +46,7 @@ public class ConfigurationTemplateStep extends AbstractWizardStep {
public Canvas getCanvas() {
if (form == null) {
- form = new DynamicForm();
+ form = getDynamicForm();
TextItem nameItem = new TextItem("resourceName", "Resource
Name");
nameItem.setRequired(true);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
index 7731067..f2f15dc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
@@ -18,13 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
-import java.util.ArrayList;
import java.util.Collection;
-import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.Criterion;
-import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -41,8 +37,8 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> {
- public ResourceGroupSelector() {
- super();
+ public ResourceGroupSelector(String id) {
+ super(id);
}
protected DynamicForm getAvailableFilterForm() {
@@ -63,22 +59,39 @@ public class ResourceGroupSelector extends
AbstractSelector<ResourceGroup> {
return new SelectedResourceGroupsDataSource();
}
+ // TODO: Until
http://code.google.com/p/smartgwt/issues/detail?id=490 is fixed, avoid
AdvancedCriteria and always
+ // use server-side fetch and simple criteria. When fixed, use the commented version
below. Also see
+ // ResourceGroupDataSource.
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
String search = (String) availableFilterForm.getValue("search");
String category = (String)
availableFilterForm.getValue("groupCategory");
- ArrayList<Criterion> criteria = new ArrayList<Criterion>(2);
+ Criteria criteria = new Criteria();
if (null != search) {
- criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
+ criteria.addCriteria("name", search);
}
if (null != category) {
- criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ criteria.addCriteria("category", category);
}
- AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
- .size()]));
- return latestCriteria;
+ return criteria;
}
+ // protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
+ // String search = (String) availableFilterForm.getValue("search");
+ // String category = (String)
availableFilterForm.getValue("groupCategory");
+ // ArrayList<Criterion> criteria = new ArrayList<Criterion>(2);
+ // if (null != search) {
+ // criteria.add(new Criterion("name", OperatorId.CONTAINS,
search));
+ // }
+ // if (null != category) {
+ // criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ // }
+ // AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
+ // .size()]));
+ //
+ // return latestCriteria;
+ // }
+
public class SelectedResourceGroupsDataSource extends ResourceGroupsDataSource {
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index 0d25f38..2115988 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -23,14 +23,10 @@ import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceD
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 java.util.ArrayList;
import java.util.Collection;
-import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.Criterion;
import com.smartgwt.client.data.DSRequest;
-import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.IPickTreeItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -44,6 +40,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelecto
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
/**
* @author Greg Hinkle
@@ -52,8 +49,8 @@ public class ResourceSelector extends AbstractSelector<Resource>
{
private ResourceType requireType;
- public ResourceSelector() {
- super();
+ public ResourceSelector(String id) {
+ super(id);
}
public ResourceType getRequireType() {
@@ -66,75 +63,108 @@ public class ResourceSelector extends
AbstractSelector<Resource> {
}
protected DynamicForm getAvailableFilterForm() {
- DynamicForm availableFilterForm = new DynamicForm();
- availableFilterForm.setNumCols(6);
- final TextItem search = new TextItem("search", "Search");
-
- IPickTreeItem typeSelectItem = new IPickTreeItem("type",
"Type");
- typeSelectItem.setDataSource(new ResourceTypePluginTreeDataSource());
- typeSelectItem.setValueField("id");
- typeSelectItem.setCanSelectParentItems(true);
- typeSelectItem.setLoadDataOnDemand(false);
- typeSelectItem.setEmptyMenuMessage("Loading...");
- typeSelectItem.setShowIcons(true);
-
- if (requireType != null) {
- // TODO: Currently ignore the typeSelectItem widget because we already know
the type.
- // Alternatively, we could display it disabled but we'd want the type
name to be displayed as the
- // value. To get this to display the type name I think we need to pre-fetch
the type tree here. We could
- // potentially optimize typeSelectItem.setValue(requireType.getId()) to build
a tree that includes only
- // this single type.
- //typeSelectItem.setValue(requireType.getId());
- //typeSelectItem.setDisabled(true);
- availableFilterForm.setItems(search);
- } else {
- SelectItem categorySelect = new SelectItem("category",
"Category");
- categorySelect.setValueMap("Platform", "Server",
"Service");
- categorySelect.setAllowEmptyValue(true);
-
- availableFilterForm.setItems(search, typeSelectItem, categorySelect);
+ if (null == availableFilterForm) {
+ availableFilterForm = new
LocatableDynamicForm("AvailableFilterForm");
+ availableFilterForm.setNumCols(6);
+ final TextItem search = new TextItem("search",
"Search");
+
+ IPickTreeItem typeSelectItem = new IPickTreeItem("type",
"Type");
+ typeSelectItem.setDataSource(new ResourceTypePluginTreeDataSource());
+ typeSelectItem.setValueField("id");
+ typeSelectItem.setCanSelectParentItems(true);
+ typeSelectItem.setLoadDataOnDemand(false);
+ typeSelectItem.setEmptyMenuMessage("Loading...");
+ typeSelectItem.setShowIcons(true);
+
+ if (requireType != null) {
+ // TODO: Currently ignore the typeSelectItem widget because we already
know the type.
+ // Alternatively, we could display it disabled but we'd want the type
name to be displayed as the
+ // value. To get this to display the type name I think we need to
pre-fetch the type tree here. We could
+ // potentially optimize typeSelectItem.setValue(requireType.getId()) to
build a tree that includes only
+ // this single type.
+ //typeSelectItem.setValue(requireType.getId());
+ //typeSelectItem.setDisabled(true);
+ availableFilterForm.setItems(search);
+ } else {
+ SelectItem categorySelect = new SelectItem("category",
"Category");
+ categorySelect.setValueMap("Platform", "Server",
"Service");
+ categorySelect.setAllowEmptyValue(true);
+
+ availableFilterForm.setItems(search, typeSelectItem, categorySelect);
+ }
}
return availableFilterForm;
}
protected RPCDataSource<Resource> getDataSource() {
- return new SelectedResourceDataSource();
+ if (null == datasource) {
+ datasource = new SelectedResourceDataSource();
+ }
+
+ return datasource;
}
+ // TODO: Until
http://code.google.com/p/smartgwt/issues/detail?id=490 is fixed, avoid
AdvancedCriteria and always
+ // use server-side fetch and simple criteria. When fixed, use the commented version
below. Also see
+ // ResourceDataSource.
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
String search = (String) availableFilterForm.getValue("search");
String type = availableFilterForm.getValueAsString("type");
String category = (String) availableFilterForm.getValue("category");
- ArrayList<Criterion> criteria = new ArrayList<Criterion>(3);
+ Criteria criteria = new Criteria();
if (null != search) {
- criteria.add(new Criterion(NAME.propertyName(), OperatorId.CONTAINS,
search));
+ criteria.addCriteria(NAME.propertyName(), search);
}
if (null != type) {
// If type is a number its a typeId, otherwise a plugin name
try {
Integer.parseInt(type);
- criteria.add(new Criterion(TYPE.propertyName(), OperatorId.EQUALS,
type));
+ criteria.addCriteria(TYPE.propertyName(), type);
} catch (NumberFormatException nfe) {
- criteria.add(new Criterion(PLUGIN.propertyName(), OperatorId.EQUALS,
type));
+ criteria.addCriteria(PLUGIN.propertyName(), type);
}
}
if (null != category) {
- criteria.add(new Criterion(CATEGORY.propertyName(), OperatorId.EQUALS,
category));
+ criteria.addCriteria(CATEGORY.propertyName(), category);
}
- AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
- .size()]));
- return latestCriteria;
+ return criteria;
}
+ // protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
+ // String search = (String) availableFilterForm.getValue("search");
+ // String type = availableFilterForm.getValueAsString("type");
+ // String category = (String) availableFilterForm.getValue("category");
+ // ArrayList<Criterion> criteria = new ArrayList<Criterion>(3);
+ // if (null != search) {
+ // criteria.add(new Criterion(NAME.propertyName(), OperatorId.CONTAINS,
search));
+ // }
+ // if (null != type) {
+ // // If type is a number its a typeId, otherwise a plugin name
+ // try {
+ // Integer.parseInt(type);
+ // criteria.add(new Criterion(TYPE.propertyName(), OperatorId.EQUALS,
type));
+ // } catch (NumberFormatException nfe) {
+ // criteria.add(new Criterion(PLUGIN.propertyName(), OperatorId.EQUALS,
type));
+ // }
+ // }
+ // if (null != category) {
+ // criteria.add(new Criterion(CATEGORY.propertyName(), OperatorId.EQUALS,
category));
+ // }
+ // AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
+ // .size()]));
+ //
+ // return latestCriteria;
+ //}
+
private class SelectedResourceDataSource extends ResourceDatasource {
@Override
public ListGridRecord[] buildRecords(Collection<Resource> resources) {
ListGridRecord[] records = super.buildRecords(resources);
for (ListGridRecord record : records) {
- if (selection.contains(record.getAttributeAsInt("id"))) {
+ if (getSelection().contains(record.getAttributeAsInt("id"))) {
record.setEnabled(false);
}
}
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 d761dbd..53909d1 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
@@ -29,6 +29,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* @author Greg Hinkle
@@ -87,9 +88,10 @@ public class MenuBarView extends VLayout {
// loggedInAs.setWrap(false);
// loggedInAs.setValign(VerticalAlignment.CENTER);
// helpLayout.addMember(loggedInAs);
- topStrip.addMember(new Hyperlink("Help", "Help"));
- topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
- topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
+
+ topStrip.addMember(SeleniumUtility.setHtmlId(new Hyperlink("Help",
"Help")));
+ topStrip.addMember(SeleniumUtility.setHtmlId(new
Hyperlink("Preferences", "Preferences")));
+ topStrip.addMember(SeleniumUtility.setHtmlId(new Hyperlink("Log Out",
"LogOut")));
// helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
// topStrip.addMember(helpLayout);
@@ -140,6 +142,7 @@ public class MenuBarView extends VLayout {
styleClass += "Selected";
}
+ // Set explicit identifiers because the generated scLocator is not getting
picked up by Selenium.
headerString.append("<td id=\"" + section + "\"
class=\"" + styleClass
+ "\" onclick=\"document.location='#" + section +
"'\" >");
headerString.append(section);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableDynamicForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableDynamicForm.java
new file mode 100644
index 0000000..6daedc2
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableDynamicForm.java
@@ -0,0 +1,24 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.form.DynamicForm that sets the ID for use with
selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableDynamicForm extends DynamicForm {
+
+ /**
+ * <pre>
+ * ID Format: "scClassname-id"
+ * </pre>
+ * @param id not null or empty.
+ */
+ public LocatableDynamicForm(String id) {
+ super();
+ String locatorId = this.getScClassName() + "-" + id;
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableIButton.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableIButton.java
new file mode 100644
index 0000000..74d01ae
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableIButton.java
@@ -0,0 +1,24 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.IButton;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.IButton that sets the ID for use with selenium
scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableIButton extends IButton {
+
+ /**
+ * <pre>
+ * ID Format: "scClassname-title"
+ * </pre>
+ * @param id not null or empty.
+ */
+ public LocatableIButton(String title) {
+ super(title);
+ String locatorId = this.getScClassName() + "-" + title;
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
new file mode 100644
index 0000000..739aee5
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
@@ -0,0 +1,23 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.grid.ListGrid;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.grid.ListGrid that sets the ID for use with
selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableListGrid extends ListGrid {
+
+ /**
+ * <pre>
+ * ID Format: "scClassname-id"
+ * </pre>
+ * @param id not null or empty.
+ */
+ public LocatableListGrid(String id) {
+ super();
+ String locatorId = this.getScClassName() + "-" + id;
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTransferImgButton.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTransferImgButton.java
new file mode 100644
index 0000000..e254411
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTransferImgButton.java
@@ -0,0 +1,47 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.TransferImgButton;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.TransferImgButton that sets the ID for use
with selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableTransferImgButton extends TransferImgButton {
+
+ /**
+ * <pre>
+ * ID Format: "scClassname-img.toString()"
+ * </pre>
+ * @param id not null or empty.
+ */
+ public LocatableTransferImgButton(TransferImg img) {
+ super(img);
+ String locatorId = this.getScClassName() + "-" + getSuffix(img);
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+
+ private String getSuffix(TransferImg img) {
+ if (TransferImgButton.LEFT == img)
+ return "LEFT";
+ if (TransferImgButton.LEFT_ALL == img)
+ return "LEFT_ALL";
+ if (TransferImgButton.RIGHT == img)
+ return "RIGHT";
+ if (TransferImgButton.RIGHT_ALL == img)
+ return "RIGHT_ALL";
+ if (TransferImgButton.UP == img)
+ return "UP";
+ if (TransferImgButton.UP_FIRST == img)
+ return "UP_FIRST";
+ if (TransferImgButton.DOWN == img)
+ return "DOWN";
+ if (TransferImgButton.DOWN_LAST == img)
+ return "DOWN_LAST";
+ if (TransferImgButton.DELETE == img)
+ return "DELETE";
+
+ return img.toString();
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTreeGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTreeGrid.java
new file mode 100644
index 0000000..317d795
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableTreeGrid.java
@@ -0,0 +1,22 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.tree.TreeGrid;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.tree.TreeGrid that sets the ID for use with
selenium scLocators.
+ *
+ * @author jay shaughnessy
+ */
+public class LocatableTreeGrid extends TreeGrid {
+
+ /**
+ * ID set explicitly
+ * @param id not null or empty
+ */
+ public LocatableTreeGrid(String id) {
+ super();
+ String locatorId = this.getScClassName() + "-" + id;
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java
new file mode 100644
index 0000000..aa2c7dd
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java
@@ -0,0 +1,24 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.smartgwt.client.widgets.layout.VLayout;
+
+/**
+ * Wrapper for com.smartgwt.client.widgets.layout.VLayout that sets the ID for use with
selenium scLocators.
+ *
+ * @author Jay Shaughnessy
+ */
+public class LocatableVLayout extends VLayout {
+
+ /**
+ * <pre>
+ * ID Format: "scClassname-id"
+ * </pre>
+ * @param id not null or empty.
+ */
+ public LocatableVLayout(String id) {
+ super();
+ String locatorId = this.getScClassName() + "-" + id;
+ setID(SeleniumUtility.getSafeId(locatorId, locatorId));
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java
new file mode 100644
index 0000000..a4d01ea
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java
@@ -0,0 +1,109 @@
+package org.rhq.enterprise.gui.coregui.client.util.selenium;
+
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.UIObject;
+import com.smartgwt.client.widgets.BaseWidget;
+
+/**
+ * Utilities for assisting with Selenium Automation
+ *
+ * @author Jay Shaughnessy
+ */
+public class SeleniumUtility {
+
+ /** A default id that is not ecommended as it will clash with any other element set
to the default */
+ public static final String DEFAULT_ID = "DefaultID";
+
+ /**
+ * A utility for assigning an ID to a smartgwt widget. Any current ID will be
overwritten. The algorithm is:
+ * <pre>
+ * If the widget has a non-empty title, the ID is set to the title, with spaces
removed.
+ * Else the ID is set to the widget's hashcode
+ * </pre>
+ * @return the updated widget
+ * @return the ID.
+ */
+ static public <T extends BaseWidget> T setId(final T widget, String unsafeId)
{
+ String id = getSafeId(unsafeId, String.valueOf(widget.hashCode()));
+ widget.setID(id);
+ return widget;
+ }
+
+ /**
+ * A utility for assigning an ID to a smartgwt widget. Any current ID will be
overwritten. The algorithm is:
+ * <pre>
+ * Equivalent to setId(widget, widget.getTitle());
+ * </pre>
+ * @return the updated widget
+ * @return the ID.
+ */
+ static public <T extends BaseWidget> T setId(final T widget) {
+ return setId(widget, widget.getTitle());
+ }
+
+ /**
+ * A utility for assigning an ID to a gwt uiobject. For a smartgwt widget use {@link
setId(BaseWidget)}.
+ * Any current ID will be overwritten. The algorithm is:
+ * <pre>
+ * If the unsafeId parameter is non-empty, the ID is set to the unsafeId, with
spaces removed.
+ * Else the ID is set to the uiobject's hashcode
+ * </pre>
+ *
+ * @param uiObject
+ * @param unsafeId
+ * @return the updated uiObject
+ */
+ static public <T extends UIObject> T setHtmlId(final T uiObject, String
unsafeId) {
+ String id = getSafeId(unsafeId, String.valueOf(uiObject.hashCode()));
+ uiObject.getElement().setAttribute("id", id);
+ return uiObject;
+ }
+
+ /**
+ * A utility for assigning an ID to a gwt Hyperlink. For a smartgwt widget
+ * use {@link setId(BaseWidget)}. Any current ID will be overwritten. The algorithm
is:
+ * <pre>
+ * Equivalent to setHtmlId(hyperlink, hyperlink.getText());
+ * </pre>
+ *
+ * @param hyperlink
+ * @return the updated hyperlink
+ */
+ static public <T extends Hyperlink> T setHtmlId(final T hyperlink) {
+ return setHtmlId(hyperlink, hyperlink.getText());
+ }
+
+ /**
+ * Use only if you are sure the unsafeId is not null or empty, or if DEFAULT_ID is
acceptable.
+ * <pre>
+ * Equivalent to:
+ *
+ * getSafeId( unsafeId, DEFAULT_ID );
+ * </pre>
+ * @param unsafeId The desired Id but with potential problems
+ * @return a safe version of unsafeId, or, if unsafeId is null or empty, DEFAULT_ID
+ */
+ static public String getSafeId(String unsafeId) {
+
+ return getSafeId(unsafeId, DEFAULT_ID);
+ }
+
+ /**
+ * Currently performs the following:
+ * <pre>
+ * - removes spaces
+ * - removes dots
+ * </pre>
+ * @param unsafeId The desired Id but with potential problems
+ * @param defaultId
+ * @return a safe version of unsafeId, or, if unsafeId is null or empty, defaultId
+ */
+ static public String getSafeId(String unsafeId, String defaultId) {
+ if ((null == unsafeId || unsafeId.trim().isEmpty())) {
+ return defaultId;
+ }
+
+ String safeId = unsafeId.replace(" ",
"").replace(".", "");
+ return safeId;
+ }
+}
commit 7677e9f4712c8915e3ca7782797d5e26d40884f4
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 17 16:34:39 2010 -0400
JmxConnectionHelper.loadConnection() should set JAR_TEMP_DIR EMS control prop to PC
temp dir even when PC is running in embedded mode (i.e. in the admin-console)
(
https://bugzilla.redhat.com/show_bug.cgi?id=624817)
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JmxConnectionHelper.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JmxConnectionHelper.java
index 24e3b25..c07254a 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JmxConnectionHelper.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JmxConnectionHelper.java
@@ -54,7 +54,8 @@ public class JmxConnectionHelper {
private static final String JNP_DISABLE_DISCOVERY_JNP_INIT_PROP =
"jnp.disableDiscovery";
/**
- * This is the timeout for the initial connection to the MBeanServer that is made by
{@link #start(ResourceContext)}.
+ * This is the timeout for the initial connection to the MBeanServer that is made by
+ * {@link
org.rhq.plugins.jbossas5.ApplicationServerComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)}.
*/
private static final int JNP_TIMEOUT = 30 * 1000; // 30 seconds
/**
@@ -189,12 +190,15 @@ public class JmxConnectionHelper {
// application files (making us unable to update them) Bug:
JBNADM-670
connectionSettings.getControlProperties().setProperty(ConnectionFactory.COPY_JARS_TO_TEMP,
String.valueOf(Boolean.TRUE));
-
- // But tell it to put them in a place that we clean up when shutting
down the agent
-
connectionSettings.getControlProperties().setProperty(ConnectionFactory.JAR_TEMP_DIR,
- tmpDir.getAbsolutePath());
}
+ // Tell EMS to use the plugin's temp dir, so the PC will be able to
clean it up and so an access control
+ // policy can easily be defined for the dir. EMS will use this for
connection libraries (i.e. client
+ // jars) if COPY_JARS control prop is true, but it will also use it for
the ems-mpl jar no matter what,
+ // so we need to always set it.
+
connectionSettings.getControlProperties().setProperty(ConnectionFactory.JAR_TEMP_DIR,
+ tmpDir.getAbsolutePath());
+
connectionSettings.getAdvancedProperties().setProperty(InternalVMTypeDescriptor.DEFAULT_DOMAIN_SEARCH,
"jboss");
diff --git
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
index 3597999..89cbd72 100644
---
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
+++
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
@@ -199,6 +199,7 @@ public class TomcatServerComponent implements JMXComponent,
MeasurementFacet, Op
// Tell EMS to make copies of jar files so that the ems classloader
doesn't lock
// application files (making us unable to update them) Bug:
JBNADM-670
+ // TODO (ips): Turn this off in the embedded case.
connectionSettings.getControlProperties().setProperty(ConnectionFactory.COPY_JARS_TO_TEMP,
String.valueOf(Boolean.TRUE));
commit 8e0791428b1a223e40a898b7f5e4fcd186d900b6
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 14:57:15 2010 -0400
build fix
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
index bec014a..26725b2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
@@ -31,6 +31,7 @@ import
com.smartgwt.client.widgets.form.validator.IntegerRangeValidator;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
+
import org.rhq.enterprise.gui.coregui.client.components.table.TableWidget;
/**
@@ -59,7 +60,8 @@ public class UpdateCollectionIntervalWidget extends HLayout implements
TableWidg
this.form = new DynamicForm();
this.form.setNumCols(3);
- IntegerItem intervalItem = new IntegerItem("interval");
+ IntegerItem intervalItem = new IntegerItem();
+ intervalItem.setName("interval");
intervalItem.setTitle("Collection Interval");
IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
integerRangeValidator.setMin(1);
commit d60565141f6a981e068721ca2dc95e8034ffaced
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 14:53:53 2010 -0400
Last of resource breadcrumb update issues (tab/subtab location)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 410a4a4..5c0671c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import java.util.Set;
+
import com.google.gwt.user.client.History;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -45,8 +47,6 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
-import java.util.Set;
-
/**
* Right panel of the Resource view.
*
@@ -242,8 +242,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.selectTab(0);
}
- // TODO: This doesn't seem to actually be calling redraw(), draw(), or
onDraw() on topTabSet, so subtab
- // enablement isn't getting updated...
topTabSet.markForRedraw();
}
@@ -258,7 +256,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
String path = "Resource/" +
this.resourceComposite.getResource().getId() + tabPath;
// But still add an item to the history, specifying false to tell it not to
fire an event.
- History.newItem(path, false);
+ History.newItem(path, true);
}
}
commit 67902b25277e9cc1ae27ff0f9122a4223d098df3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 17 14:34:48 2010 -0400
misc minor fixes and tweaks
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
index 1bc3202..595a216 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
@@ -160,9 +160,9 @@ public class BundleDeploymentView extends VLayout implements
BookmarkableView {
Table table = new Table("Deployment Machines");
- table.setTitleComponent(new HTMLFlow("Select a row to show install
detials"));
+ table.setTitleComponent(new HTMLFlow("Select a row to show install
details."));
- ListGridField resourceIcon = new ListGridField("resourceAvailabity",
"");
+ ListGridField resourceIcon = new ListGridField("resourceAvailability",
"");
HashMap<String, String> icons = new HashMap<String, String>();
icons.put("UP", "types/Platform_up_16.png");
icons.put("DOWN", "types/Platform_down_16.png");
@@ -204,7 +204,7 @@ public class BundleDeploymentView extends VLayout implements
BookmarkableView {
record.setAttribute("resource", rd.getResource().getName());
- record.setAttribute("resourceAvailabity",
rd.getResource().getCurrentAvailability().getAvailabilityType().name());
+ record.setAttribute("resourceAvailability",
rd.getResource().getCurrentAvailability().getAvailabilityType().name());
record.setAttribute("resourceId", rd.getResource().getId());
record.setAttribute("resourceVersion",
rd.getResource().getVersion());
record.setAttribute("status", rd.getStatus().name());
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 7b6ca8e..d35ec53 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
@@ -54,7 +54,6 @@ public class Table extends VLayout {
private static final SelectionEnablement DEFAULT_SELECTION_ENABLEMENT =
SelectionEnablement.ALWAYS;
- private HLayout titleLayout;
private HTMLFlow title;
private Canvas titleComponent;
@@ -133,7 +132,7 @@ public class Table extends VLayout {
// Title
title = new HTMLFlow();
- setTableTitle(tableTitle);
+ setTableTitle(tableTitle);
// Grid
listGrid = new ListGrid();
@@ -192,7 +191,7 @@ public class Table extends VLayout {
if (showHeader) {
- titleLayout = new HLayout();
+ HLayout titleLayout = new HLayout();
titleLayout.setAutoHeight();
titleLayout.setAlign(VerticalAlignment.BOTTOM);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
index e4daee2..bec014a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
@@ -1,3 +1,21 @@
+/*
+ * 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.common;
import com.smartgwt.client.widgets.IButton;
@@ -16,7 +34,11 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.components.table.TableWidget;
/**
- * TODO
+ * Widget for updating the collection intervals on the selected metrics. It displays two
form fields for
+ * entering the interval and the interval's units (seconds, minutes, or hours), as
well as a Set button
+ * for submitting the update.
+ *
+ * @author Ian Springer
*/
public class UpdateCollectionIntervalWidget extends HLayout implements TableWidget {
private AbstractMeasurementScheduleListView schedulesView;
@@ -37,7 +59,8 @@ public class UpdateCollectionIntervalWidget extends HLayout implements
TableWidg
this.form = new DynamicForm();
this.form.setNumCols(3);
- IntegerItem intervalItem = new IntegerItem("interval", "Collection
Interval");
+ IntegerItem intervalItem = new IntegerItem("interval");
+ intervalItem.setTitle("Collection Interval");
IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
integerRangeValidator.setMin(1);
intervalItem.setValidators(integerRangeValidator);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
index ea28b3f..ccf8ee3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
@@ -1,3 +1,21 @@
+/*
+ * 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.monitoring.schedules;
import com.google.gwt.user.client.rpc.AsyncCallback;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
index d944bd0..a9b10f2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
@@ -1,3 +1,21 @@
+/*
+ * 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.monitoring.schedules;
import com.smartgwt.client.data.Criteria;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
index 10a5646..4dd6710 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
@@ -1,3 +1,21 @@
+/*
+ * 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.resource.detail.monitoring.schedules;
import com.google.gwt.user.client.rpc.AsyncCallback;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
index f9a1d80..9b60119 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
@@ -1,3 +1,21 @@
+/*
+ * 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.resource.detail.monitoring.schedules;
import com.smartgwt.client.data.Criteria;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/tables/resource/ResourceMetricsTableUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/tables/resource/ResourceMetricsTableUIBean.java
index dee8e9d..13092b8 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/tables/resource/ResourceMetricsTableUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/tables/resource/ResourceMetricsTableUIBean.java
@@ -38,6 +38,8 @@ import
org.rhq.enterprise.server.measurement.uibean.MetricDisplaySummary;
import org.rhq.enterprise.server.util.LookupUtil;
/**
+ * The JSF managed bean that backs /rhq/resource/monitor/traits.xhtml.
+ *
* @author Greg Hinkle
* @author Joseph Marques
*/
commit 645db4e980313895ff6b95fcbe9fdbc680b71acd
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 17 14:30:03 2010 -0400
Fix a problem with LogOut
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 7cd621b..1e863fb 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
@@ -169,8 +169,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
Subject subject = result.get(0);
subject.setSessionId(sessionId);
setSessionSubject(subject);
- System.out.println("Portal-War logged
in");
-
+ //System.out.println("Portal-War logged
in");
}
});
} else {
@@ -311,6 +310,15 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
CoreGUI.sessionSubject = subject;
CoreGUI.userPreferences = new UserPreferences(subject);
loadProductInfo();
+ // After a user initiated logout start back at the default view
+ if ("LogOut".equals(CoreGUI.currentPath)) {
+ History.newItem(getDefaultView());
+ }
+ }
+
+ private static String getDefaultView() {
+ // TODO: should this be Dashboard or a User Preference?
+ return "";
}
public static void setContent(Canvas newContent) {
@@ -369,7 +377,6 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
// default view
History.newItem("Dashboard");
} else {
-
if (!viewPath.getCurrent().equals(currentViewId)) {
currentViewId = viewPath.getCurrent();
commit a4aeccc47dbe35f45160de17dc2b8c5205ac7fa6
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 13:47:13 2010 -0400
Moving this off my shelf, a plugin oriented tree view for the plugin config, template
metric and alert settings pages
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java
new file mode 100644
index 0000000..5970507
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java
@@ -0,0 +1,115 @@
+/*
+ * 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.type;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tree.TreeGrid;
+import com.smartgwt.client.widgets.tree.TreeGridField;
+import com.smartgwt.client.widgets.tree.TreeNode;
+
+import org.rhq.core.domain.criteria.ResourceTypeCriteria;
+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.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
+
+/**
+ * @author Greg Hinkle
+ */
+public class PluginTypeTreeView extends VLayout {
+
+ private ResourceTypeGWTServiceAsync resourceTypeService =
GWTServiceLookup.getResourceTypeGWTService();
+
+ public PluginTypeTreeView() {
+ setWidth100();
+ setHeight100();
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+
+ final TreeGrid treeGrid = new CustomResourceTypeTreeGrid();
+
+ treeGrid.setHeight100();
+
+ treeGrid.setTitle("Resource Types");
+ treeGrid.setAnimateFolders(false);
+ treeGrid.setResizeFieldsInRealTime(true);
+
+
+ final TreeGridField name, plugin, category;
+ name = new TreeGridField("name");
+ plugin = new TreeGridField("plugin");
+ category = new TreeGridField("category");
+
+ treeGrid.setFields(name, plugin, category);
+
+ addMember(treeGrid);
+
+ ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+ criteria.fetchParentResourceTypes(true);
+ criteria.setPageControl(PageControl.getUnlimitedInstance());
+
+ resourceTypeService.findResourceTypesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
inventory discovery queue", caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+
+
treeGrid.getTree().linkNodes(ResourceTypePluginTreeDataSource.buildNodes(result));
+
+ }
+ });
+ }
+
+
+ public static class CustomResourceTypeTreeGrid extends TreeGrid {
+ @Override
+ protected String getIcon(Record record, boolean defaultState) {
+
+ if (record instanceof TreeNode) {
+ boolean open = getTree().isOpen((TreeNode) record);
+
+ if (record instanceof
ResourceTypePluginTreeDataSource.ResourceTypeTreeNode) {
+ ResourceType resourceType =
((ResourceTypePluginTreeDataSource.ResourceTypeTreeNode) record).getResourceType();
+
+ switch (resourceType.getCategory()) {
+ case PLATFORM:
+ return "types/Platform_up_16.png";
+ case SERVER:
+ return "types/Server_up_16.png";
+ case SERVICE:
+ return "types/Service_up_16.png";
+ }
+ } else if (record instanceof
ResourceTypePluginTreeDataSource.PluginTreeNode) {
+ return "types/plugin_16.png";
+ }
+ }
+ return null;
+ }
+ }
+}
commit 528c6e5fb51b0f5c6fdc5dc10adb5c58c1279305
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 13:44:28 2010 -0400
dead code removal
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
index 49e3974..c1dd21b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-import java.util.ArrayList;
import java.util.Date;
import java.util.EnumSet;
import java.util.List;
@@ -42,9 +41,7 @@ import ca.nanometrics.gflot.client.options.TickFormatter;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.AnimationEffect;
-import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.WidgetCanvas;
@@ -57,8 +54,6 @@ import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.criteria.ResourceCriteria;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementConverterClient;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
@@ -132,7 +127,7 @@ public class SmallGraphView extends VLayout {
public void setDefinitionId(int definitionId) {
this.definitionId = definitionId;
- this.definition = null;
+ this.definition = null;
}
@Override
@@ -260,8 +255,6 @@ public class SmallGraphView extends VLayout {
// create a series
if (definition != null && data != null) {
loadData(model, plotOptions);
- } else {
- loadFakeData(model, plotOptions);
}
// create the plot
@@ -362,29 +355,6 @@ public class SmallGraphView extends VLayout {
}
- private void loadFakeData(PlotModel model, PlotOptions plotOptions) {
- SeriesHandler handler = model.addSeries("Ottawa's Month
Temperatures", "#007f00");
-
- // add data
- handler.add(new DataPoint(1, -10.5));
- handler.add(new DataPoint(2, -8.6));
- handler.add(new DataPoint(3, -2.4));
- handler.add(new DataPoint(4, 6));
- handler.add(new DataPoint(5, 13.6));
- handler.add(new DataPoint(6, 18.4));
- handler.add(new DataPoint(7, 21));
- handler.add(new DataPoint(8, 19.7));
- handler.add(new DataPoint(9, 14.7));
- handler.add(new DataPoint(10, 8.2));
- handler.add(new DataPoint(11, 1.5));
- handler.add(new DataPoint(12, -6.6));
-
- plotOptions.setXAxisOptions(new AxisOptions().setTicks(12).setTickFormatter(new
TickFormatter() {
- public String formatTickValue(double tickValue, Axis axis) {
- return MONTH_NAMES[(int) (tickValue - 1)];
- }
- }));
- }
private void displayAsDialog() {
SmallGraphView graph = new SmallGraphView(resourceId, definition, data);
commit 7470277296582f98c47457509dbeb827e126e0a8
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 13:41:39 2010 -0400
ResourceTree preloading, preopening, lazy fixes
Resource breadcrumb fixes
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
index efed5ff..535cdca 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import java.util.EnumSet;
+
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -37,8 +39,6 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import java.util.EnumSet;
-
/**
* @author Greg Hinkle
*/
@@ -125,7 +125,6 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
private void completeSetSelectedResource(ResourceComposite resourceComposite,
ViewPath viewPath) {
this.currentResource = resourceComposite;
- this.treeView.setSelectedResource(resourceComposite.getResource(),
viewPath.getCurrent());
this.detailView.onResourceSelected(resourceComposite);
}
@@ -152,8 +151,9 @@ public class ResourceTopView extends HLayout implements
BookmarkableView {
setSelectedResource(resourceId, viewPath);
}
- viewPath.next();
this.treeView.renderView(viewPath);
+
+ viewPath.next();
this.detailView.renderView(viewPath);
}
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 67417dd..1adee12 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
@@ -23,13 +23,11 @@ import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
-import com.google.gwt.user.client.Window;
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.DataSource;
import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.fields.DataSourceImageField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.rpc.RPCResponse;
@@ -142,6 +140,7 @@ public class ResourceTreeDatasource extends DataSource {
// criteria.addFilterId(rootId);
processIncomingData(initialData, response, requestId);
+ response.setStatus(DSResponse.STATUS_SUCCESS);
return;
} else {
@@ -174,7 +173,7 @@ public class ResourceTreeDatasource extends DataSource {
public void onResourceTypeLoaded(List<Resource> result) {
response.setData(build(result));
processResponse(requestId, response);
-
+ response.setStatus(DSResponse.STATUS_SUCCESS);
}
});
}
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 02570b6..f01e0e6 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
@@ -18,7 +18,36 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
+import com.smartgwt.client.widgets.grid.events.SelectionEvent;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.menu.Menu;
+import com.smartgwt.client.widgets.menu.MenuItem;
+import com.smartgwt.client.widgets.menu.MenuItemSeparator;
+import com.smartgwt.client.widgets.menu.events.ClickHandler;
+import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
+import com.smartgwt.client.widgets.tree.TreeGrid;
+import com.smartgwt.client.widgets.tree.TreeNode;
+import com.smartgwt.client.widgets.tree.events.DataArrivedEvent;
+import com.smartgwt.client.widgets.tree.events.DataArrivedHandler;
+import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent;
+import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler;
+
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
import org.rhq.core.domain.dashboard.DashboardPortlet;
@@ -43,38 +72,13 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.Resource
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
-import com.smartgwt.client.widgets.events.CloseClientEvent;
-import com.smartgwt.client.widgets.events.ShowContextMenuEvent;
-import com.smartgwt.client.widgets.events.ShowContextMenuHandler;
-import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
-import com.smartgwt.client.widgets.grid.events.SelectionEvent;
-import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuItem;
-import com.smartgwt.client.widgets.menu.MenuItemSeparator;
-import com.smartgwt.client.widgets.menu.events.ClickHandler;
-import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
-import com.smartgwt.client.widgets.tree.TreeGrid;
-import com.smartgwt.client.widgets.tree.TreeNode;
-import com.smartgwt.client.widgets.tree.events.DataArrivedEvent;
-import com.smartgwt.client.widgets.tree.events.DataArrivedHandler;
-import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent;
-import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler;
-
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.List;
-
/**
* @author Greg Hinkle
*/
public class ResourceTreeView extends VLayout {
+
+ private int selectedResourceId;
+
private Resource selectedResource;
private Resource rootResource;
@@ -138,7 +142,6 @@ public class ResourceTreeView extends VLayout {
}
}
-
}
}
});
@@ -147,7 +150,7 @@ public class ResourceTreeView extends VLayout {
// This constructs the context menu for the resource at the time of the click.
setContextMenu(contextMenu);
-
+
treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() {
public void onNodeContextClick(final NodeContextClickEvent event) {
@@ -161,6 +164,44 @@ public class ResourceTreeView extends VLayout {
}
}
});
+
+ treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
+ public void onDataArrived(DataArrivedEvent dataArrivedEvent) {
+ if (!initialSelect) {
+
+ updateBreadcrumb();
+ }
+ }
+ });
+ }
+
+ private void updateBreadcrumb() {
+ TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResourceId));
+// System.out.println("Trying to preopen: "
+ selectedNode);
+ if (selectedNode != null) {
+ TreeNode[] parents = treeGrid.getTree().getParents(selectedNode);
+ treeGrid.getTree().openFolders(parents);
+ treeGrid.getTree().openFolder(selectedNode);
+
+ for (TreeNode p : parents) {
+// System.out.println("open? " +
treeGrid.getTree().isOpen(p) + " node: " + p.getName());
+ }
+
+ treeGrid.selectRecord(selectedNode);
+ initialSelect = true;
+ treeGrid.markForRedraw();
+
+ // Update breadcrumbs
+ if (currentViewId != null) {
+ currentViewId.getBreadcrumbs().clear();
+ for (int i = parents.length - 1; i >= 0; i--) {
+ TreeNode n = parents[i];
+ adjustBreadcrumb(n, currentViewId);
+ }
+ adjustBreadcrumb(selectedNode, currentViewId);
+ CoreGUI.refreshBreadCrumbTrail();
+ }
+ }
}
@@ -252,7 +293,21 @@ public class ResourceTreeView extends VLayout {
MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName());
operationItem.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
- new OperationCreateWizard(selectedResource,
operationDefinition).startOperationWizard();
+
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(selectedResourceId);
+
+
GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria,
+ new AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
get resource to run operation",caught);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ new OperationCreateWizard(result.get(0),
operationDefinition).startOperationWizard();
+ }
+ });
+
}
});
opSubMenu.addItem(operationItem);
@@ -351,8 +406,6 @@ public class ResourceTreeView extends VLayout {
Menu defSubItem = new Menu();
defItem.setSubmenu(defSubItem);
-
-
for (final Dashboard d : result) {
MenuItem addToDBItem = new MenuItem("Add chart to Dashboard:
" + d.getName());
defSubItem.addItem(addToDBItem);
@@ -361,7 +414,7 @@ public class ResourceTreeView extends VLayout {
public void onClick(MenuItemClickEvent menuItemClickEvent) {
DashboardPortlet p = new
DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250);
- p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId()));
+ p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResourceId));
p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId()));
d.addPortlet(p, 0, 0);
@@ -405,12 +458,12 @@ public class ResourceTreeView extends VLayout {
this.rootResource = rootResource;
}
- public void setSelectedResource(final Resource selectedResource, final ViewId viewId)
{
- this.selectedResource = selectedResource;
+ public void setSelectedResource(final int selectedResourceId) {
+ this.selectedResourceId = selectedResourceId;
TreeNode node = null;
if (treeGrid != null && treeGrid.getTree() != null
- && (node =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) {
+ && (node =
treeGrid.getTree().findById(String.valueOf(selectedResourceId))) != null) {
// This is the case where the tree was previously loaded and we get fired to
look at a different
// node in the same tree and just have to switch the selection
@@ -423,6 +476,9 @@ public class ResourceTreeView extends VLayout {
treeGrid.selectRecord(node);
+ updateBreadcrumb();
+ /*
+ TODO DELETEME
// Update breadcrumbs
viewId.getBreadcrumbs().clear();
for (int i = parents.length - 1; i >= 0; i--) {
@@ -432,14 +488,15 @@ public class ResourceTreeView extends VLayout {
adjustBreadcrumb(node, viewId);
CoreGUI.refreshBreadCrumbTrail();
+*/
-
- // Todo: update viewId's breadcrumbs with known data
} else {
+ // This is for cases where we have to load the tree fresh including down to
the currently visible node
+
final ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
// This is an expensive call, but loads all nodes that are visible in the
tree given a selected resource
- resourceService.getResourceLineageAndSiblings(selectedResource.getId(), new
AsyncCallback<List<Resource>>() {
+ resourceService.getResourceLineageAndSiblings(selectedResourceId, new
AsyncCallback<List<Resource>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to lookup platform
for tree", caught);
}
@@ -457,39 +514,7 @@ public class ResourceTreeView extends VLayout {
setRootResource(root);
- treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
- public void onDataArrived(DataArrivedEvent dataArrivedEvent)
{
- if (!initialSelect) {
- TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()));
-// System.out.println("Trying to preopen: "
+ selectedNode);
- if (selectedNode != null) {
- TreeNode[] parents =
treeGrid.getTree().getParents(selectedNode);
- treeGrid.getTree().openFolders(parents);
- treeGrid.getTree().openFolder(selectedNode);
-
- for (TreeNode p : parents) {
-// System.out.println("open? " +
treeGrid.getTree().isOpen(p) + " node: " + p.getName());
- }
-
- treeGrid.selectRecord(selectedNode);
- initialSelect = true;
- treeGrid.markForRedraw();
-
- // Update breadcrumbs
- if (viewId != null) {
- viewId.getBreadcrumbs().clear();
- for (int i = parents.length - 1; i >= 0;
i--) {
- TreeNode n = parents[i];
- adjustBreadcrumb(n, viewId);
- }
- adjustBreadcrumb(selectedNode, viewId);
- CoreGUI.refreshBreadCrumbTrail();
- }
- }
- }
- }
- });
ResourceTreeDatasource dataSource = new
ResourceTreeDatasource(result);
treeGrid.setDataSource(dataSource);
@@ -500,7 +525,16 @@ public class ResourceTreeView extends VLayout {
addMember(treeGrid);
- TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()));
+ treeGrid.fetchData(treeGrid.getCriteria(),new DSCallback() {
+ public void execute(DSResponse dsResponse, Object o,
DSRequest dsRequest) {
+ System.out.println("Here!!!!!");
+ updateBreadcrumb();
+ }
+ });
+
+
+
+ TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResourceId));
// System.out.println("Trying to preopen: " +
selectedNode);
if (selectedNode != null) {
// System.out.println("Preopen node!!!");
@@ -512,6 +546,8 @@ public class ResourceTreeView extends VLayout {
System.out.println("open? " +
treeGrid.getTree().isOpen(p) + " node: " + p.getName());
}
+ updateBreadcrumb();
+
treeGrid.selectRecord(selectedNode);
initialSelect = true;
treeGrid.markForRedraw();
@@ -527,7 +563,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.getTree().linkNodes(ResourceTreeDatasource.build(result));
- TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()));
+ TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResourceId));
if (selectedNode != null) {
treeGrid.deselectAllRecords();
treeGrid.selectRecord(selectedNode);
@@ -536,6 +572,8 @@ public class ResourceTreeView extends VLayout {
treeGrid.getTree().openFolders(parents);
treeGrid.getTree().openFolder(selectedNode);
+ /*
+ todo deleteme
// Update breadcrumbs
viewId.getBreadcrumbs().clear();
for (int i = parents.length - 1; i >= 0;
i--) {
@@ -543,10 +581,10 @@ public class ResourceTreeView extends VLayout {
adjustBreadcrumb(n, viewId);
}
adjustBreadcrumb(selectedNode, viewId);
- CoreGUI.refreshBreadCrumbTrail();
+ CoreGUI.refreshBreadCrumbTrail();*/
} else {
- CoreGUI.getMessageCenter().notify(new
Message("Failed to select resource [" + selectedResource.getId() + "] in
tree.", Message.Severity.Warning));
+ CoreGUI.getMessageCenter().notify(new
Message("Failed to select resource [" + selectedResourceId + "] in
tree.", Message.Severity.Warning));
}
@@ -556,7 +594,7 @@ public class ResourceTreeView extends VLayout {
}
- TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()));
+ TreeNode selectedNode =
treeGrid.getTree().findById(String.valueOf(selectedResourceId));
// System.out.println("Trying to preopen: "
+ selectedNode);
if (selectedNode != null) {
TreeNode[] parents =
treeGrid.getTree().getParents(selectedNode);
@@ -622,6 +660,8 @@ public class ResourceTreeView extends VLayout {
public void renderView(ViewPath viewPath) {
currentViewId = viewPath.getCurrent();
+ Integer resourceId = Integer.parseInt(currentViewId.getPath());
+ setSelectedResource(resourceId);
}
}
commit 13b0161e3f4f0912b54612f7f8507cc3053aa596
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 13:39:57 2010 -0400
Fix resource link to default resource view
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 0375213..ee73969 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
@@ -33,7 +33,7 @@ public class LinkManager {
public static String getResourceLink(int resourceId) {
if (GWT) {
- return "#Resource/" + resourceId;
+ return "#Resource/" + resourceId + "/Summary/Overview";
} else {
return "/rhq/resource/summary/summary.xhtml?id=" + resourceId;
}
commit 9132b980be2f36c13676f975a047203d56a9227a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 17 13:38:24 2010 -0400
Fix resource link
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index ba81f5c..8983ffe 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -41,6 +41,7 @@ import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
import org.rhq.core.domain.criteria.AlertCriteria;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -105,7 +106,7 @@ public class AlertsView extends Table {
listGrid.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>";
+ return "<a href=\"" +
LinkManager.getResourceLink(listGridRecord.getAttributeAsInt("resourceId")) +
"\">" + o + "</a>";
}
});
commit 1ffccc1d48ef1de58b2af3754c4e55db337af971
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Aug 16 10:58:51 2010 -0400
Support enable/disablement of subtabs properly
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java
deleted file mode 100644
index ea27d0c..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java
+++ /dev/null
@@ -1,101 +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.components;
-
-import com.smartgwt.client.types.SelectionType;
-import com.smartgwt.client.widgets.Button;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.toolbar.ToolStrip;
-
-import java.util.LinkedHashMap;
-
-/**
- * @author Greg Hinkle
- */
-public class SubTabLayout extends VLayout {
-
- ToolStrip buttonBar;
-
- LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String,
Canvas>();
-
- Canvas currentlyDisplayed;
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- setWidth100();
- setHeight100();
- setMargin(0);
- setPadding(0);
-
-
- buttonBar = new ToolStrip();
- buttonBar.setBackgroundColor("grey");
- buttonBar.setWidth100();
- buttonBar.setBorder(null);
-
-
- for (final String title : subtabs.keySet()) {
- if (currentlyDisplayed == null) {
- currentlyDisplayed = subtabs.get(title);
- }
-
-
- Button button = new Button(title);
- button.setShowRollOver(false);
- button.setActionType(SelectionType.RADIO);
- button.setRadioGroup("subtabs");
- button.setBorder(null);
-
- button.setBaseStyle("SubTabButton");
-
-// button.setStyleName("SubTabButton");
-// button.setStylePrimaryName("SubTabButton");
-
- button.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- if (currentlyDisplayed != null) {
- removeMember(currentlyDisplayed);
- }
- currentlyDisplayed = subtabs.get(title);
- addMember(currentlyDisplayed);
- markForRedraw();
- }
- });
-
- buttonBar.addMember(button);
-
- }
- addMember(buttonBar);
-
- // Initial settings
- Button b = (Button) buttonBar.getMember(0);
- b.select();
- addMember(currentlyDisplayed);
- }
-
-
- public void registerSubTab(String title, Canvas canvas) {
- subtabs.put(title, canvas);
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
index cda5761..afec88d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.tab;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -39,10 +40,11 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
*/
public class SubTabLayout extends VLayout {
- ToolStrip buttonBar;
+ private ToolStrip buttonBar;
- Map<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>();
- Set<String> disabledSubTabs = new HashSet<String>();
+ private LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String,
Canvas>();
+ private HashMap<String, Button> subTabButtons = new HashMap<String,
Button>();
+ private Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed;
String currentlySelected;
@@ -107,6 +109,8 @@ public class SubTabLayout extends VLayout {
}
});
+ subTabButtons.put(title,button);
+
buttonBar.addMember(button);
}
@@ -116,13 +120,17 @@ public class SubTabLayout extends VLayout {
}
public void enableSubTab(String title) {
- if (disabledSubTabs.remove(title)) {
+ disabledSubTabs.remove(title);
+ if (subTabButtons.containsKey(title)) {
+ subTabButtons.get(title).enable();
markForRedraw();
}
}
public void disableSubTab(String title) {
- if (disabledSubTabs.add(title)) {
+ disabledSubTabs.add(title);
+ if (subTabButtons.containsKey(title)) {
+ subTabButtons.get(title).disable();
markForRedraw();
}
}
@@ -201,7 +209,7 @@ public class SubTabLayout extends VLayout {
public void fireSubTabSelection() {
TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent("?",
currentlySelected, -1, currentIndex,
- currentlyDisplayed);
+ currentlyDisplayed);
hm.fireEvent(event);
}
}
\ No newline at end of file
commit 7acc837d4759fe020daf9224df31bbfd83bcd524
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Aug 13 13:51:29 2010 -0400
Remove out of date query settings from resourcedatasource
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 88c61d4..b56df20 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,13 +18,6 @@
*/
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.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 com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@ -46,12 +39,18 @@ 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;
+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.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;
+
/**
* @author Greg Hinkle
*/
public class ResourceDatasource extends RPCDataSource<Resource> {
- private String query;
private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
@@ -61,7 +60,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> {
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID", 20);
idDataField.setPrimaryKey(true);
- DataSourceImageField iconField = new DataSourceImageField("icon");
+ DataSourceImageField iconField = new
DataSourceImageField("icon","");
iconField.setImageURLPrefix("types/");
DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(),
NAME.title(), 200);
@@ -84,13 +83,6 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
categoryDataField, availabilityDataField);
}
- public String getQuery() {
- return query;
- }
-
- public void setQuery(String query) {
- this.query = query;
- }
public void executeFetch(final DSRequest request, final DSResponse response) {
commit c2aa64c1dbc3acf1251898359d48060fd72b9a56
Merge: 02a6eaf... cf30cd9...
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 17 19:21:09 2010 +0200
Merge branch 'ui-updates'
commit cf30cd9117a2a179ae1d28fb820073405bcf1890
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 17 19:12:03 2010 +0200
clean up of the disambiguation API before merge into master
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java
deleted file mode 100644
index 4578aee..0000000
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java
+++ /dev/null
@@ -1,58 +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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-package org.rhq.core.domain.resource.composite;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * This class is a result of resource disambiguation.
- * This is used in ResourceManager. When supplied a list of results, it returns an
- * instance of this class describing how the results should be disambiguated.
- *
- * @author Lukas Krejci
- */
-public class ResourceNamesDisambiguationResult<T> implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private List<DisambiguationReport<T>> resolution;
-
- public ResourceNamesDisambiguationResult(List<DisambiguationReport<T>>
resolution) {
- this.resolution = resolution;
- }
-
- /**
- * Lists the disambiguation results.
- * Each record contains the original value, disambiguated parents, the resource type
name and
- * the type plugin name.
- */
- public List<DisambiguationReport<T>> getResolution() {
- return resolution;
- }
-
- public String toString() {
- return "ResourceNamesDisambiguationResult(resolution=" + resolution +
")";
- }
-}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java
index 8999775..300fddc 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java
@@ -23,8 +23,9 @@
package org.rhq.enterprise.gui.common.paging;
+import java.util.List;
+
import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.util.IntExtractor;
@@ -66,10 +67,10 @@ public abstract class
ResourceNameDisambiguatingPagedListDataModel<T> extends
public PageList<DisambiguationReport<T>> fetchPage(PageControl pc) {
PageList<T> data = fetchDataForPage(pc);
- ResourceNamesDisambiguationResult<T> disambiguation =
resourceManager.disambiguate(data, getResourceIdExtractor(),
+ List<DisambiguationReport<T>> disambiguation =
resourceManager.disambiguate(data, getResourceIdExtractor(),
DefaultDisambiguationUpdateStrategies.getDefault());
- return new
PageList<DisambiguationReport<T>>(disambiguation.getResolution(),
data.getTotalSize(), data
+ return new PageList<DisambiguationReport<T>>(disambiguation,
data.getTotalSize(), data
.getPageControl());
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java
index e079474..3f42406 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java
@@ -296,7 +296,7 @@ public class AutoDiscoveryQueueUIBean extends PagedDataTableUIBean {
List<DisambiguationReport<Resource>> disambiguatedQueuedPlatforms
=
resourceManager.disambiguate(queuedPlatforms,
- RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution();
+ RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault());
PageList<DisambiguationReport<Resource>>
disambiguatedQueuedPlaformsPageList =
new
PageList<DisambiguationReport<Resource>>(disambiguatedQueuedPlatforms,
queuedPlatforms.getTotalSize(), queuedPlatforms.getPageControl());
@@ -306,7 +306,7 @@ public class AutoDiscoveryQueueUIBean extends PagedDataTableUIBean {
for (InventoryStatus status : newIgnoredSet) {
List<Resource> childServers =
discoveryBoss.getQueuedPlatformChildServers(subject, status, platform.getOriginal());
List<DisambiguationReport<Resource>>
disambiguatedChildServers =
- resourceManager.disambiguate(childServers, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution();
+ resourceManager.disambiguate(childServers, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault());
queuedServers.addAll(disambiguatedChildServers);
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java
index 9b05558..766e551 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java
@@ -38,7 +38,6 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
@@ -181,44 +180,5 @@ public class AddGroupResourcesFormPrepareAction extends Action {
}
return resourceCategoryTypes;
- }
-
- //
- // These two methods are to support the resource names disambiguation in the above
code.
- // Hopefully this page gets rewritten in JSF so that we don't have to employ this
kind of
- // nasties.
- //
-
- private static PageList<Resource>
buildResourceList(ResourceNamesDisambiguationResult<Resource> results, int
totalSize, PageControl pageControl) {
- ArrayList<Resource> convertedResults = new
ArrayList<Resource>(results.getResolution().size());
-
- for(DisambiguationReport<Resource> dr : results.getResolution()) {
- Resource resource = dr.getOriginal();
-
- Resource parent = resource.getParentResource();
- //platforms don't have parents, need to check for null here
- if (parent != null) {
- parent.setName(buildLineage(dr.getParents()));
- }
-
- convertedResults.add(resource);
- }
- return new PageList<Resource>(convertedResults, totalSize, pageControl);
- }
-
- private static String buildLineage(List<DisambiguationReport.Resource> parents)
{
- if (parents == null || parents.size() == 0) {
- return "";
- }
-
- Iterator<DisambiguationReport.Resource> it = parents.iterator();
-
- StringBuilder bld = new StringBuilder(it.next().getName());
-
- while (it.hasNext()) {
-
bld.append(DisambiguatedResourceLineageComponent.DEFAULT_SEPARATOR).append(it.next().getName());
- }
-
- return bld.toString();
- }
+ }
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java
index b8c7c63..4ac3c8d 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java
@@ -178,11 +178,11 @@ public class ViewAction extends TilesAction {
//first disambiguate the platforms
List<Resource> platforms = new
ArrayList<Resource>(queuedResources.keySet());
- List<DisambiguationReport<Resource>> disambiguatedPlatforms =
resourceManager.disambiguate(platforms, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution();
+ List<DisambiguationReport<Resource>> disambiguatedPlatforms =
resourceManager.disambiguate(platforms, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault());
for (DisambiguationReport<Resource> platform : disambiguatedPlatforms) {
List<Resource> servers = queuedResources.get(platform.getOriginal());
- List<DisambiguationReport<Resource>> disambiguatedServers =
resourceManager.disambiguate(servers, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution();
+ List<DisambiguationReport<Resource>> disambiguatedServers =
resourceManager.disambiguate(servers, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault());
ret.put(platform, disambiguatedServers);
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
index 55d892d..90d59a3 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
@@ -86,7 +86,7 @@ public class ViewAction extends TilesAction {
platformList =
DisambiguatedRecentlyAddedResourceComposite.fromResolution(resourceManager.disambiguate(
resourceManager.findRecentlyAddedPlatforms(subject, ts,
recentlyApprovedPreferences.range),
- RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution());
+ RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()));
Map<Integer, DisambiguatedRecentlyAddedResourceComposite> platformMap;
platformMap = new HashMap<Integer,
DisambiguatedRecentlyAddedResourceComposite>();
@@ -113,7 +113,7 @@ public class ViewAction extends TilesAction {
miniPlatform.setChildren(DisambiguatedRecentlyAddedResourceComposite.fromResolution(
resourceManager.disambiguate(resourceManager
.findRecentlyAddedServers(subject, ts, platformId.intValue()),
RESOURCE_ID_EXTRACTOR,
-
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution()));
+ DefaultDisambiguationUpdateStrategies.getDefault())));
} else {
removeExpandedPlatforms.add(expandedPlatform);
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java
index fb9be73..2c52bfd 100755
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java
@@ -35,7 +35,6 @@ import org.apache.struts.util.MessageResources;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourceHealthComposite;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.common.tag.FunctionTagLibrary;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java
index 7a1a824..516b9c9 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java
@@ -31,7 +31,6 @@ import org.apache.struts.tiles.actions.TilesAction;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.ResourceHealthComposite;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.util.IntExtractor;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java
index 41e710f..4ad0df8 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java
@@ -23,8 +23,9 @@
package org.rhq.enterprise.gui.legacy.util;
+import java.util.List;
+
import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.util.IntExtractor;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
@@ -43,7 +44,7 @@ public class DisambiguatedResourceListUtil {
}
public static <T> PageList<DisambiguationReport<T>>
disambiguate(ResourceManagerLocal resourceManager, PageList<T> results,
IntExtractor<T> resourceIdExtractor) {
- ResourceNamesDisambiguationResult<T> result =
resourceManager.disambiguate(results, resourceIdExtractor,
DefaultDisambiguationUpdateStrategies.getDefault());
- return new PageList<DisambiguationReport<T>>(result.getResolution(),
results.getTotalSize(), results.getPageControl());
+ List<DisambiguationReport<T>> result =
resourceManager.disambiguate(results, resourceIdExtractor,
DefaultDisambiguationUpdateStrategies.getDefault());
+ return new PageList<DisambiguationReport<T>>(result,
results.getTotalSize(), results.getPageControl());
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java
index afe2e3b..625c33f 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java
@@ -79,6 +79,6 @@ public class ResourceSelectUIBean {
result =
resourceManager.findResourceComposites(EnterpriseFacesContextUtility.getSubject(), null,
null, null,
null, pref, true, pc);
- return resourceManager.disambiguate(result, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault()).getResolution();
+ return resourceManager.disambiguate(result, RESOURCE_ID_EXTRACTOR,
DefaultDisambiguationUpdateStrategies.getDefault());
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java
index 0f5777f..52b6812 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java
@@ -29,7 +29,6 @@ import javax.faces.model.SelectItem;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.gui.util.FacesContextUtility;
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 ea6a4fc..64fd5f8 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
@@ -87,13 +87,13 @@ import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.ResourceErrorType;
import org.rhq.core.domain.resource.ResourceSubCategory;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceHealthComposite;
import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight;
import org.rhq.core.domain.resource.composite.ResourceInstallCount;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.composite.ResourceWithAvailability;
import org.rhq.core.domain.resource.flyweight.FlyweightCache;
@@ -2166,7 +2166,7 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
return (findChildResources(subject, parentResource, pageControl));
}
- public <T> ResourceNamesDisambiguationResult<T>
disambiguate(List<T> results, IntExtractor<? super T> extractor,
+ public <T> List<DisambiguationReport<T>> disambiguate(List<T>
results, IntExtractor<? super T> extractor,
DisambiguationUpdateStrategy updateStrategy) {
return Disambiguator.disambiguate(results, updateStrategy, extractor,
entityManager, typeManager.getDuplicateTypeNames());
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
index d753c89..78ece78 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
@@ -36,13 +36,13 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.ResourceErrorType;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceHealthComposite;
import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight;
import org.rhq.core.domain.resource.composite.ResourceInstallCount;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.domain.resource.composite.ResourceWithAvailability;
import org.rhq.core.domain.resource.flyweight.ResourceFlyweight;
import org.rhq.core.domain.resource.group.ResourceGroup;
@@ -453,6 +453,6 @@ public interface ResourceManagerLocal {
* @see Disambiguator#disambiguate(List, boolean, IntExtractor,
javax.persistence.EntityManager)
* @return the disambiguation result or null on error
*/
- <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T>
results, IntExtractor<? super T> resourceIdExtractor,
+ <T> List<DisambiguationReport<T>> disambiguate(List<T>
results, IntExtractor<? super T> resourceIdExtractor,
DisambiguationUpdateStrategy updateStrategy);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
index 8a340d5..f948244 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
@@ -134,7 +134,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
}
};
- private static final DisambiguationPolicy.Level overridingResolution = new
DisambiguationPolicy.Level(ResourceResolution.TYPE);
+ private static final DisambiguationPolicy.Level OVERRIDING_RESOLUTION = new
DisambiguationPolicy.Level(ResourceResolution.TYPE);
/**
* This updates the resources in the report according to the resolutions contained in
the policy.
@@ -182,7 +182,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
if (pushDownPluginInfo) {
parentPlugins.add(report.parents.get(disambiguationPolicyIndex).resourceType.plugin);
}
- updateResource(overridingResolution,
report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames);
+ updateResource(OVERRIDING_RESOLUTION,
report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames);
}
if (pushDownPluginInfo) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
index 2baa4db..617d4fd 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
@@ -33,7 +33,6 @@ import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
-import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
import org.rhq.core.util.IntExtractor;
/**
@@ -99,14 +98,14 @@ public class Disambiguator {
* @param resourceIdExtractor an object able to extract resource id from an instance
of type parameter.
* @param entityManager an entityManager to be used to access the database
* @param duplicateTypeNames the list of type names that are ambiguous without plugin
spec
- * @return the disambiguation result or null on error
+ * @return the disambiguation result
*/
- public static <T> ResourceNamesDisambiguationResult<T>
disambiguate(List<T> results,
+ public static <T> List<DisambiguationReport<T>>
disambiguate(List<T> results,
DisambiguationUpdateStrategy disambiguationUpdateStrategy, IntExtractor<?
super T> extractor,
EntityManager entityManager, List<String> duplicateTypeNames) {
if (results.isEmpty()) {
- return new ResourceNamesDisambiguationResult<T>(new
ArrayList<DisambiguationReport<T>>());
+ return new ArrayList<DisambiguationReport<T>>();
}
//we can't assume the ordering of the provided results and the disambiguation
query results
@@ -258,7 +257,7 @@ public class Disambiguator {
resolution.add(report.getReport());
}
- return new ResourceNamesDisambiguationResult<T>(resolution);
+ return resolution;
}
private static <T> void repartitionUnique(ReportPartitions<T> partitions,
DisambiguationUpdateStrategy updateStrategy, List<ReportPartitions<T>>
ambigousPartitions) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
index 337ef31..04ae04f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
@@ -31,10 +31,6 @@ import java.util.List;
* This class partitions the reports inserted into it by chunking them up
* into sublists containing mutually ambiguous reports. The ambiguity is determined using
* a {@link DisambiguationPolicy}.
- * <p>
- * The ReportPartition instances can form a tree using the {@link
#getPreviousPartitioning()}
- * and the parameters provided to the constructors. This is handy to keep track of what
- * partitions have been disambiguated at what level and how.
*
* @param <T> the type of the original instances the are being disambiguated.
*
commit efc3d3574cc27e586788d8372d6354d68db4237f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 17 15:57:53 2010 +0200
Add more tables, provide better output
diff --git
a/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
index 5fcc229..4e0857e 100644
---
a/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
+++
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
@@ -43,7 +43,9 @@ public class DataGen {
private static final String[][] props = {//
{"agents","RHQ_Agent","id,name,address,port,agenttoken,remote_endpoint"},
-
{"plugins","RHQ_Plugin","id,name,display_name,version,amps_version"}
+
{"plugins","RHQ_Plugin","id,name,display_name,version,amps_version"},
+
{"resourceTypes","RHQ_resource_type","id,name,category,plugin"},
// TODO parent / child types?
+
{"resources","RHQ_resource","id,uuid,resource_key,name,resource_type_id,parent_resource_id"}
// TODO child resources?
};
public static void main(String[] args) {
@@ -83,10 +85,13 @@ public class DataGen {
String columns = prop[2];
File agents = new File(TARGET + fileName + DOTCSV);
- System.out.println("File: " + agents.getAbsolutePath());
+ System.out.println("Writing file: " + agents.getAbsolutePath());
CSVWriter writer = new CSVWriter(new FileWriter(agents));
Statement stm = conn.createStatement();
- ResultSet rs = stm.executeQuery("SELECT " + columns + " FROM
" + tableName);
+ String query = "SELECT " + columns + " FROM " + tableName;
+ System.out.println(" using query: [" + query + "]");
+ System.out.flush();
+ ResultSet rs = stm.executeQuery(query);
writer.writeAll(rs,true);
rs.close();
writer.close();
commit d8d9991b7f9985bd2eb7e107f180d1415706e8ae
Merge: 686f2d7... 02a6eaf...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 17 14:38:06 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 686f2d7aaf3701f7aaab6a8e20876de5c7e46bcf
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 17 14:22:55 2010 +0200
Helper to generate the input data for table driven test setup
diff --git a/modules/helpers/perftest-data-gen/pom.xml
b/modules/helpers/perftest-data-gen/pom.xml
new file mode 100644
index 0000000..dceeb22
--- /dev/null
+++ b/modules/helpers/perftest-data-gen/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>rhq-helpers</artifactId>
+ <groupId>org.rhq.helpers</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>Perftest-data-gen</name>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>perftest-data-gen</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <description>Create performance unit test csv files from
database</description>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-dbutils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresql.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git
a/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
new file mode 100644
index 0000000..5fcc229
--- /dev/null
+++
b/modules/helpers/perftest-data-gen/src/main/java/org/rhq/etc/perftestDataGen/DataGen.java
@@ -0,0 +1,96 @@
+/*
+ * 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.etc.perftestDataGen;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import au.com.bytecode.opencsv.CSVWriter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.db.DbUtil;
+
+/**
+ * // TODO: Document this
+ * @author Heiko W. Rupp
+ */
+public class DataGen {
+
+ private final Log log = LogFactory.getLog(DataGen.class);
+ private static final String TARGET = "target/";
+ private static final String DOTCSV = ".csv";
+
+ private static final String[][] props = {//
+
{"agents","RHQ_Agent","id,name,address,port,agenttoken,remote_endpoint"},
+
{"plugins","RHQ_Plugin","id,name,display_name,version,amps_version"}
+ };
+
+ public static void main(String[] args) {
+
+ DataGen dg = new DataGen();
+
+ dg.run(args);
+ }
+
+ private void run(String[] args) {
+
+ if (args.length<3) {
+ System.err.println("Usage: DataGen jdbcurl user pass");
+ return;
+ }
+
+
+ String url = args[0];
+ String user = args[1];
+ String pass = args[2];
+
+ try {
+ Connection conn = DbUtil.getConnection(url,user,pass);
+
+ for (String[] prop : props) {
+ exportTable(conn, prop);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void exportTable(Connection conn, String[] prop) throws Exception {
+
+ String fileName = prop[0];
+ String tableName = prop[1];
+ String columns = prop[2];
+
+ File agents = new File(TARGET + fileName + DOTCSV);
+ System.out.println("File: " + agents.getAbsolutePath());
+ CSVWriter writer = new CSVWriter(new FileWriter(agents));
+ Statement stm = conn.createStatement();
+ ResultSet rs = stm.executeQuery("SELECT " + columns + " FROM
" + tableName);
+ writer.writeAll(rs,true);
+ rs.close();
+ writer.close();
+ stm.close();
+
+ }
+}
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 8fa853a..a26b7f2 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -38,6 +38,7 @@
<module>pluginGen</module>
<module>pluginAnnotations</module>
<module>bundleGen</module>
+ <module>perftest-data-gen</module>
</modules>
commit 351594645e43c69b2be040e830746d67adae00fe
Merge: c809e68... 5662138...
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Aug 17 12:05:30 2010 +0200
Merge branch 'master' into ui-updates
commit 25735a3547c396ebc7fae2a8b9db7a58bf9fe9d7
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 17 00:26:22 2010 -0400
Adding logic to throw exception if script accesses nonexistent manager SLSB
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index a1f131d..3d47f1e 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -18,7 +18,12 @@ class RHQScript extends Script {
def propertyMissing(String name) {
if (name.endsWith("Manager")) {
def method = "get$name"
- return LookupUtil."$method"()
+ try {
+ return LookupUtil."$method"()
+ }
+ catch (MissingMethodException e) {
+ throw new RHQScriptException("Unable to locate $name", e)
+ }
}
if (entityMap.containsKey(name)) {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptException.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptException.groovy
new file mode 100644
index 0000000..930a358
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptException.groovy
@@ -0,0 +1,22 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class RHQScriptException extends Exception {
+
+ def RHQScriptException() {
+ super();
+ }
+
+ def RHQScriptException(String message) {
+ super(message);
+ }
+
+ def RHQScriptException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ def RHQScriptException(Throwable cause) {
+ super(cause);
+ }
+
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
index e45656f..1991b25 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -17,12 +17,8 @@ class ScriptRunnerTest {
def lookupMock = new MockFor(LookupUtil)
lookupMock.demand.getSubjectManager { fakeMgr }
- def runner = new ScriptRunner()
- def params = new Configuration()
- params.put(new PropertySimple('script',
getScriptPath('access_mgr.groovy')))
-
lookupMock.use {
- def result = runner.invoke('execute', params)
+ def result = executeScript('access_mgr.groovy')
assertScriptResultEquals(
result,
fakeMgr.class.name,
@@ -31,6 +27,19 @@ class ScriptRunnerTest {
}
}
+ @Test(expectedExceptions = [RHQScriptException])
+ void throwExceptionWhenManagerAccessedDoesNotExist() {
+ executeScript('access_nonexistent_mgr.groovy')
+ }
+
+ def executeScript(String script) {
+ def runner = new ScriptRunner()
+ def params = new Configuration()
+ params.put(new PropertySimple('script', getScriptPath(script)))
+
+ return runner.invoke('execute', params)
+ }
+
String getScriptPath(String scriptName) {
this.class.getResource(scriptName).toURI().path
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_nonexistent_mgr.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_nonexistent_mgr.groovy
new file mode 100644
index 0000000..75fc7ca
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_nonexistent_mgr.groovy
@@ -0,0 +1,3 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+return NonexistentManager.class.name
commit 02a6eafa5eb24c64fd7e09257b956ea3ebb424b1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 17 00:14:26 2010 -0400
make togglable fields a different color to give the user a hint that they're
editable
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
index 0ae01ce..02592c8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
@@ -82,6 +82,7 @@ public class EnhancedDynamicForm extends DynamicForm {
new
StaticTextItem(getStaticTextItemName(togglableTextItem.getName()),
togglableTextItem.getTitle());
staticTextItem.setAttribute("editing", false);
+ staticTextItem.setTextBoxStyle("editableText");
FormItemIcon editIcon = new FormItemIcon();
editIcon.setName("Edit");
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index bc48f18..305fcf8 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -354,4 +354,8 @@ a:hover {
.tallCellOver, .tallCellOverDark {
background-color: rgb(230,230,230) !important; /* for browsers that don't like
alpha */
background-color: rgba(230,230,230,0.6) !important;
-}
\ No newline at end of file
+}
+
+.editableText {
+ color: #070;
+}
commit dd07dc1e3cf123a4d034a54a8cc4fdc93cf11cdc
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 17 00:03:50 2010 -0400
Renaming GroovyScriptPluginComponent to ScriptRunner and adding unit test for it
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml
b/modules/enterprise/server/plugins/groovy-script/pom.xml
index a8a98b2..4691ce7 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -26,12 +26,34 @@
<artifactId>groovy-all</artifactId>
<version>1.7.1</version>
</dependency>
-
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
</dependency>
+ <dependency>
+ <groupId>quartz</groupId>
+ <artifactId>quartz</artifactId>
+ <version>1.5.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jms-api</artifactId>
+ <version>1.1.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <version>4.2.3.GA</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index 4e73145..8e07760 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -16,7 +16,7 @@ class CriteriaGenerator {
clazz = Class.forName(className)
}
catch (Exception e) {
- def msg = "Failed to load criteria class $classname"
+ def msg = "Failed to load criteria class $className"
log.warn msg, e
throw new CriteriaGeneratorException(msg, e)
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
index c46892d..008a090 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
@@ -12,6 +12,6 @@ class CriteriaSpec {
this.criteriaType = criteriaType
}
- def propertyMissing
+ //def propertyMissing
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
deleted file mode 100644
index de0184c..0000000
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.rhq.enterprise.server.plugins.groovy
-
-import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
-import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
-import org.rhq.enterprise.server.plugin.pc.ControlFacet
-import org.rhq.enterprise.server.plugin.pc.ControlResults
-import org.rhq.core.domain.configuration.Configuration
-import org.rhq.core.domain.configuration.PropertySimple
-import org.codehaus.groovy.control.CompilerConfiguration
-
-class GroovyScriptPluginComponent implements ServerPluginComponent, ControlFacet {
-
- void initialize(ServerPluginContext context) {
-
- }
-
- void start() {
-
- }
-
- void stop() {
-
- }
-
- void shutdown() {
-
- }
-
- ControlResults invoke(String name, Configuration parameters) {
- def compilerConfig = new CompilerConfiguration()
- compilerConfig.scriptBaseClass = RHQScript.class.name
-
- def scriptName = parameters.getSimpleValue("script", null)
-
- def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig)
- def scriptRoots = new URL[1]
- scriptRoots[0] = new File(scriptName).toURI().toURL()
- def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
- scriptEngine.config = compilerConfig
-
- def scriptResult = scriptEngine.run(scriptName, new Binding())
-
- ControlResults results = new ControlResults()
- results.complexResults.put(new PropertySimple("results", scriptResult))
-
- return results;
- }
-
-
-}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index b87e863..a1f131d 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -30,10 +30,11 @@ class RHQScript extends Script {
def criteria(Class entityClass, Closure specifyCriteria) {
def criteriaSpec = new CriteriaSpec(entityClass)
+ specifyCriteria.resolveStrategy = Closure.DELEGATE_FIRST
specifyCriteria.delegate = criteriaSpec
specifyCriteria()
- return new CriteriaGenerator().execute(criteriaSpec)
+ return new CriteriaGenerator().execute(specifyCriteria.delegate)
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
new file mode 100644
index 0000000..9b27562
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy
@@ -0,0 +1,50 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
+import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
+import org.rhq.enterprise.server.plugin.pc.ControlFacet
+import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.core.domain.configuration.Configuration
+import org.rhq.core.domain.configuration.PropertySimple
+import org.codehaus.groovy.control.CompilerConfiguration
+
+class ScriptRunner implements ServerPluginComponent, ControlFacet {
+
+ void initialize(ServerPluginContext context) {
+
+ }
+
+ void start() {
+
+ }
+
+ void stop() {
+
+ }
+
+ void shutdown() {
+
+ }
+
+ ControlResults invoke(String name, Configuration parameters) {
+ def compilerConfig = new CompilerConfiguration()
+ compilerConfig.scriptBaseClass = RHQScript.class.name
+
+ def scriptName = parameters.getSimpleValue("script", null)
+
+ def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig)
+ def scriptRoots = new URL[1]
+ scriptRoots[0] = new File(scriptName).toURI().toURL()
+ def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
+ scriptEngine.config = compilerConfig
+
+ def scriptResult = scriptEngine.run(scriptName, new Binding())
+
+ ControlResults results = new ControlResults()
+ results.complexResults.put(new PropertySimple("results", scriptResult))
+
+ return results;
+ }
+
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
index c4c6678..31d21a5 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -7,7 +7,7 @@
xmlns="urn:xmlns:rhq-serverplugin.generic"
xmlns:serverplugin="urn:xmlns:rhq-serverplugin"
xmlns:c="urn:xmlns:rhq-configuration">
- <serverplugin:plugin-component class="GroovyScriptPluginComponent">
+ <serverplugin:plugin-component class="ScriptRunner">
<serverplugin:control name="execute" description="Executes a
Groovy script">
<serverplugin:parameters>
<c:simple-property name="script"
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
new file mode 100644
index 0000000..e45656f
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunnerTest.groovy
@@ -0,0 +1,46 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.testng.annotations.Test
+import groovy.mock.interceptor.MockFor
+import org.rhq.enterprise.server.util.LookupUtil
+import org.rhq.core.domain.configuration.Configuration
+import org.rhq.core.domain.configuration.PropertySimple
+
+import static org.testng.Assert.*
+import org.rhq.enterprise.server.plugin.pc.ControlResults
+
+class ScriptRunnerTest {
+
+ @Test
+ void lookupManagerWhenADynamicManagerPropertyIsAccessed() {
+ def fakeMgr = {}
+ def lookupMock = new MockFor(LookupUtil)
+ lookupMock.demand.getSubjectManager { fakeMgr }
+
+ def runner = new ScriptRunner()
+ def params = new Configuration()
+ params.put(new PropertySimple('script',
getScriptPath('access_mgr.groovy')))
+
+ lookupMock.use {
+ def result = runner.invoke('execute', params)
+ assertScriptResultEquals(
+ result,
+ fakeMgr.class.name,
+ "Expected the script to return the object it received from accessing a
dynamic manager property"
+ )
+ }
+ }
+
+ String getScriptPath(String scriptName) {
+ this.class.getResource(scriptName).toURI().path
+ }
+
+ def assertScriptResultEquals(controlResults, expected, msg) {
+ assertEquals(getScriptResult(controlResults), expected, msg)
+ }
+
+ def getScriptResult(ControlResults results) {
+ results.complexResults.getSimpleValue("results", null)
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_mgr.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_mgr.groovy
new file mode 100644
index 0000000..1f060f5
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/resources/org/rhq/enterprise/server/plugins/groovy/access_mgr.groovy
@@ -0,0 +1,4 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+return SubjectManager.class.name
+
commit efc9c02e61ca9536e007356b0e8e74972c76f975
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:10:15 2010 -0400
add missing method to WebservicesManagerBean
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index 25ffa7b..6c2c7f1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -856,6 +856,11 @@ public class WebservicesManagerBean implements WebservicesRemote {
resourceGroupManager.deleteResourceGroup(subject, groupId);
}
+ public void deleteResourceGroups(Subject subject, int[] groupIds) throws
ResourceGroupNotFoundException,
+ ResourceGroupDeleteException {
+ resourceGroupManager.deleteResourceGroups(subject, groupIds);
+ }
+
public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
ResourceGroupCriteria criteria) {
checkParametersPassedIn(subject, criteria);
return resourceGroupManager.findResourceGroupsByCriteria(subject, criteria);
commit 2968c8c3c37ba5432683577f16e0e8e929bbd18a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:06:25 2010 -0400
AuthenticationUserAction doesn't need to pre-fetch any related subject data
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
index db8b1f0..432d95c 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
@@ -105,8 +105,6 @@ public class AuthenticateUserAction extends TilesAction {
subjectCriteria.setCaseSensitive(false);
subjectCriteria.setStrict(true);
subjectCriteria.addFilterName(logonForm.getJ_username());
- subjectCriteria.fetchRoles(true);
- subjectCriteria.fetchConfiguration(true);
PageList<Subject> subjectsLocated =
LookupUtil.getSubjectManager().findSubjectsByCriteria(
LookupUtil.getSubjectManager().getOverlord(), subjectCriteria);
//if subject variants located then take the first one with a
principal otherwise do nothing
commit 9ed36881c1424d3af8bdbd3621d6dbaec2938d75
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:04:33 2010 -0400
SearchGUI.sessionSubject doesn't need to pre-load any related data
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
index 42600a5..f4c52d7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
@@ -87,9 +87,7 @@ public class SearchGUI implements EntryPoint {
// look up real user prefs
SubjectCriteria criteria = new SubjectCriteria();
- criteria.fetchConfiguration(true);
criteria.addFilterId(subjectId);
- criteria.fetchRoles(true);
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria,
new AsyncCallback<PageList<Subject>>() {
commit 74b6b2958fb4bba076009217e1dd6607bcacc964
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:04:07 2010 -0400
CoreGUI.sessionSubject only needs to pre-load Configuration, not roles
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 aa6c084..b82b8ce 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
@@ -155,7 +155,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
SubjectCriteria criteria = new SubjectCriteria();
criteria.fetchConfiguration(true);
criteria.addFilterId(subjectId);
- criteria.fetchRoles(true);
+ //criteria.fetchRoles(true);
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria,
new AsyncCallback<PageList<Subject>>() {
commit 29e2b4eecd3658456856098518bbbc50b59bea1b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:03:24 2010 -0400
uninventory all selected resources in a single async service call
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 c0731b8..88c61d4 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
@@ -25,9 +25,6 @@ import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceD
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 java.util.List;
-
-import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@ -48,7 +45,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
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;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
@@ -71,16 +67,16 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(),
NAME.title(), 200);
nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new
DataSourceTextField(DESCRIPTION.propertyName(), DESCRIPTION
- .title());
+ DataSourceTextField descriptionDataField = new
DataSourceTextField(DESCRIPTION.propertyName(),
+ DESCRIPTION.title());
descriptionDataField.setCanEdit(false);
DataSourceTextField typeNameDataField = new
DataSourceTextField(TYPE.propertyName(), TYPE.title());
DataSourceTextField pluginNameDataField = new
DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title());
DataSourceTextField categoryDataField = new
DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new
DataSourceImageField(AVAILABILITY.propertyName(), AVAILABILITY
- .title(), 20);
+ DataSourceImageField availabilityDataField = new
DataSourceImageField(AVAILABILITY.propertyName(),
+ AVAILABILITY.title(), 20);
availabilityDataField.setCanEdit(false);
@@ -120,8 +116,8 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
criteria.setPageControl(getPageControl(request));
if (request.getCriteria().getValues().get("parentId") != null) {
- criteria.addFilterParentResourceId(Integer.parseInt((String)
request.getCriteria().getValues().get(
- "parentId")));
+ criteria.addFilterParentResourceId(Integer.parseInt((String)
request.getCriteria().getValues()
+ .get("parentId")));
}
if (request.getCriteria().getValues().get("id") != null) {
@@ -158,8 +154,8 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
}
if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) {
- criteria.addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get(
- TYPE.propertyName()))));
+ criteria.addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues()
+ .get(TYPE.propertyName()))));
}
if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) {
@@ -185,30 +181,6 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
return criteria;
}
- @Override
- protected void executeRemove(final DSRequest request, final DSResponse response) {
- JavaScriptObject data = request.getData();
- final ListGridRecord rec = new ListGridRecord(data);
- final Resource resourceToDelete = copyValues(rec);
-
- final int resourceId = resourceToDelete.getId();
- resourceService.uninventoryResources(new int[] { resourceId }, new
AsyncCallback<List<Integer>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to uninventory
resource " + resourceId, caught);
- response.setStatus(DSResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(List<Integer> result) {
- CoreGUI.getMessageCenter().notify(
- new Message("Resource [" + resourceId + "]
successfully uninventoried.", Message.Severity.Info));
- response.setStatus(DSResponse.STATUS_SUCCESS);
- processResponse(request.getRequestId(), response);
- }
- });
-
- }
-
protected void dataRetrieved(PageList<Resource> result, DSResponse response,
DSRequest request) {
ListGridRecord[] records = buildRecords(result);
response.setData(records);
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 1642c64..97a55db 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
@@ -18,35 +18,33 @@
*/
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.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 java.util.ArrayList;
+import java.util.List;
-import com.google.gwt.event.dom.client.KeyCodes;
+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.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
-import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
-
-import javax.persistence.Id;
-
-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.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 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.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/**
* @author Greg Hinkle
@@ -90,24 +88,23 @@ public class ResourceSearchView extends Table {
setWidth100();
setHeight100();
-// DynamicForm searchPanel = new DynamicForm();
-// final TextItem searchBox = new TextItem("query", "Search
Resources");
-// searchBox.setValue("");
-// searchPanel.setWrapItemTitles(false);
-// searchPanel.setFields(searchBox);
-
+ // DynamicForm searchPanel = new DynamicForm();
+ // final TextItem searchBox = new TextItem("query", "Search
Resources");
+ // searchBox.setValue("");
+ // searchPanel.setWrapItemTitles(false);
+ // searchPanel.setFields(searchBox);
final ResourceDatasource datasource = new ResourceDatasource();
-// setTitleComponent(searchPanel);
+ // setTitleComponent(searchPanel);
setDataSource(datasource);
getListGrid().setSelectionType(SelectionStyle.SIMPLE);
-// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
- ListGridField iconField = new ListGridField("icon","", 40);
+ ListGridField iconField = new ListGridField("icon", "", 40);
ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(),
250);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
@@ -123,15 +120,35 @@ public class ResourceSearchView extends Table {
ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(),
AVAILABILITY.title(), 55);
availabilityField.setAlign(Alignment.CENTER);
getListGrid().setFields(idField, iconField, nameField, descriptionField,
typeNameField, pluginNameField,
- categoryField, availabilityField);
+ categoryField, availabilityField);
addTableAction("Uninventory", Table.SelectionEnablement.ANY,
- "Are you sure you want to delete # resources?", new
TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- getListGrid().removeSelectedData();
+ "Are you sure you want to uninventory # resources?", new
TableAction() {
+ public void executeAction(ListGridRecord[] selections) {
+ int[] resourceIds = new int[selections.length];
+ int index = 0;
+ for (ListGridRecord selection : selections) {
+ resourceIds[index++] =
selection.getAttributeAsInt("id");
}
- });
+ ResourceGWTServiceAsync resourceManager =
GWTServiceLookup.getResourceService();
+
+ resourceManager.uninventoryResources(resourceIds, new
AsyncCallback<List<Integer>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
uninventory selected resources", caught);
+ }
+
+ public void onSuccess(List<Integer> result) {
+ CoreGUI.getMessageCenter()
+ .notify(
+ new Message("Successfully uninventoried " +
result.size() + " resources",
+ Severity.Info));
+ ResourceSearchView.this.refresh();
+ }
+ });
+
+ }
+ });
/*searchBox.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
@@ -153,13 +170,10 @@ public class ResourceSearchView extends Table {
});*/
}
-
-
public int getMatches() {
return this.getListGrid().getTotalRows();
}
-
public void addResourceSelectedListener(ResourceSelectListener listener) {
selectListeners.add(listener);
}
commit a064c1435259e596538243c7a86b8d80aa626557
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 21:03:02 2010 -0400
delete all selected resource groups in a single async service call
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
index 3d78c78..ff3be5b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
@@ -18,6 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.gwt;
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria;
import org.rhq.core.domain.resource.group.GroupDefinition;
@@ -25,9 +28,6 @@ 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 com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
-
/**
* @author Greg Hinkle
*/
@@ -44,7 +44,7 @@ public interface ResourceGroupGWTService extends RemoteService {
ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds);
- void deleteResourceGroup(int groupId);
+ void deleteResourceGroups(int[] groupIds);
void updateResourceGroup(ResourceGroup group);
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 d2953eb..3206da5 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
@@ -27,7 +27,6 @@ import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -88,24 +87,25 @@ public class ResourceGroupListView extends Table {
addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected resource groups?",
new TableAction() {
public void executeAction(ListGridRecord[] selections) {
- ResourceGroupsDataSource ds = (ResourceGroupsDataSource)
getDataSource();
+ int[] groupIds = new int[selections.length];
+ int index = 0;
for (ListGridRecord selection : selections) {
- ResourceGroupGWTServiceAsync resourceGroupManager =
GWTServiceLookup.getResourceGroupService();
- final ResourceGroup object = ds.copyValues(selection);
- resourceGroupManager.deleteResourceGroup(object.getId(), new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to delete resource group [" +
object.getName() + "]", caught);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(
- new Message("Deleted resource group [" +
object.getName() + "]", Severity.Info));
-
- CoreGUI.refresh();
- }
- });
+ groupIds[index++] = selection.getAttributeAsInt("id");
}
+ ResourceGroupGWTServiceAsync resourceGroupManager =
GWTServiceLookup.getResourceGroupService();
+
+ resourceGroupManager.deleteResourceGroups(groupIds, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to delete
selected resource groups", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Deleted selected resource groups",
Severity.Info));
+
+ ResourceGroupListView.this.refresh();
+ }
+ });
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
index 31a4381..e6b5936 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
@@ -41,17 +41,17 @@ public class ResourceGroupGWTServiceImpl extends
AbstractGWTServiceImpl implemen
public PageList<ResourceGroup>
findResourceGroupsByCriteria(ResourceGroupCriteria criteria) {
return
SerialUtility.prepare(groupManager.findResourceGroupsByCriteria(getSessionSubject(),
criteria),
- "ResourceGroupService.findResourceGroupsByCriteria");
+ "ResourceGroupService.findResourceGroupsByCriteria");
}
public PageList<ResourceGroupComposite>
findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria) {
return
SerialUtility.prepare(groupManager.findResourceGroupCompositesByCriteria(getSessionSubject(),
criteria),
- "ResourceGroupService.findResourceGroupCompositesByCriteria");
+ "ResourceGroupService.findResourceGroupCompositesByCriteria");
}
public PageList<GroupDefinition>
findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria) {
return
SerialUtility.prepare(definitionManager.findGroupDefinitionsByCriteria(getSessionSubject(),
criteria),
- "ResourceGroupService.findGroupDefinitionsByCriteria");
+ "ResourceGroupService.findGroupDefinitionsByCriteria");
}
public void ensureMembershipMatches(int groupId, int[] resourceIds) {
@@ -66,9 +66,9 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl
implemen
return SerialUtility.prepare(group,
"ResourceGroupService.createResourceGroup");
}
- public void deleteResourceGroup(int groupId) {
+ public void deleteResourceGroups(int[] groupIds) {
try {
- groupManager.deleteResourceGroup(getSessionSubject(), groupId);
+ groupManager.deleteResourceGroups(getSessionSubject(), groupIds);
} catch (ResourceGroupDeleteException e) {
throw new RuntimeException(e.getMessage());
}
commit 1eb5159403a3bd12bd05aea4a9bc0b422d64f36b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 19:13:21 2010 -0400
add the ability to delete multiple resource groups with a single SLSB call
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index f6a5b4d..04dd614 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -181,8 +181,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
}
if (!authorizationManager.hasGroupPermission(user, Permission.MODIFY_RESOURCE,
groupId)) {
- throw new PermissionException("User [" + user + "] does not
have permission to modify Resource group with id ["
- + groupId + "].");
+ throw new PermissionException("User [" + user
+ + "] does not have permission to modify Resource group with id
[" + groupId + "].");
}
if (changeType == null) {
@@ -197,7 +197,7 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
// recursive bit didn't change
}
}
-
+
group.setMtime(System.currentTimeMillis());
group.setModifiedBy(user.getName());
@@ -285,6 +285,14 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
entityManager.remove(group);
}
+ @RequiredPermission(Permission.MANAGE_INVENTORY)
+ public void deleteResourceGroups(Subject subject, int[] groupIds) throws
ResourceGroupNotFoundException,
+ ResourceGroupDeleteException {
+ for (int nextGroupId : groupIds) {
+ deleteResourceGroup(subject, nextGroupId);
+ }
+ }
+
/*
* TODO: Deletion of all associated group data (except implicit/explicit resource
members) should be moved here.
* in other words, we don't want Hibernate cascade annotations to remove
that history upon deletion of an
@@ -312,9 +320,7 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
try {
operationManager.unscheduleGroupOperation(overlord,
schedule.getJobId().toString(), group.getId());
} catch (UnscheduleException e) {
- log
- .warn("Failed to unschedule job [" + schedule + "]
for a group being deleted [" + group + "]",
- e);
+ log.warn("Failed to unschedule job [" + schedule + "]
for a group being deleted [" + group + "]", e);
}
}
} catch (Exception e) {
@@ -753,8 +759,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
* to this method, we can just do simple RHQ_RESOURCE_GROUP_RES_IMP_MAP
table insertions
*/
String insertImplicitQueryString =
JDBCUtil.transformQueryForMultipleInParameters(
- ResourceGroup.QUERY_NATIVE_ADD_RESOURCES_TO_GROUP_IMPLICIT,
"@@RESOURCE_IDS@@", resourceIdsToAdd
- .size());
+ ResourceGroup.QUERY_NATIVE_ADD_RESOURCES_TO_GROUP_IMPLICIT,
"@@RESOURCE_IDS@@",
+ resourceIdsToAdd.size());
insertImplicitStatement =
conn.prepareStatement(insertImplicitQueryString);
insertImplicitStatement.setInt(1, implicitRecursiveGroupId);
JDBCUtil.bindNTimes(insertImplicitStatement,
ArrayUtils.unwrapCollection(resourceIdsToAdd), 2);
@@ -816,9 +822,9 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
ResourceGroup group = getResourceGroupById(subject, groupId, category);
Set<Resource> res = group.getExplicitResources();
if (res != null && res.size() > 0) {
- List<Resource> resources =
PersistenceUtility.getHibernateSession(entityManager).createFilter(res,
- "where this.inventoryStatus =
:inventoryStatus").setParameter("inventoryStatus",
- InventoryStatus.COMMITTED).list();
+ List<Resource> resources =
PersistenceUtility.getHibernateSession(entityManager)
+ .createFilter(res, "where this.inventoryStatus =
:inventoryStatus")
+ .setParameter("inventoryStatus",
InventoryStatus.COMMITTED).list();
return resources;
} else {
@@ -1465,8 +1471,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
}
if (!authorizationManager.hasGroupPermission(subject, Permission.MODIFY_RESOURCE,
groupId)) {
- throw new PermissionException("User [" + subject + "] does not
have permission to modify Resource group with id ["
- + groupId + "].");
+ throw new PermissionException("User [" + subject
+ + "] does not have permission to modify Resource group with id
[" + groupId + "].");
}
return group;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
index 9b0468b..2919879 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
@@ -125,6 +125,9 @@ public interface ResourceGroupManagerLocal {
void deleteResourceGroup(Subject user, int groupId) throws
ResourceGroupNotFoundException,
ResourceGroupDeleteException;
+ void deleteResourceGroups(Subject user, int[] groupIds) throws
ResourceGroupNotFoundException,
+ ResourceGroupDeleteException;
+
ResourceGroup getResourceGroup(Subject subject, int groupId);
ResourceGroupComposite getResourceGroupComposite(Subject subject, int groupId);
@@ -138,5 +141,5 @@ public interface ResourceGroupManagerLocal {
ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
ResourceGroupCriteria criteria);
-
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
index fdda4e2..4071c39 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
@@ -60,6 +60,12 @@ public interface ResourceGroupManagerRemote {
@WebParam(name = "groupId") int groupId) throws
ResourceGroupNotFoundException, ResourceGroupDeleteException;
@WebMethod
+ void deleteResourceGroups( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "groupIds") int[] groupIds) throws
ResourceGroupNotFoundException,
+ ResourceGroupDeleteException;
+
+ @WebMethod
ResourceGroup getResourceGroup( //
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "groupId") int groupId);
commit 0cf06bb06f6975b68aeaa78a886c004851423409
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 18:37:13 2010 -0400
refresh the ResourceGroupListView after adding a new group
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 8171d96..d2953eb 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
@@ -111,7 +111,7 @@ public class ResourceGroupListView extends Table {
addTableAction("New", new TableAction() {
public void executeAction(ListGridRecord[] selection) {
- new GroupCreateWizard().startBundleWizard();
+ new GroupCreateWizard(ResourceGroupListView.this).startBundleWizard();
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 55d1588..d579c8c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -35,6 +35,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
@@ -42,10 +43,14 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
*/
public class GroupCreateWizard extends AbstractWizard {
+ private ResourceGroupListView resourceGroupListView;
+
private GroupCreateStep createStep;
private GroupMembersStep memberStep;
- public GroupCreateWizard() {
+ public GroupCreateWizard(ResourceGroupListView resourceGroupListView) {
+ this.resourceGroupListView = resourceGroupListView;
+
ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
steps.add(createStep = new GroupCreateStep());
@@ -98,7 +103,7 @@ public class GroupCreateWizard extends AbstractWizard {
public void onSuccess(ResourceGroup result) {
CoreGUI.getMessageCenter().notify(
new Message("Saved new group " + result.getName(),
Message.Severity.Info));
- // TODO: Implement this method.
+ resourceGroupListView.refresh();
}
});
commit 9d21c482cfc4e294aafae0360a9285b575d845c8
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 16 19:05:15 2010 -0400
add support for updating collection interval to abstract metric schedules view
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 67632e9..7b6ca8e 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
@@ -399,6 +399,11 @@ public class Table extends VLayout {
}
tableAction.actionButton.setDisabled(!enabled);
}
+ for (Canvas extraWidget : extraWidgets) {
+ if (extraWidget instanceof TableWidget) {
+ ((TableWidget)extraWidget).refresh(this.listGrid);
+ }
+ }
this.tableInfo.setContents("Total: " + listGrid.getTotalRows() +
" (" + count + " selected)");
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java
new file mode 100644
index 0000000..61c59e5
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java
@@ -0,0 +1,10 @@
+package org.rhq.enterprise.gui.coregui.client.components.table;
+
+import com.smartgwt.client.widgets.grid.ListGrid;
+
+/**
+ *
+ */
+public interface TableWidget {
+ void refresh(ListGrid listGrid);
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
index 15c7127..333b500 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -79,7 +79,7 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
}
});
- // TODO: Add controls to set collection interval - base class is going to need
massaging...
+ addExtraWidget(new UpdateCollectionIntervalWidget(this));
}
class MillisecondsCellFormatter implements CellFormatter {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
new file mode 100644
index 0000000..e4daee2
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java
@@ -0,0 +1,92 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.common;
+
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.IntegerItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
+import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import com.smartgwt.client.widgets.form.validator.IntegerRangeValidator;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableWidget;
+
+/**
+ * TODO
+ */
+public class UpdateCollectionIntervalWidget extends HLayout implements TableWidget {
+ private AbstractMeasurementScheduleListView schedulesView;
+ private DynamicForm form;
+ private IButton setButton;
+
+ public UpdateCollectionIntervalWidget(AbstractMeasurementScheduleListView
schedulesView) {
+ this.schedulesView = schedulesView;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ VLayout spacer = new VLayout();
+ spacer.setWidth(20);
+ addMember(spacer);
+
+ this.form = new DynamicForm();
+ this.form.setNumCols(3);
+ IntegerItem intervalItem = new IntegerItem("interval", "Collection
Interval");
+ IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
+ integerRangeValidator.setMin(1);
+ intervalItem.setValidators(integerRangeValidator);
+ intervalItem.setValidateOnChange(true);
+ intervalItem.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+
refresh(UpdateCollectionIntervalWidget.this.schedulesView.getListGrid());
+ }
+ });
+ SelectItem unitsItem = new SelectItem("units", null);
+ unitsItem.setValueMap("seconds", "minutes",
"hours");
+ unitsItem.setDefaultValue("seconds");
+ unitsItem.setShowTitle(false);
+ this.form.setFields(intervalItem, unitsItem);
+ addMember(this.form);
+
+ this.setButton = new IButton("Set");
+ this.setButton.setDisabled(true);
+ this.setButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ form.validate();
+
UpdateCollectionIntervalWidget.this.schedulesView.getDataSource().updateSchedules(
+ UpdateCollectionIntervalWidget.this.schedulesView,
getInterval());
+ }
+ });
+ addMember(this.setButton);
+ }
+
+ @Override
+ public void refresh(ListGrid listGrid) {
+ int count = listGrid.getSelection().length;
+ Long interval = getInterval();
+ this.setButton.setDisabled(count == 0 || interval == null);
+ }
+
+ private Long getInterval() {
+ FormItem item = this.form.getItem("interval");
+ if (item.getValue() == null || !item.validate()) {
+ return null;
+ }
+ String stringValue = this.form.getValueAsString("interval");
+ long value = Long.valueOf(stringValue.trim());
+ String units = this.form.getValueAsString("units");
+ value *= 1000;
+ if (units.equals("minutes")) {
+ value *= 60;
+ } else if (units.equals("hours")) {
+ value *= 60 * 60;
+ }
+ return value;
+ }
+}
commit 76ed96cb78102d33520f33bece21e15963c2606e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 16 18:01:59 2010 -0400
comment out method that doesn't exist in smart gwt 2.2
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 bcf95da..67632e9 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
@@ -153,7 +153,7 @@ public class Table extends VLayout {
// these fields to a bogus field name will disable this behavior. Note, setting
them to null does *not* disable
// the behavior.
listGrid.setRecordEnabledProperty("foobar");
- listGrid.setRecordCanSelectProperty("foobar");
+ //listGrid.setRecordCanSelectProperty("foobar");
listGrid.setRecordEditProperty("foobar");
// Footer
commit 225c0357d027d6e46269eec7ab723a692cf46813
Merge: 986a88c... 7677e9f...
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 16 17:03:52 2010 -0400
Merge branch 'master' into groovy-server-plugin
commit 986a88c1e229f182ae1aa78de4f15fb3ecb9985c
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 16 16:41:34 2010 -0400
Adding error handling logic in CriteriaGenerator
Initial commit for RHQScriptTest.groovy which includes a test for the
criteria dsl.
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index 3595114..4e73145 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -1,10 +1,33 @@
package org.rhq.enterprise.server.plugins.groovy
+import org.apache.commons.logging.Log
+import org.apache.commons.logging.LogFactory
+
class CriteriaGenerator {
+ static Log log = LogFactory.getLog(CriteriaGenerator)
+
def execute(CriteriaSpec spec) {
- def clazz =
Class.forName("org.rhq.core.domain.criteria.${spec.criteriaType.simpleName}Criteria")
- def criteria = clazz.newInstance()
+ def className =
"org.rhq.core.domain.criteria.${spec.criteriaType.simpleName}Criteria"
+ def clazz
+ def criteria
+
+ try {
+ clazz = Class.forName(className)
+ }
+ catch (Exception e) {
+ def msg = "Failed to load criteria class $classname"
+ log.warn msg, e
+ throw new CriteriaGeneratorException(msg, e)
+ }
+ try {
+ criteria = clazz.newInstance()
+ }
+ catch (Exception e) {
+ def msg = "Failed to create instance of criteria class $className"
+ log.warn msg, e
+ throw new CriteriaGeneratorException(msg, e)
+ }
spec.filters.each { key, value ->
def filterName = "addFilter${capitalize(key)}"
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorException.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorException.groovy
new file mode 100644
index 0000000..9040a51
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorException.groovy
@@ -0,0 +1,22 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class CriteriaGeneratorException extends Exception {
+
+ def CriteriaGeneratorException() {
+ super();
+ }
+
+ def CriteriaGeneratorException(String message) {
+ super(message);
+ }
+
+ def CriteriaGeneratorException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ def CriteriaGeneratorException(Throwable cause) {
+ super(cause);
+ }
+
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index caed55c..07d450d 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -6,6 +6,7 @@ import static org.testng.Assert.*
import org.rhq.core.domain.criteria.TestEntityCriteria
import org.rhq.org.rhq.core.domain.test.TestEntity
+import org.rhq.org.rhq.core.domain.test.TestEntityWithoutCriteria
class CriteriaGeneratorTest {
@@ -17,10 +18,11 @@ class CriteriaGeneratorTest {
assertTrue(criteria instanceof TestEntityCriteria, "Expected an instance of
${TestEntityCriteria.name}")
}
-// @Test
-// void throwExceptionWhenEntityTypeDoesNotExist() {
-// def spec = new CriteriaSpec()
-// }
+ @Test(expectedExceptions = [CriteriaGeneratorException])
+ void throwExceptionWhenCriteriaTypeDoesNotExist() {
+ def spec = new CriteriaSpec(TestEntityWithoutCriteria)
+ def criteria = new CriteriaGenerator().execute(spec)
+ }
@Test
void setTheFilterFields() {
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
new file mode 100644
index 0000000..84c7806
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScriptTest.groovy
@@ -0,0 +1,22 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.testng.annotations.Test
+import org.rhq.org.rhq.core.domain.test.TestEntity
+
+import static org.testng.Assert.*
+
+class RHQScriptTest {
+
+ @Test
+ void buildCriteriaThatMatchesSpec() {
+ def script = new RHQScript()
+ def criteria = script.criteria(TestEntity) {
+ filters = [id: 1]
+ fetch = ['resourceTypes']
+ }
+
+ assertEquals(criteria.id, 1, "The criteria's id property is wrong")
+ assertTrue(criteria.fetchResourceTypes)
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
new file mode 100644
index 0000000..1ddcea2
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntityWithoutCriteria.groovy
@@ -0,0 +1,4 @@
+package org.rhq.org.rhq.core.domain.test
+
+class TestEntityWithoutCriteria {
+}
commit 6bd6bd06d5aeecf3d08d324ce545b164f0b47e8a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 16 13:15:58 2010 -0400
fix several bugs in the Schedules tabs
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 d5b8b13..bcf95da 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
@@ -149,9 +149,12 @@ public class Table extends VLayout {
listGrid.setAutoFitData(Autofit.HORIZONTAL);
listGrid.setAlternateRecordStyles(true);
listGrid.setResizeFieldsInRealTime(false);
- // By default, SmartGWT will disable row that have a record named
"enabled" with a value of false - setting this
- // field to null will disable this behavior.
- listGrid.setRecordEnabledProperty(null);
+ // By default, SmartGWT will disable any rows that have a record named
"enabled" with a value of false - setting
+ // these fields to a bogus field name will disable this behavior. Note, setting
them to null does *not* disable
+ // the behavior.
+ listGrid.setRecordEnabledProperty("foobar");
+ listGrid.setRecordCanSelectProperty("foobar");
+ listGrid.setRecordEditProperty("foobar");
// Footer
footer = new ToolStrip();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
index b9a017a..08f3473 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
@@ -141,7 +141,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
@Override
public MeasurementSchedule copyValues(ListGridRecord from) {
- return null; // TODO: Implement?
+ return null;
}
@Override
@@ -162,26 +162,29 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
}
public void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
- int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
- enableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
+ List<String> displayNames =
getMeasurementDefinitionDisplayNames(measurementScheduleListView);
+ enableSchedules(measurementScheduleListView, ids, displayNames);
measurementScheduleListView.refresh();
}
protected abstract void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds);
+ int[] measurementDefinitionIds,
List<String> measurementDefinitionDisplayNames);
public void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
- int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
- disableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
+ List<String> displayNames =
getMeasurementDefinitionDisplayNames(measurementScheduleListView);
+ disableSchedules(measurementScheduleListView, ids, displayNames);
measurementScheduleListView.refresh();
}
protected abstract void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds);
+ int[] measurementDefinitionIds,
List<String> measurementDefinitionDisplayNames);
public void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, long interval) {
- int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
- updateSchedules(measurementScheduleListView, measurementDefinitionIds,
interval);
+ int[] ids = getMeasurementDefinitionIds(measurementScheduleListView);
+ List<String> displayNames =
getMeasurementDefinitionDisplayNames(measurementScheduleListView);
+ updateSchedules(measurementScheduleListView, ids, displayNames, interval);
measurementScheduleListView.refresh();
}
@@ -198,6 +201,17 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
return measurementDefinitionIds;
}
+ private List<String>
getMeasurementDefinitionDisplayNames(AbstractMeasurementScheduleListView
measurementScheduleListView) {
+ ListGrid listGrid = measurementScheduleListView.getListGrid();
+ ListGridRecord[] records = listGrid.getSelection();
+ List<String> displayNames = new ArrayList<String>(records.length);
+ for (ListGridRecord record : records) {
+ String displayName =
record.getAttributeAsString(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME);
+ displayNames.add(displayName);
+ }
+ return displayNames;
+ }
+
protected abstract void updateSchedules(final AbstractMeasurementScheduleListView
measurementScheduleListView,
- final int[] measurementDefinitionIds, final
long interval);
+ final int[] measurementDefinitionIds,
List<String> measurementDefinitionDisplayNames, final long interval);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
index 7b56290..ea28b3f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
@@ -47,38 +47,42 @@ public class SchedulesDataSource extends
AbstractMeasurementScheduleDataSource {
@Override
protected void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds) {
+ int[] measurementDefinitionIds, final
List<String> measurementDefinitionDisplayNames) {
this.measurementService.enableSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds,
new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to enable specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
- throwable);
- }
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to enable
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
group with id [" + resourceGroupId + "].",
+ throwable);
+ }
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource group with id [" + resourceGroupId +
- "] enabled.",
Message.Severity.Info));
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Enabled
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
group with id [" + resourceGroupId +
+ "].", Message.Severity.Info));
- }
+ }
});
}
@Override
- protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds) {
+ protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds, final List<String>
measurementDefinitionDisplayNames) {
this.measurementService.disableSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds,
new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to disable specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
+ CoreGUI.getErrorHandler().handleError("Failed to disable collection
of metrics "
+ + measurementDefinitionDisplayNames + " for Resource group
with id [" + resourceGroupId + "].",
throwable);
}
@Override
public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified metric
schedules for Resource group with id [" + resourceGroupId +
- "] disabled.",
Message.Severity.Info));
+ CoreGUI.getMessageCenter().notify(new Message("Disabled collection
of metrics "
+ + measurementDefinitionDisplayNames + " for Resource group
with id [" + resourceGroupId +
+ "].", Message.Severity.Info));
}
});
@@ -86,19 +90,22 @@ public class SchedulesDataSource extends
AbstractMeasurementScheduleDataSource {
@Override
protected void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds, long
collectionInterval) {
+ int[] measurementDefinitionIds, final
List<String> measurementDefinitionDisplayNames, final long collectionInterval) {
this.measurementService.updateSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds, collectionInterval,
new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to update specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
+ CoreGUI.getErrorHandler().handleError("Failed to set collection
interval to " + (collectionInterval / 1000)
+ + " seconds for metrics " +
measurementDefinitionDisplayNames + " for Resource group with id ["
+ + resourceGroupId + "].",
throwable);
}
@Override
public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource group with id [" + resourceGroupId +
- "] updated.", Message.Severity.Info));
+ CoreGUI.getMessageCenter().notify(new Message("Collection interval
for metrics "
+ + measurementDefinitionDisplayNames + " for Resource group
with id [" + resourceGroupId +
+ "] set to " + (collectionInterval /
1000) + " seconds.", Message.Severity.Info));
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
index 3f1f7dc..d944bd0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
@@ -3,7 +3,6 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring
import com.smartgwt.client.data.Criteria;
import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesDataSource;
/**
* The group Monitoring>Schedules subtab.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
index dbfb9a0..10a5646 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
@@ -47,58 +47,65 @@ public class SchedulesDataSource extends
AbstractMeasurementScheduleDataSource {
@Override
protected void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds) {
+ int[] measurementDefinitionIds, final
List<String> measurementDefinitionDisplayNames) {
this.measurementService.enableSchedulesForResource(this.resourceId,
measurementDefinitionIds,
new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to enable specified
metric schedules for Resource with id[" + resourceId + "].",
- throwable);
- }
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to enable
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
with id [" + resourceId + "].",
+ throwable);
+ }
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource with id [" + resourceId +
- "] enabled.",
Message.Severity.Info));
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Enabled
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
with id [" + resourceId +
+ "].", Message.Severity.Info));
- }
+ }
});
}
@Override
- protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds) {
+ protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds, final List<String>
measurementDefinitionDisplayNames) {
this.measurementService.disableSchedulesForResource(this.resourceId,
measurementDefinitionIds,
new AsyncCallback<Void>() {
- @Override
- public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to disable specified
metric schedules for Resource with id[" + resourceId + "].",
- throwable);
- }
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to disable
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
with id [" + resourceId + "].",
+ throwable);
+ }
- @Override
- public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified metric
schedules for Resource with id [" + resourceId +
- "] disabled.",
Message.Severity.Info));
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Disabled
collection of metrics "
+ + measurementDefinitionDisplayNames + " for Resource
with id [" + resourceId +
+ "].", Message.Severity.Info));
- }
+ }
});
}
@Override
protected void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- int[] measurementDefinitionIds, long
collectionInterval) {
+ int[] measurementDefinitionIds, final
List<String> measurementDefinitionDisplayNames, final long collectionInterval) {
this.measurementService.updateSchedulesForResource(this.resourceId,
measurementDefinitionIds, collectionInterval,
new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable throwable) {
- CoreGUI.getErrorHandler().handleError("Failed to update specified
metric schedules for Resource with id[" + resourceId + "].",
+ CoreGUI.getErrorHandler().handleError("Failed to set collection
interval to " + (collectionInterval / 1000)
+ + " seconds for metrics " +
measurementDefinitionDisplayNames + " for Resource with id ["
+ + resourceId + "].",
throwable);
}
@Override
public void onSuccess(Void aVoid) {
- CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource with id [" + resourceId +
- "] updated.", Message.Severity.Info));
+ CoreGUI.getMessageCenter().notify(new Message("Collection interval
for metrics "
+ + measurementDefinitionDisplayNames + " for Resource with id
[" + resourceId +
+ "] set to " + (collectionInterval /
1000) + " seconds.", Message.Severity.Info));
}
});
commit 78d42055bb2657c9c9b938697ac6121c9d2354c1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 16 11:55:22 2010 -0400
first cut of group Monitoring>Schedules subtab; add resourcePermission field to
ResourceGroupComposite
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
index 5199ba2..1925c37 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
@@ -27,6 +27,7 @@ import java.io.Serializable;
import javax.xml.bind.annotation.XmlTransient;
import org.rhq.core.domain.resource.composite.ResourceFacets;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
@@ -53,7 +54,8 @@ public class ResourceGroupComposite implements Serializable {
private ResourceFacets resourceFacets;
- // TODO: Expose authz permissions current user has for the group.
+ @XmlTransient
+ private ResourcePermission resourcePermission;
private class GroupDefinitionMember extends ResourceGroup {
public void setGroupCategory(GroupCategory category) {
@@ -159,6 +161,14 @@ public class ResourceGroupComposite implements Serializable {
return resourceFacets;
}
+ public ResourcePermission getResourcePermission() {
+ return resourcePermission;
+ }
+
+ public void setResourcePermission(ResourcePermission resourcePermission) {
+ this.resourcePermission = resourcePermission;
+ }
+
/**
* Returns a query string snippet that can be passed to group URLs that reference
this specific group.
* Note that the returned string does not include the "?" itself.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index 1cb4b9e..ba81f5c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -21,7 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.alert;
import java.util.ArrayList;
import java.util.List;
-import com.google.gwt.user.client.ui.VerticalPanel;
import com.smartgwt.client.core.DataClass;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.Record;
@@ -64,9 +63,6 @@ public class AlertsView extends Table {
private static final String DELETE_CONFIRM_MESSAGE = "Are you sure you want to
delete the selected alert(s)?";
private AlertDataSource dataSource;
- private HTMLFlow detailsContent;
- private DynamicForm detailsTable;
- private VerticalPanel vpanel;
private static final String SENDER = "sender";
Criteria criteria;
@@ -95,7 +91,6 @@ public class AlertsView extends Table {
protected void onInit() {
super.onInit();
-
// Add the list table as the top half of the view.
//Criteria criteria = new Criteria(AlertCriteria.);
ListGrid listGrid = getListGrid();
@@ -129,7 +124,6 @@ public class AlertsView extends Table {
listGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent event) {
ListGridRecord[] selectedRecords =
AlertsView.this.getListGrid().getSelection();
- String contents;
if (selectedRecords.length == 1) {
ListGridRecord record = selectedRecords[0];
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
index 6300f6a..8d61228 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
@@ -8,12 +8,15 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
*/
public class BooleanCellFormatter implements CellFormatter {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
- if (value == null) {
- return "";
- }
- if (!(value instanceof Boolean)) {
- throw new IllegalArgumentException("value parameter is not a
Boolean.");
- }
- return ((Boolean) value) ? "yes" : "no";
+ if (value == null) {
+ return "";
+ }
+ if (value instanceof Boolean) {
+ return ((Boolean) value) ? "yes" : "no";
+ } else if (value instanceof String) {
+ return Boolean.parseBoolean((String) value) ? "yes" :
"no";
+ } else {
+ throw new IllegalArgumentException("value parameter is not a Boolean or
a String.");
+ }
}
}
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 ee29754..d5b8b13 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
@@ -19,6 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.components.table;
import java.util.ArrayList;
+import java.util.List;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
@@ -96,8 +97,8 @@ public class Table extends VLayout {
;
- private ArrayList<TableActionInfo> tableActions = new
ArrayList<TableActionInfo>();
- private ArrayList<Canvas> extraWidgets = new ArrayList<Canvas>();
+ private List<TableActionInfo> tableActions = new
ArrayList<TableActionInfo>();
+ private List<Canvas> extraWidgets = new ArrayList<Canvas>();
public Table() {
this(null, null, null, null, true);
@@ -148,6 +149,9 @@ public class Table extends VLayout {
listGrid.setAutoFitData(Autofit.HORIZONTAL);
listGrid.setAlternateRecordStyles(true);
listGrid.setResizeFieldsInRealTime(false);
+ // By default, SmartGWT will disable row that have a record named
"enabled" with a value of false - setting this
+ // field to null will disable this behavior.
+ listGrid.setRecordEnabledProperty(null);
// Footer
footer = new ToolStrip();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index 2b163f6..cf1a9a2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -68,4 +68,10 @@ public interface MeasurementDataGWTService extends RemoteService {
void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long
collectionInterval);
+ void enableSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds);
+
+ void disableSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds);
+
+ void updateSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds, long collectionInterval);
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
index 81fe163..b9a017a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
@@ -18,8 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.common;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
@@ -163,12 +161,6 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
return record;
}
- protected void executeRemove(final DSRequest request, final DSResponse response) {
- JavaScriptObject data = request.getData();
- ListGridRecord record = new ListGridRecord(data);
- Window.alert(String.valueOf(record.getAttributeAsInt("id")));
- }
-
public void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
enableSchedules(measurementScheduleListView, measurementDefinitionIds);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
index 605c857..15c7127 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -36,12 +36,11 @@ import
org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
*
* @author Ian Springer
*/
-// TODO: Actually, this class probably does not need to be abstract...
public abstract class AbstractMeasurementScheduleListView extends Table {
private static final String TITLE = "Metric Collection Schedules";
private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{
- new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
SortDirection.ASCENDING)
+ new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
SortDirection.ASCENDING)
};
public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource, Criteria criteria,
@@ -59,89 +58,87 @@ public abstract class AbstractMeasurementScheduleListView extends
Table {
protected void onInit() {
super.onInit();
- ListGrid listGrid = getListGrid();
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("25%");
+ ListGrid listGrid = getListGrid();
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%");
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%");
ListGridField enabledField =
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED);
- enabledField.setWidth("5%");
+ enabledField.setWidth("10%");
enabledField.setCellFormatter(new BooleanCellFormatter());
ListGridField intervalField =
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL);
- intervalField.setCellFormatter(new CellFormatter() {
- public String format(Object value, ListGridRecord record, int rowNum, int
colNum) {
- if (value == null) {
- return "";
- }
+ intervalField.setCellFormatter(new MillisecondsCellFormatter());
+ intervalField.setWidth("25%");
- long milliseconds = (Integer)value;
- if (milliseconds == 0) {
- return "0";
- }
+ addTableAction("Enable", Table.SelectionEnablement.ANY, null, new
TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+
getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this);
+ }
+ });
+ addTableAction("Disable", Table.SelectionEnablement.ANY, null, new
TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+
getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
+ }
+ });
+ // TODO: Add controls to set collection interval - base class is going to need
massaging...
+ }
- StringBuilder result = new StringBuilder();
- if (milliseconds > 1000) {
- long seconds = milliseconds / 1000;
- milliseconds = milliseconds % 1000;
- if (seconds >= 60) {
- long minutes = seconds / 60;
- seconds = seconds % 60;
- if (minutes > 60) {
- long hours = minutes / 60;
- minutes = minutes % 60;
- result.append(hours).append(" hour");
- if (hours > 1) {
- result.append("s");
- }
- }
- if (minutes != 0) {
- if (result.length() != 0) {
- result.append(", ");
- }
- result.append(minutes).append(" minute");
- if (minutes > 1) {
- result.append("s");
- }
+ class MillisecondsCellFormatter implements CellFormatter {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum)
{
+ if (value == null) {
+ return "";
+ }
+
+ long milliseconds = (Integer) value;
+ if (milliseconds == 0) {
+ return "0";
+ }
+
+ StringBuilder result = new StringBuilder();
+ if (milliseconds > 1000) {
+ long seconds = milliseconds / 1000;
+ milliseconds = milliseconds % 1000;
+ if (seconds >= 60) {
+ long minutes = seconds / 60;
+ seconds = seconds % 60;
+ if (minutes > 60) {
+ long hours = minutes / 60;
+ minutes = minutes % 60;
+ result.append(hours).append(" hour");
+ if (hours > 1) {
+ result.append("s");
}
}
- if (seconds != 0) {
+ if (minutes != 0) {
if (result.length() != 0) {
result.append(", ");
}
- result.append(seconds).append(" second");
- if (seconds > 1) {
+ result.append(minutes).append(" minute");
+ if (minutes > 1) {
result.append("s");
}
}
}
- if (milliseconds != 0) {
+ if (seconds != 0) {
if (result.length() != 0) {
result.append(", ");
}
- result.append(milliseconds).append(" millisecond");
- if (milliseconds > 1) {
+ result.append(seconds).append(" second");
+ if (seconds > 1) {
result.append("s");
}
}
- return result.toString();
- }
- });
- intervalField.setWidth("25%");
-
- addTableAction("Enable", Table.SelectionEnablement.ANY, null, new
TableAction() {
- public void executeAction(ListGridRecord[] selection) {
-
getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this);
}
- });
- addTableAction("Disable", Table.SelectionEnablement.ANY, null, new
TableAction() {
- public void executeAction(ListGridRecord[] selection) {
-
getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
+ if (milliseconds != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(milliseconds).append(" millisecond");
+ if (milliseconds > 1) {
+ result.append("s");
+ }
}
- });
- // TODO: Add controls to set collection interval - base class is going to need
massaging...
- }
+ return result.toString();
+ }
- public void refresh() {
- this.getListGrid().invalidateCache();
- //this.table.getListGrid().markForRedraw();
- }
+ }
}
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 e6b208c..a9a6989 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
@@ -23,7 +23,6 @@ import java.util.Set;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.docs.Members;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -43,6 +42,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.OverviewView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -138,8 +138,9 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
+ groupId));
monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId="
+ groupId));
- monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId="
- + groupId));
+ monitoringTab.updateSubTab("Schedules", new SchedulesView(groupId));
+
+ //new FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId="
+ groupId));
monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId="
+ groupId));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
new file mode 100644
index 0000000..7b56290
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
@@ -0,0 +1,106 @@
+package
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleDataSource;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+import java.util.List;
+
+/**
+ * A DataSource for reading and updating the metric schedules for the current group.
+ *
+ * @author Ian Springer
+ */
+public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource {
+ private MeasurementDataGWTServiceAsync measurementService =
GWTServiceLookup.getMeasurementDataService();
+ private int resourceGroupId;
+
+ public SchedulesDataSource(int resourceGroupId) {
+ this.resourceGroupId = resourceGroupId;
+ }
+
+ @Override
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = super.createFields();
+ DataSourceField resourceGroupIdField = new
DataSourceIntegerField(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID,
+ "Resource Group Id");
+ resourceGroupIdField.setHidden(true);
+ fields.add(resourceGroupIdField);
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementSchedule from) {
+ ListGridRecord record = super.copyValues(from);
+ record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID,
this.resourceGroupId);
+ return record;
+ }
+
+ @Override
+ protected void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ int[] measurementDefinitionIds) {
+ this.measurementService.enableSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to enable specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource group with id [" + resourceGroupId +
+ "] enabled.",
Message.Severity.Info));
+
+ }
+ });
+ }
+
+ @Override
+ protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds) {
+ this.measurementService.disableSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to disable specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified metric
schedules for Resource group with id [" + resourceGroupId +
+ "] disabled.",
Message.Severity.Info));
+
+ }
+ });
+ }
+
+ @Override
+ protected void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ int[] measurementDefinitionIds, long
collectionInterval) {
+ this.measurementService.updateSchedulesForCompatibleGroup(this.resourceGroupId,
measurementDefinitionIds, collectionInterval,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to update specified
metric schedules for Resource group with id[" + resourceGroupId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource group with id [" + resourceGroupId +
+ "] updated.", Message.Severity.Info));
+
+ }
+ });
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
new file mode 100644
index 0000000..3f1f7dc
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java
@@ -0,0 +1,25 @@
+package
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules;
+
+import com.smartgwt.client.data.Criteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesDataSource;
+
+/**
+ * The group Monitoring>Schedules subtab.
+ *
+ * @author Ian Springer
+ */
+public class SchedulesView extends AbstractMeasurementScheduleListView {
+ private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID };
+
+ public SchedulesView(int resourceGroupId) {
+ super(new SchedulesDataSource(resourceGroupId), createCriteria(resourceGroupId),
EXCLUDED_FIELD_NAMES);
+ }
+
+ private static Criteria createCriteria(int resourceGroupId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID,
resourceGroupId);
+ return criteria;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
index 31247f4..dbfb9a0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
@@ -16,7 +16,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import java.util.List;
/**
- * A DataSource for reading an updating the metric schedules for the current Resource.
+ * A DataSource for reading and updating the metric schedules for the current Resource.
*
* @author Ian Springer
*/
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index cdac27f..52b5619 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@ -118,9 +118,24 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
}
public void updateSchedulesForResource(int resourceId, int[]
measurementDefinitionIds, long collectionInterval) {
- scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId,
measurementDefinitionIds, collectionInterval);
+ scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId,
measurementDefinitionIds,
+ collectionInterval);
}
+ public void enableSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds) {
+ scheduleManager.enableSchedulesForCompatibleGroup(getSessionSubject(),
resourceGroupId, measurementDefinitionIds);
+ }
+
+ public void disableSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds) {
+ scheduleManager.disableSchedulesForCompatibleGroup(getSessionSubject(),
resourceGroupId, measurementDefinitionIds);
+ }
+
+ public void updateSchedulesForCompatibleGroup(int resourceGroupId, int[]
measurementDefinitionIds,
+ long collectionInterval) {
+ scheduleManager.updateSchedulesForCompatibleGroup(getSessionSubject(),
resourceGroupId, measurementDefinitionIds,
+ collectionInterval);
+ }
+
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index 43c6f0f..f6a5b4d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -70,6 +70,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourceFacets;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
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;
@@ -1024,6 +1025,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
ResourceFacets facets = (type != null) ?
resourceTypeManager.getResourceFacets(type.getId())
: ResourceFacets.NONE;
composite.setResourceFacets(facets);
+ Set<Permission> perms =
authorizationManager.getImplicitGroupPermissions(subject, group.getId());
+ composite.setResourcePermission(new ResourcePermission(perms));
}
return results;
}
@@ -1223,6 +1226,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
}
ResourceGroupComposite composite = new ResourceGroupComposite(explicitCount,
explicitAvail, implicitCount,
implicitAvail, group, facets);
+ Set<Permission> perms =
authorizationManager.getImplicitGroupPermissions(subject, group.getId());
+ composite.setResourcePermission(new ResourcePermission(perms));
results.add(composite);
}
commit 63b941dd6a0e954948c8a79e81d69cf388718d1c
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Aug 16 16:55:34 2010 +0200
More mvn:site related changes - add reports
diff --git a/pom.xml b/pom.xml
index bc895da..c443bd7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1089,13 +1089,25 @@
<reporting>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.1</version>
+ <configuration>
+ <xmlOutput>true</xmlOutput>
+ <onlyAnalyze>org.rhq.*,org.jboss.jopr.*</onlyAnalyze>
+ <effort>Max</effort>
+ <threshold>Default</threshold>
+ </configuration>
+ <inherited>true</inherited>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jdepend-maven-plugin</artifactId>
</plugin>
<!--
<plugin>
@@ -1111,6 +1123,25 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
+<!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <inherited>true</inherited>
+ </plugin>
+-->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.4</version>
+ <inherited>true</inherited>
+ </plugin>
+ <plugin>
+ <!-- must be last plugin in the list -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>dashboard-maven-plugin</artifactId>
+ </plugin>
</plugins>
</reporting>
@@ -1118,6 +1149,7 @@
<licenses>
<license>
<name>GPL</name>
+ <url>http://gnu.org</url>
</license>
</licenses>
<developers>
commit 56621380a7a59b9047fd3aa3563944b0043039a5
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Aug 16 14:37:26 2010 +0200
added the missing @WebMethod annotation and copied the javadoc from the local
interface method.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
index b3fbce0..01ed5a1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
@@ -100,6 +100,14 @@ public interface ResourceManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId);
+ /**
+ * Update resource's editable properties (name, description, location).
+ *
+ * @param user the logged in user
+ * @param resource the resource to update
+ * @return the updated resource
+ */
+ @WebMethod
Resource updateResource( //
@WebParam(name = "subject") Subject user, //
@WebParam(name = "resource") Resource resource);
commit d7f2b2f0aad74e96b29c256c654bacd4262b8286
Merge: 0d54848... 02a6eaf...
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 16 07:38:27 2010 -0400
Merge branch 'master' into groovy-server-plugin
commit 0d5484847d4e9f995ec7e83bc851d4e5d721110f
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 16 07:31:18 2010 -0400
Adding support for fetch fields in criteria dsl, adding criteria() method in
RHQScript
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
deleted file mode 100644
index 742dded..0000000
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.rhq.enterprise.server.plugins.groovy
-
-class CriteriaDelegate {
-
- Map filters = [:]
-
- Class criteriaType
-
- CriteriaDelegate(Class criteriaType) {
- this.criteriaType = criteriaType
- }
-
-}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
index c966dee..3595114 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -2,15 +2,17 @@ package org.rhq.enterprise.server.plugins.groovy
class CriteriaGenerator {
- def execute(CriteriaDelegate details) {
- def clazz =
Class.forName("org.rhq.core.domain.criteria.${details.criteriaType.simpleName}Criteria")
+ def execute(CriteriaSpec spec) {
+ def clazz =
Class.forName("org.rhq.core.domain.criteria.${spec.criteriaType.simpleName}Criteria")
def criteria = clazz.newInstance()
- details.filters.each { key, value ->
+ spec.filters.each { key, value ->
def filterName = "addFilter${capitalize(key)}"
criteria."$filterName"(value)
}
+ spec.fetch.each { criteria."fetch${capitalize(it)}"(true) }
+
return criteria
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
new file mode 100644
index 0000000..c46892d
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaSpec.groovy
@@ -0,0 +1,17 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class CriteriaSpec {
+
+ Class criteriaType
+
+ Map filters = [:]
+
+ List fetch = []
+
+ CriteriaSpec(Class criteriaType) {
+ this.criteriaType = criteriaType
+ }
+
+ def propertyMissing
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index 6259473..b87e863 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -28,4 +28,13 @@ class RHQScript extends Script {
return null // TODO Should we instead some sort of property not found exception
}
+ def criteria(Class entityClass, Closure specifyCriteria) {
+ def criteriaSpec = new CriteriaSpec(entityClass)
+ specifyCriteria.delegate = criteriaSpec
+ specifyCriteria()
+
+ return new CriteriaGenerator().execute(criteriaSpec)
+
+ }
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
index fe1395a..9c83185 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
@@ -6,6 +6,10 @@ class TestEntityCriteria extends Criteria {
String name
+ boolean fetchResources
+
+ boolean fetchResourceTypes
+
Class<?> getPersistentClass() {
TestEntityCriteria
}
@@ -18,4 +22,12 @@ class TestEntityCriteria extends Criteria {
this.name = name
}
+ void fetchResources(boolean fetch) {
+ fetchResources = fetch
+ }
+
+ void fetchResourceTypes(boolean fetch) {
+ fetchResourceTypes = fetch
+ }
+
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
index 9ec9fbf..caed55c 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -11,28 +11,43 @@ class CriteriaGeneratorTest {
@Test
void theCriteriaTypeShouldMatchTheSpecifiedEntity() {
-// def details = new CriteriaDelegate(Resource.class)
- def details = new CriteriaDelegate(TestEntity)
- def criteria = new CriteriaGenerator().execute(details)
+ def spec = new CriteriaSpec(TestEntity)
+ def criteria = new CriteriaGenerator().execute(spec)
assertTrue(criteria instanceof TestEntityCriteria, "Expected an instance of
${TestEntityCriteria.name}")
}
+// @Test
+// void throwExceptionWhenEntityTypeDoesNotExist() {
+// def spec = new CriteriaSpec()
+// }
+
@Test
- void setTheCriteriaFilters() {
+ void setTheFilterFields() {
def expectedId = 1
def expectedName = 'Test Entity'
- def details = new CriteriaDelegate(TestEntity)
- details.filters = [
+ def spec = new CriteriaSpec(TestEntity)
+ spec.filters = [
id: expectedId,
name: expectedName
]
- def criteria = new CriteriaGenerator().execute(details)
+ def criteria = new CriteriaGenerator().execute(spec)
assertEquals(criteria.id, expectedId, 'The <id> filter is wrong')
assertEquals(criteria.name, expectedName, 'The <name> filter is
wrong')
}
+ @Test
+ void setTheFetchFields() {
+ def spec = new CriteriaSpec(TestEntity)
+ spec.fetch = ['resources', 'resourceTypes']
+
+ def criteria = new CriteriaGenerator().execute(spec)
+
+ assertTrue(criteria.fetchResources, 'Expected fetchResources to be
<true>')
+ assertTrue(criteria.fetchResourceTypes, 'Expected fetchResourceTypes to be
<false>')
+ }
+
}
commit 4200f06280fbe7b900e76ee03883f0fe3e7ab585
Author: John Sanda <jsanda(a)redhat.com>
Date: Sun Aug 15 15:26:48 2010 -0400
Starting to implement criteria dsl.
The purpose of the dsl is to provide a more concise, yet readable syntax
for creating and executing criteria queries that are commonly used in the
remote apis and in the CLI. The syntax will look something like,
criteria(Resource) {
filters = [
id: 1
name: 'My Resource'
availability: UP
]
sort = [
name: ASC,
pluginName: DESC
]
}
This will create a ResourceCriteria object with the id, name, and
availability filters set. And it will sort by the name and pluginName
properties.
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
new file mode 100644
index 0000000..742dded
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaDelegate.groovy
@@ -0,0 +1,13 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class CriteriaDelegate {
+
+ Map filters = [:]
+
+ Class criteriaType
+
+ CriteriaDelegate(Class criteriaType) {
+ this.criteriaType = criteriaType
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
new file mode 100644
index 0000000..c966dee
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGenerator.groovy
@@ -0,0 +1,24 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+class CriteriaGenerator {
+
+ def execute(CriteriaDelegate details) {
+ def clazz =
Class.forName("org.rhq.core.domain.criteria.${details.criteriaType.simpleName}Criteria")
+ def criteria = clazz.newInstance()
+
+ details.filters.each { key, value ->
+ def filterName = "addFilter${capitalize(key)}"
+ criteria."$filterName"(value)
+ }
+
+ return criteria
+ }
+
+ String capitalize(String string) {
+ if (string.length() == 1) {
+ return string.toUpperCase()
+ }
+ return string[0].toUpperCase() + string[1..string.length() - 1]
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
index 38bcad7..6259473 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -1,9 +1,16 @@
package org.rhq.enterprise.server.plugins.groovy
import org.rhq.enterprise.server.util.LookupUtil
+import org.rhq.core.domain.resource.Resource
+import org.rhq.core.domain.resource.ResourceType
class RHQScript extends Script {
+ def entityMap = [
+ Resource: Resource.class,
+ ResourceType: ResourceType.class
+ ]
+
Object run() {
super.run()
}
@@ -13,6 +20,11 @@ class RHQScript extends Script {
def method = "get$name"
return LookupUtil."$method"()
}
+
+ if (entityMap.containsKey(name)) {
+ return entityMap[name]
+ }
+
return null // TODO Should we instead some sort of property not found exception
}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
new file mode 100644
index 0000000..fe1395a
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/core/domain/criteria/TestEntityCriteria.groovy
@@ -0,0 +1,21 @@
+package org.rhq.core.domain.criteria
+
+class TestEntityCriteria extends Criteria {
+
+ Integer id
+
+ String name
+
+ Class<?> getPersistentClass() {
+ TestEntityCriteria
+ }
+
+ void addFilterId(Integer id) {
+ this.id = id
+ }
+
+ void addFilterName(String name) {
+ this.name = name
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
new file mode 100644
index 0000000..9ec9fbf
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/enterprise/server/plugins/groovy/CriteriaGeneratorTest.groovy
@@ -0,0 +1,38 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.testng.annotations.Test
+
+import static org.testng.Assert.*
+
+import org.rhq.core.domain.criteria.TestEntityCriteria
+import org.rhq.org.rhq.core.domain.test.TestEntity
+
+class CriteriaGeneratorTest {
+
+ @Test
+ void theCriteriaTypeShouldMatchTheSpecifiedEntity() {
+// def details = new CriteriaDelegate(Resource.class)
+ def details = new CriteriaDelegate(TestEntity)
+ def criteria = new CriteriaGenerator().execute(details)
+
+ assertTrue(criteria instanceof TestEntityCriteria, "Expected an instance of
${TestEntityCriteria.name}")
+ }
+
+ @Test
+ void setTheCriteriaFilters() {
+ def expectedId = 1
+ def expectedName = 'Test Entity'
+
+ def details = new CriteriaDelegate(TestEntity)
+ details.filters = [
+ id: expectedId,
+ name: expectedName
+ ]
+
+ def criteria = new CriteriaGenerator().execute(details)
+
+ assertEquals(criteria.id, expectedId, 'The <id> filter is wrong')
+ assertEquals(criteria.name, expectedName, 'The <name> filter is
wrong')
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
new file mode 100644
index 0000000..12ee6df
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/test/groovy/org/rhq/org/rhq/core/domain/test/TestEntity.groovy
@@ -0,0 +1,9 @@
+package org.rhq.org.rhq.core.domain.test
+
+class TestEntity {
+
+ Integer id
+
+ String name
+
+}
commit 1c5c441b9d59362f538f795c3d928a6aaedee4a1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Aug 13 22:31:25 2010 -0400
implement first cut of Resource Monitoring>Schedules subtab (all that's missing
is ability to update collection intervals)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index c4cf1b4..1cb4b9e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -27,7 +27,6 @@ import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.form.DynamicForm;
@@ -39,7 +38,6 @@ import com.smartgwt.client.widgets.grid.ListGridField;
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.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
@@ -261,7 +259,6 @@ public class AlertsView extends Table {
DataClass[] input = record.getAttributeAsRecordArray("conditionLogs");
String mode = record.getAttribute("conditionExpression");
-
Table table = new Table("Conditions: match = " + mode, false);
table.setHeight("35%");
table.setWidth100();
@@ -272,16 +269,10 @@ public class AlertsView extends Table {
condition.setWidth("60%");
ListGridField value = new ListGridField("value", "Value");
-
grid.setFields(condition, value);
return table;
}
- public void refresh() {
- this.getListGrid().invalidateCache();
- //this.table.getListGrid().markForRedraw();
- }
-
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
new file mode 100644
index 0000000..6300f6a
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java
@@ -0,0 +1,19 @@
+package org.rhq.enterprise.gui.coregui.client.components.table;
+
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+/**
+ * @author Ian Springer
+ */
+public class BooleanCellFormatter implements CellFormatter {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value == null) {
+ return "";
+ }
+ if (!(value instanceof Boolean)) {
+ throw new IllegalArgumentException("value parameter is not a
Boolean.");
+ }
+ return ((Boolean) value) ? "yes" : "no";
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index c3c67e2..2b163f6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -62,4 +62,10 @@ public interface MeasurementDataGWTService extends RemoteService {
PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId,
int n);
+ void enableSchedulesForResource(int resourceId, int[] measurementDefinitionIds);
+
+ void disableSchedulesForResource(int resourceId, int[] measurementDefinitionIds);
+
+ void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long
collectionInterval);
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
index 9137081..81fe163 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
@@ -63,7 +63,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
protected List<DataSourceField> createFields() {
List<DataSourceField> fields = new ArrayList<DataSourceField>();
- DataSourceField idField = new
DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID,
+ DataSourceIntegerField idField = new
DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID,
"Id");
idField.setPrimaryKey(true);
idField.setHidden(true);
@@ -85,7 +85,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
"Enabled?");
fields.add(enabledField);
- DataSourceTextField intervalField = new
DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL,
+ DataSourceIntegerField intervalField = new
DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL,
"Collection Interval");
fields.add(intervalField);
@@ -149,13 +149,17 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
@Override
public ListGridRecord copyValues(MeasurementSchedule from) {
ListGridRecord record = new ListGridRecord();
- record.setAttribute("id", from.getId());
+
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID,
from.getDefinition().getId());
record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
from.getDefinition().getDisplayName());
record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION,
from.getDefinition().getDescription());
- record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE,
from.getDefinition().getDataType().name());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE,
+ from.getDefinition().getDataType().name().toLowerCase());
record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED,
from.isEnabled());
record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL,
from.getInterval());
- // TODO: resourceId and resourceGroupId (can probably be handled by subclasses)
+
+ // TODO: resourceId and resourceGroupId (in subclasses)
+
return record;
}
@@ -166,31 +170,34 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
}
public void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
- Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
enableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ measurementScheduleListView.refresh();
}
protected abstract void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- Integer[] measurementDefinitionIds);
+ int[] measurementDefinitionIds);
public void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
- Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
disableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ measurementScheduleListView.refresh();
}
protected abstract void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
- Integer[] measurementDefinitionIds);
+ int[] measurementDefinitionIds);
public void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, long interval) {
- Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ int[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
updateSchedules(measurementScheduleListView, measurementDefinitionIds,
interval);
+ measurementScheduleListView.refresh();
}
- private Integer[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView
measurementScheduleListView) {
+ private int[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView
measurementScheduleListView) {
ListGrid listGrid = measurementScheduleListView.getListGrid();
ListGridRecord[] records = listGrid.getSelection();
- Integer[] measurementDefinitionIds = new Integer[records.length];
+ int[] measurementDefinitionIds = new int[records.length];
for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
ListGridRecord record = records[i];
Integer measurementDefinitionId =
record.getAttributeAsInt(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID);
@@ -200,5 +207,5 @@ public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSourc
}
protected abstract void updateSchedules(final AbstractMeasurementScheduleListView
measurementScheduleListView,
- final Integer[] measurementDefinitionIds,
final long interval);
+ final int[] measurementDefinitionIds, final
long interval);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
index 8d76d32..605c857 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -21,9 +21,12 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.SortDirection;
+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 org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.enterprise.gui.coregui.client.components.table.BooleanCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -41,11 +44,8 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
SortDirection.ASCENDING)
};
- public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource) {
- this(dataSource, null, null);
- }
-
- public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource, Criteria criteria, String[] excludedFieldNames) {
+ public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource, Criteria criteria,
+ String[] excludedFieldNames) {
super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames);
setDataSource(dataSource);
}
@@ -60,11 +60,72 @@ public abstract class AbstractMeasurementScheduleListView extends
Table {
super.onInit();
ListGrid listGrid = getListGrid();
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%");
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("30%");
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("20%");
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED).setWidth("10%");
-
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL).setWidth("20%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("25%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%");
+ ListGridField enabledField =
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED);
+ enabledField.setWidth("5%");
+ enabledField.setCellFormatter(new BooleanCellFormatter());
+ ListGridField intervalField =
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL);
+ intervalField.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int
colNum) {
+ if (value == null) {
+ return "";
+ }
+
+ long milliseconds = (Integer)value;
+ if (milliseconds == 0) {
+ return "0";
+ }
+
+ StringBuilder result = new StringBuilder();
+ if (milliseconds > 1000) {
+ long seconds = milliseconds / 1000;
+ milliseconds = milliseconds % 1000;
+ if (seconds >= 60) {
+ long minutes = seconds / 60;
+ seconds = seconds % 60;
+ if (minutes > 60) {
+ long hours = minutes / 60;
+ minutes = minutes % 60;
+ result.append(hours).append(" hour");
+ if (hours > 1) {
+ result.append("s");
+ }
+ }
+ if (minutes != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(minutes).append(" minute");
+ if (minutes > 1) {
+ result.append("s");
+ }
+ }
+ }
+ if (seconds != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(seconds).append(" second");
+ if (seconds > 1) {
+ result.append("s");
+ }
+ }
+ }
+ if (milliseconds != 0) {
+ if (result.length() != 0) {
+ result.append(", ");
+ }
+ result.append(milliseconds).append(" millisecond");
+ if (milliseconds > 1) {
+ result.append("s");
+ }
+ }
+ return result.toString();
+ }
+ });
+ intervalField.setWidth("25%");
addTableAction("Enable", Table.SelectionEnablement.ANY, null, new
TableAction() {
public void executeAction(ListGridRecord[] selection) {
@@ -78,4 +139,9 @@ public abstract class AbstractMeasurementScheduleListView extends Table
{
});
// TODO: Add controls to set collection interval - base class is going to need
massaging...
}
+
+ public void refresh() {
+ this.getListGrid().invalidateCache();
+ //this.table.getListGrid().markForRedraw();
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 24c2e00..410a4a4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -41,6 +41,7 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
@@ -144,8 +145,8 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
+ resource.getId()));
monitoringTab.updateSubTab("Availability", new FullHTMLPane(
"/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
- monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id="
- + resource.getId()));
+ monitoringTab.updateSubTab("Schedules", new
SchedulesView(resource.getId()));
+ //new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/resource/monitor/response-plain.xhtml?id="
+ resource.getId()));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
new file mode 100644
index 0000000..31247f4
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java
@@ -0,0 +1,106 @@
+package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleDataSource;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+import java.util.List;
+
+/**
+ * A DataSource for reading an updating the metric schedules for the current Resource.
+ *
+ * @author Ian Springer
+ */
+public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource {
+ private MeasurementDataGWTServiceAsync measurementService =
GWTServiceLookup.getMeasurementDataService();
+ private int resourceId;
+
+ public SchedulesDataSource(int resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ @Override
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = super.createFields();
+ DataSourceField resourceIdField = new
DataSourceIntegerField(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID,
+ "Resource Id");
+ resourceIdField.setHidden(true);
+ fields.add(resourceIdField);
+ return fields;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementSchedule from) {
+ ListGridRecord record = super.copyValues(from);
+ record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID,
this.resourceId);
+ return record;
+ }
+
+ @Override
+ protected void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ int[] measurementDefinitionIds) {
+ this.measurementService.enableSchedulesForResource(this.resourceId,
measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to enable specified
metric schedules for Resource with id[" + resourceId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource with id [" + resourceId +
+ "] enabled.",
Message.Severity.Info));
+
+ }
+ });
+ }
+
+ @Override
+ protected void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, int[] measurementDefinitionIds) {
+ this.measurementService.disableSchedulesForResource(this.resourceId,
measurementDefinitionIds,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to disable specified
metric schedules for Resource with id[" + resourceId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified metric
schedules for Resource with id [" + resourceId +
+ "] disabled.",
Message.Severity.Info));
+
+ }
+ });
+ }
+
+ @Override
+ protected void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ int[] measurementDefinitionIds, long
collectionInterval) {
+ this.measurementService.updateSchedulesForResource(this.resourceId,
measurementDefinitionIds, collectionInterval,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getErrorHandler().handleError("Failed to update specified
metric schedules for Resource with id[" + resourceId + "].",
+ throwable);
+ }
+
+ @Override
+ public void onSuccess(Void aVoid) {
+ CoreGUI.getMessageCenter().notify(new Message("Specified Metric
schedules for Resource with id [" + resourceId +
+ "] updated.", Message.Severity.Info));
+
+ }
+ });
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
new file mode 100644
index 0000000..f9a1d80
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java
@@ -0,0 +1,24 @@
+package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules;
+
+import com.smartgwt.client.data.Criteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView;
+
+/**
+ * The Resource Monitoring>Schedules subtab.
+ *
+ * @author Ian Springer
+ */
+public class SchedulesView extends AbstractMeasurementScheduleListView {
+ private static final String[] EXCLUDED_FIELD_NAMES = new String[] {
MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID };
+
+ public SchedulesView(int resourceId) {
+ super(new SchedulesDataSource(resourceId), createCriteria(resourceId),
EXCLUDED_FIELD_NAMES);
+ }
+
+ private static Criteria createCriteria(int resourceId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID,
resourceId);
+ return criteria;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index 2514bd6..cdac27f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@ -36,7 +36,6 @@ import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
-import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal;
@@ -109,4 +108,19 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
n),
"MeasurementDataService.getHighestNOOBsForResource");
}
+
+ public void enableSchedulesForResource(int resourceId, int[]
measurementDefinitionIds) {
+ scheduleManager.enableSchedulesForResource(getSessionSubject(), resourceId,
measurementDefinitionIds);
+ }
+
+ public void disableSchedulesForResource(int resourceId, int[]
measurementDefinitionIds) {
+ scheduleManager.disableSchedulesForResource(getSessionSubject(), resourceId,
measurementDefinitionIds);
+ }
+
+ public void updateSchedulesForResource(int resourceId, int[]
measurementDefinitionIds, long collectionInterval) {
+ scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId,
measurementDefinitionIds, collectionInterval);
+ }
+
}
+
+
commit d7aaa1768dba37a238b1c2d4bd77a9cb1e6a193c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 13 19:36:42 2010 -0400
starting conditions tab
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
index c3c6660..7e56aec 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
@@ -28,7 +28,6 @@ import com.smartgwt.client.types.FieldType;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition;
-import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -49,7 +48,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends
RPCDataSource<A
protected static final String FIELD_ENABLED = "enabled";
protected static final String FIELD_DELETED = "deleted";
protected static final String FIELD_PRIORITY = "priority"; // not the
actual object; a string for the UI
- protected static final String FIELD_PRIORITY_ENUM = "priority_enum"; // the
actual enum name
+ protected static final String FIELD_OBJECT = "_object"; // the actual
AlertDefinition object
public AbstractAlertDefinitionsDataSource() {
setupFields();
@@ -57,14 +56,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends
RPCDataSource<A
@Override
public AlertDefinition copyValues(ListGridRecord from) {
- AlertDefinition alertDef = new AlertDefinition();
- alertDef.setId(from.getAttributeAsInt(FIELD_ID));
- alertDef.setName(from.getAttributeAsString(FIELD_NAME));
- alertDef.setDescription(from.getAttributeAsString(FIELD_DESCRIPTION));
- alertDef.setCtime(from.getAttributeAsDate(FIELD_CTIME).getTime());
- alertDef.setMtime(from.getAttributeAsDate(FIELD_MTIME).getTime());
- alertDef.setEnabled(from.getAttributeAsBoolean(FIELD_ENABLED));
-
alertDef.setPriority(AlertPriority.valueOf(from.getAttributeAsString(FIELD_PRIORITY_ENUM)));
+ AlertDefinition alertDef = (AlertDefinition)
from.getAttributeAsObject(FIELD_OBJECT);
return alertDef;
}
@@ -79,7 +71,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends
RPCDataSource<A
record.setAttribute(FIELD_ENABLED, from.getEnabled());
record.setAttribute(FIELD_DELETED, from.getDeleted());
record.setAttribute(FIELD_PRIORITY, from.getPriority().getDisplayName());
- record.setAttribute(FIELD_PRIORITY_ENUM, from.getPriority().name());
+ record.setAttribute(FIELD_OBJECT, from);
return record;
}
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 4a57272..f7257f4 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
@@ -97,6 +97,7 @@ public abstract class AbstractAlertDefinitionsView extends VLayout {
: SelectionEnablement.NEVER, "Are You Sure?", new TableAction() {
public void executeAction(ListGridRecord[] selection) {
disableButtonPressed(selection);
+ CoreGUI.refresh();
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
index 819260f..8be60bb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
@@ -23,8 +23,11 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.LinkedHashMap;
+
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.alert.BooleanExpression;
@@ -38,6 +41,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
private SelectItem conditionExpression;
+ private StaticTextItem conditionExpressionStatic;
+
private boolean formBuilt = false;
public ConditionsAlertDefinitionForm() {
@@ -73,8 +78,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
if (alertDef == null) {
clearFormValues();
} else {
- // TODO: why is cond expression always null????
-
//conditionExpression.setValue(alertDef.getConditionExpression().toString());
+ conditionExpression.setValue(alertDef.getConditionExpression().name());
+
conditionExpressionStatic.setValue(alertDef.getConditionExpression().toString());
}
markForRedraw();
@@ -82,23 +87,32 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
@Override
public void makeEditable() {
- // TODO Auto-generated method stub
+ conditionExpression.show();
+ conditionExpressionStatic.hide();
+
+ markForRedraw();
}
@Override
public void makeViewOnly() {
- // TODO Auto-generated method stub
+ conditionExpression.hide();
+ conditionExpressionStatic.show();
+
+ markForRedraw();
}
@Override
public void saveAlertDefinition() {
- // TODO Auto-generated method stub
+ String condExpr = conditionExpression.getValue().toString();
+ alertDefinition.setConditionExpression(BooleanExpression.valueOf(condExpr));
}
@Override
public void clearFormValues() {
conditionExpression.clearValue();
+ conditionExpressionStatic.clearValue();
+
markForRedraw();
}
@@ -106,10 +120,14 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
if (!formBuilt) {
conditionExpression = new SelectItem("conditionExpression",
"Fire alert when");
- conditionExpression.setValueMap(BooleanExpression.ALL.toString(),
BooleanExpression.ANY.toString());
- conditionExpression.setDefaultValue(BooleanExpression.ALL.toString());
-
- setFields(conditionExpression);
+ LinkedHashMap<String, String> condExprs = new LinkedHashMap<String,
String>(2);
+ condExprs.put(BooleanExpression.ALL.name(),
BooleanExpression.ALL.toString());
+ condExprs.put(BooleanExpression.ANY.name(),
BooleanExpression.ANY.toString());
+ conditionExpression.setValueMap(condExprs);
+ conditionExpression.setDefaultValue(BooleanExpression.ALL.name());
+ conditionExpressionStatic = new
StaticTextItem("conditionExpressionStatic", "Fire alert when");
+
+ setFields(conditionExpression, conditionExpressionStatic);
formBuilt = true;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
index 5590af6..1da8f49 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
@@ -78,11 +78,15 @@ public class DampeningAlertDefinitionForm extends DynamicForm
implements EditAle
@Override
public void makeEditable() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
public void makeViewOnly() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
index ab79d1c..d0fddc6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
@@ -78,11 +78,15 @@ public class NotificationsAlertDefinitionForm extends DynamicForm
implements Edi
@Override
public void makeEditable() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
public void makeViewOnly() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
index cff9ad7..637c2cc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
@@ -83,11 +83,15 @@ public class RecoveryAlertDefinitionForm extends DynamicForm
implements EditAler
@Override
public void makeEditable() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
public void makeViewOnly() {
// TODO Auto-generated method stub
+
+ markForRedraw();
}
@Override
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 ed19a24..ac7b789 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
@@ -40,11 +40,8 @@ import org.rhq.core.domain.resource.Resource;
*/
public class ResourceAlertDefinitionsDataSource extends
AbstractAlertDefinitionsDataSource {
- protected static final String FIELD_PARENT = "parent"; // the column field
- may be template or group alert def parent
- protected static final String FIELD_PARENT_TEMPLATEID = "parent_tid"; //
the actual integer (may be 0) of template ID
- protected static final String FIELD_PARENT_GROUPALERTDEF = "parentId_gad";
// the actual group alert def parent (may be null)
+ protected static final String FIELD_PARENT = "parent"; // may be template
or group alert def parent
protected static final String FIELD_READONLY = "readOnly"; // not
necessarily the actual boolean; sometimes we display "N/A"
- protected static final String FIELD_READONLY_BOOLEAN = "readOnly_boolean";
// the actual boolean value
private Resource resource;
@@ -54,15 +51,6 @@ public class ResourceAlertDefinitionsDataSource extends
AbstractAlertDefinitions
}
@Override
- public AlertDefinition copyValues(ListGridRecord from) {
- AlertDefinition alertDef = super.copyValues(from);
- alertDef.setParentId(from.getAttributeAsInt(FIELD_PARENT_TEMPLATEID));
- alertDef.setGroupAlertDefinition((AlertDefinition)
from.getAttributeAsObject(FIELD_PARENT_GROUPALERTDEF));
- alertDef.setReadOnly(from.getAttributeAsBoolean(FIELD_READONLY_BOOLEAN));
- return alertDef;
- }
-
- @Override
public ListGridRecord copyValues(AlertDefinition from) {
ListGridRecord record = super.copyValues(from);
@@ -70,10 +58,6 @@ public class ResourceAlertDefinitionsDataSource extends
AbstractAlertDefinitions
AlertDefinition groupAlertDefinition = from.getGroupAlertDefinition();
boolean readOnly = from.isReadOnly();
- record.setAttribute(FIELD_PARENT_TEMPLATEID, parentId);
- record.setAttribute(FIELD_PARENT_GROUPALERTDEF, groupAlertDefinition);
- record.setAttribute(FIELD_READONLY_BOOLEAN, readOnly);
-
if ((parentId == null || parentId.intValue() == 0) &&
(groupAlertDefinition == null)) {
record.setAttribute(FIELD_PARENT, "");
record.setLinkText("");
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 6d01e26..84dd71c 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
@@ -29,6 +29,7 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.alert.BooleanExpression;
import org.rhq.core.domain.resource.Resource;
/**
@@ -76,6 +77,7 @@ public class ResourceAlertDefinitionsView extends
AbstractAlertDefinitionsView {
newAlertDef.setEnabled(true);
newAlertDef.setNotifyFiltered(false);
newAlertDef.setParentId(Integer.valueOf(0));
+ newAlertDef.setConditionExpression(BooleanExpression.ALL);
newAlertDef.setPriority(AlertPriority.MEDIUM);
newAlertDef.setWillRecover(false);
commit e34f00313d65d75fc5d7fb0e5f423be09942d259
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Aug 13 19:35:28 2010 -0400
fix wsprovide failure in build.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
index 8b6f809..823a785 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
@@ -45,7 +45,7 @@ public class ResourceComposite implements Serializable {
@XmlElement
private Resource parent;
- @XmlElement
+ @XmlTransient
private ResourcePermission resourcePermission;
@XmlElement
commit 2d5cada01618a79e2819b7dbfeb763bc32a1620d
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Aug 13 18:56:30 2010 -0400
change how togglable form items are rendered (edit icon now only appears when you
hover over the item); add missing updateResource() method to WebServicesManagerBean; move
group Overview subtab from Inventory tab to Summary tab; rename some classes to make
resource and group View classnames more consistent witheach other
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java
index 9a8ff9d..d9ca343 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java
@@ -74,7 +74,7 @@ import org.rhq.core.domain.tagging.Tag;
@NamedQuery(name = ResourceGroup.QUERY_FIND_ALL_FILTERED_COUNT, query = "SELECT
count(DISTINCT g) "
+ "FROM ResourceGroup g JOIN g.roles r JOIN r.subjects s " //
+ "LEFT JOIN g.resourceType type " //
- + "LEFT JOIN g.implicitResources res " // used for
inventory>overview "member in groups" section, authz-related
+ + "LEFT JOIN g.implicitResources res " // used for inventory>summary
"member in groups" section, authz-related
+ "WHERE s = :subject " //
+ " AND g.visible = true "
+ " AND ( res.id = :resourceId OR :resourceId is null ) "
@@ -89,7 +89,7 @@ import org.rhq.core.domain.tagging.Tag;
+ " AND (type.category = :category OR :category is null) ) )
"),
@NamedQuery(name = ResourceGroup.QUERY_FIND_ALL_FILTERED_COUNT_ADMIN, query =
"SELECT count(DISTINCT g) FROM ResourceGroup g "
+ "LEFT JOIN g.resourceType type "
- + "LEFT JOIN g.implicitResources res " // used for
inventory>overview "member in groups" section, authz-related
+ + "LEFT JOIN g.implicitResources res " // used for inventory>summary
"member in groups" section, authz-related
+ "WHERE ( g.groupCategory = :groupCategory OR :groupCategory is null )
"
+ " AND g.visible = true "
+ " AND ( res.id = :resourceId OR :resourceId is null ) "
diff --git
a/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java
b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java
index a9ca740..2f270a4 100644
---
a/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java
+++
b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java
@@ -30,7 +30,7 @@ import org.rhq.core.domain.configuration.PropertySimple;
public class DataSourceExample {
/* This class exercises the Configuration domain model from a number of different
actors and goals.
- * The following overview describes the different use cases of the domain model:
+ * The following summary describes the different use cases of the domain model:
*
* 1. Plugin populating a value set to describe the resource's current state 2.
Plugin reading a value set to write
* the changes to the resource 3. Plugin Container creating a definition 4. Server
storing a value set to the
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index ce9dfca..37e1993 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -27,7 +27,7 @@
<!-- If this is too much memory to allocate to your gwt:debug process then
override this property in
in your settings.xml -->
- <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M</gwt-plugin.extraJvmArgs>
+ <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M
-XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
<gwt-plugin.localWorkers>2</gwt-plugin.localWorkers>
</properties>
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 7cd621b..aa6c084 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,7 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupTopView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTopView;
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;
@@ -264,7 +264,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
} else if (breadcrumbName.equals("Inventory")) {
canvas = new InventoryView();
} else if (breadcrumbName.equals("Resource")) {
- canvas = new ResourceView();
+ canvas = new ResourceTopView();
} else if (breadcrumbName.equals("ResourceGroup")) {
canvas = new ResourceGroupTopView();
} else if (breadcrumbName.equals("Dashboard")) {
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 fc93906..0375213 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
@@ -35,7 +35,7 @@ public class LinkManager {
if (GWT) {
return "#Resource/" + resourceId;
} else {
- return "/rhq/resource/summary/overview.xhtml?id=" + resourceId;
+ return "/rhq/resource/summary/summary.xhtml?id=" + resourceId;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
index 02185e7..0ae01ce 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
@@ -23,16 +23,18 @@
package org.rhq.enterprise.gui.coregui.client.components.form;
import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.user.client.Timer;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.FormItemIfFunction;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.FormItemIcon;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
import com.smartgwt.client.widgets.form.fields.events.IconClickEvent;
import com.smartgwt.client.widgets.form.fields.events.IconClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.ItemHoverEvent;
+import com.smartgwt.client.widgets.form.fields.events.ItemHoverHandler;
import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
@@ -40,7 +42,12 @@ import java.util.ArrayList;
import java.util.List;
/**
- * TODO
+ * A subclass of SmartGWT's DynamicForm widget that provides the following additional
feature:
+ *
+ * If any {@link TogglableTextItem}s are added to the form, they will initially be
rendered as static text items, except
+ * when the user hovers over one of them, an edit icon will be displayed immediately to
the right of it for five seconds.
+ * If the user clicks this icon, the form item will become editable and the user can
update its value. Once the user
+ * hits Enter or switches focus somewhere outside the form item, the form item will
become static again.
*
* @author Ian Springer
*/
@@ -80,20 +87,33 @@ public class EnhancedDynamicForm extends DynamicForm {
editIcon.setName("Edit");
editIcon.setSrc("[SKIN]/actions/edit.png");
staticTextItem.setIcons(editIcon);
- staticTextItem.setShowIcons(true);
+ staticTextItem.setShowIcons(false);
+ staticTextItem.setShowIfCondition(new FormItemIfFunction() {
+ public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ boolean editing =
staticTextItem.getAttributeAsBoolean("editing");
+ return !editing;
+ }
+ });
staticTextItem.addIconClickHandler(new IconClickHandler() {
public void onIconClick(IconClickEvent iconClickEvent) {
if ("Edit".equals(iconClickEvent.getIcon().getName()))
{
staticTextItem.setAttribute("editing", true);
+ staticTextItem.setShowIcons(false);
markForRedraw();
}
}
});
- staticTextItem.setShowIfCondition(new FormItemIfFunction() {
- public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- boolean editing =
staticTextItem.getAttributeAsBoolean("editing");
- return !editing;
+ staticTextItem.addItemHoverHandler(new ItemHoverHandler() {
+ public void onItemHover(ItemHoverEvent itemHoverEvent) {
+ staticTextItem.setShowIcons(true);
+ markForRedraw();
+ new Timer() {
+ public void run() {
+ staticTextItem.setShowIcons(false);
+ markForRedraw();
+ }
+ }.schedule(5000);
}
});
staticTextItem.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
@@ -126,7 +146,7 @@ public class EnhancedDynamicForm extends DynamicForm {
itemsList.add(togglableTextItem);
} else {
itemsList.add(item);
- }
+ }
}
super.setItems((FormItem[]) itemsList.toArray(new FormItem[itemsList.size()]));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
index 399cb7e..9807b35 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
@@ -29,7 +29,8 @@ import java.util.ArrayList;
import java.util.List;
/**
- * TODO
+ * This class should only be used on conjunction with an {@link EnhancedDynamicForm}. See
that class's Javadoc for
+ * all the details.
*
* @author Ian Springer
*/
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 8fff6e2..e6b208c 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
@@ -23,6 +23,7 @@ import java.util.Set;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.docs.Members;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -42,7 +43,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.OverviewView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.OverviewView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -93,7 +94,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
monitoringTab.registerSubTabs("Graphs", "Tables",
"Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
- inventoryTab.registerSubTabs("Overview", "Members",
"Connection Settings");
+ inventoryTab.registerSubTabs("Members", "Connection
Settings");
operationsTab = new TwoLevelTab("Operations",
"/images/icons/Operation_grey_16.png");
operationsTab.registerSubTabs("History", "Scheduled");
@@ -126,11 +127,11 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
this.titleBar.setGroup(groupComposite.getResourceGroup());
- // TODO: Implement the rest of the tabs.
-
// FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
- // summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
+ // summaryTab.updateSubTab("Overview", new
DashboardView(resource));
// summaryTab.updateSubTab("Timeline", timelinePane);
+ summaryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
+
int groupId = this.groupComposite.getResourceGroup().getId();
monitoringTab.updateSubTab("Graphs", new
FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId="
@@ -142,7 +143,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId="
+ groupId));
- inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(groupId));
// inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
deleted file mode 100644
index 01faa2d..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
+++ /dev/null
@@ -1,241 +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.inventory;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.layout.HLayout;
-import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.group.GroupDefinition;
-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.components.form.EnhancedDynamicForm;
-import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
-import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * The group Inventory>Overview subtab.
- *
- * @author Ian Springer
- */
-public class OverviewView extends VLayout {
- private ResourceGroupGWTServiceAsync resourceGroupService =
GWTServiceLookup.getResourceGroupService();
- private ResourceGroupComposite groupComposite;
-
- public OverviewView(ResourceGroupComposite groupComposite) {
- super();
- this.groupComposite = groupComposite;
- }
-
- @Override
- protected void onInit() {
- super.onInit();
-
- final ResourceGroup group = this.groupComposite.getResourceGroup();
-
- HLayout spacer = new HLayout();
- spacer.setHeight(15);
- addMember(spacer);
-
- final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm();
-
- List<FormItem> formItems = new ArrayList<FormItem>();
-
- // TODO: Uncomment the below header if we decide to add other stuff to this page
besides the general props.
- //HeaderItem headerItem = new HeaderItem("header", "General
Properties");
- //headerItem.setValue("General Properties");
- //formItems.add(headerItem);
-
- boolean dynamic = (group.getGroupDefinition() != null);
-
- final FormItem nameItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
- nameItem.setName("name");
- nameItem.setTitle("Name");
- nameItem.setValue(group.getName());
- if (nameItem instanceof TogglableTextItem) {
- final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
- togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newName) {
- final String oldName = group.getName();
- if (newName.equals(oldName)) {
- return;
- }
- group.setName(newName);
- OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource group with id "
- + group.getId()
- + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
- // We failed to update it on the Server, so change back the
ResourceGroup and the form item
- // to the original value.
- group.setName(oldName);
- nameItem.setValue(oldName);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Name of
Resource group with id "
- + group.getId() + " was changed from
\""
- + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(nameItem);
-
- StaticTextItem typeItem = new StaticTextItem("memberType", "Member
Type");
- ResourceType type = group.getResourceType();
- if (type != null) {
- typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
- typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
- } else {
- typeItem.setValue("<i>Mixed</i>");
- }
- formItems.add(typeItem);
-
- StaticTextItem countItem = new StaticTextItem("memberCount",
"Member Count");
- long memberCount = this.groupComposite.getImplicitUp() +
this.groupComposite.getImplicitDown();
- countItem.setValue(memberCount);
- formItems.add(countItem);
-
- final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
- descriptionItem.setName("description");
- descriptionItem.setTitle("Description");
- descriptionItem.setValue(group.getDescription());
- if (descriptionItem instanceof TogglableTextItem) {
- final TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
- togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newDescription) {
- final String oldDescription = group.getDescription();
- if (newDescription.equals(oldDescription)) {
- return;
- }
- group.setDescription(newDescription);
- OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource group with id "
- + group.getId()
- + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
- // We failed to update it on the Server, so change back the
ResourceGroup and the form item
- // to the original value.
- group.setDescription(oldDescription);
- descriptionItem.setValue(oldDescription);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Description of Resource group with id "
- + group.getId() + " was changed from
\""
- + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(descriptionItem);
-
- final FormItem locationItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
- locationItem.setName("location");
- locationItem.setTitle("Location");
- locationItem.setValue(group.getLocation());
- if (locationItem instanceof TogglableTextItem) {
- final TogglableTextItem togglableLocationItem = (TogglableTextItem)
locationItem;
- togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newLocation) {
- final String oldLocation = group.getLocation();
- if (newLocation.equals(oldLocation)) {
- return;
- }
- group.setLocation(newLocation);
- OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource group with id "
- + group.getId()
- + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
- // We failed to update it on the Server, so change back the
ResourceGroup and the form item
- // to the original value.
- group.setLocation(oldLocation);
- locationItem.setValue(oldLocation);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Location
of Resource group with id "
- + group.getId() + " was changed from
\""
- + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(locationItem);
-
- StaticTextItem dynamicItem = new StaticTextItem("dynamic",
"Dynamic?");
- dynamicItem.setValue(dynamic ? "yes" : "no");
- formItems.add(dynamicItem);
-
- StaticTextItem recursiveItem = new StaticTextItem("recursive",
"Recursive?");
- recursiveItem.setValue((group.isRecursive()) ? "yes" :
"no");
- formItems.add(recursiveItem);
-
- StaticTextItem createdItem = new StaticTextItem("created",
"Created");
- createdItem.setValue(new Date(group.getCtime()));
- formItems.add(createdItem);
-
- StaticTextItem lastModifiedItem = new StaticTextItem("lastModified",
"Last Modified");
- lastModifiedItem.setValue(new Date(group.getMtime()));
- formItems.add(lastModifiedItem);
-
- StaticTextItem lastModifiedByItem = new
StaticTextItem("lastModifiedBy", "Last Modified By");
- lastModifiedByItem.setValue(group.getModifiedBy());
- formItems.add(lastModifiedByItem);
-
- if (dynamic) {
- StaticTextItem groupDefinitionItem = new
StaticTextItem("groupDefinition", "Group Definition");
- GroupDefinition groupDefinition = group.getGroupDefinition();
- // TODO (ips): Make this a link to the group def.
- groupDefinitionItem.setValue(groupDefinition.getName());
- formItems.add(groupDefinitionItem);
- }
-
- generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()]));
- addMember(generalPropsForm);
-
- if (dynamic) {
- spacer = new HLayout();
- spacer.setHeight(10);
- addMember(spacer);
-
- HTMLFlow note = new HTMLFlow();
- note.setContents("<b>*</b> Dynamic group names and
descriptions are managed, and therefore are not editable.");
- note.setAlign(Alignment.CENTER);
- addMember(note);
- }
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java
new file mode 100644
index 0000000..41de300
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java
@@ -0,0 +1,241 @@
+/*
+ * 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 com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.group.GroupDefinition;
+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.components.form.EnhancedDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
+import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * The group Inventory>Overview subtab.
+ *
+ * @author Ian Springer
+ */
+public class OverviewView extends VLayout {
+ private ResourceGroupGWTServiceAsync resourceGroupService =
GWTServiceLookup.getResourceGroupService();
+ private ResourceGroupComposite groupComposite;
+
+ public OverviewView(ResourceGroupComposite groupComposite) {
+ super();
+ this.groupComposite = groupComposite;
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ final ResourceGroup group = this.groupComposite.getResourceGroup();
+
+ HLayout spacer = new HLayout();
+ spacer.setHeight(15);
+ addMember(spacer);
+
+ final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm();
+
+ List<FormItem> formItems = new ArrayList<FormItem>();
+
+ // TODO: Uncomment the below header if we decide to add other stuff to this page
besides the general props.
+ //HeaderItem headerItem = new HeaderItem("header", "General
Properties");
+ //headerItem.setValue("General Properties");
+ //formItems.add(headerItem);
+
+ boolean dynamic = (group.getGroupDefinition() != null);
+
+ final FormItem nameItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ nameItem.setName("name");
+ nameItem.setTitle("Name");
+ nameItem.setValue(group.getName());
+ if (nameItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newName) {
+ final String oldName = group.getName();
+ if (newName.equals(oldName)) {
+ return;
+ }
+ group.setName(newName);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource group with id "
+ + group.getId()
+ + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setName(oldName);
+ nameItem.setValue(oldName);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Name of
Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(nameItem);
+
+ StaticTextItem typeItem = new StaticTextItem("memberType", "Member
Type");
+ ResourceType type = group.getResourceType();
+ if (type != null) {
+ typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
+ typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
+ } else {
+ typeItem.setValue("<i>Mixed</i>");
+ }
+ formItems.add(typeItem);
+
+ StaticTextItem countItem = new StaticTextItem("memberCount",
"Member Count");
+ long memberCount = this.groupComposite.getImplicitUp() +
this.groupComposite.getImplicitDown();
+ countItem.setValue(memberCount);
+ formItems.add(countItem);
+
+ final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ descriptionItem.setName("description");
+ descriptionItem.setTitle("Description");
+ descriptionItem.setValue(group.getDescription());
+ if (descriptionItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
+ togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newDescription) {
+ final String oldDescription = group.getDescription();
+ if (newDescription.equals(oldDescription)) {
+ return;
+ }
+ group.setDescription(newDescription);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource group with id "
+ + group.getId()
+ + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setDescription(oldDescription);
+ descriptionItem.setValue(oldDescription);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Description of Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(descriptionItem);
+
+ final FormItem locationItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ locationItem.setName("location");
+ locationItem.setTitle("Location");
+ locationItem.setValue(group.getLocation());
+ if (locationItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableLocationItem = (TogglableTextItem)
locationItem;
+ togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newLocation) {
+ final String oldLocation = group.getLocation();
+ if (newLocation.equals(oldLocation)) {
+ return;
+ }
+ group.setLocation(newLocation);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource group with id "
+ + group.getId()
+ + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setLocation(oldLocation);
+ locationItem.setValue(oldLocation);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Location
of Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(locationItem);
+
+ StaticTextItem dynamicItem = new StaticTextItem("dynamic",
"Dynamic?");
+ dynamicItem.setValue(dynamic ? "yes" : "no");
+ formItems.add(dynamicItem);
+
+ StaticTextItem recursiveItem = new StaticTextItem("recursive",
"Recursive?");
+ recursiveItem.setValue((group.isRecursive()) ? "yes" :
"no");
+ formItems.add(recursiveItem);
+
+ StaticTextItem createdItem = new StaticTextItem("created",
"Created");
+ createdItem.setValue(new Date(group.getCtime()));
+ formItems.add(createdItem);
+
+ StaticTextItem lastModifiedItem = new StaticTextItem("lastModified",
"Last Modified");
+ lastModifiedItem.setValue(new Date(group.getMtime()));
+ formItems.add(lastModifiedItem);
+
+ StaticTextItem lastModifiedByItem = new
StaticTextItem("lastModifiedBy", "Last Modified By");
+ lastModifiedByItem.setValue(group.getModifiedBy());
+ formItems.add(lastModifiedByItem);
+
+ if (dynamic) {
+ StaticTextItem groupDefinitionItem = new
StaticTextItem("groupDefinition", "Group Definition");
+ GroupDefinition groupDefinition = group.getGroupDefinition();
+ // TODO (ips): Make this a link to the group def.
+ groupDefinitionItem.setValue(groupDefinition.getName());
+ formItems.add(groupDefinitionItem);
+ }
+
+ generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()]));
+ addMember(generalPropsForm);
+
+ if (dynamic) {
+ spacer = new HLayout();
+ spacer.setHeight(10);
+ addMember(spacer);
+
+ HTMLFlow note = new HTMLFlow();
+ note.setContents("<b>*</b> Dynamic group names and
descriptions are managed, and therefore are not editable.");
+ note.setAlign(Alignment.CENTER);
+ addMember(note);
+ }
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 2a7183e..24c2e00 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -41,7 +41,8 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
import java.util.Set;
@@ -88,7 +89,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.setEdgeSize(0);
summaryTab = new TwoLevelTab("Summary",
"/images/icons/Service_up_16.png");
- summaryTab.registerSubTabs("Overview", "Timeline");
+ summaryTab.registerSubTabs("Overview", "Dashboard",
"Timeline");
monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
@@ -131,7 +132,8 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
final Resource resource = this.resourceComposite.getResource();
this.titleBar.setResource(resource);
- summaryTab.updateSubTab("Overview", new
ResourceOverviewView(this.resourceComposite));
+ summaryTab.updateSubTab("Overview", new
OverviewView(this.resourceComposite));
+ summaryTab.updateSubTab("Dashboard", new
DashboardView(this.resourceComposite));
summaryTab.updateSubTab("Timeline", new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id="
+ resource.getId()));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
new file mode 100644
index 0000000..efed5ff
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java
@@ -0,0 +1,160 @@
+/*
+ * 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;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.layout.HLayout;
+
+import org.rhq.core.domain.criteria.ResourceCriteria;
+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.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+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.InventoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+import java.util.EnumSet;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ResourceTopView extends HLayout implements BookmarkableView {
+
+ private Canvas contentCanvas;
+
+ private ResourceComposite currentResource;
+ //private Resource resourcePlatform;
+
+ private ResourceTreeView treeView;
+ private ResourceDetailView detailView = new ResourceDetailView();
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+
+ public ResourceTopView() {
+
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ setWidth100();
+ setHeight100();
+
+ treeView = new ResourceTreeView();
+ addMember(treeView);
+
+ contentCanvas = new Canvas();
+ addMember(contentCanvas);
+
+ // created above
+// detailView = new ResourceDetailView();
+
+ treeView.addResourceSelectListener(detailView);
+
+ setContent(detailView);
+ }
+
+
+ public void setSelectedResource(final int resourceId, final ViewPath view) {
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(resourceId);
+ criteria.fetchTags(true);
+ //criteria.fetchParentResource(true);
+ resourceService.findResourceCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
+ "] does not exist or is not accessible.",
Message.Severity.Warning));
+
+ CoreGUI.goTo(InventoryView.VIEW_PATH);
+ }
+
+ public void onSuccess(PageList<ResourceComposite> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Resource with id [" + resourceId +
"] does not exist."));
+ } else {
+ final ResourceComposite resourceComposite = result.get(0);
+ loadResourceType(resourceComposite, view);
+ }
+ }
+ });
+ }
+
+
+ private void loadResourceType(final ResourceComposite resourceComposite, final
ViewPath view) {
+ final Resource resource = resourceComposite.getResource();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.events,
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ resource.setResourceType(type);
+ completeSetSelectedResource(resourceComposite, view);
+ }
+ });
+ }
+
+
+ private void completeSetSelectedResource(ResourceComposite resourceComposite,
ViewPath viewPath) {
+ this.currentResource = resourceComposite;
+ this.treeView.setSelectedResource(resourceComposite.getResource(),
viewPath.getCurrent());
+ this.detailView.onResourceSelected(resourceComposite);
+ }
+
+
+ public void setContent(Canvas newContent) {
+ if (contentCanvas.getChildren().length > 0)
+ contentCanvas.getChildren()[0].destroy();
+ contentCanvas.addChild(newContent);
+ contentCanvas.markForRedraw();
+ }
+
+
+ public void renderView(ViewPath viewPath) {
+ if (viewPath.isEnd()) {
+ // default detail view
+ viewPath.getViewPath().add(new ViewId("Summary"));
+ viewPath.getViewPath().add(new ViewId("Overview"));
+ }
+
+ Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
+
+ if (currentResource == null || currentResource.getResource().getId() !=
resourceId) {
+ // The previous history item did not already point to this Resource.
+ setSelectedResource(resourceId, viewPath);
+ }
+
+ viewPath.next();
+ this.treeView.renderView(viewPath);
+ this.detailView.renderView(viewPath);
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
deleted file mode 100644
index 39e748f..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
+++ /dev/null
@@ -1,160 +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;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.layout.HLayout;
-
-import org.rhq.core.domain.criteria.ResourceCriteria;
-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.BookmarkableView;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.ViewId;
-import org.rhq.enterprise.gui.coregui.client.ViewPath;
-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.InventoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-import java.util.EnumSet;
-
-/**
- * @author Greg Hinkle
- */
-public class ResourceView extends HLayout implements BookmarkableView {
-
- private Canvas contentCanvas;
-
- private ResourceComposite currentResource;
- //private Resource resourcePlatform;
-
- private ResourceTreeView treeView;
- private ResourceDetailView detailView = new ResourceDetailView();
-
- private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
-
-
- public ResourceView() {
-
- }
-
- @Override
- protected void onInit() {
- super.onInit();
-
- setWidth100();
- setHeight100();
-
- treeView = new ResourceTreeView();
- addMember(treeView);
-
- contentCanvas = new Canvas();
- addMember(contentCanvas);
-
- // created above
-// detailView = new ResourceDetailView();
-
- treeView.addResourceSelectListener(detailView);
-
- setContent(detailView);
- }
-
-
- public void setSelectedResource(final int resourceId, final ViewPath view) {
- ResourceCriteria criteria = new ResourceCriteria();
- criteria.addFilterId(resourceId);
- criteria.fetchTags(true);
- //criteria.fetchParentResource(true);
- resourceService.findResourceCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceComposite>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
- "] does not exist or is not accessible.",
Message.Severity.Warning));
-
- CoreGUI.goTo(InventoryView.VIEW_PATH);
- }
-
- public void onSuccess(PageList<ResourceComposite> result) {
- if (result.isEmpty()) {
- //noinspection ThrowableInstanceNeverThrown
- onFailure(new Exception("Resource with id [" + resourceId +
"] does not exist."));
- } else {
- final ResourceComposite resourceComposite = result.get(0);
- loadResourceType(resourceComposite, view);
- }
- }
- });
- }
-
-
- private void loadResourceType(final ResourceComposite resourceComposite, final
ViewPath view) {
- final Resource resource = resourceComposite.getResource();
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
- ResourceTypeRepository.MetadataType.events,
- ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- resource.setResourceType(type);
- completeSetSelectedResource(resourceComposite, view);
- }
- });
- }
-
-
- private void completeSetSelectedResource(ResourceComposite resourceComposite,
ViewPath viewPath) {
- this.currentResource = resourceComposite;
- this.treeView.setSelectedResource(resourceComposite.getResource(),
viewPath.getCurrent());
- this.detailView.onResourceSelected(resourceComposite);
- }
-
-
- public void setContent(Canvas newContent) {
- if (contentCanvas.getChildren().length > 0)
- contentCanvas.getChildren()[0].destroy();
- contentCanvas.addChild(newContent);
- contentCanvas.markForRedraw();
- }
-
-
- public void renderView(ViewPath viewPath) {
- if (viewPath.isEnd()) {
- // default detail view
- viewPath.getViewPath().add(new ViewId("Summary"));
- viewPath.getViewPath().add(new ViewId("Overview"));
- }
-
- Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
-
- if (currentResource == null || currentResource.getResource().getId() !=
resourceId) {
- // The previous history item did not already point to this Resource.
- setSelectedResource(resourceId, viewPath);
- }
-
- viewPath.next();
- this.treeView.renderView(viewPath);
- this.detailView.renderView(viewPath);
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
deleted file mode 100644
index 92cd3ff..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
+++ /dev/null
@@ -1,61 +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.overview;
-
-import com.smartgwt.client.widgets.layout.VLayout;
-
-import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
-
-/**
- * @author Greg Hinkle
- */
-public class ResourceOverviewView extends VLayout implements ResourceSelectListener {
- private ResourceSummaryView summaryView;
- private FullHTMLPane summaryPane;
- private ResourceComposite resourceComposite;
-
- public ResourceOverviewView(ResourceComposite resourceComposite) {
- this.resourceComposite = resourceComposite;
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- this.summaryView = new ResourceSummaryView();
- addMember(this.summaryView);
-
- this.summaryPane = new FullHTMLPane();
- addMember(this.summaryPane);
-
- if (this.resourceComposite != null) {
- onResourceSelected(this.resourceComposite);
- }
- }
-
- @Override
- public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resourceComposite = resourceComposite;
- this.summaryView.onResourceSelected(resourceComposite);
-
this.summaryPane.setContentsURL("/rhq/resource/summary/overview-plain.xhtml?id="
- + resourceComposite.getResource().getId());
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
deleted file mode 100644
index 4d98f82..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
+++ /dev/null
@@ -1,289 +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.overview;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.HeaderItem;
-import com.smartgwt.client.widgets.form.fields.SpacerItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.DisplayType;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-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.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
-import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
-import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
-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.ResourceSelectListener;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-
-/**
- * @author Greg Hinkle
- * @author Ian Springer
- */
-public class ResourceSummaryView extends EnhancedDynamicForm implements
ResourceSelectListener {
-
- private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
- private ResourceComposite resourceComposite;
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- setLeft("10%");
- setWidth("80%");
- }
-
-
- public void onResourceSelected(ResourceComposite resourceComposite) {
-
- this.resourceComposite = resourceComposite;
- Resource resource = resourceComposite.getResource();
-
- // Load metric defs.
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- try {
- buildForm(type);
- loadTraitValues();
- } catch (Exception e) {
- SC.say("Form load failure");
- e.printStackTrace();
- }
- }
- });
- }
-
- private void loadTraitValues() {
- final Resource resource = resourceComposite.getResource();
- GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource(
- resource.getId(),
- DisplayType.SUMMARY,
- new AsyncCallback<List<MeasurementDataTrait>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load traits
for " + resource + ".",
- caught);
- }
-
- public void onSuccess(List<MeasurementDataTrait> result) {
- // TODO: Implement this method.
- for (MeasurementDataTrait trait : result) {
- String formId = trait.getName().replaceAll("\\.",
"_").replaceAll(" ", "__");
- FormItem item = getItem(formId);
-
- if (item != null) {
- setValue(formId, trait.getValue());
- }
- }
- markForRedraw();
- }
- }
- );
-
- }
-
- 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);
- }
- }
-
- Collections.sort(traits, new Comparator<MeasurementDefinition>() {
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
-
- List<FormItem> formItems = new ArrayList<FormItem>();
-
- HeaderItem headerItem = new HeaderItem("header", "Summary");
- headerItem.setValue("Summary");
- formItems.add(headerItem);
-
- StaticTextItem typeItem = new StaticTextItem("type",
"Type");
- typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
- typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
- formItems.add(typeItem);
-
- final Resource resource = this.resourceComposite.getResource();
- boolean modifiable =
this.resourceComposite.getResourcePermission().isInventory();
-
- final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- nameItem.setName("name");
- nameItem.setTitle("Name");
- nameItem.setValue(resource.getName());
- if (nameItem instanceof TogglableTextItem) {
- TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
- togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newName) {
- final String oldName = resource.getName();
- if (newName.equals(oldName)) {
- return;
- }
- resource.setName(newName);
- ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
- + resource.getId()
- + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setName(oldName);
- nameItem.setValue(oldName);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
- + resource.getId() + " was changed
from \""
- + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(nameItem);
-
- final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- descriptionItem.setName("description");
- descriptionItem.setTitle("Description");
- descriptionItem.setValue(resource.getDescription());
- if (descriptionItem instanceof TogglableTextItem) {
- TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
- togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newDescription) {
- final String oldDescription = resource.getDescription();
- if (newDescription.equals(oldDescription)) {
- return;
- }
- resource.setDescription(newDescription);
- ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
- + resource.getId()
- + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setDescription(oldDescription);
- descriptionItem.setValue(oldDescription);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
- + resource.getId() + " was changed
from \""
- + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(descriptionItem);
-
- final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
- locationItem.setName("location");
- locationItem.setTitle("Location");
- locationItem.setValue(resource.getLocation());
- if (locationItem instanceof TogglableTextItem) {
- TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem;
- togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
- public void onValueUpdated(final String newLocation) {
- final String oldLocation = resource.getLocation();
- if (newLocation.equals(oldLocation)) {
- return;
- }
- resource.setLocation(newLocation);
- ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
- + resource.getId()
- + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
- // We failed to update it on the Server, so change back the
Resource and the form item to
- // the original value.
- resource.setLocation(oldLocation);
- locationItem.setValue(oldLocation);
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
- + resource.getId() + " was changed
from \""
- + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
- }
- });
- }
- });
- }
- formItems.add(locationItem);
-
-
- StaticTextItem versionItem = new StaticTextItem("version",
"Version");
- formItems.add(versionItem);
-
- StaticTextItem parentItem = new StaticTextItem("parent",
"Parent");
- formItems.add(parentItem);
-
- for (MeasurementDefinition trait : traits) {
- String id = trait.getDisplayName().replaceAll("\\.",
"_").replaceAll(" ", "__");
-
- StaticTextItem item = new StaticTextItem(id, trait.getDisplayName());
- item.setTooltip(trait.getDescription());
- formItems.add(item);
-// item.setValue("?");
- }
-
-// SectionItem section = new SectionItem("Summary",
"Summary");
-// section.setTitle("Summary");
-// section.setDefaultValue("Summary");
-// section.setCanCollapse(true);
-// section.setCellStyle("HidablePlainSectionHeader");
-// section.setItemIds(itemIds.toArray(new String[itemIds.size()]));
-// formItems.add(0, section);
-
- formItems.add(new SpacerItem());
- setItems(formItems.toArray(new FormItem[formItems.size()]));
-
- setValue("type", type.getName() + " (" + type.getPlugin() +
")");
- setValue("name", resource.getName());
- setValue("description", resource.getDescription());
- setValue("location", resource.getLocation());
- setValue("version", (resource.getVersion() != null) ?
resource.getVersion() : "<i>none</i>");
- Resource parentResource = resource.getParentResource();
- setValue("parent", parentResource != null ?
- ("<a href=\"#Resource/" + parentResource.getId() +
"\">" +
- parentResource.getName() + "</a>") :
"<i>none</i>");
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
new file mode 100644
index 0000000..c29deec
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java
@@ -0,0 +1,52 @@
+/*
+ * 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 org.rhq.core.domain.resource.composite.ResourceComposite;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
+
+/**
+ * The Resource Summary>Dashboard tab.
+ *
+ * @author Greg Hinkle
+ */
+public class DashboardView extends FullHTMLPane implements ResourceSelectListener {
+ private ResourceComposite resourceComposite;
+
+ public DashboardView(ResourceComposite resourceComposite) {
+ this.resourceComposite = resourceComposite;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ if (this.resourceComposite != null) {
+ onResourceSelected(this.resourceComposite);
+ }
+ }
+
+ @Override
+ public void onResourceSelected(ResourceComposite resourceComposite) {
+ this.resourceComposite = resourceComposite;
+ setContentsURL("/rhq/resource/summary/summary-plain.xhtml?id="
+ + resourceComposite.getResource().getId());
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
new file mode 100644
index 0000000..ac2abc2
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java
@@ -0,0 +1,302 @@
+/*
+ * 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.Collections;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.HeaderItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.DisplayType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+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.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
+import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
+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.ResourceSelectListener;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+/**
+ * The Resource Summary>Overview tab.
+ *
+ * @author Greg Hinkle
+ * @author Ian Springer
+ */
+public class OverviewView extends EnhancedDynamicForm implements ResourceSelectListener
{
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+ private ResourceComposite resourceComposite;
+
+
+ public OverviewView(ResourceComposite resourceComposite) {
+ super();
+ this.resourceComposite = resourceComposite;
+ }
+
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ setLeft("10%");
+ setWidth("80%");
+
+ if (this.resourceComposite != null) {
+ onResourceSelected(this.resourceComposite);
+ }
+ }
+
+
+ public void onResourceSelected(ResourceComposite resourceComposite) {
+
+ this.resourceComposite = resourceComposite;
+ Resource resource = resourceComposite.getResource();
+
+ // Load metric defs.
+
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ try {
+ buildForm(type);
+ loadTraitValues();
+ } catch (Exception e) {
+ SC.say("Form load failure");
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ private void loadTraitValues() {
+ final Resource resource = resourceComposite.getResource();
+ GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource(
+ resource.getId(),
+ DisplayType.SUMMARY,
+ new AsyncCallback<List<MeasurementDataTrait>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load traits
for " + resource + ".",
+ caught);
+ }
+
+ public void onSuccess(List<MeasurementDataTrait> result) {
+ // TODO: Implement this method.
+ for (MeasurementDataTrait trait : result) {
+ String formId = trait.getName().replaceAll("\\.",
"_").replaceAll(" ", "__");
+ FormItem item = getItem(formId);
+
+ if (item != null) {
+ setValue(formId, trait.getValue());
+ }
+ }
+ markForRedraw();
+ }
+ }
+ );
+
+ }
+
+ 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);
+ }
+ }
+
+ Collections.sort(traits, new Comparator<MeasurementDefinition>() {
+ public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
+ return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
+
+ List<FormItem> formItems = new ArrayList<FormItem>();
+
+ HeaderItem headerItem = new HeaderItem("header", "Summary");
+ headerItem.setValue("Summary");
+ formItems.add(headerItem);
+
+ StaticTextItem typeItem = new StaticTextItem("type",
"Type");
+ typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
+ typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
+ formItems.add(typeItem);
+
+ final Resource resource = this.resourceComposite.getResource();
+ boolean modifiable =
this.resourceComposite.getResourcePermission().isInventory();
+
+ final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ nameItem.setName("name");
+ nameItem.setTitle("Name");
+ nameItem.setValue(resource.getName());
+ if (nameItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newName) {
+ final String oldName = resource.getName();
+ if (newName.equals(oldName)) {
+ return;
+ }
+ resource.setName(newName);
+ OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
+ + resource.getId()
+ + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setName(oldName);
+ nameItem.setValue(oldName);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(nameItem);
+
+ final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ descriptionItem.setName("description");
+ descriptionItem.setTitle("Description");
+ descriptionItem.setValue(resource.getDescription());
+ if (descriptionItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
+ togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newDescription) {
+ final String oldDescription = resource.getDescription();
+ if (newDescription.equals(oldDescription)) {
+ return;
+ }
+ resource.setDescription(newDescription);
+ OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
+ + resource.getId()
+ + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setDescription(oldDescription);
+ descriptionItem.setValue(oldDescription);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(descriptionItem);
+
+ final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ locationItem.setName("location");
+ locationItem.setTitle("Location");
+ locationItem.setValue(resource.getLocation());
+ if (locationItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newLocation) {
+ final String oldLocation = resource.getLocation();
+ if (newLocation.equals(oldLocation)) {
+ return;
+ }
+ resource.setLocation(newLocation);
+ OverviewView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
+ + resource.getId()
+ + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setLocation(oldLocation);
+ locationItem.setValue(oldLocation);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
+ }
+ });
+ }
+ });
+ }
+ formItems.add(locationItem);
+
+
+ StaticTextItem versionItem = new StaticTextItem("version",
"Version");
+ formItems.add(versionItem);
+
+ StaticTextItem parentItem = new StaticTextItem("parent",
"Parent");
+ formItems.add(parentItem);
+
+ for (MeasurementDefinition trait : traits) {
+ String id = trait.getDisplayName().replaceAll("\\.",
"_").replaceAll(" ", "__");
+
+ StaticTextItem item = new StaticTextItem(id, trait.getDisplayName());
+ item.setTooltip(trait.getDescription());
+ formItems.add(item);
+// item.setValue("?");
+ }
+
+// SectionItem section = new SectionItem("Summary",
"Summary");
+// section.setTitle("Summary");
+// section.setDefaultValue("Summary");
+// section.setCanCollapse(true);
+// section.setCellStyle("HidablePlainSectionHeader");
+// section.setItemIds(itemIds.toArray(new String[itemIds.size()]));
+// formItems.add(0, section);
+
+ formItems.add(new SpacerItem());
+ setItems(formItems.toArray(new FormItem[formItems.size()]));
+
+ setValue("type", type.getName() + " (" + type.getPlugin() +
")");
+ setValue("name", resource.getName());
+ setValue("description", resource.getDescription());
+ setValue("location", resource.getLocation());
+ setValue("version", (resource.getVersion() != null) ?
resource.getVersion() : "<i>none</i>");
+ Resource parentResource = resource.getParentResource();
+ setValue("parent", parentResource != null ?
+ ("<a href=\"#Resource/" + parentResource.getId() +
"\">" +
+ parentResource.getName() + "</a>") :
"<i>none</i>");
+ }
+}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
index 7a5a8d5..e9f24fa 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
@@ -351,7 +351,7 @@ public class FunctionTagLibrary extends AbstractTagLibrary {
// needs to exist separately from getDefaultContextTabURL because only some facelets
understand EntityContext
public static String getDefaultResourceTabURL() {
- return "/rhq/resource/summary/overview.xhtml";
+ return "/rhq/resource/summary/summary.xhtml";
}
public static String getDefaultGroupTabURL() {
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java
index 60f5031..56d5465 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java
@@ -40,7 +40,7 @@ import org.rhq.core.domain.resource.composite.DisambiguationReport;
* @author Lukas Krejci
*/
public class DisambiguatedResourceLineageRenderer extends Renderer {
- private static final String RESOURCE_URL =
"/rhq/resource/summary/overview.xhtml";
+ private static final String RESOURCE_URL =
"/rhq/resource/summary/summary.xhtml";
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws
IOException {
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java
index 94e6614..33310b6 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java
@@ -37,7 +37,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
* @author Ian Springer
*/
public class ResourceLineageRenderer extends Renderer {
- private static final String BASE_RESOURCE_URL =
"/rhq/resource/summary/overview.xhtml";
+ private static final String BASE_RESOURCE_URL =
"/rhq/resource/summary/summary.xhtml";
private static final String SEPARATOR = " > ";
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java
index 5e02e32..4f5bfa9 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java
@@ -46,7 +46,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
* @author Ian Springer
*/
public class InventoryHierarchyTag extends TagSupport {
- private static final String BASE_RESOURCE_URL =
"/rhq/resource/summary/overview.xhtml";
+ private static final String BASE_RESOURCE_URL =
"/rhq/resource/summary/summary.xhtml";
//private static final String BASE_GROUP_URL = "/Resource.do?type=GROUP";
private static final String BASE_GROUP_URL =
"/rhq/group/inventory/view.xhtml";
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java
index 1077aab..2efedc9 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java
@@ -170,6 +170,6 @@ public class DisambiguatedResourceNameTag extends TagSupport {
}
public static String getDefaultResourceUrl(int resourceId) {
- return "/rhq/resource/summary/overview.xhtml?id=" + resourceId;
+ return "/rhq/resource/summary/summary.xhtml?id=" + resourceId;
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
index 34fb0a6..4650eef 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
@@ -175,7 +175,7 @@ public class ResourceGroupTreeContextMenuUIBean extends
TreeContextMenuBase {
menuItem.setValue(res.getName());
menuItem.setId("groupMember_" + res.getId());
- String url = "/rhq/resource/summary/overview.xhtml?id=" +
res.getId();
+ String url = "/rhq/resource/summary/summary.xhtml?id=" +
res.getId();
menuItem.setSubmitMode("none");
menuItem.setOnclick("document.location.href='" + url +
"'");
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java
index 3bf4596..0ea233b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java
@@ -33,7 +33,7 @@ public enum PerspectiveTarget {
GROUP_MIXED("/rhq/group/inventory/view.xhtml?category=MIXED&groupId="),
//
METRIC_TEMPLATE("/admin/platform/monitor/Config.do?mode=configure&id=",
false, true), //
REPO("/rhq/content/repo.xhtml?mode=view&id="), //
- RESOURCE("/rhq/resource/summary/overview.xhtml?id="), //
+ RESOURCE("/rhq/resource/summary/summary.xhtml?id="), //
ROLE("/admin/role/RoleAdmin.do?mode=view&r="), //
SERVER("/rhq/ha/viewServer.xhtml?mode=view&serverId="), //
USER("/admin/user/UserAdmin.do?mode=view&u=");
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index e5f2802..25ffa7b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -835,6 +835,10 @@ public class WebservicesManagerBean implements WebservicesRemote {
return resourceManager.uninventoryResources(subject, resourceIds);
}
+ public Resource updateResource(Subject subject, Resource resource) {
+ return resourceManager.updateResource(subject, resource);
+ }
+
//RESOURCEMANAGER: END ----------------------------------
//RESOURCEGROUPMANAGER: BEGIN ----------------------------------
diff --git a/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java
b/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java
index ae22c2f..a7cdba4 100644
--- a/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java
+++ b/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java
@@ -45,7 +45,7 @@ import org.rhq.augeas.util.GlobFilter;
import org.rhq.plugins.platform.PlatformComponent;
/**
- * Provides an overview of all entries in the crontabs split into
hourly/daily/weekly/monthly entries.
+ * Provides an summary of all entries in the crontabs split into
hourly/daily/weekly/monthly entries.
* Is able to create new cron tabs.
*
* @author Lukas Krejci
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java
index 5e02571..024d60d 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java
@@ -192,7 +192,7 @@ public class SetComponent implements
ResourceComponent<ManagerComponent>, Config
Configuration bindings = result.getComplexResults();
- //populate the resulting binding map so that the users have overview what the
+ //populate the resulting binding map so that the users have summary what the
//the bindings would look like if this binding set was active.
PropertyList resultingBindings = new PropertyList(RESULTING_BINDINGS_PROPERTY);
bindings.put(resultingBindings);
commit 38aa7252752eb905b84127662e0149f6d470ba7b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Aug 13 15:54:55 2010 -0400
get rid of new updateResource*Name, updateResource*Description, and
updateResource*Location in resource and group managers, and use updateResource() and
updateResourceGroup() instead
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java
index 7714e39..80e92f6 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java
@@ -50,7 +50,7 @@ import javax.persistence.Table;
import org.jetbrains.annotations.NotNull;
/**
- * Class representing a sub category, where a sub category is meant to group similar
resource types together.
+ * Class representing a sub category, where a sub category is meant to group similar
Resource types together.
*/
@Entity
@SequenceGenerator(name = "SEQ", sequenceName =
"RHQ_RESOURCE_SUBCAT_ID_SEQ")
@@ -213,7 +213,7 @@ public class ResourceSubCategory implements
Comparable<ResourceSubCategory>, Ser
}
/**
- * Updates the contents of this definition with values from the specified new
defintion. The intention is for this
+ * Updates the contents of this definition with values from the specified new
definition. The intention is for this
* to be used as a merge between this attached instance and a detached instance. The
name and resourceType will NOT
* be updated as part of this call; they are used as identifiers and should already
be the same if this merge is
* being performed.
@@ -246,10 +246,9 @@ public class ResourceSubCategory implements
Comparable<ResourceSubCategory>, Ser
}
public void setChildSubCategories(List<ResourceSubCategory> childSubCategories)
{
- if (childSubCategories == null) {
- throw new IllegalArgumentException("childSubCategories is null.");
+ if (childSubCategories != null) {
+ this.childSubCategories = childSubCategories;
}
- this.childSubCategories = childSubCategories;
}
public void setParentSubCategory(ResourceSubCategory parentSubCategory) {
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 53741a9..f92e7d5 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
@@ -65,10 +65,4 @@ public interface ResourceGWTService extends RemoteService {
void unignoreResources(Integer[] resourceIds);
- void updateResourceName(int resourceId, String name);
-
- void updateResourceDescription(int resourceId, String description);
-
- void updateResourceLocation(int resourceId, String location);
-
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
index 9134199..3d78c78 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
@@ -46,10 +46,6 @@ public interface ResourceGroupGWTService extends RemoteService {
void deleteResourceGroup(int groupId);
- void updateResourceGroupName(int groupId, String name);
-
- void updateResourceGroupDescription(int groupId, String description);
-
- void updateResourceGroupLocation(int groupId, String location);
+ void updateResourceGroup(ResourceGroup group);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
index e9078cd..01faa2d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
@@ -85,13 +85,18 @@ public class OverviewView extends VLayout {
togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newName) {
final String oldName = group.getName();
-
OverviewView.this.resourceGroupService.updateResourceGroupName(group.getId(),
- newName, new AsyncCallback<Void>() {
+ if (newName.equals(oldName)) {
+ return;
+ }
+ group.setName(newName);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource group with id "
+ group.getId()
+ " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setName(oldName);
nameItem.setValue(oldName);
}
@@ -99,7 +104,6 @@ public class OverviewView extends VLayout {
CoreGUI.getMessageCenter().notify(new Message("Name of
Resource group with id "
+ group.getId() + " was changed from
\""
+ oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
- group.setName(newName);
}
});
}
@@ -131,13 +135,18 @@ public class OverviewView extends VLayout {
togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newDescription) {
final String oldDescription = group.getDescription();
-
OverviewView.this.resourceGroupService.updateResourceGroupDescription(group.getId(),
- newDescription, new AsyncCallback<Void>() {
+ if (newDescription.equals(oldDescription)) {
+ return;
+ }
+ group.setDescription(newDescription);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource group with id "
+ group.getId()
+ " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setDescription(oldDescription);
descriptionItem.setValue(oldDescription);
}
@@ -145,7 +154,6 @@ public class OverviewView extends VLayout {
CoreGUI.getMessageCenter().notify(new
Message("Description of Resource group with id "
+ group.getId() + " was changed from
\""
+ oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
- group.setDescription(newDescription);
}
});
}
@@ -162,13 +170,18 @@ public class OverviewView extends VLayout {
togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newLocation) {
final String oldLocation = group.getLocation();
-
OverviewView.this.resourceGroupService.updateResourceGroupLocation(group.getId(),
- newLocation, new AsyncCallback<Void>() {
+ if (newLocation.equals(oldLocation)) {
+ return;
+ }
+ group.setLocation(newLocation);
+ OverviewView.this.resourceGroupService.updateResourceGroup(group, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource group with id "
+ group.getId()
+ " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
ResourceGroup and the form item
+ // to the original value.
+ group.setLocation(oldLocation);
locationItem.setValue(oldLocation);
}
@@ -176,7 +189,6 @@ public class OverviewView extends VLayout {
CoreGUI.getMessageCenter().notify(new Message("Location
of Resource group with id "
+ group.getId() + " was changed from
\""
+ oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
- group.setLocation(newLocation);
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
index 56f84b6..4d98f82 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
@@ -50,6 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
+ * @author Ian Springer
*/
public class ResourceSummaryView extends EnhancedDynamicForm implements
ResourceSelectListener {
@@ -152,13 +153,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newName) {
final String oldName = resource.getName();
-
ResourceSummaryView.this.resourceService.updateResourceName(resource.getId(),
- newName, new AsyncCallback<Void>() {
+ if (newName.equals(oldName)) {
+ return;
+ }
+ resource.setName(newName);
+ ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
+ resource.getId()
+ " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setName(oldName);
nameItem.setValue(oldName);
}
@@ -166,7 +172,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
+ resource.getId() + " was changed
from \""
+ oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
- resource.setName(newName);
}
});
}
@@ -183,13 +188,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newDescription) {
final String oldDescription = resource.getDescription();
-
ResourceSummaryView.this.resourceService.updateResourceDescription(resource.getId(),
- newDescription, new AsyncCallback<Void>() {
+ if (newDescription.equals(oldDescription)) {
+ return;
+ }
+ resource.setDescription(newDescription);
+ ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
+ resource.getId()
+ " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setDescription(oldDescription);
descriptionItem.setValue(oldDescription);
}
@@ -197,7 +207,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
+ resource.getId() + " was changed
from \""
+ oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
- resource.setDescription(newDescription);
}
});
}
@@ -214,13 +223,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
public void onValueUpdated(final String newLocation) {
final String oldLocation = resource.getLocation();
-
ResourceSummaryView.this.resourceService.updateResourceLocation(resource.getId(),
- newLocation, new AsyncCallback<Void>() {
+ if (newLocation.equals(oldLocation)) {
+ return;
+ }
+ resource.setLocation(newLocation);
+ ResourceSummaryView.this.resourceService.updateResource(resource, new
AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
+ resource.getId()
+ " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
- // We failed to update it on the Server, so change back the
form item to the original value.
+ // We failed to update it on the Server, so change back the
Resource and the form item to
+ // the original value.
+ resource.setLocation(oldLocation);
locationItem.setValue(oldLocation);
}
@@ -228,7 +242,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
+ resource.getId() + " was changed
from \""
+ oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
- resource.setLocation(newLocation);
}
});
}
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 56d91bd..c10254e 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
@@ -127,7 +127,9 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
criteria);
List<Resource> resources = new
ArrayList<Resource>(result.size());
- ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet);
+ if (resources.size() > 1) {
+ ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet);
+ }
return SerialUtility.prepare(result,
"ResourceService.findResourceCompositesByCriteria");
} catch (Exception e) {
@@ -212,16 +214,5 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
public void unignoreResources(Integer[] resourceIds) {
discoveryBoss.unignoreResources(getSessionSubject(), resourceIds);
}
-
- public void updateResourceName(int resourceId, String name) {
- resourceManager.updateResourceName(getSessionSubject(), resourceId, name);
- }
-
- public void updateResourceDescription(int resourceId, String description) {
- resourceManager.updateResourceDescription(getSessionSubject(), resourceId,
description);
- }
-
- public void updateResourceLocation(int resourceId, String location) {
- resourceManager.updateResourceLocation(getSessionSubject(), resourceId,
location);
- }
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
index d4dd777..31a4381 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
@@ -31,7 +31,6 @@ import
org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
-
/**
* @author Greg Hinkle
*/
@@ -75,15 +74,8 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl
implemen
}
}
- public void updateResourceGroupName(int groupId, String name) {
- groupManager.updateResourceGroupName(getSessionSubject(), groupId, name);
- }
-
- public void updateResourceGroupDescription(int groupId, String description) {
- groupManager.updateResourceGroupDescription(getSessionSubject(), groupId,
description);
+ public void updateResourceGroup(ResourceGroup group) {
+ groupManager.updateResourceGroup(getSessionSubject(), group);
}
- public void updateResourceGroupLocation(int groupId, String location) {
- groupManager.updateResourceGroupLocation(getSessionSubject(), groupId,
location);
- }
}
\ No newline at end of file
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 5051bdf..cb17046 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
@@ -285,6 +285,16 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
return result;
}
+ // local only
+ public void setResourceConfiguration(int resourceId, Configuration configuration) {
+ Resource resource = entityManager.find(Resource.class, resourceId);
+ if (resource == null) {
+ throw new ResourceNotFoundException("Resource [" + resourceId +
"] does not exist.");
+ }
+ resource.setResourceConfiguration(configuration);
+ entityManager.merge(resource);
+ }
+
// Use new transaction because this only works if the resource in question has not
// yet been loaded by Hibernate. We want the query to return a non-proxied
configuration,
// this is critical for remote API use.
@@ -2032,7 +2042,6 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
}
-
@SuppressWarnings("unchecked")
public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdatesByCriteria(
Subject subject, ResourceConfigurationUpdateCriteria criteria) {
@@ -2047,7 +2056,15 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
PageList<ResourceConfigurationUpdate> updates = queryRunner.execute();
-
return updates;
}
+
+
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ //
+ // Remote Interface Impl
+ //
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ // ***TODO***: Move all remoted methods below this line.
}
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 495583e..fc61a48 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
@@ -490,6 +490,15 @@ public interface ConfigurationManagerLocal {
Configuration getResourceConfiguration(Subject subject, int resourceId);
/**
+ * This method is called when the plugin container reports a new Resource
configuration after an external change was
+ * detected.
+ *
+ * @param resourceId the Resource's id
+ * @param configuration the updated configuration
+ */
+ void setResourceConfiguration(int resourceId, Configuration configuration);
+
+ /**
* @see
ConfigurationManagerRemote#getPackageTypeConfigurationDefinition(Subject,int)
*/
ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int
packageTypeId);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
index 8932607..6ae1e16 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -81,7 +81,10 @@ public class ConfigurationServerServiceImpl implements
ConfigurationServerServic
}
Resource resource = update.getResource();
- resource.setResourceConfiguration(update.getConfiguration().deepCopy(false));
+ // First clone the config, zeroing out all id's.
+ Configuration configuration = update.getConfiguration().deepCopy(false);
+ configurationManager.setResourceConfiguration(resource.getId(), configuration);
+ resource.setResourceConfiguration(configuration);
resourceManager.updateResource(overlord, resource);
}
}
\ No newline at end of file
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 4804a73..7c34f0d 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
@@ -206,14 +206,29 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
}
public Resource updateResource(Subject user, Resource resource) {
+ Resource persistedResource = entityManager.find(Resource.class,
resource.getId());
+ if (persistedResource == null) {
+ throw new ResourceNotFoundException(resource.getId());
+ }
+
if (!authorizationManager.hasResourcePermission(user, Permission.MODIFY_RESOURCE,
resource.getId())) {
- throw new PermissionException("You do not have permission to modify
resource");
+ throw new PermissionException("You do not have permission to modify
Resource with id " + resource.getId()
+ + ".");
}
/*if (getResourceByParentAndKey(user, resource.getParentResource(),
resource.getResourceKey()) != null)
* { throw new ResourceAlreadyExistsException("Resource with key '"
+ resource.getName() + "' already
* exists");}*/
- return entityManager.merge(resource);
+
+ persistedResource.setName(resource.getName());
+ persistedResource.setLocation(resource.getLocation());
+ persistedResource.setDescription(resource.getDescription());
+
+ // NOTE: Updating the mtime will tell the Agent it needs to sync this Resource.
+ persistedResource.setMtime(System.currentTimeMillis());
+ persistedResource.setModifiedBy(user.getName());
+
+ return entityManager.merge(persistedResource);
}
public List<Integer> uninventoryResources(Subject user, int[] resourceIds) {
@@ -2155,39 +2170,4 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
DisambiguationUpdateStrategy updateStrategy) {
return Disambiguator.disambiguate(results, updateStrategy, extractor,
entityManager);
}
-
- public void updateResourceName(Subject subject, int resourceId, String name) {
- if (name == null) {
- throw new IllegalArgumentException("Resource name cannot be
null.");
- }
- Resource resource = getResourceToBeModified(subject, resourceId);
- resource.setName(name);
- resource.setMtime(System.currentTimeMillis());
- }
-
- public void updateResourceDescription(Subject subject, int resourceId, String
description) {
- Resource resource = getResourceToBeModified(subject, resourceId);
- resource.setDescription(description);
- resource.setMtime(System.currentTimeMillis());
- }
-
- public void updateResourceLocation(Subject subject, int resourceId, String location)
{
- Resource resource = getResourceToBeModified(subject, resourceId);
- resource.setLocation(location);
- resource.setMtime(System.currentTimeMillis());
- }
-
- private Resource getResourceToBeModified(Subject subject, int resourceId) {
- Resource resource = entityManager.find(Resource.class, resourceId);
-
- if (resource == null) {
- throw new ResourceNotFoundException(resourceId);
- }
-
- if (!authorizationManager.hasResourcePermission(subject,
Permission.MODIFY_RESOURCE, resourceId)) {
- throw new PermissionException("User [" + subject + "] does not
have permission to modify Resource with id ["
- + resourceId + "].");
- }
- return resource;
- }
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
index 3dd1fcb..d753c89 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
@@ -74,10 +74,10 @@ public interface ResourceManagerLocal {
void createResource(Subject user, Resource resource, int parentId) throws
ResourceAlreadyExistsException;
/**
- * Update an existing Resource.
+ * Update a Resource's editable properties (name, description, and location).
*
- * @param user the user updating the resource
- * @param resource the resource to be updated
+ * @param user the user updating the Resource
+ * @param resource the Resource to be updated
* @return the updated (attached) resource
*/
Resource updateResource(Subject user, Resource resource);
@@ -386,7 +386,7 @@ public interface ResourceManagerLocal {
* view of the platform inventory. This includes resource type and subcategory
information
* as well as current availability and structure.
*
- * This method also returns placesholder {@link
org.rhq.core.domain.resource.composite.LockedResourcerce}
+ * This method also returns placesholder {@link
org.rhq.core.domain.resource.composite.LockedResource}
* objects for resources that a user should not have visibility to in order to keep
the tree a
* directed graph.
*
@@ -455,10 +455,4 @@ public interface ResourceManagerLocal {
*/
<T> ResourceNamesDisambiguationResult<T> disambiguate(List<T>
results, IntExtractor<? super T> resourceIdExtractor,
DisambiguationUpdateStrategy updateStrategy);
-
- void updateResourceName(Subject subject, int resourceId, String name);
-
- void updateResourceDescription(Subject subject, int resourceId, String description);
-
- void updateResourceLocation(Subject subject, int resourceId, String location);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
index 2eb9d62..b3fbce0 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
@@ -100,6 +100,10 @@ public interface ResourceManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId);
+ Resource updateResource( //
+ @WebParam(name = "subject") Subject user, //
+ @WebParam(name = "resource") Resource resource);
+
/**
* Removes these resources from inventory. The resources may subsequently be
rediscovered. Note that for
* each specified resource all children will also be removed, it it not necessary or
recommended to
@@ -137,22 +141,4 @@ public interface ResourceManagerRemote {
Resource getParentResource( //
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId);
-
- @WebMethod
- void updateResourceName( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "resourceId") int resourceId, //
- @WebParam(name = "name") String name);
-
- @WebMethod
- void updateResourceDescription( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "resourceId") int resourceId, //
- @WebParam(name = "description") String description);
-
- @WebMethod
- void updateResourceLocation( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "resourceId") int resourceId, //
- @WebParam(name = "location") String location);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
index 7c31d96..946d7e3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
@@ -35,7 +35,7 @@ public class ResourceNotFoundException extends RuntimeException {
* @param resourceId a resource id
*/
public ResourceNotFoundException(int resourceId) {
- super("A resource with id " + resourceId + " does not exist in
inventory.");
+ super("A Resource with id " + resourceId + " does not exist in
inventory.");
}
public ResourceNotFoundException(String message) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index 987015b..43c6f0f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -90,7 +90,6 @@ import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter;
import org.rhq.enterprise.server.operation.GroupOperationSchedule;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.resource.ResourceNotFoundException;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
@@ -175,9 +174,17 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
throws ResourceGroupUpdateException {
int groupId = group.getId();
+ ResourceGroup attachedGroup = entityManager.find(ResourceGroup.class, groupId);
+ if (attachedGroup == null) {
+ throw new ResourceGroupNotFoundException(groupId);
+ }
+
+ if (!authorizationManager.hasGroupPermission(user, Permission.MODIFY_RESOURCE,
groupId)) {
+ throw new PermissionException("User [" + user + "] does not
have permission to modify Resource group with id ["
+ + groupId + "].");
+ }
if (changeType == null) {
- ResourceGroup attachedGroup = entityManager.find(ResourceGroup.class,
groupId);
changeType = RecursivityChangeType.None;
if (attachedGroup.isRecursive() == true && group.isRecursive() ==
false) {
// making a recursive group into a "normal" group
@@ -189,9 +196,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
// recursive bit didn't change
}
}
-
- long time = System.currentTimeMillis();
- group.setMtime(time);
+
+ group.setMtime(System.currentTimeMillis());
group.setModifiedBy(user.getName());
ResourceGroup newlyAttachedGroup = entityManager.merge(group);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
index 8ed40b6..9b0468b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
@@ -138,10 +138,5 @@ public interface ResourceGroupManagerLocal {
ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
ResourceGroupCriteria criteria);
-
- void updateResourceGroupName(Subject subject, int groupId, String name);
-
- void updateResourceGroupDescription(Subject subject, int groupId, String
description);
-
- void updateResourceGroupLocation(Subject subject, int groupId, String location);
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
index 8907ea9..fdda4e2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
@@ -97,21 +97,4 @@ public interface ResourceGroupManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "criteria") ResourceGroupCriteria criteria);
- @WebMethod
- void updateResourceGroupName( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "groupId") int groupId, //
- @WebParam(name = "name") String name);
-
- @WebMethod
- void updateResourceGroupDescription( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "groupId") int groupId, //
- @WebParam(name = "description") String description);
-
- @WebMethod
- void updateResourceGroupLocation( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "groupId") int groupId, //
- @WebParam(name = "location") String location);
}
commit 8772b4ebacc2d74f66b24dd744ea843450da4082
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Aug 13 12:38:43 2010 -0400
only display Connection Settings subtab when appropriate; some failed attempts to get
subtabs to deraw after selecting a different Resource
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
index eb66445..cda5761 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.components.tab;
import java.util.HashSet;
import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.Set;
import com.google.gwt.event.shared.HandlerManager;
@@ -40,7 +41,7 @@ public class SubTabLayout extends VLayout {
ToolStrip buttonBar;
- LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String,
Canvas>();
+ Map<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>();
Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed;
@@ -115,11 +116,15 @@ public class SubTabLayout extends VLayout {
}
public void enableSubTab(String title) {
- disabledSubTabs.remove(title);
+ if (disabledSubTabs.remove(title)) {
+ markForRedraw();
+ }
}
public void disableSubTab(String title) {
- disabledSubTabs.add(title);
+ if (disabledSubTabs.add(title)) {
+ markForRedraw();
+ }
}
public void updateSubTab(String title, Canvas canvas) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
index c335dc9..cc5cac4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
@@ -28,6 +28,7 @@ public class TwoLevelTab extends Tab {
private SubTabLayout layout;
+
public TwoLevelTab(String title, String icon) {
super(title, icon);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
index b12304c..e5cacf8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
@@ -30,7 +30,6 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
*/
public class TwoLevelTabSet extends TabSet implements TabSelectedHandler,
TwoLevelTabSelectedHandler {
-
public void setTabs(TwoLevelTab... tabs) {
super.setTabs(tabs);
for (TwoLevelTab tab : tabs) {
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 51c225a..8fff6e2 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
@@ -203,11 +203,16 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private void completeTabUpdate() {
+ GroupCategory groupCategory =
groupComposite.getResourceGroup().getGroupCategory();
+ Set<ResourceTypeFacet> facets =
groupComposite.getResourceFacets().getFacets();
+
// Summary and Inventory tabs are always enabled.
topTabSet.enableTab(summaryTab);
topTabSet.enableTab(inventoryTab);
- GroupCategory groupCategory =
groupComposite.getResourceGroup().getGroupCategory();
+ // Inventory>Connection Settings subtab is only enabled for compat groups that
define conn props.
+ inventoryTab.setSubTabEnabled("Connection Settings",
+ groupCategory == GroupCategory.COMPATIBLE &&
facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION));
// Monitoring and Alerts tabs are always enabled for compatible groups and always
disabled for mixed groups.
if (groupCategory == GroupCategory.COMPATIBLE) {
@@ -219,8 +224,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
// Operations tab is only enabled for compatible groups of a type that supports
the Operations facet.
- Set<ResourceTypeFacet> typeFacets =
groupComposite.getResourceFacets().getFacets();
- if (typeFacets.contains(ResourceTypeFacet.OPERATION)) {
+ if (facets.contains(ResourceTypeFacet.OPERATION)) {
topTabSet.enableTab(operationsTab);
} else {
topTabSet.disableTab(operationsTab);
@@ -228,21 +232,21 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// Configuration tab is only enabled for compatible groups of a type that
supports the Configuration facet
// and when the current user has the CONFIGURE_READ permission.
- if (typeFacets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
+ if (facets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
} else {
topTabSet.disableTab(configurationTab);
}
// Events tab is only enabled for compatible groups of a type that supports the
Events facet.
- if (typeFacets.contains(ResourceTypeFacet.EVENT)) {
+ if (facets.contains(ResourceTypeFacet.EVENT)) {
topTabSet.enableTab(eventsTab);
} else {
topTabSet.disableTab(eventsTab);
}
// only enable "Call Time" sub-tab for those that implement it
- monitoringTab.setSubTabEnabled("Call Time",
typeFacets.contains(ResourceTypeFacet.CALL_TIME));
+ monitoringTab.setSubTabEnabled("Call Time",
facets.contains(ResourceTypeFacet.CALL_TIME));
}
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 5c2e94f..2a7183e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -23,8 +23,8 @@ import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceTypeFacet;
import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.core.domain.resource.composite.ResourceFacets;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -43,6 +43,8 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
+import java.util.Set;
+
/**
* Right panel of the Resource view.
*
@@ -201,41 +203,44 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
private void completeTabUpdate() {
ResourcePermission permissions = this.resourceComposite.getResourcePermission();
- ResourceFacets facets = this.resourceComposite.getResourceFacets();
+ Set<ResourceTypeFacet> facets =
this.resourceComposite.getResourceFacets().getFacets();
// Summary, Monitoring, Inventory, and Alerts tabs are always enabled.
- monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
+ monitoringTab.setSubTabEnabled("Call Time",
facets.contains(ResourceTypeFacet.CALL_TIME));
+
+ inventoryTab.setSubTabEnabled("Connection Settings",
facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION));
- if (facets.isOperation()) {
+ if (facets.contains(ResourceTypeFacet.OPERATION)) {
topTabSet.enableTab(operationsTab);
} else {
topTabSet.disableTab(operationsTab);
}
- if (facets.isConfiguration() && permissions.isConfigureRead()) {
+ if (facets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
} else {
topTabSet.disableTab(configurationTab);
}
- if (facets.isEvent()) {
+ if (facets.contains(ResourceTypeFacet.EVENT)) {
topTabSet.enableTab(eventsTab);
} else {
topTabSet.disableTab(eventsTab);
}
- if (facets.isContent()) {
+ if (facets.contains(ResourceTypeFacet.CONTENT)) {
topTabSet.enableTab(contentTab);
} else {
topTabSet.disableTab(contentTab);
}
-
if (topTabSet.getSelectedTab().getDisabled()) {
topTabSet.selectTab(0);
}
+ // TODO: This doesn't seem to actually be calling redraw(), draw(), or
onDraw() on topTabSet, so subtab
+ // enablement isn't getting updated...
topTabSet.markForRedraw();
}
commit 1c98f96a1d2751aacd48ff4ba6b07666906b7dc9
Merge: 761b250... 40fc34f...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 13 13:17:53 2010 -0400
Merge branch 'alert-def-gwt'
commit 40fc34f2b200c1ea90e8faf26cae4f0bd2c03658
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 13 13:16:08 2010 -0400
the general properties tab now works nicely.
starting the "edit" feature. still doesn't store anything to the DB yet
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index 807d3d3..31be645 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -623,6 +623,14 @@ public class AlertDefinition implements Serializable {
this.deleted = deleted;
}
+ /**
+ * A definition is "read-only" with respect to updates that come from the
group/template level.
+ * If "read only" is true, then changes to the parent group/template alert
definition will not
+ * change this resource alert def. If read only is false, changes to the parent
propagate to the
+ * child resource alert.
+ *
+ * @return read only flag
+ */
public boolean isReadOnly() {
return this.readOnly;
}
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 6c6aa9f..4a57272 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
@@ -39,6 +39,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.table.Table.SelectionEna
public abstract class AbstractAlertDefinitionsView extends VLayout {
private SingleAlertDefinitionView singleAlertDefinitionView;
+ private Table alertDefinitionsTable;
public AbstractAlertDefinitionsView() {
setWidth100();
@@ -51,11 +52,11 @@ public abstract class AbstractAlertDefinitionsView extends VLayout {
super.onDraw();
Criteria criteria = getCriteria();
- final Table table = new Table(getTableTitle(), criteria);
- table.setDataSource(getAlertDefinitionDataSource());
- table.getListGrid().setUseAllDataSourceFields(true);
+ alertDefinitionsTable = new Table(getTableTitle(), criteria);
+ alertDefinitionsTable.setDataSource(getAlertDefinitionDataSource());
+ alertDefinitionsTable.getListGrid().setUseAllDataSourceFields(true);
- table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() {
+ alertDefinitionsTable.getListGrid().addSelectionChangedHandler(new
SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
AlertDefinition alertDef = null;
ListGridRecord selectedRecord = null;
@@ -64,16 +65,11 @@ public abstract class AbstractAlertDefinitionsView extends VLayout {
selectedRecord = allSelections[0];
}
if (selectedRecord != null) {
- alertDef = ((AbstractAlertDefinitionsDataSource)
table.getDataSource()).copyValues(selectedRecord);
- table.setHeight("33%");
- table.setShowResizeBar(true);
- singleAlertDefinitionView.setHeight("67%");
- singleAlertDefinitionView.show();
- singleAlertDefinitionView.setAlertDefinition(alertDef);
+ alertDef = ((AbstractAlertDefinitionsDataSource)
alertDefinitionsTable.getDataSource())
+ .copyValues(selectedRecord);
+ showSingleAlertDefinitionView(alertDef);
} else {
- table.setHeight100();
- table.setShowResizeBar(false);
- singleAlertDefinitionView.hide();
+ hideSingleAlertDefinitionView();
}
markForRedraw();
}
@@ -81,49 +77,63 @@ public abstract class AbstractAlertDefinitionsView extends VLayout {
boolean permitted = isAllowedToModifyAlerts();
- table.addTableAction("New", (permitted) ? SelectionEnablement.ALWAYS :
SelectionEnablement.NEVER, null,
- new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- newButtonPressed(selection);
- CoreGUI.refresh();
- }
- });
+ alertDefinitionsTable.addTableAction("New", (permitted) ?
SelectionEnablement.ALWAYS
+ : SelectionEnablement.NEVER, null, new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ newButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
- table.addTableAction("Enable", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
- "Are You Sure?", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- enableButtonPressed(selection);
- CoreGUI.refresh();
- }
- });
+ alertDefinitionsTable.addTableAction("Enable", (permitted) ?
SelectionEnablement.ANY
+ : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ enableButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
- table.addTableAction("Disable", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
- "Are You Sure?", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- disableButtonPressed(selection);
- }
- });
+ alertDefinitionsTable.addTableAction("Disable", (permitted) ?
SelectionEnablement.ANY
+ : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ disableButtonPressed(selection);
+ }
+ });
- table.addTableAction("Delete", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
- "Are You Sure?", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- deleteButtonPressed(selection);
- CoreGUI.refresh();
- }
- });
+ alertDefinitionsTable.addTableAction("Delete", (permitted) ?
SelectionEnablement.ANY
+ : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ deleteButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
- addMember(table);
+ addMember(alertDefinitionsTable);
- this.singleAlertDefinitionView = buildSingleAlertDefinitionView();
- this.singleAlertDefinitionView.hide();
- this.singleAlertDefinitionView.setWidth100();
- this.singleAlertDefinitionView.setHeight100();
- this.singleAlertDefinitionView.setMargin(10);
- addMember(this.singleAlertDefinitionView);
+ singleAlertDefinitionView = buildSingleAlertDefinitionView();
+ singleAlertDefinitionView.hide();
+ singleAlertDefinitionView.setWidth100();
+ singleAlertDefinitionView.setHeight100();
+ singleAlertDefinitionView.setMargin(10);
+ addMember(singleAlertDefinitionView);
}
protected SingleAlertDefinitionView getSingleAlertDefinitionView() {
- return this.singleAlertDefinitionView;
+ return singleAlertDefinitionView;
+ }
+
+ protected void showSingleAlertDefinitionView(AlertDefinition alertDef) {
+ alertDefinitionsTable.setHeight("33%");
+ alertDefinitionsTable.setShowResizeBar(true);
+ singleAlertDefinitionView.setHeight("67%");
+ singleAlertDefinitionView.show();
+ singleAlertDefinitionView.setAlertDefinition(alertDef);
+ }
+
+ protected void hideSingleAlertDefinitionView() {
+ alertDefinitionsTable.setHeight100();
+ alertDefinitionsTable.setShowResizeBar(false);
+ singleAlertDefinitionView.hide();
}
protected SingleAlertDefinitionView buildSingleAlertDefinitionView() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
index 3f91844..819260f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
@@ -38,6 +38,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
private SelectItem conditionExpression;
+ private boolean formBuilt = false;
+
public ConditionsAlertDefinitionForm() {
this(null);
}
@@ -50,7 +52,7 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
protected void onDraw() {
super.onDraw();
- if (conditionExpression == null) {
+ if (!formBuilt) {
buildForm();
setAlertDefinition(alertDefinition);
makeViewOnly();
@@ -59,12 +61,14 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
@Override
public AlertDefinition getAlertDefinition() {
- return this.alertDefinition;
+ return alertDefinition;
}
@Override
public void setAlertDefinition(AlertDefinition alertDef) {
- this.alertDefinition = alertDef;
+ alertDefinition = alertDef;
+
+ buildForm();
if (alertDef == null) {
clearFormValues();
@@ -94,13 +98,20 @@ public class ConditionsAlertDefinitionForm extends DynamicForm
implements EditAl
@Override
public void clearFormValues() {
conditionExpression.clearValue();
+
+ markForRedraw();
}
private void buildForm() {
- conditionExpression = new SelectItem("conditionExpression", "Fire
alert when");
- conditionExpression.setValueMap(BooleanExpression.ALL.toString(),
BooleanExpression.ANY.toString());
- conditionExpression.setDefaultValue(BooleanExpression.ALL.toString());
+ if (!formBuilt) {
- setFields(conditionExpression);
+ conditionExpression = new SelectItem("conditionExpression",
"Fire alert when");
+ conditionExpression.setValueMap(BooleanExpression.ALL.toString(),
BooleanExpression.ANY.toString());
+ conditionExpression.setDefaultValue(BooleanExpression.ALL.toString());
+
+ setFields(conditionExpression);
+
+ formBuilt = true;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
index adf2173..5590af6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
@@ -34,6 +34,8 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements
EditAle
private AlertDefinition alertDefinition;
+ private boolean formBuilt = false;
+
public DampeningAlertDefinitionForm() {
this(null);
}
@@ -46,8 +48,7 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements
EditAle
protected void onDraw() {
super.onDraw();
- // TODO only build form if we didn't do it yet
- if (true) {
+ if (!formBuilt) {
buildForm();
setAlertDefinition(alertDefinition);
makeViewOnly();
@@ -56,12 +57,14 @@ public class DampeningAlertDefinitionForm extends DynamicForm
implements EditAle
@Override
public AlertDefinition getAlertDefinition() {
- return this.alertDefinition;
+ return alertDefinition;
}
@Override
public void setAlertDefinition(AlertDefinition alertDef) {
- this.alertDefinition = alertDef;
+ alertDefinition = alertDef;
+
+ buildForm();
if (alertDef == null) {
clearFormValues();
@@ -90,10 +93,16 @@ public class DampeningAlertDefinitionForm extends DynamicForm
implements EditAle
@Override
public void clearFormValues() {
// TODO component.clearValue();
+
+ markForRedraw();
}
private void buildForm() {
- // TODO build components
- // TODO setFields(components);
+ if (!formBuilt) {
+ // TODO build components
+ // TODO setFields(components);
+
+ formBuilt = true;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
index 712013c..3b46437 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
@@ -23,6 +23,8 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.LinkedHashMap;
+
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -75,12 +77,12 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm
implements
@Override
public AlertDefinition getAlertDefinition() {
- return this.alertDefinition;
+ return alertDefinition;
}
@Override
public void setAlertDefinition(AlertDefinition alertDef) {
- this.alertDefinition = alertDef;
+ alertDefinition = alertDef;
buildForm();
@@ -93,7 +95,7 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm
implements
descriptionTextField.setValue(alertDef.getDescription());
descriptionStatic.setValue(alertDef.getDescription());
- prioritySelection.setValue(alertDef.getPriority().getDisplayName());
+ prioritySelection.setValue(alertDef.getPriority().name());
priorityStatic.setValue(alertDef.getPriority().getDisplayName());
enabledSelection.setValue(alertDef.getEnabled() ? "Yes" :
"No");
@@ -123,11 +125,15 @@ public class GeneralPropertiesAlertDefinitionForm extends
DynamicForm implements
readOnlySelection.show();
readOnlyStatic.hide();
- Integer parentId = this.alertDefinition.getParentId();
- if ((parentId == null || parentId.intValue() == 0) &&
(this.alertDefinition.getGroupAlertDefinition() == null)) {
- readOnlySelection.hide();
+ if (alertDefinition != null) {
+ Integer parentId = alertDefinition.getParentId();
+ if ((parentId == null || parentId.intValue() == 0) &&
(alertDefinition.getGroupAlertDefinition() == null)) {
+ readOnlySelection.hide();
+ } else {
+ readOnlySelection.show();
+ }
} else {
- readOnlySelection.show();
+ readOnlySelection.hide();
}
readOnlyStatic.hide();
@@ -151,11 +157,15 @@ public class GeneralPropertiesAlertDefinitionForm extends
DynamicForm implements
readOnlySelection.hide();
readOnlyStatic.show();
- Integer parentId = this.alertDefinition.getParentId();
- if ((parentId == null || parentId.intValue() == 0) &&
(this.alertDefinition.getGroupAlertDefinition() == null)) {
- readOnlyStatic.hide();
+ if (alertDefinition != null) {
+ Integer parentId = alertDefinition.getParentId();
+ if ((parentId == null || parentId.intValue() == 0) &&
(alertDefinition.getGroupAlertDefinition() == null)) {
+ readOnlyStatic.hide();
+ } else {
+ readOnlyStatic.show();
+ }
} else {
- readOnlyStatic.show();
+ readOnlyStatic.hide();
}
readOnlySelection.hide();
@@ -164,7 +174,14 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm
implements
@Override
public void saveAlertDefinition() {
- // TODO Auto-generated method stub
+ alertDefinition.setName(nameTextField.getValue().toString());
+ alertDefinition.setDescription(descriptionTextField.getValue().toString());
+
+ String prioritySelected = prioritySelection.getValue().toString();
+ alertDefinition.setPriority(AlertPriority.valueOf(prioritySelected));
+
+ alertDefinition.setEnabled("Yes".equals(enabledSelection.getValue()));
+
alertDefinition.setReadOnly("Yes".equals(readOnlySelection.getValue()));
}
@Override
@@ -188,16 +205,21 @@ public class GeneralPropertiesAlertDefinitionForm extends
DynamicForm implements
if (!formBuilt) {
nameTextField = new TextItem("name", "Name");
nameTextField.setWidth(300);
+ nameTextField.setDefaultValue("");
nameStatic = new StaticTextItem("nameStatic", "Name");
descriptionTextField = new TextAreaItem("description",
"Description");
descriptionTextField.setWidth(300);
+ descriptionTextField.setDefaultValue("");
descriptionStatic = new StaticTextItem("descriptionStatic",
"Description");
prioritySelection = new SelectItem("priority",
"Priority");
- prioritySelection.setValueMap(AlertPriority.HIGH.getDisplayName(),
AlertPriority.MEDIUM.getDisplayName(),
- AlertPriority.LOW.getDisplayName());
- prioritySelection.setDefaultValue(AlertPriority.MEDIUM.getDisplayName());
+ LinkedHashMap<String, String> priorities = new LinkedHashMap<String,
String>(3);
+ priorities.put(AlertPriority.HIGH.name(),
AlertPriority.HIGH.getDisplayName());
+ priorities.put(AlertPriority.MEDIUM.name(),
AlertPriority.MEDIUM.getDisplayName());
+ priorities.put(AlertPriority.LOW.name(),
AlertPriority.LOW.getDisplayName());
+ prioritySelection.setValueMap(priorities);
+ prioritySelection.setDefaultValue(AlertPriority.MEDIUM.name());
priorityStatic = new StaticTextItem("priorityStatic",
"Priority");
enabledSelection = new RadioGroupItem("enabled",
"Enabled");
@@ -205,11 +227,12 @@ public class GeneralPropertiesAlertDefinitionForm extends
DynamicForm implements
enabledSelection.setDefaultValue("Yes");
enabledStatic = new StaticTextItem("enabledStatic",
"Enabled");
- readOnlySelection = new RadioGroupItem("readOnly", "Read
Only");
+ readOnlySelection = new RadioGroupItem("readOnly",
"Protected");
readOnlySelection.setValueMap("Yes", "No");
readOnlySelection.setDefaultValue("Yes");
- readOnlySelection.setPrompt("If true, the parent definition will not
override this alert definition");
- readOnlyStatic = new StaticTextItem("readOnlyStatic", "Read
Only");
+ readOnlySelection
+ .setPrompt("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.");
+ readOnlyStatic = new StaticTextItem("readOnlyStatic",
"Protected");
setFields(nameTextField, nameStatic, descriptionTextField, descriptionStatic,
prioritySelection,
priorityStatic, enabledSelection, enabledStatic, readOnlySelection,
readOnlyStatic);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
index 948656a..ab79d1c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
@@ -34,6 +34,8 @@ public class NotificationsAlertDefinitionForm extends DynamicForm
implements Edi
private AlertDefinition alertDefinition;
+ private boolean formBuilt = false;
+
public NotificationsAlertDefinitionForm() {
this(null);
}
@@ -46,8 +48,7 @@ public class NotificationsAlertDefinitionForm extends DynamicForm
implements Edi
protected void onDraw() {
super.onDraw();
- // TODO only build form if we didn't do it yet
- if (true) {
+ if (!formBuilt) {
buildForm();
setAlertDefinition(alertDefinition);
makeViewOnly();
@@ -56,12 +57,14 @@ public class NotificationsAlertDefinitionForm extends DynamicForm
implements Edi
@Override
public AlertDefinition getAlertDefinition() {
- return this.alertDefinition;
+ return alertDefinition;
}
@Override
public void setAlertDefinition(AlertDefinition alertDef) {
- this.alertDefinition = alertDef;
+ alertDefinition = alertDef;
+
+ buildForm();
if (alertDef == null) {
clearFormValues();
@@ -90,10 +93,16 @@ public class NotificationsAlertDefinitionForm extends DynamicForm
implements Edi
@Override
public void clearFormValues() {
// TODO component.clearValue();
+
+ markForRedraw();
}
private void buildForm() {
- // TODO build components
- // TODO setFields(components);
+ if (!formBuilt) {
+ // TODO build components
+ // TODO setFields(components);
+
+ formBuilt = true;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
index e95c771..cff9ad7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
@@ -62,12 +62,12 @@ public class RecoveryAlertDefinitionForm extends DynamicForm
implements EditAler
@Override
public AlertDefinition getAlertDefinition() {
- return this.alertDefinition;
+ return alertDefinition;
}
@Override
public void setAlertDefinition(AlertDefinition alertDef) {
- this.alertDefinition = alertDef;
+ alertDefinition = alertDef;
buildForm();
@@ -99,6 +99,8 @@ public class RecoveryAlertDefinitionForm extends DynamicForm implements
EditAler
public void clearFormValues() {
recoverAlertSelection.clearValue();
disableWhenFiredSelection.clearValue();
+
+ markForRedraw();
}
private void buildForm() {
@@ -113,6 +115,7 @@ public class RecoveryAlertDefinitionForm extends DynamicForm
implements EditAler
disableWhenFiredSelection.setDefaultValue("Yes");
setFields(recoverAlertSelection, disableWhenFiredSelection);
+
formBuilt = true;
}
}
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 36c146c..6d01e26 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
@@ -27,6 +27,8 @@ import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.resource.Resource;
/**
@@ -68,12 +70,17 @@ public class ResourceAlertDefinitionsView extends
AbstractAlertDefinitionsView {
@Override
protected void newButtonPressed(ListGridRecord[] selection) {
- // TODO Auto-generated method stub
- String str = "this is not implemented yet but you selected";
- for (ListGridRecord record : selection) {
- str += ": " + record.getAttribute("name");
- }
- SC.say(str);
+ // create an empty one with all defaults
+ AlertDefinition newAlertDef = new AlertDefinition();
+ newAlertDef.setDeleted(false);
+ newAlertDef.setEnabled(true);
+ newAlertDef.setNotifyFiltered(false);
+ newAlertDef.setParentId(Integer.valueOf(0));
+ newAlertDef.setPriority(AlertPriority.MEDIUM);
+ newAlertDef.setWillRecover(false);
+
+ showSingleAlertDefinitionView(newAlertDef);
+ getSingleAlertDefinitionView().makeEditable();
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
index eff934f..810d31e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
@@ -107,6 +107,7 @@ public class SingleAlertDefinitionView extends VLayout {
@Override
public void onClick(ClickEvent event) {
saveAlertDefinition();
+ setAlertDefinition(getAlertDefinition()); // loads data into static
fields
makeViewOnly();
// TODO getAlertDefinition() should now have the new user data - commit
it to DB
commit 761b250755f3b21feeace531c324afeb13b36d54
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Aug 13 10:12:00 2010 -0400
add the missing pieces to finish up filtering MeasurementSchedules by resourceTypeId
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
index c82c98e..a4c8a09 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
@@ -53,6 +53,7 @@ public class MeasurementScheduleCriteria extends Criteria {
// filter fields
public static final String FILTER_FIELD_RESOURCE_ID = "resourceId";
public static final String FILTER_FIELD_RESOURCE_GROUP_ID =
"resourceGroupId";
+ public static final String FILTER_FIELD_RESOURCE_TYPE_ID =
"resourceTypeId";
private Integer filterId;
private Boolean filterEnabled;
@@ -89,6 +90,7 @@ public class MeasurementScheduleCriteria extends Criteria {
+ " FROM Resource res " //
+ " JOIN res.parentResource parent " //
+ " WHERE parent.id = ? )");
+ filterOverrides.put(FILTER_FIELD_RESOURCE_TYPE_ID, "resource.type.id =
?");
sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id");
sortOverrides.put(SORT_FIELD_NAME, "definition.name");
@@ -130,6 +132,10 @@ public class MeasurementScheduleCriteria extends Criteria {
this.filterAutoGroupParentResourceId = filterAutoGroupParentResourceId;
}
+ public void addFilterResourceTypeId(Integer filterResourceTypeId) {
+ this.filterResourceTypeId = filterResourceTypeId;
+ }
+
public void fetchBaseline(boolean fetchBaseline) {
this.fetchBaseline = fetchBaseline;
}
commit 5e99a1a17683741a4fc7f92376e6269a7a73ddf3
Merge: 602b409... 9964a96...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 13 03:04:34 2010 -0400
Merge branch 'master' into alert-def-gwt
commit 602b40901e514a475854f00219e790cb5d6d0f47
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 13 03:02:06 2010 -0400
the start of the GWT resource alert definition tab
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index 23ecc44..807d3d3 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -475,6 +475,10 @@ public class AlertDefinition implements Serializable {
return this.ctime;
}
+ public void setCtime(long ctime) {
+ this.ctime = ctime;
+ }
+
@PrePersist
void onPersist() {
this.mtime = this.ctime = System.currentTimeMillis();
@@ -484,6 +488,10 @@ public class AlertDefinition implements Serializable {
return this.mtime;
}
+ public void setMtime(long mtime) {
+ this.mtime = mtime;
+ }
+
@PreUpdate
void onUpdate() {
this.mtime = System.currentTimeMillis();
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java
index 62c9a92..87ebf60 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java
@@ -1,25 +1,25 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.domain.alert;
public enum BooleanExpression {
@@ -38,4 +38,4 @@ public enum BooleanExpression {
* processing
*/
COMPLEX; // <-- not currently supported
-}
\ No newline at end of file
+}; // gwt compiler wants semicolon
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 9ddf148..298a6e5 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
@@ -52,10 +52,10 @@ public class AlertDefinitionCriteria extends Criteria {
private List<Integer> filterResourceIds; // requires overrides
private List<Integer> filterResourceGroupIds; // requires overrides
private Boolean filterEnabled;
- private String filterOperationName; // requires overrides
private Boolean filterDeleted = false; // find enabled definitions by default
private boolean fetchAlerts;
+ private boolean fetchGroupAlertDefinition;
private boolean fetchConditions;
private boolean fetchAlertNotifications;
@@ -68,7 +68,6 @@ public class AlertDefinitionCriteria extends Criteria {
filterOverrides.put("alertTemplateResourceTypeName",
"resourceType.name like ?");
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
filterOverrides.put("resourceGroupIds", "resourceGroup.id IN ( ?
)");
- filterOverrides.put("operationName", "operationDefinition.name
like ?");
}
@Override
@@ -116,10 +115,6 @@ public class AlertDefinitionCriteria extends Criteria {
this.filterEnabled = filterEnabled;
}
- public void addFilterOperationName(String filterOperationName) {
- this.filterOperationName = filterOperationName;
- }
-
public void addFilterDeleted(Boolean filterDeleted) {
this.filterDeleted = filterDeleted;
}
@@ -128,6 +123,10 @@ public class AlertDefinitionCriteria extends Criteria {
this.fetchAlerts = fetchAlerts;
}
+ public void fetchGroupAlertDefinition(boolean fetchGroupAlertDefinition) {
+ this.fetchGroupAlertDefinition = fetchGroupAlertDefinition;
+ }
+
public void fetchConditions(boolean fetchConditions) {
this.fetchConditions = fetchConditions;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
new file mode 100644
index 0000000..c3c6660
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
@@ -0,0 +1,133 @@
+/*
+ * 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.alert.definitions;
+
+import java.util.Date;
+
+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.fields.DataSourceTextField;
+import com.smartgwt.client.types.FieldType;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ * @author John Mazzitelli
+ */
+public abstract class AbstractAlertDefinitionsDataSource extends
RPCDataSource<AlertDefinition> {
+
+ protected static final String FIELD_ID = "id";
+ protected static final String FIELD_NAME = "name";
+ protected static final String FIELD_DESCRIPTION = "description";
+ protected static final String FIELD_CTIME = "ctime";
+ protected static final String FIELD_MTIME = "mtime";
+ protected static final String FIELD_ENABLED = "enabled";
+ protected static final String FIELD_DELETED = "deleted";
+ protected static final String FIELD_PRIORITY = "priority"; // not the
actual object; a string for the UI
+ protected static final String FIELD_PRIORITY_ENUM = "priority_enum"; // the
actual enum name
+
+ public AbstractAlertDefinitionsDataSource() {
+ setupFields();
+ }
+
+ @Override
+ public AlertDefinition copyValues(ListGridRecord from) {
+ AlertDefinition alertDef = new AlertDefinition();
+ alertDef.setId(from.getAttributeAsInt(FIELD_ID));
+ alertDef.setName(from.getAttributeAsString(FIELD_NAME));
+ alertDef.setDescription(from.getAttributeAsString(FIELD_DESCRIPTION));
+ alertDef.setCtime(from.getAttributeAsDate(FIELD_CTIME).getTime());
+ alertDef.setMtime(from.getAttributeAsDate(FIELD_MTIME).getTime());
+ alertDef.setEnabled(from.getAttributeAsBoolean(FIELD_ENABLED));
+
alertDef.setPriority(AlertPriority.valueOf(from.getAttributeAsString(FIELD_PRIORITY_ENUM)));
+ return alertDef;
+ }
+
+ @Override
+ public ListGridRecord copyValues(AlertDefinition from) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_ID, from.getId());
+ record.setAttribute(FIELD_NAME, from.getName());
+ record.setAttribute(FIELD_DESCRIPTION, from.getDescription());
+ record.setAttribute(FIELD_CTIME, new Date(from.getCtime()));
+ record.setAttribute(FIELD_MTIME, new Date(from.getMtime()));
+ record.setAttribute(FIELD_ENABLED, from.getEnabled());
+ record.setAttribute(FIELD_DELETED, from.getDeleted());
+ record.setAttribute(FIELD_PRIORITY, from.getPriority().getDisplayName());
+ record.setAttribute(FIELD_PRIORITY_ENUM, from.getPriority().name());
+ return record;
+ }
+
+ /**
+ * Sets up some basic alert definition fields for this data source. Subclasses are
+ * free to call this method and then add more, or add their own custom set and not
+ * call this method at all (if they don't want some of these basic fields or want
to reorder them).
+ */
+ protected void setupFields() {
+ DataSourceTextField nameField = new DataSourceTextField(FIELD_NAME,
"Name");
+ addField(nameField);
+
+ DataSourceTextField descriptionField = new DataSourceTextField(FIELD_DESCRIPTION,
"Description");
+ addField(descriptionField);
+
+ DataSourceTextField ctimeField = new DataSourceTextField(FIELD_CTIME,
"Created Time");
+ ctimeField.setType(FieldType.DATETIME);
+ addField(ctimeField);
+
+ DataSourceTextField mtimeField = new DataSourceTextField(FIELD_MTIME,
"Modified Time");
+ mtimeField.setType(FieldType.DATETIME);
+ addField(mtimeField);
+
+ DataSourceTextField enabledField = new DataSourceTextField(FIELD_ENABLED,
"Enabled");
+ enabledField.setType(FieldType.BOOLEAN);
+ addField(enabledField);
+
+ DataSourceTextField priorityField = new DataSourceTextField(FIELD_PRIORITY,
"Priority");
+ addField(priorityField);
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+ AlertDefinitionCriteria criteria = getCriteria(request);
+ GWTServiceLookup.getAlertService().findAlertDefinitionsByCriteria(criteria,
+ new AsyncCallback<PageList<AlertDefinition>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load alert
definition data", caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<AlertDefinition> result) {
+ response.setData(buildRecords(result));
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ protected abstract AlertDefinitionCriteria getCriteria(DSRequest request);
+}
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
new file mode 100644
index 0000000..6c6aa9f
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
@@ -0,0 +1,149 @@
+/*
+ * 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.alert.definitions;
+
+import com.smartgwt.client.data.Criteria;
+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.VLayout;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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.components.table.Table.SelectionEnablement;
+
+/**
+ * Superclass to the different alert definition views. This should be subclassed
+ * to obtain resource, group, and template alert definition views.
+ *
+ * @author John Mazzitelli
+ */
+public abstract class AbstractAlertDefinitionsView extends VLayout {
+
+ private SingleAlertDefinitionView singleAlertDefinitionView;
+
+ public AbstractAlertDefinitionsView() {
+ setWidth100();
+ setHeight100();
+ setMembersMargin(10);
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ Criteria criteria = getCriteria();
+ final Table table = new Table(getTableTitle(), criteria);
+ table.setDataSource(getAlertDefinitionDataSource());
+ table.getListGrid().setUseAllDataSourceFields(true);
+
+ table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ AlertDefinition alertDef = null;
+ ListGridRecord selectedRecord = null;
+ ListGridRecord[] allSelections = selectionEvent.getSelection();
+ if (allSelections != null && allSelections.length == 1) {
+ selectedRecord = allSelections[0];
+ }
+ if (selectedRecord != null) {
+ alertDef = ((AbstractAlertDefinitionsDataSource)
table.getDataSource()).copyValues(selectedRecord);
+ table.setHeight("33%");
+ table.setShowResizeBar(true);
+ singleAlertDefinitionView.setHeight("67%");
+ singleAlertDefinitionView.show();
+ singleAlertDefinitionView.setAlertDefinition(alertDef);
+ } else {
+ table.setHeight100();
+ table.setShowResizeBar(false);
+ singleAlertDefinitionView.hide();
+ }
+ markForRedraw();
+ }
+ });
+
+ boolean permitted = isAllowedToModifyAlerts();
+
+ table.addTableAction("New", (permitted) ? SelectionEnablement.ALWAYS :
SelectionEnablement.NEVER, null,
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ newButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
+
+ table.addTableAction("Enable", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
+ "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ enableButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
+
+ table.addTableAction("Disable", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
+ "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ disableButtonPressed(selection);
+ }
+ });
+
+ table.addTableAction("Delete", (permitted) ? SelectionEnablement.ANY :
SelectionEnablement.NEVER,
+ "Are You Sure?", new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ deleteButtonPressed(selection);
+ CoreGUI.refresh();
+ }
+ });
+
+ addMember(table);
+
+ this.singleAlertDefinitionView = buildSingleAlertDefinitionView();
+ this.singleAlertDefinitionView.hide();
+ this.singleAlertDefinitionView.setWidth100();
+ this.singleAlertDefinitionView.setHeight100();
+ this.singleAlertDefinitionView.setMargin(10);
+ addMember(this.singleAlertDefinitionView);
+ }
+
+ protected SingleAlertDefinitionView getSingleAlertDefinitionView() {
+ return this.singleAlertDefinitionView;
+ }
+
+ protected SingleAlertDefinitionView buildSingleAlertDefinitionView() {
+ SingleAlertDefinitionView singleAlertDefinitionView = new
SingleAlertDefinitionView();
+ return singleAlertDefinitionView;
+ }
+
+ protected abstract String getTableTitle();
+
+ protected abstract Criteria getCriteria();
+
+ protected abstract AbstractAlertDefinitionsDataSource
getAlertDefinitionDataSource();
+
+ protected abstract boolean isAllowedToModifyAlerts();
+
+ protected abstract void newButtonPressed(ListGridRecord[] selection);
+
+ protected abstract void deleteButtonPressed(ListGridRecord[] selection);
+
+ protected abstract void enableButtonPressed(ListGridRecord[] selection);
+
+ protected abstract void disableButtonPressed(ListGridRecord[] selection);
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java
deleted file mode 100644
index e8ec455..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java
+++ /dev/null
@@ -1,194 +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.alert.definitions;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.xml.bind.annotation.XmlTransient;
-
-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.DSResponse;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
-import com.smartgwt.client.data.fields.DataSourceTextField;
-import com.smartgwt.client.types.FieldType;
-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.AlertDampening;
-import org.rhq.core.domain.alert.AlertDampeningEvent;
-import org.rhq.core.domain.alert.AlertDefinition;
-import org.rhq.core.domain.alert.AlertDefinitionContext;
-import org.rhq.core.domain.alert.AlertPriority;
-import org.rhq.core.domain.alert.BooleanExpression;
-import org.rhq.core.domain.alert.notification.AlertNotification;
-import org.rhq.core.domain.criteria.AlertCriteria;
-import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-
-/**
- * @author Greg Hinkle
- */
-public class AlertDefinitionsDataSource extends RPCDataSource<AlertDefinition> {
-
-
- public AlertDefinitionsDataSource() {
-
- DataSourceIntegerField idField = new
DataSourceIntegerField("id","ID");
- idField.setPrimaryKey(true);
- addField(idField);
-
- DataSourceTextField nameField = new
DataSourceTextField("name","Name");
- addField(nameField);
-
- DataSourceTextField ctimeField = new
DataSourceTextField("ctime","Created Time");
- ctimeField.setType(FieldType.DATETIME);
- addField(ctimeField);
-
- DataSourceTextField mtimeField = new DataSourceTextField("mtime",
"Modified Time");
- mtimeField.setType(FieldType.DATETIME);
- addField(mtimeField);
-
- DataSourceTextField descriptionField = new
DataSourceTextField("description","Description");
- addField(descriptionField);
-
- DataSourceTextField priorityField = new
DataSourceTextField("priority","Priority");
- addField(priorityField);
-
- DataSourceTextField enabledField = new
DataSourceTextField("enabled","Enabled");
- enabledField.setType(FieldType.BOOLEAN);
- addField(enabledField);
-
- }
-
- @Override
- protected void executeFetch(final DSRequest request, final DSResponse response) {
-
- AlertDefinitionCriteria criteria = getCriteria(request);
-
- GWTServiceLookup.getAlertService().findAlertDefinitionsByCriteria(
- criteria,
- new AsyncCallback<PageList<AlertDefinition>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load alert
definition data", caught);
- response.setStatus(DSResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(PageList<AlertDefinition> result) {
- response.setData(buildRecords(result));
- processResponse(request.getRequestId(), response);
- }
- }
- );
- }
-
-
- protected AlertDefinitionCriteria getCriteria(DSRequest request) {
- AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
- criteria.fetchConditions(true);
-
- Criteria requestCriteria = request.getCriteria();
- if (requestCriteria != null) {
- Map values = requestCriteria.getValues();
- for (Object key : values.keySet()) {
- String fieldName = (String) key;
- if (fieldName.equals("resourceId")) {
- Integer resourceId = (Integer) values.get(fieldName);
- criteria.addFilterResourceIds(resourceId);
- }
- // TODO: Add support for other fields we need to filter by (e.g.
resourceGroupId).
- }
- }
-
- criteria.setPageControl(getPageControl(request));
- return criteria;
- }
-
-
- @Override
- public AlertDefinition copyValues(ListGridRecord from) {
- return null; // TODO: Implement this method.
- }
-
- @Override
- public ListGridRecord copyValues(AlertDefinition from) {
- ListGridRecord record = new ListGridRecord();
-
- record.setAttribute("id", from.getId());
- record.setAttribute("name", from.getName());
- record.setAttribute("ctime", new Date(from.getCtime()));
- record.setAttribute("mtime", new Date(from.getMtime()));
- record.setAttribute("parentId", from.getParentId());
- record.setAttribute("description", from.getDescription());
- record.setAttribute("priority", from.getPriority().getDisplayName());
- record.setAttribute("enabled", from.getEnabled());
-
- record.setAttribute("recoveryId", from.getRecoveryId());
- record.setAttribute("willRecover", from.getWillRecover());
- record.setAttribute("notifyFiltered", from.getNotifyFiltered());
- record.setAttribute("controlFiltered", from.getControlFiltered());
- record.setAttribute("deleted", from.getDeleted());
- record.setAttribute("readOnly", from.isReadOnly());
- record.setAttribute("conditionExpression",
from.getConditionExpression());
-
-
- return record;
- }
-
-
-/*
-The following is not yet translated into the record
- private AlertDefinition groupAlertDefinition;
- private Set<AlertDefinition> groupAlertDefinitionChildren = new
LinkedHashSet<AlertDefinition>();
- private AlertDampening alertDampening;
- private BooleanExpression conditionExpression;
- private Set<AlertCondition> conditions = new
LinkedHashSet<AlertCondition>(1); // Most alerts will only have one condition.
- private List<AlertNotification> alertNotifications = new
ArrayList<AlertNotification>();
- private OperationDefinition operationDefinition;
- private Set<AlertDampeningEvent> alertDampeningEvents = new
HashSet<AlertDampeningEvent>();
- private Set<Alert> alerts = new LinkedHashSet<Alert>();
-*/
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
deleted file mode 100644
index 0e35a55..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
+++ /dev/null
@@ -1,69 +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.alert.definitions;
-
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-import org.rhq.core.domain.resource.Resource;
-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.inventory.resource.detail.alert.AlertEditView;
-
-/**
- * @author Greg Hinkle
- */
-public class AlertDefinitionsView extends VLayout {
-
- private Resource resource;
-
- public AlertDefinitionsView(Resource resource) {
- setWidth100();
- this.resource = resource;
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- Criteria criteria = new Criteria();
- criteria.addCriteria("resourceId",resource.getId());
-
- Table table = new Table("Alert Definitions", criteria);
- table.setDataSource(new AlertDefinitionsDataSource());
- table.getListGrid().setUseAllDataSourceFields(true);
-
-
- table.addTableAction("New", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- new AlertEditView(resource).displayAsDialog();
- }
- });
-
- addMember(table);
- }
-
-
- public static AlertDefinitionsView getResourceView(Resource resource) {
- return new AlertDefinitionsView(resource);
- }
-
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
new file mode 100644
index 0000000..3f91844
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java
@@ -0,0 +1,106 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.alert.BooleanExpression;
+
+/**
+ * @author John Mazzitelli
+ */
+public class ConditionsAlertDefinitionForm extends DynamicForm implements
EditAlertDefinitionForm {
+
+ private AlertDefinition alertDefinition;
+
+ private SelectItem conditionExpression;
+
+ public ConditionsAlertDefinitionForm() {
+ this(null);
+ }
+
+ public ConditionsAlertDefinitionForm(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ if (conditionExpression == null) {
+ buildForm();
+ setAlertDefinition(alertDefinition);
+ makeViewOnly();
+ }
+ }
+
+ @Override
+ public AlertDefinition getAlertDefinition() {
+ return this.alertDefinition;
+ }
+
+ @Override
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ this.alertDefinition = alertDef;
+
+ if (alertDef == null) {
+ clearFormValues();
+ } else {
+ // TODO: why is cond expression always null????
+
//conditionExpression.setValue(alertDef.getConditionExpression().toString());
+ }
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeEditable() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void makeViewOnly() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void saveAlertDefinition() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void clearFormValues() {
+ conditionExpression.clearValue();
+ }
+
+ private void buildForm() {
+ conditionExpression = new SelectItem("conditionExpression", "Fire
alert when");
+ conditionExpression.setValueMap(BooleanExpression.ALL.toString(),
BooleanExpression.ANY.toString());
+ conditionExpression.setDefaultValue(BooleanExpression.ALL.toString());
+
+ setFields(conditionExpression);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
new file mode 100644
index 0000000..adf2173
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
@@ -0,0 +1,99 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+
+/**
+ * @author John Mazzitelli
+ */
+public class DampeningAlertDefinitionForm extends DynamicForm implements
EditAlertDefinitionForm {
+
+ private AlertDefinition alertDefinition;
+
+ public DampeningAlertDefinitionForm() {
+ this(null);
+ }
+
+ public DampeningAlertDefinitionForm(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ // TODO only build form if we didn't do it yet
+ if (true) {
+ buildForm();
+ setAlertDefinition(alertDefinition);
+ makeViewOnly();
+ }
+ }
+
+ @Override
+ public AlertDefinition getAlertDefinition() {
+ return this.alertDefinition;
+ }
+
+ @Override
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ this.alertDefinition = alertDef;
+
+ if (alertDef == null) {
+ clearFormValues();
+ } else {
+ // TODO set values of the components
+ }
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeEditable() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void makeViewOnly() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void saveAlertDefinition() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void clearFormValues() {
+ // TODO component.clearValue();
+ }
+
+ private void buildForm() {
+ // TODO build components
+ // TODO setFields(components);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
new file mode 100644
index 0000000..439ed3e
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
@@ -0,0 +1,21 @@
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+
+/**
+ * @author John Mazzitelli
+ */
+public interface EditAlertDefinitionForm {
+
+ AlertDefinition getAlertDefinition();
+
+ void setAlertDefinition(AlertDefinition alertDef);
+
+ void makeEditable();
+
+ void makeViewOnly();
+
+ void saveAlertDefinition();
+
+ void clearFormValues();
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
new file mode 100644
index 0000000..712013c
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
@@ -0,0 +1,221 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextAreaItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.alert.AlertPriority;
+
+/**
+ * @author John Mazzitelli
+ */
+public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements
EditAlertDefinitionForm {
+
+ private AlertDefinition alertDefinition;
+
+ private TextItem nameTextField;
+ private TextAreaItem descriptionTextField;
+ private SelectItem prioritySelection;
+ private RadioGroupItem enabledSelection;
+ private RadioGroupItem readOnlySelection;
+
+ private StaticTextItem nameStatic;
+ private StaticTextItem descriptionStatic;
+ private StaticTextItem priorityStatic;
+ private StaticTextItem enabledStatic;
+ private StaticTextItem readOnlyStatic;
+
+ private boolean formBuilt = false;
+
+ public GeneralPropertiesAlertDefinitionForm() {
+ this(null);
+ }
+
+ public GeneralPropertiesAlertDefinitionForm(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ if (!formBuilt) {
+ buildForm();
+ setAlertDefinition(alertDefinition);
+ makeViewOnly();
+ }
+ }
+
+ @Override
+ public AlertDefinition getAlertDefinition() {
+ return this.alertDefinition;
+ }
+
+ @Override
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ this.alertDefinition = alertDef;
+
+ buildForm();
+
+ if (alertDef == null) {
+ clearFormValues();
+ } else {
+ nameTextField.setValue(alertDef.getName());
+ nameStatic.setValue(alertDef.getName());
+
+ descriptionTextField.setValue(alertDef.getDescription());
+ descriptionStatic.setValue(alertDef.getDescription());
+
+ prioritySelection.setValue(alertDef.getPriority().getDisplayName());
+ priorityStatic.setValue(alertDef.getPriority().getDisplayName());
+
+ enabledSelection.setValue(alertDef.getEnabled() ? "Yes" :
"No");
+ enabledStatic.setValue(alertDef.getEnabled() ? "Yes" :
"No");
+
+ readOnlySelection.setValue(alertDef.isReadOnly() ? "Yes" :
"No");
+ readOnlyStatic.setValue(alertDef.isReadOnly() ? "Yes" :
"No");
+ }
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeEditable() {
+ nameTextField.show();
+ nameStatic.hide();
+
+ descriptionTextField.show();
+ descriptionStatic.hide();
+
+ prioritySelection.show();
+ priorityStatic.hide();
+
+ enabledSelection.show();
+ enabledStatic.hide();
+
+ readOnlySelection.show();
+ readOnlyStatic.hide();
+
+ Integer parentId = this.alertDefinition.getParentId();
+ if ((parentId == null || parentId.intValue() == 0) &&
(this.alertDefinition.getGroupAlertDefinition() == null)) {
+ readOnlySelection.hide();
+ } else {
+ readOnlySelection.show();
+ }
+ readOnlyStatic.hide();
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeViewOnly() {
+ nameTextField.hide();
+ nameStatic.show();
+
+ descriptionTextField.hide();
+ descriptionStatic.show();
+
+ prioritySelection.hide();
+ priorityStatic.show();
+
+ enabledSelection.hide();
+ enabledStatic.show();
+
+ readOnlySelection.hide();
+ readOnlyStatic.show();
+
+ Integer parentId = this.alertDefinition.getParentId();
+ if ((parentId == null || parentId.intValue() == 0) &&
(this.alertDefinition.getGroupAlertDefinition() == null)) {
+ readOnlyStatic.hide();
+ } else {
+ readOnlyStatic.show();
+ }
+ readOnlySelection.hide();
+
+ markForRedraw();
+ }
+
+ @Override
+ public void saveAlertDefinition() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void clearFormValues() {
+ nameTextField.clearValue();
+ descriptionTextField.clearValue();
+ prioritySelection.clearValue();
+ enabledSelection.clearValue();
+ readOnlySelection.clearValue();
+
+ nameStatic.clearValue();
+ descriptionStatic.clearValue();
+ priorityStatic.clearValue();
+ enabledStatic.clearValue();
+ readOnlyStatic.clearValue();
+
+ markForRedraw();
+ }
+
+ private void buildForm() {
+ if (!formBuilt) {
+ nameTextField = new TextItem("name", "Name");
+ nameTextField.setWidth(300);
+ nameStatic = new StaticTextItem("nameStatic", "Name");
+
+ descriptionTextField = new TextAreaItem("description",
"Description");
+ descriptionTextField.setWidth(300);
+ descriptionStatic = new StaticTextItem("descriptionStatic",
"Description");
+
+ prioritySelection = new SelectItem("priority",
"Priority");
+ prioritySelection.setValueMap(AlertPriority.HIGH.getDisplayName(),
AlertPriority.MEDIUM.getDisplayName(),
+ AlertPriority.LOW.getDisplayName());
+ prioritySelection.setDefaultValue(AlertPriority.MEDIUM.getDisplayName());
+ priorityStatic = new StaticTextItem("priorityStatic",
"Priority");
+
+ enabledSelection = new RadioGroupItem("enabled",
"Enabled");
+ enabledSelection.setValueMap("Yes", "No");
+ enabledSelection.setDefaultValue("Yes");
+ enabledStatic = new StaticTextItem("enabledStatic",
"Enabled");
+
+ readOnlySelection = new RadioGroupItem("readOnly", "Read
Only");
+ readOnlySelection.setValueMap("Yes", "No");
+ readOnlySelection.setDefaultValue("Yes");
+ readOnlySelection.setPrompt("If true, the parent definition will not
override this alert definition");
+ readOnlyStatic = new StaticTextItem("readOnlyStatic", "Read
Only");
+
+ setFields(nameTextField, nameStatic, descriptionTextField, descriptionStatic,
prioritySelection,
+ priorityStatic, enabledSelection, enabledStatic, readOnlySelection,
readOnlyStatic);
+
+ formBuilt = true;
+ }
+
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java
new file mode 100644
index 0000000..90f9490
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java
@@ -0,0 +1,57 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import java.util.Map;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
+
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
+
+/**
+ * @author John Mazzitelli
+ */
+public class GroupAlertDefinitionsDataSource extends AbstractAlertDefinitionsDataSource
{
+
+ @Override
+ protected AlertDefinitionCriteria getCriteria(DSRequest request) {
+ AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+
+ Criteria requestCriteria = request.getCriteria();
+ if (requestCriteria != null) {
+ Map values = requestCriteria.getValues();
+ for (Object key : values.keySet()) {
+ String fieldName = (String) key;
+ if (fieldName.equals(GroupAlertDefinitionsView.CRITERIA_GROUP_ID)) {
+ Integer resourceId = (Integer) values.get(fieldName);
+ criteria.addFilterResourceGroupIds(resourceId);
+ }
+ }
+ }
+
+ criteria.setPageControl(getPageControl(request));
+ return criteria;
+ }
+}
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
new file mode 100644
index 0000000..7283f8f
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java
@@ -0,0 +1,108 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.resource.group.ResourceGroup;
+
+/**
+ * @author John Mazzitelli
+ */
+public class GroupAlertDefinitionsView extends AbstractAlertDefinitionsView {
+
+ public static final String CRITERIA_GROUP_ID = "groupId";
+
+ private ResourceGroup group;
+
+ public GroupAlertDefinitionsView(ResourceGroup group) {
+ super();
+ this.group = group;
+ }
+
+ @Override
+ protected Criteria getCriteria() {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(CRITERIA_GROUP_ID, group.getId());
+ return criteria;
+ }
+
+ @Override
+ protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() {
+ return new GroupAlertDefinitionsDataSource();
+ }
+
+ @Override
+ protected String getTableTitle() {
+ return "Group Alert Definitions";
+ }
+
+ @Override
+ protected boolean isAllowedToModifyAlerts() {
+ // TODO: see if user can modify group alerts on this group
+ return true;
+ }
+
+ @Override
+ protected void newButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void enableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void disableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void deleteButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
new file mode 100644
index 0000000..948656a
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java
@@ -0,0 +1,99 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+
+/**
+ * @author John Mazzitelli
+ */
+public class NotificationsAlertDefinitionForm extends DynamicForm implements
EditAlertDefinitionForm {
+
+ private AlertDefinition alertDefinition;
+
+ public NotificationsAlertDefinitionForm() {
+ this(null);
+ }
+
+ public NotificationsAlertDefinitionForm(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ // TODO only build form if we didn't do it yet
+ if (true) {
+ buildForm();
+ setAlertDefinition(alertDefinition);
+ makeViewOnly();
+ }
+ }
+
+ @Override
+ public AlertDefinition getAlertDefinition() {
+ return this.alertDefinition;
+ }
+
+ @Override
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ this.alertDefinition = alertDef;
+
+ if (alertDef == null) {
+ clearFormValues();
+ } else {
+ // TODO set values of the components
+ }
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeEditable() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void makeViewOnly() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void saveAlertDefinition() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void clearFormValues() {
+ // TODO component.clearValue();
+ }
+
+ private void buildForm() {
+ // TODO build components
+ // TODO setFields(components);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
new file mode 100644
index 0000000..e95c771
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java
@@ -0,0 +1,119 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+
+/**
+ * @author John Mazzitelli
+ */
+public class RecoveryAlertDefinitionForm extends DynamicForm implements
EditAlertDefinitionForm {
+
+ private AlertDefinition alertDefinition;
+
+ private SelectItem recoverAlertSelection;
+ private RadioGroupItem disableWhenFiredSelection;
+
+ private boolean formBuilt = false;
+
+ public RecoveryAlertDefinitionForm() {
+ this(null);
+ }
+
+ public RecoveryAlertDefinitionForm(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ if (!formBuilt) {
+ buildForm();
+ setAlertDefinition(alertDefinition);
+ makeViewOnly();
+ }
+ }
+
+ @Override
+ public AlertDefinition getAlertDefinition() {
+ return this.alertDefinition;
+ }
+
+ @Override
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ this.alertDefinition = alertDef;
+
+ buildForm();
+
+ if (alertDef == null) {
+ clearFormValues();
+ } else {
+ disableWhenFiredSelection.setValue(alertDef.getWillRecover() ?
"Yes" : "No");
+ }
+
+ markForRedraw();
+ }
+
+ @Override
+ public void makeEditable() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void makeViewOnly() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void saveAlertDefinition() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void clearFormValues() {
+ recoverAlertSelection.clearValue();
+ disableWhenFiredSelection.clearValue();
+ }
+
+ private void buildForm() {
+ if (!formBuilt) {
+ recoverAlertSelection = new SelectItem("recoveryAlert",
"Recover Alert");
+ recoverAlertSelection.setValueMap("Select...");
+ recoverAlertSelection.setDefaultValue("Select...");
+ // TODO: call into server and get the menu list of all alerts that we can
recover
+
+ disableWhenFiredSelection = new RadioGroupItem("disableWhenFired",
"Disable When Fired");
+ disableWhenFiredSelection.setValueMap("Yes", "No");
+ disableWhenFiredSelection.setDefaultValue("Yes");
+
+ setFields(recoverAlertSelection, disableWhenFiredSelection);
+ formBuilt = true;
+ }
+ }
+}
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
new file mode 100644
index 0000000..ed19a24
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
@@ -0,0 +1,132 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import java.util.Map;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.fields.DataSourceLinkField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
+import org.rhq.core.domain.resource.Resource;
+
+/**
+ * @author John Mazzitelli
+ */
+public class ResourceAlertDefinitionsDataSource extends
AbstractAlertDefinitionsDataSource {
+
+ protected static final String FIELD_PARENT = "parent"; // the column field
- may be template or group alert def parent
+ protected static final String FIELD_PARENT_TEMPLATEID = "parent_tid"; //
the actual integer (may be 0) of template ID
+ protected static final String FIELD_PARENT_GROUPALERTDEF = "parentId_gad";
// the actual group alert def parent (may be null)
+ protected static final String FIELD_READONLY = "readOnly"; // not
necessarily the actual boolean; sometimes we display "N/A"
+ protected static final String FIELD_READONLY_BOOLEAN = "readOnly_boolean";
// the actual boolean value
+
+ private Resource resource;
+
+ public ResourceAlertDefinitionsDataSource(Resource resource) {
+ super();
+ this.resource = resource;
+ }
+
+ @Override
+ public AlertDefinition copyValues(ListGridRecord from) {
+ AlertDefinition alertDef = super.copyValues(from);
+ alertDef.setParentId(from.getAttributeAsInt(FIELD_PARENT_TEMPLATEID));
+ alertDef.setGroupAlertDefinition((AlertDefinition)
from.getAttributeAsObject(FIELD_PARENT_GROUPALERTDEF));
+ alertDef.setReadOnly(from.getAttributeAsBoolean(FIELD_READONLY_BOOLEAN));
+ return alertDef;
+ }
+
+ @Override
+ public ListGridRecord copyValues(AlertDefinition from) {
+ ListGridRecord record = super.copyValues(from);
+
+ Integer parentId = from.getParentId(); // a valid non-zero number means the alert
def came from a template
+ AlertDefinition groupAlertDefinition = from.getGroupAlertDefinition();
+ boolean readOnly = from.isReadOnly();
+
+ record.setAttribute(FIELD_PARENT_TEMPLATEID, parentId);
+ record.setAttribute(FIELD_PARENT_GROUPALERTDEF, groupAlertDefinition);
+ record.setAttribute(FIELD_READONLY_BOOLEAN, readOnly);
+
+ if ((parentId == null || parentId.intValue() == 0) &&
(groupAlertDefinition == null)) {
+ record.setAttribute(FIELD_PARENT, "");
+ record.setLinkText("");
+ record.setAttribute(FIELD_READONLY, "N/A");
+ } else {
+ // TODO: fix the URLs so they point to the new GWT pages when they are
implemented
+ if (parentId != null && parentId.intValue() != 0) {
+ record.setAttribute(FIELD_PARENT,
"/alerts/Config.do?mode=viewRoles&type="
+ + this.resource.getResourceType().getId() + "&from=" +
from.getId() + "&ad=" + parentId);
+ record.setLinkText("View Template");
+ } else {
+ record.setAttribute(FIELD_PARENT,
"/alerts/Config.do?mode=viewRoles&groupId="
+ + groupAlertDefinition.getResourceGroup().getId() +
"&from=" + from.getId() + "&ad="
+ + groupAlertDefinition.getId());
+ record.setLinkText("View Group Definition");
+ }
+ record.setAttribute(FIELD_READONLY, readOnly);
+ }
+
+ return record;
+ }
+
+ @Override
+ protected void setupFields() {
+ super.setupFields();
+
+ // add two more columns
+ DataSourceLinkField parentIdField = new DataSourceLinkField(FIELD_PARENT,
"Parent");
+ addField(parentIdField);
+
+ DataSourceTextField readOnlyField = new DataSourceTextField(FIELD_READONLY,
"Read Only");
+ addField(readOnlyField);
+ }
+
+ @Override
+ protected AlertDefinitionCriteria getCriteria(DSRequest request) {
+ AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+
+ criteria.fetchGroupAlertDefinition(true);
+
+ Criteria requestCriteria = request.getCriteria();
+ if (requestCriteria != null) {
+ Map values = requestCriteria.getValues();
+ for (Object key : values.keySet()) {
+ String fieldName = (String) key;
+ if (fieldName.equals(ResourceAlertDefinitionsView.CRITERIA_RESOURCE_ID))
{
+ Integer resourceId = (Integer) values.get(fieldName);
+ criteria.addFilterResourceIds(resourceId);
+ }
+ }
+ }
+
+ criteria.setPageControl(getPageControl(request));
+ 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
new file mode 100644
index 0000000..36c146c
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
@@ -0,0 +1,108 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.resource.Resource;
+
+/**
+ * @author John Mazzitelli
+ */
+public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView {
+
+ public static final String CRITERIA_RESOURCE_ID = "resourceId";
+
+ private Resource resource;
+
+ public ResourceAlertDefinitionsView(Resource resource) {
+ super();
+ this.resource = resource;
+ }
+
+ @Override
+ protected Criteria getCriteria() {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(CRITERIA_RESOURCE_ID, resource.getId());
+ return criteria;
+ }
+
+ @Override
+ protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() {
+ return new ResourceAlertDefinitionsDataSource(this.resource);
+ }
+
+ @Override
+ protected String getTableTitle() {
+ return "Alert Definitions";
+ }
+
+ @Override
+ protected boolean isAllowedToModifyAlerts() {
+ // TODO: see if user can modify alerts on this resource
+ return true;
+ }
+
+ @Override
+ protected void newButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void enableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void disableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void deleteButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
new file mode 100644
index 0000000..eff934f
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
@@ -0,0 +1,175 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.widgets.Button;
+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.VLayout;
+import com.smartgwt.client.widgets.tab.Tab;
+import com.smartgwt.client.widgets.tab.TabSet;
+
+import org.rhq.core.domain.alert.AlertDefinition;
+
+/**
+ * @author John Mazzitelli
+ */
+public class SingleAlertDefinitionView extends VLayout {
+
+ private AlertDefinition alertDefinition;
+ private GeneralPropertiesAlertDefinitionForm generalProperties;
+ private ConditionsAlertDefinitionForm conditions;
+ private NotificationsAlertDefinitionForm notifications;
+ private RecoveryAlertDefinitionForm recovery;
+ private DampeningAlertDefinitionForm dampening;
+
+ private Button editButton;
+ private Button saveButton;
+ private Button cancelButton;
+
+ public SingleAlertDefinitionView() {
+ this(null);
+ }
+
+ public SingleAlertDefinitionView(AlertDefinition alertDefinition) {
+ this.alertDefinition = alertDefinition;
+
+ TabSet tabSet = new TabSet();
+ tabSet.setHeight100();
+
+ Tab generalPropertiesTab = new Tab("General Properties");
+ generalProperties = new GeneralPropertiesAlertDefinitionForm(alertDefinition);
+ generalPropertiesTab.setPane(generalProperties);
+
+ Tab conditionsTab = new Tab("Conditions");
+ conditions = new ConditionsAlertDefinitionForm(alertDefinition);
+ conditionsTab.setPane(conditions);
+
+ Tab notificationsTab = new Tab("Notifications");
+ notifications = new NotificationsAlertDefinitionForm(alertDefinition);
+ notificationsTab.setPane(notifications);
+
+ Tab recoveryTab = new Tab("Recovery");
+ recovery = new RecoveryAlertDefinitionForm(alertDefinition);
+ recoveryTab.setPane(recovery);
+
+ Tab dampeningTab = new Tab("Dampening");
+ dampening = new DampeningAlertDefinitionForm(alertDefinition);
+ dampeningTab.setPane(dampening);
+
+ tabSet.setTabs(generalPropertiesTab, conditionsTab, notificationsTab,
recoveryTab, dampeningTab);
+
+ final HLayout buttons = new HLayout();
+ buttons.setMembersMargin(20);
+
+ editButton = new Button("Edit");
+ saveButton = new Button("Save");
+ cancelButton = new Button("Cancel");
+
+ editButton.show();
+ saveButton.hide();
+ cancelButton.hide();
+
+ buttons.addMember(editButton);
+ buttons.addMember(saveButton);
+ buttons.addMember(cancelButton);
+
+ editButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ makeEditable();
+ }
+ });
+
+ saveButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ saveAlertDefinition();
+ makeViewOnly();
+
+ // TODO getAlertDefinition() should now have the new user data - commit
it to DB
+ }
+ });
+
+ cancelButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ makeViewOnly();
+ }
+ });
+
+ setMembersMargin(10);
+ addMember(tabSet);
+ addMember(buttons);
+ }
+
+ public AlertDefinition getAlertDefinition() {
+ return alertDefinition;
+ }
+
+ public void setAlertDefinition(AlertDefinition alertDef) {
+ alertDefinition = alertDef;
+
+ generalProperties.setAlertDefinition(alertDef);
+ conditions.setAlertDefinition(alertDef);
+ notifications.setAlertDefinition(alertDef);
+ recovery.setAlertDefinition(alertDef);
+ dampening.setAlertDefinition(alertDef);
+
+ makeViewOnly();
+ }
+
+ public void makeEditable() {
+ saveButton.show();
+ cancelButton.show();
+ editButton.hide();
+
+ generalProperties.makeEditable();
+ conditions.makeEditable();
+ notifications.makeEditable();
+ recovery.makeEditable();
+ dampening.makeEditable();
+ }
+
+ public void makeViewOnly() {
+ saveButton.hide();
+ cancelButton.hide();
+ editButton.show();
+
+ generalProperties.makeViewOnly();
+ conditions.makeViewOnly();
+ notifications.makeViewOnly();
+ recovery.makeViewOnly();
+ dampening.makeViewOnly();
+ }
+
+ public void saveAlertDefinition() {
+ generalProperties.saveAlertDefinition();
+ conditions.saveAlertDefinition();
+ notifications.saveAlertDefinition();
+ recovery.saveAlertDefinition();
+ dampening.saveAlertDefinition();
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java
new file mode 100644
index 0000000..9a96db8
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java
@@ -0,0 +1,57 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import java.util.Map;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
+
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
+
+/**
+ * @author John Mazzitelli
+ */
+public class TemplateAlertDefinitionsDataSource extends
AbstractAlertDefinitionsDataSource {
+
+ @Override
+ protected AlertDefinitionCriteria getCriteria(DSRequest request) {
+ AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+
+ Criteria requestCriteria = request.getCriteria();
+ if (requestCriteria != null) {
+ Map values = requestCriteria.getValues();
+ for (Object key : values.keySet()) {
+ String fieldName = (String) key;
+ if
(fieldName.equals(TemplateAlertDefinitionsView.CRITERIA_RESOURCE_TYPE_ID)) {
+ Integer resourceId = (Integer) values.get(fieldName);
+ criteria.addFilterAlertTemplateResourceTypeId(resourceId);
+ }
+ }
+ }
+
+ criteria.setPageControl(getPageControl(request));
+ 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
new file mode 100644
index 0000000..e9674ad
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java
@@ -0,0 +1,108 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.resource.ResourceType;
+
+/**
+ * @author John Mazzitelli
+ */
+public class TemplateAlertDefinitionsView extends AbstractAlertDefinitionsView {
+
+ public static final String CRITERIA_RESOURCE_TYPE_ID = "resourceTypeId";
+
+ private ResourceType resourceType;
+
+ public TemplateAlertDefinitionsView(ResourceType resourceType) {
+ super();
+ this.resourceType = resourceType;
+ }
+
+ @Override
+ protected Criteria getCriteria() {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(CRITERIA_RESOURCE_TYPE_ID, resourceType.getId());
+ return criteria;
+ }
+
+ @Override
+ protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() {
+ return new TemplateAlertDefinitionsDataSource();
+ }
+
+ @Override
+ protected String getTableTitle() {
+ return "Alert Templates";
+ }
+
+ @Override
+ protected boolean isAllowedToModifyAlerts() {
+ // TODO: see if user can modify template alerts
+ return true;
+ }
+
+ @Override
+ protected void newButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void enableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void disableButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+
+ @Override
+ protected void deleteButtonPressed(ListGridRecord[] selection) {
+ // TODO Auto-generated method stub
+ String str = "this is not implemented yet but you selected";
+ for (ListGridRecord record : selection) {
+ str += ": " + record.getAttribute("name");
+ }
+ SC.say(str);
+ }
+}
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 2418783..ee29754 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
@@ -34,11 +34,8 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent;
import com.smartgwt.client.widgets.grid.events.DataArrivedHandler;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -68,7 +65,6 @@ public class Table extends VLayout {
private String headerIcon;
-
private boolean showHeader = true;
private boolean showFooter = true;
@@ -91,7 +87,11 @@ public class Table extends VLayout {
/**
* Two or more rows are selected.
*/
- MULTIPLE
+ MULTIPLE,
+ /**
+ * Never enabled - usually due to the user having a lack of permissions
+ */
+ NEVER
}
;
@@ -124,7 +124,7 @@ public class Table extends VLayout {
}
public Table(String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers,
String[] excludedFieldNames,
- boolean autoFetchData) {
+ boolean autoFetchData) {
super();
setWidth100();
@@ -164,7 +164,6 @@ public class Table extends VLayout {
protected void onInit() {
super.onInit();
-
// NOTE: It is essential that we wait to hide any excluded fields until after
super.onDraw() is called, since
// super.onDraw() is what actually adds the fields to the ListGrid (based
on what fields are defined in
// the underlying datasource).
@@ -174,13 +173,10 @@ public class Table extends VLayout {
}
}
-
tableInfo.setWrap(false);
-
}
-
@Override
protected void onDraw() {
super.onDraw();
@@ -222,7 +218,7 @@ public class Table extends VLayout {
if (tableAction.confirmMessage != null) {
String message =
tableAction.confirmMessage.replaceAll("\\#", String.valueOf(listGrid
- .getSelection().length));
+ .getSelection().length));
SC.ask(message, new BooleanCallback() {
public void execute(Boolean confirmed) {
@@ -244,7 +240,6 @@ public class Table extends VLayout {
footer.addMember(extraWidgetCanvas);
}
-
footer.addMember(new LayoutSpacer());
IButton refreshButton = new IButton("Refresh");
@@ -268,11 +263,9 @@ public class Table extends VLayout {
public void onDataArrived(DataArrivedEvent dataArrivedEvent) {
refreshTableInfo();
fieldSizes.clear();
- totalWidth = 0;
}
});
-
addMember(footer);
}
}
@@ -297,9 +290,7 @@ public class Table extends VLayout {
this.showFooter = showFooter;
}
- private int totalWidth;
private ArrayList<Integer> fieldSizes = new ArrayList<Integer>();
- private boolean autoSizing = false;
public void refresh(Criteria criteria) {
this.listGrid.invalidateCache();
@@ -311,7 +302,6 @@ public class Table extends VLayout {
this.listGrid.invalidateCache();
this.listGrid.markForRedraw();
}
-
public void setTableTitle(String titleString) {
if (titleString == null) {
@@ -346,7 +336,6 @@ public class Table extends VLayout {
return listGrid;
}
-
public void setTitleComponent(Canvas canvas) {
this.titleComponent = canvas;
}
@@ -356,7 +345,7 @@ public class Table extends VLayout {
}
public void addTableAction(String title, SelectionEnablement enablement, String
confirmation,
- TableAction tableAction) {
+ TableAction tableAction) {
if (enablement == null) {
enablement = DEFAULT_SELECTION_ENABLEMENT;
}
@@ -383,20 +372,23 @@ public class Table extends VLayout {
for (TableActionInfo tableAction : tableActions) {
boolean enabled;
switch (tableAction.enablement) {
- case ALWAYS:
- enabled = true;
- break;
- case ANY:
- enabled = (count >= 1);
- break;
- case SINGLE:
- enabled = (count == 1);
- break;
- case MULTIPLE:
- enabled = (count > 1);
- break;
- default:
- throw new IllegalStateException("Unhandled
SelectionEnablement: " + tableAction.enablement.name());
+ case ALWAYS:
+ enabled = true;
+ break;
+ case NEVER:
+ enabled = false;
+ break;
+ case ANY:
+ enabled = (count >= 1);
+ break;
+ case SINGLE:
+ enabled = (count == 1);
+ break;
+ case MULTIPLE:
+ enabled = (count > 1);
+ break;
+ default:
+ throw new IllegalStateException("Unhandled SelectionEnablement:
" + tableAction.enablement.name());
}
tableAction.actionButton.setDisabled(!enabled);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index ea7b88e..5da123b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -33,6 +33,7 @@ import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import
org.rhq.enterprise.gui.coregui.client.alert.definitions.ResourceAlertDefinitionsView;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
@@ -108,7 +109,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
operationsTab.registerSubTabs("History", "Scheduled");
alertsTab = new TwoLevelTab("Alerts",
"/images/icons/Alert_grey_16.png");
- alertsTab.registerSubTabs("History", "Definitions");
+ alertsTab.registerSubTabs("History", "Definitions",
"DELETEME");
configurationTab = new TwoLevelTab("Configuration",
"/images/icons/Configure_grey_16.png");
configurationTab.registerSubTabs("Current", "History");
@@ -178,11 +179,11 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
// 3) user can enable/disable/delete alert definitions if they possess the
appropriate permissions
// 4) user can search alert history by: date alert was fired, alert priority,
or alert definition
//alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
- //alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
alertsTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/alert/listAlertHistory-plain.xhtml?id="
+ resource.getId()));
- alertsTab.updateSubTab("Definitions", new FullHTMLPane(
- "/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" +
resource.getId()));
+ alertsTab.updateSubTab("Definitions", new
ResourceAlertDefinitionsView(resource));
+ alertsTab.updateSubTab("DELETEME", new
FullHTMLPane("/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id="
+ + resource.getId()));
// comment out GWT-based view until...
// 1) user can search event history by: metric display range, event source,
event details, event severity
commit 9964a96c296a2ecde766d5e899b5c30bc74a6d2a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 12 17:28:02 2010 -0400
first rev of the base classes needed for the metric schedule list pages for resources,
groups, and templates
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
index cae02bf..c82c98e 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
@@ -39,6 +39,21 @@ import org.rhq.core.domain.util.PageOrdering;
public class MeasurementScheduleCriteria extends Criteria {
private static final long serialVersionUID = 1L;
+ // sort fields from the MeasurementSchedule itself
+ public static final String SORT_FIELD_ENABLED = "enabled";
+ public static final String SORT_FIELD_INTERVAL = "interval";
+
+ // sort fields from the MeasurementSchedule's MeasurementDefinition
+ public static final String SORT_FIELD_DEFINITION_ID = "definitionId";
+ public static final String SORT_FIELD_NAME = "name";
+ public static final String SORT_FIELD_DISPLAY_NAME = "displayName";
+ public static final String SORT_FIELD_DESCRIPTION = "description";
+ public static final String SORT_FIELD_DATA_TYPE = "dataType";
+
+ // filter fields
+ public static final String FILTER_FIELD_RESOURCE_ID = "resourceId";
+ public static final String FILTER_FIELD_RESOURCE_GROUP_ID =
"resourceGroupId";
+
private Integer filterId;
private Boolean filterEnabled;
private List<Integer> filterDefinitionIds; // requires overrides
@@ -46,6 +61,7 @@ public class MeasurementScheduleCriteria extends Criteria {
private Integer filterResourceGroupId; // requires overrides
private Integer filterAutoGroupResourceTypeId; // requires overrides
private Integer filterAutoGroupParentResourceId; // requires overrides
+ private Integer filterResourceTypeId; // requires overrides
private boolean fetchBaseline;
private boolean fetchDefinition;
@@ -57,8 +73,8 @@ public class MeasurementScheduleCriteria extends Criteria {
public MeasurementScheduleCriteria() {
filterOverrides.put("definitionIds", "definition.id IN ( ?
)");
- filterOverrides.put("resourceId", "resource.id IN ( ? )");
- filterOverrides.put("resourceGroupId", "resource.id IN " //
+ filterOverrides.put(FILTER_FIELD_RESOURCE_ID, "resource.id IN ( ? )");
+ filterOverrides.put(FILTER_FIELD_RESOURCE_GROUP_ID, "resource.id IN "
//
+ "( SELECT res.id " //
+ " FROM Resource res " //
+ " JOIN res.implicitGroups ig " //
@@ -74,9 +90,11 @@ public class MeasurementScheduleCriteria extends Criteria {
+ " JOIN res.parentResource parent " //
+ " WHERE parent.id = ? )");
- sortOverrides.put("name", "definition.name");
- sortOverrides.put("displayName", "definition.displayName");
- sortOverrides.put("dataType", "definition.dataType");
+ sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id");
+ sortOverrides.put(SORT_FIELD_NAME, "definition.name");
+ sortOverrides.put(SORT_FIELD_DISPLAY_NAME, "definition.displayName");
+ sortOverrides.put(SORT_FIELD_DESCRIPTION, "definition.description");
+ sortOverrides.put(SORT_FIELD_DATA_TYPE, "definition.dataType");
}
@Override
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 6e5430f..3369352 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
@@ -70,9 +70,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
setCanMultiSort(true);
List<DataSourceField> fields = createFields();
- for (DataSourceField field : fields) {
- addField(field);
- }
+ addFields(fields);
}
protected List<DataSourceField> createFields() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index 9240e83..c4cf1b4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -279,18 +279,9 @@ public class AlertsView extends Table {
}
- protected Criteria getCriteria() {
- return null;
- }
-
public void refresh() {
this.getListGrid().invalidateCache();
//this.table.getListGrid().markForRedraw();
}
- public void refresh(Criteria criteria) {
- this.refresh(criteria);
- //this.table.getListGrid().markForRedraw();
- }
-
}
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 2418783..8d71fe2 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
@@ -34,11 +34,8 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent;
import com.smartgwt.client.widgets.grid.events.DataArrivedHandler;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent;
-import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index cd99ad7..c3c67e2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -53,9 +53,9 @@ public interface MeasurementDataGWTService extends RemoteService {
PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId,
long start, long end,
PageControl pageControl);
- public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
+ PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
- public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
+ PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String
metricNameFilter,
String resourceNameFilter, String parentNameFilter, PageControl pc);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
new file mode 100644
index 0000000..9137081
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java
@@ -0,0 +1,204 @@
+/*
+ * 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.common;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.user.client.Window;
+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.DSResponse;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceBooleanField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A server-side SmartGWT DataSource for reading and updating {@link
MeasurementSchedule}s.
+ *
+ * @author Ian Springer
+ */
+public abstract class AbstractMeasurementScheduleDataSource extends
RPCDataSource<MeasurementSchedule> {
+ private MeasurementDataGWTServiceAsync measurementService =
GWTServiceLookup.getMeasurementDataService();
+
+ protected AbstractMeasurementScheduleDataSource() {
+ super();
+
+ setCanMultiSort(true);
+
+ List<DataSourceField> fields = createFields();
+ addFields(fields);
+ }
+
+ protected List<DataSourceField> createFields() {
+ List<DataSourceField> fields = new ArrayList<DataSourceField>();
+
+ DataSourceField idField = new
DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID,
+ "Id");
+ idField.setPrimaryKey(true);
+ idField.setHidden(true);
+ fields.add(idField);
+
+ DataSourceTextField nameField = new
DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
+ "Metric");
+ fields.add(nameField);
+
+ DataSourceTextField descriptionField = new
DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION,
+ "Description");
+ fields.add(descriptionField);
+
+ DataSourceTextField typeField = new
DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE,
+ "Type");
+ fields.add(typeField);
+
+ DataSourceBooleanField enabledField = new
DataSourceBooleanField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED,
+ "Enabled?");
+ fields.add(enabledField);
+
+ DataSourceTextField intervalField = new
DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL,
+ "Collection Interval");
+ fields.add(intervalField);
+
+ return fields;
+ }
+
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+ final long startTime = System.currentTimeMillis();
+
+ final MeasurementScheduleCriteria criteria = getCriteria(request);
+
+ this.measurementService.findMeasurementSchedulesByCriteria(criteria, new
AsyncCallback<PageList<MeasurementSchedule>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to fetch measurement
schedules for criteria " + criteria,
+ caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<MeasurementSchedule> result) {
+ long fetchDuration = System.currentTimeMillis() - startTime;
+ System.out.println(result.size() + " measurement schedules fetched
in: " + fetchDuration + "ms");
+
+ response.setData(buildRecords(result));
+ // For paging to work, we have to specify size of full result set.
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ protected MeasurementScheduleCriteria getCriteria(DSRequest request) {
+ MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria();
+ criteria.fetchDefinition(true);
+
+ Criteria requestCriteria = request.getCriteria();
+ if (requestCriteria != null) {
+ Map values = requestCriteria.getValues();
+ for (Object key : values.keySet()) {
+ String fieldName = (String) key;
+ if
(fieldName.equals(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID)) {
+ Integer resourceId = (Integer) values.get(fieldName);
+ criteria.addFilterResourceId(resourceId);
+ } else if
(fieldName.equals(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID)) {
+ Integer resourceGroupId = (Integer) values.get(fieldName);
+ criteria.addFilterResourceGroupId(resourceGroupId);
+ }
+ // TODO: Add support for other fields we need to filter by (e.g.
resourceTypeId for metric templates).
+ }
+ }
+
+ criteria.setPageControl(getPageControl(request));
+ return criteria;
+ }
+
+ @Override
+ public MeasurementSchedule copyValues(ListGridRecord from) {
+ return null; // TODO: Implement?
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementSchedule from) {
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute("id", from.getId());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
from.getDefinition().getDisplayName());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION,
from.getDefinition().getDescription());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE,
from.getDefinition().getDataType().name());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED,
from.isEnabled());
+ record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL,
from.getInterval());
+ // TODO: resourceId and resourceGroupId (can probably be handled by subclasses)
+ return record;
+ }
+
+ protected void executeRemove(final DSRequest request, final DSResponse response) {
+ JavaScriptObject data = request.getData();
+ ListGridRecord record = new ListGridRecord(data);
+ Window.alert(String.valueOf(record.getAttributeAsInt("id")));
+ }
+
+ public void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
+ Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ enableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ }
+
+ protected abstract void enableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ Integer[] measurementDefinitionIds);
+
+ public void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView) {
+ Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ disableSchedules(measurementScheduleListView, measurementDefinitionIds);
+ }
+
+ protected abstract void disableSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView,
+ Integer[] measurementDefinitionIds);
+
+ public void updateSchedules(AbstractMeasurementScheduleListView
measurementScheduleListView, long interval) {
+ Integer[] measurementDefinitionIds =
getMeasurementDefinitionIds(measurementScheduleListView);
+ updateSchedules(measurementScheduleListView, measurementDefinitionIds,
interval);
+ }
+
+ private Integer[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView
measurementScheduleListView) {
+ ListGrid listGrid = measurementScheduleListView.getListGrid();
+ ListGridRecord[] records = listGrid.getSelection();
+
+ Integer[] measurementDefinitionIds = new Integer[records.length];
+ for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
+ ListGridRecord record = records[i];
+ Integer measurementDefinitionId =
record.getAttributeAsInt(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID);
+ measurementDefinitionIds[i] = measurementDefinitionId;
+ }
+ return measurementDefinitionIds;
+ }
+
+ protected abstract void updateSchedules(final AbstractMeasurementScheduleListView
measurementScheduleListView,
+ final Integer[] measurementDefinitionIds,
final long interval);
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
new file mode 100644
index 0000000..8d76d32
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java
@@ -0,0 +1,81 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.common;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.SortDirection;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+
+/**
+ * A view that displays a non-paginated table of {@link
org.rhq.core.domain.measurement.MeasurementSchedule measurement
+ * schedule}s, along with the ability to sort, enable, disable, or update the collection
interval on those schedules.
+ *
+ * @author Ian Springer
+ */
+// TODO: Actually, this class probably does not need to be abstract...
+public abstract class AbstractMeasurementScheduleListView extends Table {
+ private static final String TITLE = "Metric Collection Schedules";
+
+ private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{
+ new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME,
SortDirection.ASCENDING)
+ };
+
+ public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource) {
+ this(dataSource, null, null);
+ }
+
+ public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource
dataSource, Criteria criteria, String[] excludedFieldNames) {
+ super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames);
+ setDataSource(dataSource);
+ }
+
+ @Override
+ public AbstractMeasurementScheduleDataSource getDataSource() {
+ return (AbstractMeasurementScheduleDataSource) super.getDataSource();
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ ListGrid listGrid = getListGrid();
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("30%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("20%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED).setWidth("10%");
+
listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL).setWidth("20%");
+
+ addTableAction("Enable", Table.SelectionEnablement.ANY, null, new
TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+
getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this);
+ }
+ });
+ addTableAction("Disable", Table.SelectionEnablement.ANY, null, new
TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+
getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this);
+ }
+ });
+ // TODO: Add controls to set collection interval - base class is going to need
massaging...
+ }
+}
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 95436d4..1b6f6cd 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
@@ -23,6 +23,7 @@ import java.util.Collection;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSource;
+import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.DSProtocol;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -169,4 +170,10 @@ public abstract class RPCDataSource<T> extends DataSource {
response.setStatus(0);
return response;
}
+
+ public void addFields(Collection<DataSourceField> fields) {
+ for (DataSourceField field : fields) {
+ addField(field);
+ }
+ }
}
commit 1043bd79d2744f13a4b8db9b54fc7df9811fa619
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 16:24:14 2010 -0400
BZ-536368 - fix for ConcurrentModificationException during resource discovery
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java
index c16ba56..1d803b4 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java
@@ -136,7 +136,7 @@ public class RuntimeDiscoveryExecutor implements Runnable,
Callable<InventoryRep
discoverForResource(platform, report, false);
// Next discover all other services and non-top-level servers
- Set<Resource> servers = platform.getChildResources();
+ Set<Resource> servers = new
HashSet<Resource>(platform.getChildResources()); // prevent concurrent mod
for (Resource server : servers) {
discoverForResource(server, report, false);
}
commit 733cabfa08d3ca73b943665a65771ee7fef41256
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 14:54:11 2010 -0400
mplement "plain" / "nomenu" scheme using iframed-struts for
unimplemented metric templates section
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
index 6c08474..61a14fe 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
@@ -1264,6 +1264,16 @@
<forward name="success"
path="/resource/platform/monitor/Config.do?mode=configure"/>
</action>
+ <action path="/resource/platform/monitor/config/ConfigMetricsNoMenu"
+ name="MonitoringConfigForm"
+ scope="request"
+
input="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"
+
type="org.rhq.enterprise.gui.legacy.action.resource.common.monitor.config.ConfigMetricsAction">
+ <forward name="remove"
path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ <forward name="failure"
path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ <forward name="success"
path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ </action>
+
<!-- / -->
<!-- server monitoring actions -->
@@ -3135,6 +3145,16 @@
<forward name="failure"
path="/admin/platform/monitor/Config.do?mode=configure"/>
<forward name="success"
path="/admin/platform/monitor/Config.do?mode=configure"/>
</action>
+
+ <action path="/resource/common/monitor/config/ConfigMetricsNoMenu"
+ name="MonitoringConfigForm"
+ scope="request"
+
input="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"
+
type="org.rhq.enterprise.gui.legacy.action.resource.common.monitor.config.ConfigMetricsAction">
+ <forward name="remove"
path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ <forward name="failure"
path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ <forward name="success"
path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/>
+ </action>
<!-- === Resource Monitor>Events Tab === -->
<action path="/resource/common/Events"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
index 988672f..0ec1a85 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
@@ -32,9 +32,16 @@
<td class="ListCellPrimary"><c:out
value="${entry.type.name}"/> <c:out
value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left"
nowrap="nowrap">
<c:if test="${monitorEnabled}">
- <html:link
page="/admin/platform/monitor/Config.do?mode=configure&id=${entry.type.id}&type=${entry.type.id}"
styleClass="buttonsmall">
- Edit Metric Template
- </html:link>
+ <c:if test="${not empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${entry.type.id}&type=${entry.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
+ <c:if test="${empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?mode=configure&id=${entry.type.id}&type=${entry.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
<c:if test="${(entry.enabledMetricCount + entry.disabledMetricCount)
> 0}">
<span title="(enabled | disabled)">
(<c:out value="${entry.enabledMetricCount}" /> | <c:out
value="${entry.disabledMetricCount}" />)
@@ -99,9 +106,16 @@
<td class="ListCellPrimary"><c:out
value="${entry.type.name}"/> <c:out
value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left">
<c:if test="${monitorEnabled}">
- <html:link
page="/admin/platform/monitor/Config.do?mode=configure&type=${entry.type.id}"
styleClass="buttonsmall">
- Edit Metric Template
- </html:link>
+ <c:if test="${not empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&type=${entry.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
+ <c:if test="${empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?mode=configure&type=${entry.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
<c:if test="${(entry.enabledMetricCount + entry.disabledMetricCount)
> 0}">
<span title="(enabled | disabled)">
(<c:out value="${entry.enabledMetricCount}" /> | <c:out
value="${entry.disabledMetricCount}" />)
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
index 8ce14ae..26b0682 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
@@ -22,17 +22,30 @@
<c:param name="mode" value="configure"/>
<c:param name="groupId" value="${groupId}"/>
<c:param name="category" value="COMPATIBLE"/>
+ <c:if test="${not empty param.nomenu}">
+ <c:param name="nomenu" value="${param.nomenu}" />
+ </c:if>
</c:url>
</c:when>
<c:otherwise>
<c:url var="selfAction"
value="/resource/common/monitor/Config.do">
<c:param name="mode" value="configure"/>
<c:param name="id" value="${Resource.id}"/>
+ <c:if test="${not empty param.nomenu}">
+ <c:param name="nomenu" value="${param.nomenu}" />
+ </c:if>
</c:url>
</c:otherwise>
</c:choose>
-<html:form action="/resource/${section}/monitor/config/ConfigMetrics">
+<c:if test="${not empty param.nomenu}">
+ <c:set var="actionSuffix" value="NoMenu" />
+</c:if>
+<c:if test="${empty param.nomenu}">
+ <c:set var="actionSuffix" value="" />
+</c:if>
+
+<html:form
action="/resource/${section}/monitor/config/ConfigMetrics${actionSuffix}">
<c:choose>
<c:when test="${not empty ResourceType && empty
param.parent}">
<!-- resource type wasn't empty so it is a default-->
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp
index c89b9e7..6780c28 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp
@@ -40,6 +40,9 @@
<c:if test="${not empty param.ps}">
<c:param name="ps" value="${param.ps}"/>
</c:if>
+ <c:if test="${not empty param.nomenu}">
+ <c:param name="nomenu" value="${param.nomenu}"/>
+ </c:if>
</c:url>
<c:if test="${ResourceType != null && param.parent > 0}">
<c:set var="isAutoGroup" value="true"/>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
index 4ce0cf2..9165090 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
@@ -50,9 +50,16 @@
</td>
<td class="ListCell" align="left"
nowrap="nowrap">
<c:if test="${monitorEnabled}">
- <html:link
page="/admin/platform/monitor/Config.do?mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}"
styleClass="buttonsmall">
- Edit Metric Template
- </html:link>
+ <c:if test="${not empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
+ <c:if test="${empty param.nomenu}">
+ <html:link
page="/admin/platform/monitor/Config.do?mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}"
styleClass="buttonsmall">
+ Edit Metric Template
+ </html:link>
+ </c:if>
<c:if test="${(serviceType.enabledMetricCount +
serviceType.disabledMetricCount) > 0}">
<span title="(enabled | disabled)">
(<c:out value="${serviceType.enabledMetricCount}" /> |
<c:out value="${serviceType.disabledMetricCount}" />)
commit d8fca9dc8305e86a642cd4be9633b93476670c98
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 13:57:54 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented admin >
config > plugins section
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index dc1bb5c..5779155 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -241,7 +241,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
} else if ("License".equals(page)) {
url = "/admin/license/LicenseAdmin.do?mode=view";
} else if ("Plugins".equals(page)) {
- url = "/rhq/admin/plugin/plugin-list.xhtml";
+ url = "/rhq/admin/plugin/plugin-list-plain.xhtml";
}
url = addQueryStringParam(url, "nomenu=true");
content = new FullHTMLPane(url);
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml
new file mode 100644
index 0000000..e2c4d98
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+ <from-view-id>/rhq/admin/largeenv-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/admin/largeenv-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/admin/plugin/plugin-list-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-action>#{InstalledPluginsUIBean.uploadPlugin}</from-action>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/admin/plugin/plugin-list-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/plugin/plugin-config-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}&listName=#{param.listName}&listIndex=#{param.listIndex}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.addNewMap}</from-action>
+
<to-view-id>/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+
<from-action>#{editPluginConfigurationUIBean.updatePlugin}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/plugin/plugin-config-plain.xhtml?pluginName=#{editPluginConfigurationUIBean.plugin.name}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}</to-view-id>
+
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}</to-view-id>
+
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/plugin/plugin-details-plain.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/plugin/plugin-details-plain.xhtml?plugin=#{plugin.name}&deployment=#{plugin.deployment}&pluginType=#{serverPlugin.type}&control=#{param.control}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>sessionExpired</from-outcome>
+ <to-view-id>/Login.do</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index 87580b6..ed22bc6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -162,6 +162,7 @@
/WEB-INF/jsf-navigation/summary-navigation.xml,
/WEB-INF/jsf-navigation/test-navigation.xml,
+ /WEB-INF/jsf-navigation/admin-plain-navigation.xml,
/WEB-INF/jsf-navigation/alert-plain-navigation.xml,
/WEB-INF/jsf-navigation/cluster-plain-navigation.xml,
/WEB-INF/jsf-navigation/content-plain-navigation.xml,
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml
new file mode 100644
index 0000000..56c872d
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml
@@ -0,0 +1,108 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="pluginsConfigForm">
+ <h:panelGrid columns="2" width="100%"
columnClasses="col1,col2">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Available Plugins" />
+ </f:facet>
+
+ <rich:tree
nodeSelectListener="#{pluginConfigUIBean.processSelection}"
+
adviseNodeSelected="#{pluginConfigUIBean.adviseSelected}"
+
adviseNodeOpened="#{pluginConfigUIBean.adviseOpened}"
+ reRender="pluginConfig"
+ value="#{pluginConfigUIBean.root}"
+ ajaxSubmitSelection="true"
+ switchType="client"
+ var="item"
+ toggleOnClick="false"
+ nodeFace="#{item.class.simpleName}"
+
+
+ <rich:treeNode type="String">
+ <h:outputText value="#{item}s" />
+ </rich:treeNode>
+ <rich:treeNode type="ServerPlugin">
+ <h:outputText value="#{item.displayName}" />
+ </rich:treeNode>
+ </rich:tree>
+ </rich:panel>
+
+ <h:panelGroup id="pluginConfig">
+ <rich:panel id="detailsLink"
+ style="background: #EEEEEE;"
+ rendered="#{pluginConfigUIBean.plugin !=
null}"
+
<h:outputText value="See the " />
+ <h:outputLink
value="/rhq/admin/plugin/plugin-details-plain.xhtml">
+ <f:param name="plugin"
value="#{pluginConfigUIBean.plugin.name}"/>
+ <f:param name="deployment"
value="#{pluginConfigUIBean.plugin.deployment}"/>
+ <f:param name="pluginType"
value="#{pluginConfigUIBean.plugin.type}"/>
+ <h:outputText
value="'#{pluginConfigUIBean.plugin.displayName}' details page"/>
+ </h:outputLink>
+ <h:outputText value=" for more plugin information."
/>
+ </rich:panel>
+
+ <rich:panel id="noConfigMessage"
+ style="background: #EEEEEE;"
+ rendered="#{not pluginConfigUIBean.editable and
pluginConfigUIBean.plugin != null}"
+
<h:outputText escape="true" value="Plugin
'#{pluginConfigUIBean.plugin.displayName}' has no configuration." />
+ </rich:panel>
+
+ <rich:panel id="pluginButtonsTopPanel"
rendered="#{pluginConfigUIBean.editable}">
+ <h:panelGroup id="pluginButtonsTop">
+ <h:outputLink
value="/rhq/admin/plugin/plugin-edit-plain.xhtml"
styleClass="buttonmed">
+ <f:param name="plugin"
value="#{pluginConfigUIBean.plugin.name}"/>
+ <f:param name="deployment"
value="#{pluginConfigUIBean.plugin.deployment}"/>
+ <f:param name="pluginType"
value="#{pluginConfigUIBean.plugin.type}"/>
+ <h:outputText value="EDIT"/>
+ </h:outputLink>
+ </h:panelGroup>
+ </rich:panel>
+
+ <rich:panel
rendered="#{pluginConfigUIBean.plugin.pluginConfiguration != null}">
+ <f:facet name="header">
+ <h:outputText value="Plugin Configuration"/>
+ </f:facet>
+ <onc:config
configurationDefinition="#{pluginConfigUIBean.pluginConfigurationDefinition}"
+
configuration="#{pluginConfigUIBean.plugin.pluginConfiguration}"
+ readOnly="true" />
+ </rich:panel>
+
+ <rich:panel
rendered="#{pluginConfigUIBean.plugin.scheduledJobsConfiguration != null}">
+ <f:facet name="header">
+ <h:outputText value="Scheduled Jobs"/>
+ </f:facet>
+ <onc:config
configurationDefinition="#{pluginConfigUIBean.scheduledJobsDefinition}"
+
configuration="#{pluginConfigUIBean.plugin.scheduledJobsConfiguration}"
+ readOnly="true" />
+ </rich:panel>
+
+ <rich:panel id="pluginButtonsBottomPanel"
rendered="#{pluginConfigUIBean.editable}">
+ <h:panelGroup id="pluginButtonsBottom">
+ <h:outputLink
value="/rhq/admin/plugin/plugin-edit-plain.xhtml"
styleClass="buttonmed">
+ <f:param name="plugin"
value="#{pluginConfigUIBean.plugin.name}"/>
+ <f:param name="deployment"
value="#{pluginConfigUIBean.plugin.deployment}"/>
+ <f:param name="pluginType"
value="#{pluginConfigUIBean.plugin.type}"/>
+ <h:outputText value="EDIT"/>
+ </h:outputLink>
+ </h:panelGroup>
+ </rich:panel>
+
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:form>
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml
new file mode 100644
index 0000000..fc22797
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml
@@ -0,0 +1,155 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="pluginsForm">
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Plugin: #{plugin.displayName}
(#{plugin.name})"/>
+ </f:facet>
+
+ <h:panelGrid styleClass="BlockContent" columns="4"
width="100%">
+
+ <h:outputLabel styleClass="BlockLabel"
value="Version:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.version}"/>
+
+ <h:outputLabel styleClass="BlockLabel" value="AMPS
Version:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.ampsVersion}"/>
+
+ <h:outputLabel styleClass="BlockLabel"
value="Enabled:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.enabled}"/>
+
+ <h:outputLabel styleClass="BlockLabel"
value="Type:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.deployment}"/>
+
+ <h:outputLabel styleClass="BlockLabel"
value="MD5:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.md5}"/>
+
+ <h:outputLabel styleClass="BlockLabel"
value="Description:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.description}"/>
+
+ <h:outputLabel styleClass="BlockLabel"
value="Path:"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.path}"/>
+ </h:panelGrid>
+
+ <br />
+ <h:outputLink
value="/rhq/admin/plugin/plugin-config-plain.xhtml"
rendered="#{plugin.deployment eq 'SERVER'}">
+ <f:param name="pluginName"
value="#{plugin.name}"/>
+ <h:outputText value="Configure
'#{plugin.displayName}'"/>
+ </h:outputLink>
+ <br />
+ <br />
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Plugin Help"/>
+ </f:facet>
+
+ <h:outputText escape="false" value="<pre>
#{plugin.help} </pre>"/>
+ </rich:panel>
+
+ <rich:panel rendered="#{plugin.deployment == 'SERVER' and
ServerPluginControlUIBean.controls.size > 0 and ServerPluginControlUIBean.permission
}">
+ <f:facet name="header">
+ <h:outputText value="Plugin Controls"/>
+ </f:facet>
+
+ <rich:dataTable id="serverPluginsDataTable"
+ value="#{ServerPluginControlUIBean.controls}"
+ var="control"
+ width="100%"
+ columnsWidth="25% 75%"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name"/>
+ </f:facet>
+
+ <h:outputLink
value="/rhq/admin/plugin/plugin-details-plain.xhtml">
+ <f:param name="plugin"
value="#{plugin.name}"/>
+ <f:param name="deployment"
value="#{plugin.deployment}"/>
+ <f:param name="pluginType"
value="#{plugin.type}"/>
+ <f:param name="control"
value="#{control[0]}"/>
+ <h:outputText value="#{control[1]} *"
rendered="#{param.control eq control[0]}"/>
+ <h:outputText value="#{control[1]}"
rendered="#{param.control ne control[0]}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description"/>
+ </f:facet>
+
+ <h:outputText value="#{control[2]}"/>
+ </rich:column>
+ </rich:dataTable>
+
+ <br/>
+ <onc:config id="paramConfig"
+ rendered="#{param.control ne null}"
+
readOnly="#{ServerPluginControlUIBean.resultsAvailable}"
+
configurationDefinition="#{ServerPluginControlUIBean.paramsDefinition}"
+
configuration="#{ServerPluginControlUIBean.paramsConfiguration}"
+ nullConfigurationDefinitionMessage="This control does
not accept parameters"
+ nullConfigurationMessage="This control does not accept
parameters!"
+ nullConfigurationStyle="InfoBlock"/>
+ <br />
+ <input type="hidden" name="plugin"
value="#{plugin.name}" />
+ <input type="hidden" name="deployment"
value="#{plugin.deployment}" />
+ <input type="hidden" name="pluginType"
value="#{serverPlugin.type}" />
+ <c:if test="${not empty param.control}">
+ <input type="hidden" name="control"
value="#{param.control}" />
+ </c:if>
+ <h:commandButton
action="#{ServerPluginControlUIBean.invokeControl}"
+ rendered="#{param.control ne null and
!ServerPluginControlUIBean.resultsAvailable }"
+ value="EXECUTE"
+ styleClass="buttonmed"
+ onclick="return preventDoubleClick();"/>
+ <br/>
+ <h:panelGrid
rendered="#{ServerPluginControlUIBean.resultsAvailable}">
+ <rich:panel>
+ <h:outputText
rendered="#{ServerPluginControlUIBean.resultsError ne null}"
value="Results: #{ServerPluginControlUIBean.resultsError}"
styleClass="ErrorBlock" />
+ <h:outputText
rendered="#{ServerPluginControlUIBean.resultsError eq null}"
value="Results: Success!" styleClass="InfoBlock" />
+ </rich:panel>
+ <rich:panel
rendered="#{ServerPluginControlUIBean.resultsDefinition ne null}">
+ <onc:config id="resultsConfig"
+ readOnly="true"
+
configurationDefinition="#{ServerPluginControlUIBean.resultsDefinition}"
+
configuration="#{ServerPluginControlUIBean.resultsConfiguration}"
+ nullConfigurationDefinitionMessage="No result
properties were returned"
+ nullConfigurationMessage="No result properties
were returned!"
+
nullConfigurationStyle="#{ServerPluginControlUIBean.resultsError eq null ?
'InfoBlock' : 'WarnBlock'}"/>
+ </rich:panel>
+ </h:panelGrid>
+
+
+ </rich:panel>
+
+ </rich:panel>
+ </h:form>
+
+ <script type="text/javascript">
+ var submitted = false;
+ function preventDoubleClick() {
+ if (submitted) { return false; }
+ else { submitted = true; return true; }
+ }
+ </script>
+
+ </ui:define>
+
+ </ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml
new file mode 100644
index 0000000..73d77e6
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml
@@ -0,0 +1,28 @@
+<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:param name="actionVerb" value="Add to" />
+ <ui:param name="editBreadCrumb" value="true" />
+
+ <ui:define name="mapConfig">
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.currentConfigurationDefinition}"
+
configuration="#{editPluginConfigurationUIBean.currentConfiguration}"
+ listName="#{param.listName}" />
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="OK" type="submit"
action="#{editPluginConfigurationUIBean.finishMap}"
+ alt="Click to Add Map"
styleClass="buttonmed"/>
+ <h:commandButton value="RESET" type="reset"
immediate="true"
+ alt="Click to Reset Fields"
styleClass="buttonmed"/>
+ </h:panelGrid>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml
new file mode 100644
index 0000000..8e0f8b9
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml
@@ -0,0 +1,21 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="editPluginConfigurationForm"
onsubmit="prepareInputsForSubmission(this)">
+ <ui:insert name="mapConfig" />
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml
new file mode 100644
index 0000000..ffa8733
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml
@@ -0,0 +1,41 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="pluginConfigForm">
+ <rich:panel
rendered="#{editPluginConfigurationUIBean.plugin.pluginConfiguration !=
null}">
+ <f:facet name="header">
+ <h:outputText value="Plugin Configuration"/>
+ </f:facet>
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.pluginConfigurationDefinition}"
+
configuration="#{editPluginConfigurationUIBean.plugin.pluginConfiguration}"
/>
+ </rich:panel>
+
+ <rich:panel
rendered="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration !=
null}">
+ <f:facet name="header">
+ <h:outputText value="Scheduled Jobs"/>
+ </f:facet>
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.scheduledJobsDefinition}"
+
configuration="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration}"
/>
+ </rich:panel>
+
+ <h:panelGroup id="pluginButtons">
+ <h:commandButton value="SAVE" type="submit"
action="#{editPluginConfigurationUIBean.updatePlugin}"
+ alt="Click to Save Changes"
styleClass="buttonmed" />
+ <h:commandButton value="RESET" type="reset"
immediate="true"
+ title="Click to Reset Fields"
styleClass="buttonmed"/>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml
new file mode 100644
index 0000000..8d847b7
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml
@@ -0,0 +1,29 @@
+<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:param name="actionVerb" value="Update" />
+ <ui:param name="editBreadCrumb" value="true" />
+
+ <ui:define name="mapConfig">
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.currentConfigurationDefinition}"
+
configuration="#{editPluginConfigurationUIBean.currentConfiguration}"
+ listName="#{param.listName}"
+ listIndex="#{param.listIndex}" />
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="OK" type="submit"
action="#{editPluginConfigurationUIBean.finishMap}"
+ alt="Click to Update Map"
styleClass="buttonmed"/>
+ <h:commandButton value="RESET" type="reset"
immediate="true"
+ alt="Click to Reset Fields"
styleClass="buttonmed"/>
+ </h:panelGrid>
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml
new file mode 100644
index 0000000..02b18c4
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml
@@ -0,0 +1,22 @@
+<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:param name="actionVerb" value="View" />
+
+ <ui:define name="mapConfig">
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.scheduledJobsDefinition}"
+
configuration="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration}"
+ listName="#{param.listName}"
+ listIndex="#{param.listIndex}"
+ readOnly="true" />
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml
new file mode 100644
index 0000000..c85a6c1
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml
@@ -0,0 +1,268 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+<h:form id="pluginsForm">
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Installed Plugins"/>
+ </f:facet>
+
+ <h:panelGrid columns="1" width="100%">
+ <rich:tabPanel switchType="ajax"
selectedTab="#{InstalledPluginsSessionUIBean.selectedTab}">
+
+ <!-- ========== AGENT PLUGINS TAB ========== -->
+
+ <rich:tab name="AGENT" label="Agent Plugins">
+
+ <rich:dataTable id="agentPluginsDataTable"
+
value="#{InstalledPluginsUIBean.installedAgentPlugins}"
+ var="agentPlugin"
+ width="100%"
+ columnsWidth="3%, 20%, 52%, 15%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedPlugin"/>
+ </f:facet>
+
+ <onc:select name="selectedPlugin"
value="#{agentPlugin.id}"/>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="ID"/>
+ </f:facet>
+
+ <h:outputText value="#{agentPlugin.id}"/>
+ </rich:column>
+
+ <rich:column sortBy="#{agentPlugin.displayName}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name"/>
+ </f:facet>
+
+ <h:outputLink
value="/rhq/admin/plugin/plugin-details-plain.xhtml">
+ <f:param name="plugin"
value="#{agentPlugin.name}"/>
+ <f:param name="deployment" value="AGENT"/>
+ <h:outputText value="#{agentPlugin.displayName}"/>
+ </h:outputLink>
+
+ </rich:column>
+
+ <rich:column sortBy="#{agentPlugin.description}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description"/>
+ </f:facet>
+
+ <h:outputText value="#{agentPlugin.description}"/>
+ </rich:column>
+
+ <rich:column sortBy="#{agentPlugin.mtime}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Last
Update"/>
+ </f:facet>
+
+ <h:outputText value="#{agentPlugin.mtime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Enabled"/>
+ </f:facet>
+
+ <h:graphicImage
value="/images/icons/availability_green_16.png"
rendered="#{agentPlugin.enabled}"/>
+ <h:graphicImage value="/images/icons/availability_red_16.png"
rendered="#{!agentPlugin.enabled}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="5" width="100%">
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.enableAgentPlugins}"
+ value="ENABLE"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.disableAgentPlugins}"
+ value="DISABLE"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ </rich:column>
+ <rich:column colspan="5" width="100%"
breakBefore="true">
+ <h:commandButton
action="#{InstalledPluginsUIBean.scan}"
+ value="SCAN FOR UPDATES"
styleClass="on-pager-button buttonsmall">
+ </h:commandButton>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:tab>
+
+ <!-- ========== SERVER PLUGINS TAB ========== -->
+
+ <rich:tab name="SERVER" label="Server Plugins">
+
+ <rich:dataTable id="serverPluginsDataTable"
+
value="#{InstalledPluginsUIBean.installedServerPlugins}"
+ var="serverPlugin"
+ width="100%"
+
columnsWidth="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? '3%, 20%,
52%, 15%, 5%, 5%' : '3%, 20%, 52%, 15%, 10%'}"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedPlugin"/>
+ </f:facet>
+
+ <onc:select name="selectedPlugin"
value="#{serverPlugin.id}"/>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="ID"/>
+ </f:facet>
+
+ <h:outputText value="#{serverPlugin.id}"/>
+ </rich:column>
+
+ <rich:column sortBy="#{serverPlugin.displayName}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name"/>
+ </f:facet>
+
+ <h:outputLink
value="/rhq/admin/plugin/plugin-details-plain.xhtml"
rendered="#{serverPlugin.status eq 'INSTALLED'}">
+ <f:param name="plugin"
value="#{serverPlugin.name}"/>
+ <f:param name="deployment" value="SERVER"/>
+ <f:param name="pluginType"
value="#{serverPlugin.type}"/>
+ <h:outputText value="#{serverPlugin.displayName}"/>
+ </h:outputLink>
+ <h:outputText value="#{serverPlugin.displayName}"
rendered="#{serverPlugin.status ne 'INSTALLED'}"/>
+
+ </rich:column>
+
+ <rich:column sortBy="#{serverPlugin.description}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description"/>
+ </f:facet>
+
+ <h:outputText value="#{serverPlugin.description}"/>
+ </rich:column>
+
+ <rich:column sortBy="#{serverPlugin.mtime}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Last
Update"/>
+ </f:facet>
+
+ <h:outputText value="#{serverPlugin.mtime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+
+ <rich:column sortBy="#{serverPlugin.enabled}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Enabled"/>
+ </f:facet>
+
+ <h:graphicImage
value="/images/icons/availability_green_16.png"
rendered="#{serverPlugin.enabled}"/>
+ <h:graphicImage value="/images/icons/availability_red_16.png"
rendered="#{!serverPlugin.enabled}"/>
+ </rich:column>
+
+ <rich:column sortBy="#{serverPlugin.status}"
rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Deployed"/>
+ </f:facet>
+
+ <h:graphicImage
value="/images/icons/availability_green_16.png"
rendered="#{serverPlugin.status eq 'INSTALLED' }"/>
+ <h:graphicImage value="/images/icons/availability_red_16.png"
rendered="#{serverPlugin.status ne 'INSTALLED' }"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column
colspan="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? 6 : 5}"
width="100%">
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.enableServerPlugins}"
+ value="ENABLE"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.disableServerPlugins}"
+ value="DISABLE"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.undeployServerPlugins}"
+ value="UNDEPLOY"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ <onc:selectCommandButton
action="#{InstalledPluginsUIBean.purgeServerPlugins}"
+
rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}"
+ value="PURGE"
target="selectedPlugin" styleClass="on-pager-button buttonsmall">
+ </onc:selectCommandButton>
+ </rich:column>
+ <rich:column breakBefore="true"
colspan="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? 6 : 5}"
width="100%">
+ <h:commandButton
action="#{InstalledPluginsUIBean.scan}"
+ value="SCAN FOR UPDATES"
styleClass="on-pager-button buttonsmall">
+ </h:commandButton>
+ <h:commandButton
action="#{InstalledPluginsUIBean.restartMasterPluginContainer}"
+ value="RESTART MASTER PLUGIN CONTAINER"
styleClass="on-pager-button buttonsmall">
+ </h:commandButton>
+ <h:commandButton
action="#{InstalledPluginsSessionUIBean.showUndeployedServerPlugins}"
+
rendered="#{!InstalledPluginsSessionUIBean.showAllServerPlugins}"
+ value="SHOW UNDEPLOYED"
styleClass="on-pager-button buttonsmall">
+ </h:commandButton>
+ <h:commandButton
action="#{InstalledPluginsSessionUIBean.hideUndeployedServerPlugins}"
+
rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}"
+ value="HIDE UNDEPLOYED"
styleClass="on-pager-button buttonsmall">
+ </h:commandButton>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:tab>
+ </rich:tabPanel>
+ </h:panelGrid>
+
+ </rich:panel>
+
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Upload Plugin"/>
+ </f:facet>
+
+ <h:panelGrid columns="1" width="100%">
+ <rich:fileUpload
+ id="upload"
+ fileUploadListener="#{InstalledPluginsUIBean.fileUploadListener}"
+ maxFilesQuantity="10"
+ acceptedTypes="jar"
+ noDuplicate="true"
+ immediateUpload="false"
+ autoclear="false"
+ allowFlash="false">
+ <a4j:support event="onuploadcomplete"
reRender="pluginsmessages" />
+ </rich:fileUpload>
+ </h:panelGrid>
+
+</rich:panel>
+</h:form>
+</ui:define>
+
+</ui:composition>
commit dc2c58ac2e463d43f331d393955a605576e0476f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 13:57:21 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented admin >
config > settings section
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp
index 4ad7b5f..dc5dcfb 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp
@@ -33,6 +33,9 @@
<c:if test="${not empty param.debug}">
<input type="hidden" name="debug"
value="${param.debug}" />
</c:if>
+<c:if test="${not empty param.nomenu}">
+ <input type="hidden" name="nomenu"
value="${param.nomenu}" />
+</c:if>
<tiles:insert page="/admin/config/SystemInfoForm.jsp"/>
<br>
commit 36bde6fd9ce6e52d996ae59be1a131abf2905630
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 13:56:50 2010 -0400
implement "plain" / "nomenu" scheme using iframed-facelets for
unimplemented admin > config > license section
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
index a4a323e..6c08474 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
@@ -1898,6 +1898,19 @@
<forward name="failure"
path="/admin/license/LicenseAdmin.do?mode=edit&error=true"
redirect="true"/>
<forward name="success"
path="/admin/license/LicenseAdmin.do?mode=view&update=true"
redirect="true"/>
</action>
+
+ <action path="/admin/license/UpdateLicenseNoMenu"
+ name="LicenseAdminForm"
+ scope="request"
+ parameter="mode"
+ type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction"
+
input="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">
+ <set-property property="title" value="License"/>
+ <forward name="cancel"
path="/admin/license/LicenseAdmin.do?mode=view&nomenu=true"
redirect="true"/>
+ <forward name="reset"
path="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true"
redirect="true"/>
+ <forward name="failure"
path="/admin/license/LicenseAdmin.do?mode=edit&error=true&nomenu=true"
redirect="true"/>
+ <forward name="success"
path="/admin/license/LicenseAdmin.do?mode=view&update=true&nomenu=true"
redirect="true"/>
+ </action>
<action path="/dashboard/Admin"
forward=".dashboard.admin.layout">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
index 6f30264..4c7d47a 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
@@ -84,7 +84,7 @@
<hq:authorization permission="MANAGE_SETTINGS">
<tr>
- <td class="BlockContent" colspan="4"
align="center"><html:link
action="/admin/license/LicenseAdmin.do?mode=edit">Update
License</html:link>
+ <td class="BlockContent" colspan="4"
align="center"><html:link
action="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">Update
License</html:link>
</td>
</tr>
</hq:authorization>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
index 5019eb0..f49a8bf 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
@@ -10,7 +10,8 @@
<table width="100%" cellpadding="0" cellspacing="0"
border="0">
- <html:form action="/admin/license/UpdateLicense"
enctype="multipart/form-data" method="POST">
+ <c:if test="${not empty param.nomenu}">
+ <html:form action="/admin/license/UpdateLicenseNoMenu"
enctype="multipart/form-data" method="POST">
<tr>
<td colspan="4" class="BlockHeader">
<tiles:insert definition=".header.tab">
@@ -30,7 +31,30 @@
</tr>
<tiles:insert definition=".form.buttons"/>
-
</html:form>
+ </c:if>
+ <c:if test="${empty param.nomenu}">
+ <html:form action="/admin/license/UpdateLicense"
enctype="multipart/form-data" method="POST">
+ <tr>
+ <td colspan="4" class="BlockHeader">
+ <tiles:insert definition=".header.tab">
+ <tiles:put name="tabKey"
value="admin.license.UpdateLicenseTab"/>
+ </tiles:insert>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="4">An up to date license file can be downloaded
from the
+ <a
href="https://network.jboss.com/jbossnetwork/restricted/listSoftware...
+ JBoss Network Customer Service Portal</a>.</td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message
key="admin.license.LicenseFile"/></td>
+ <td class="BlockContent"><html:file
property="licenseFile"/></td>
+ <td colspan="2"
class="BlockContent"> </td>
+ </tr>
+
+ <tiles:insert definition=".form.buttons"/>
+ </html:form>
+ </c:if>
</table>
\ No newline at end of file
commit 805562e28f654ad90f65c93e16ce2644707af6c3
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 12:38:14 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented
administration > cluster section
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 469fda4..dc1bb5c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -249,15 +249,14 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
} else if ("Cluster".equals(section)) {
String url = null;
if ("Servers".equals(page)) {
- url = "/rhq/ha/listServers.xhtml";
+ url = "/rhq/ha/listServers-plain.xhtml";
} else if ("Agents".equals(page)) {
- url = "/rhq/ha/listAgents.xhtml";
+ url = "/rhq/ha/listAgents-plain.xhtml";
} else if ("Affinity Groups".equals(page)) {
- url = "/rhq/ha/listAffinityGroups.xhtml";
+ url = "/rhq/ha/listAffinityGroups-plain.xhtml";
} else if ("Partition Events".equals(page)) {
- url = "/rhq/ha/listPartitionEvents.xhtml";
+ url = "/rhq/ha/listPartitionEvents-plain.xhtml";
}
- url = addQueryStringParam(url, "nomenu=true");
content = new FullHTMLPane(url);
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml
new file mode 100644
index 0000000..b51e6b2
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml
@@ -0,0 +1,211 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- Server View/Edit -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/viewServer-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=view&serverId=#{param.serverId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>edit</from-outcome>
+
<to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=edit&serverId=#{param.serverId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=view&serverId=#{param.serverId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Server List -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/listServers-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/ha/listServers-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/ha/listServers-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Agent View -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/viewAgent-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/viewAgent-plain.xhtml?mode=view&agentId=#{param.agentId}&serverId=#{param.serverId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- AffinityGroup View/Edit -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>createSuccess</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{ViewAffinityGroupDetailsUIBean.affinityGroup.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancelCreate</from-outcome>
+ <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createFailure</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=create</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{param.affinityGroupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>edit</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=edit&affinityGroupId=#{param.affinityGroupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>addAgentToAffinityGroup</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>editServers</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{param.affinityGroupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- AffinityGroup List -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>create</from-outcome>
+
<to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=create</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Agent add/remove from group -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>successOrFailure</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Server add/remove from group -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/affinityGroupServers-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>successOrFailure</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- List PartitionEvents -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- View PartitionEventDetails -->
+ <navigation-rule>
+ <from-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml?eventId=#{param.eventId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml?eventId=#{param.eventId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index 1bcfe79..87580b6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -163,6 +163,7 @@
/WEB-INF/jsf-navigation/test-navigation.xml,
/WEB-INF/jsf-navigation/alert-plain-navigation.xml,
+ /WEB-INF/jsf-navigation/cluster-plain-navigation.xml,
/WEB-INF/jsf-navigation/content-plain-navigation.xml,
/WEB-INF/jsf-navigation/events-plain-navigation.xml,
/WEB-INF/jsf-navigation/operation-plain-navigation.xml,
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml
new file mode 100644
index 0000000..1943479
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml
@@ -0,0 +1,288 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="affinityGroupDetails"
value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" />
+ <ui:param name="mode" value="#{param.mode}" />
+
+ <h:form id="subscribedAgentsForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Agents in this group"/>
+ </f:facet>
+
+ <ui:param name="subscribedAgentsDataModel"
value="#{AffinityGroupSubscribedAgentsUIBean.dataModel}"/>
+ <rich:dataTable id="subscribedAgentsDataTable"
+
rows="#{PageControl.AffinityGroupSubscribedAgents.pageSize}"
+ value="#{subscribedAgentsDataModel}"
+ var="agentItem"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AffinityGroupSubscribedAgents"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAgentsToUnsubscribe"
/>
+ </f:facet>
+
+ <onc:select name="selectedAgentsToUnsubscribe"
value="#{agentItem.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAgent-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="agentId"
value="#{agentItem.id}"/>
+ <h:outputText value="#{agentItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.address">
+ <h:outputText styleClass="headerText"
value="Bind Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.port">
+ <h:outputText styleClass="headerText"
value="Bind Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.port}"/>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.agentToken">
+ <h:outputText styleClass="headerText"
value="Token" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.agentToken}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.lastAvailabilityReport">
+ <h:outputText styleClass="headerText"
value="Last Availability Report" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{agentItem.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.status}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:5 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 8 : 5}"
width="100%">
+
+ <onc:selectCommandButton
action="#{AffinityGroupSubscribedAgentsUIBean.unsubscribeAgents}"
+ value="REMOVE FROM GROUP"
styleClass="on-pager-button buttonsmall"
+
target="selectedAgentsToUnsubscribe"/>
+
+ <ui:param name="paginationDataTableName"
value="subscribedAgentsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{subscribedAgentsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupSubscribedAgents}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <h:form id="unsubscribedAgentsForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Agents not part of an affinity
group"/>
+ </f:facet>
+
+ <ui:param name="unsubscribedAgentsDataModel"
value="#{AffinityGroupUnsubscribedAgentsUIBean.dataModel}"/>
+ <rich:dataTable id="unsubscribedAgentsDataTable"
+
rows="#{PageControl.AffinityGroupUnsubscribedAgents.pageSize}"
+ value="#{unsubscribedAgentsDataModel}"
+ var="agentItem"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 10%"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="AffinityGroupUnsubscribedAgents" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAgentsToSubscribe"
/>
+ </f:facet>
+
+ <onc:select name="selectedAgentsToSubscribe"
value="#{agentItem.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAgent-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="agentId"
value="#{agentItem.id}"/>
+ <h:outputText value="#{agentItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.address">
+ <h:outputText styleClass="headerText"
value="Bind Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.port">
+ <h:outputText styleClass="headerText"
value="Bind Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.port}"/>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.agentToken">
+ <h:outputText styleClass="headerText"
value="Token" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.agentToken}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.lastAvailabilityReport">
+ <h:outputText styleClass="headerText"
value="Last Availability Report" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{agentItem.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.status}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:5 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 8 : 5}"
width="100%">
+
+ <onc:selectCommandButton
action="#{AffinityGroupUnsubscribedAgentsUIBean.subscribeAgents}"
+ value="ADD TO GROUP"
styleClass="on-pager-button buttonsmall"
+
target="selectedAgentsToSubscribe"/>
+
+ <ui:param name="paginationDataTableName"
value="unsubscribedAgentsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{unsubscribedAgentsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupUnsubscribedAgents}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <h:outputText value="Return to Affinity Group"/>
+ <f:param name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <f:param name="mode" value="#{param.mode}"/>
+ </h:outputLink>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml
new file mode 100644
index 0000000..79b86d7
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml
@@ -0,0 +1,290 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="affinityGroupDetails"
value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" />
+ <ui:param name="mode" value="#{param.mode}" />
+
+ <h:form id="subscribedServersForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Server Members"/>
+ </f:facet>
+
+ <ui:param name="subscribedServersDataModel"
value="#{AffinityGroupSubscribedServersUIBean.dataModel}"/>
+ <rich:dataTable id="subscribedServersDataTable"
+
rows="#{PageControl.AffinityGroupSubscribedServers.pageSize}"
+ value="#{subscribedServersDataModel}"
+ var="serverItem"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 8%, 8%, 15%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AffinityGroupSubscribedServers"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedServersToUnsubscribe"
/>
+ </f:facet>
+
+ <onc:select name="selectedServersToUnsubscribe"
value="#{serverItem.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{serverItem.id}"/>
+ <h:outputText value="#{serverItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.operationMode">
+ <h:outputText styleClass="headerText"
value="Mode" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.operationMode}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.address">
+ <h:outputText styleClass="headerText"
value="Endpoint Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.port">
+ <h:outputText styleClass="headerText"
value="HTTP Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.securePort">
+ <h:outputText styleClass="headerText"
value="Secure HTTPS Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.securePort}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.ctime">
+ <h:outputText styleClass="headerText"
value="Last Update Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:7 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 8 : 7}"
width="100%">
+
+ <onc:selectCommandButton
action="#{AffinityGroupSubscribedServersUIBean.unsubscribeServers}"
+ value="REMOVE FROM GROUP"
styleClass="on-pager-button buttonsmall"
+
target="selectedServersToUnsubscribe"/>
+
+ <ui:param name="paginationDataTableName"
value="subscribedServersDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{subscribedServersDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupSubscribedServers}"/>
+ <ui:include
src="../resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+
+ </h:form>
+
+ <h:form id="unsubscribedServersForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Server Members"/>
+ </f:facet>
+
+ <ui:param name="unsubscribedServersDataModel"
value="#{AffinityGroupUnsubscribedServersUIBean.dataModel}"/>
+ <rich:dataTable id="unsubscribedServersDataTable"
+
rows="#{PageControl.AffinityGroupUnsubscribedServers.pageSize}"
+ value="#{unsubscribedServersDataModel}"
+ var="serverItem"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 8%, 8%, 15%"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="AffinityGroupUnsubscribedServers" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedServersToSubscribe"
/>
+ </f:facet>
+
+ <onc:select name="selectedServersToSubscribe"
value="#{serverItem.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{serverItem.id}"/>
+ <h:outputText value="#{serverItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.operationMode">
+ <h:outputText styleClass="headerText"
value="Mode" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.operationMode}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.address">
+ <h:outputText styleClass="headerText"
value="Endpoint Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.port">
+ <h:outputText styleClass="headerText"
value="HTTP Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.securePort">
+ <h:outputText styleClass="headerText"
value="Secure HTTPS Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.securePort}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.ctime">
+ <h:outputText styleClass="headerText"
value="Last Update Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:7 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 8 : 7}"
width="100%">
+
+ <onc:selectCommandButton
action="#{AffinityGroupUnsubscribedServersUIBean.subscribeServers}"
+ value="ADD TO GROUP"
styleClass="on-pager-button buttonsmall"
+
target="selectedServersToSubscribe"/>
+
+ <ui:param name="paginationDataTableName"
value="unsubscribedServersDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{unsubscribedServersDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupUnsubscribedServers}"/>
+ <ui:include
src="../resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+
+ </h:form>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <h:outputText value="Return to Affinity Group"/>
+ <f:param name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <f:param name="mode" value="#{param.mode}"/>
+ </h:outputLink>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml
new file mode 100644
index 0000000..3756548
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml
@@ -0,0 +1,113 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="affinityGroupsForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+
+ <rich:panel styleClass="BlockContent">
+
+ <ui:param name="affinityGroupsDataModel"
value="#{ListAffinityGroupsUIBean.dataModel}"/>
+ <rich:dataTable id="affinityGroupsDataTable"
+ rows="#{PageControl.ListAffinityGroups.pageSize}"
+ value="#{affinityGroupsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="ListAffinityGroups" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAffinityGroups" />
+ </f:facet>
+
+ <onc:select name="selectedAffinityGroups"
value="#{item.affinityGroup.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="ag.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.affinityGroup.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="ag.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="affinityGroupId"
value="#{item.affinityGroup.id}"/>
+ <h:outputText value="#{item.affinityGroup.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Agent
Count" />
+ </f:facet>
+
+ <h:outputText value="#{item.agentCount}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Server Count" />
+ </f:facet>
+
+ <h:outputText value="#{item.serverCount}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 5:4 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 5 : 4}"
width="100%">
+ <h:commandButton
action="#{ListAffinityGroupsUIBean.createNewAffinityGroup}"
+ value="CREATE NEW"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="${GlobalPermissionsUIBean.inventory}" />
+
+ <onc:selectCommandButton
action="#{ListAffinityGroupsUIBean.deleteSelectedAffinityGroups}"
+ value="REMOVE SELECTED"
target="selectedAffinityGroups"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="${GlobalPermissionsUIBean.inventory}" />
+
+ <ui:param name="paginationDataTableName"
value="affinityGroupsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{affinityGroupsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ListAffinityGroups}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml
new file mode 100644
index 0000000..e085d20
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml
@@ -0,0 +1,138 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="AgentsListForm">
+
+ <rich:panel styleClass="BlockContent">
+
+ <ui:param name="agentsDataModel"
value="#{ListAgentsUIBean.dataModel}"/>
+ <rich:dataTable id="agentsDataTable"
+ rows="#{PageControl.AgentsList.pageSize}"
+ value="#{agentsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="15%, 15%, 10%, 10%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AgentsList" />
+ </f:facet>
+
+ <rich:column rendered="false">
+ <f:facet name="header">
+ <onc:allSelect target="selectedAgents" />
+ </f:facet>
+
+ <onc:select name="selectedAgents"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAgent-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{item.server.id}"/>
+ <f:param name="agentId"
value="#{item.id}"/>
+ <h:outputText value="#{item.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.server.name">
+ <h:outputText styleClass="headerText"
value="Connected Server" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{item.server.id}"/>
+ <h:outputText value="#{item.server.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.address">
+ <h:outputText styleClass="headerText"
value="Agent Bind Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.port">
+ <h:outputText styleClass="headerText"
value="Agent Bind Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.lastAvailabilityReport">
+ <h:outputText styleClass="headerText"
value="Last Availability Report" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.affinityGroup">
+ <h:outputText styleClass="headerText"
value="Affinity Group" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="affinityGroupId"
value="#{item.affinityGroup.id}"/>
+ <h:outputText value="#{item.affinityGroup.name}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 9:6 for the debug 'id' column -->
+ <rich:column colspan="6" width="100%">
+ <ui:param name="paginationDataTableName"
value="agentsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{agentsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AgentsList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml
new file mode 100644
index 0000000..29dfc51
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml
@@ -0,0 +1,162 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="partitionEventsForm">
+
+ <rich:panel styleClass="BlockContent">
+
+ <h:panelGrid columns="4" cellspacing="3">
+ <h:outputLabel for="typeFilter" value="Type Filter:
" />
+ <h:selectOneMenu id="typeFilter"
value="#{ListPartitionEventsUIBean.typeFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
reRender="partitionEventsDataTable, partitionEventsDataTableScroller"/>
+
+ <f:selectItems
value="#{ListPartitionEventsUIBean.typeSelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="executionStatusFilter"
value="Execution Status Filter: " />
+ <h:selectOneMenu id="executionStatusFilter"
value="#{ListPartitionEventsUIBean.executionStatusFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
reRender="partitionEventsDataTable, partitionEventsDataTableScroller"/>
+
+ <f:selectItems
value="#{ListPartitionEventsUIBean.executionStatusSelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="detailsFilter" value="Details
Filter: " />
+ <h:inputText id="detailsFilter"
value="#{ListPartitionEventsUIBean.detailsFilter}"
+ onkeypress="return ignoreEnterKey(event);"
+ style="width: 300px;"/>
+ <a4j:commandButton value="GO"
reRender="partitionEventsDataTable, partitionEventsDataTableScroller"
+ styleClass="buttonmed">
+ <s:defaultAction />
+ </a4j:commandButton>
+ <rich:spacer/>
+ </h:panelGrid>
+
+ <br/>
+
+ <ui:param name="partitionEventsDataModel"
value="#{ListPartitionEventsUIBean.dataModel}"/>
+ <rich:dataTable id="partitionEventsDataTable"
+
rows="#{PageControl.ListPartitionEventsView.pageSize}"
+ value="#{partitionEventsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 25%, 20%, 30% 10% 15%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="ListPartitionEventsView" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedEvents" />
+ </f:facet>
+
+ <onc:select name="selectedEvents"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="pe.ctime">
+ <h:outputText styleClass="headerText"
value="Execution Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="pe.eventType">
+ <h:outputText styleClass="headerText"
value="Type" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewPartitionEvent-plain.xhtml">
+ <f:param name="eventId"
value="#{item.id}"/>
+ <h:outputText value="#{item.eventType}" />
+ </h:outputLink>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="pe.eventDetail">
+ <h:outputText styleClass="headerText"
value="Details" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.eventDetail}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="pe.subjectName">
+ <h:outputText styleClass="headerText"
value="Initiated By" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.subjectName}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="pe.executionStatus">
+ <h:outputText styleClass="headerText"
value="Execution Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.executionStatus}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6" width="100%">
+ <onc:selectCommandButton
action="#{ListPartitionEventsUIBean.removeSelectedEvents}"
+ value="REMOVE SELECTED"
target="selectedEvents" styleClass="on-pager-button buttonsmall"
+
rendered="${GlobalPermissionsUIBean.inventory}" />
+ <h:commandButton
action="#{ListPartitionEventsUIBean.purgeAllEvents}"
+ value="PURGE ALL"
styleClass="on-pager-button buttonsmall"
+
rendered="${GlobalPermissionsUIBean.inventory}" />
+ <h:commandButton
action="#{ListPartitionEventsUIBean.repartition}"
+ value="FORCE REPARTITION"
styleClass="on-pager-button buttonsmall"
+
rendered="${GlobalPermissionsUIBean.inventory}" />
+
+ <ui:param name="paginationDataTableName"
value="partitionEventsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{partitionEventsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ListPartitionEventsView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml
new file mode 100644
index 0000000..d3ddce8
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml
@@ -0,0 +1,168 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="serversListForm">
+
+ <rich:panel styleClass="BlockContent">
+
+ <ui:param name="serversDataModel"
value="#{ListServersUIBean.dataModel}"/>
+ <rich:dataTable id="serversDataTable"
+ rows="#{PageControl.ServersList.pageSize}"
+ value="#{serversDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="ServersList" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedServers" />
+ </f:facet>
+
+ <onc:select name="selectedServers"
value="#{item.server.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{item.server.id}"/>
+ <h:outputText value="#{item.server.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.operationMode">
+ <h:outputText styleClass="headerText"
value="Mode" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.operationMode}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.address">
+ <h:outputText styleClass="headerText"
value="Endpoint Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.port">
+ <h:outputText styleClass="headerText"
value="Nonsecure Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.securePort">
+ <h:outputText styleClass="headerText"
value="Secure Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.securePort}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.mtime">
+ <h:outputText styleClass="headerText"
value="Last Update Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.mtime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.affinityGroup">
+ <h:outputText styleClass="headerText"
value="Affinity Group" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="affinityGroupId"
value="#{item.server.affinityGroup.id}"/>
+ <h:outputText
value="#{item.server.affinityGroup.name}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Agent
Count" />
+ </f:facet>
+
+ <h:outputText value="#{item.agentCount}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 10:9 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 10 : 9}"
width="100%">
+ <onc:selectCommandButton
action="#{ListServersUIBean.setSelectedServersModeNormal}"
+ value="SET NORMAL"
target="selectedServers" styleClass="on-pager-button
buttonsmall"/>
+ <onc:selectCommandButton
action="#{ListServersUIBean.setSelectedServersModeMaintenance}"
+ value="SET MAINTENANCE"
target="selectedServers" styleClass="on-pager-button buttonsmall"/>
+ <onc:selectCommandButton
action="#{ListServersUIBean.removeSelectedServers}"
+ value="REMOVE SELECTED"
target="selectedServers" styleClass="on-pager-button
buttonsmall"/>
+
+ <ui:param name="paginationDataTableName"
value="serversDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{serversDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ServersList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml
new file mode 100644
index 0000000..968f4d8
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml
@@ -0,0 +1,291 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="affinityGroupDetails"
value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" />
+ <ui:param name="mode" value="#{param.mode}" />
+
+ <h:form id="affinityGroupDetailsForm">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}" />
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">Affinity Group
Details</f:facet>
+ <table>
+ <tr>
+ <td align="right"><b>Name:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{affinityGroupDetails.name}" />
+ <h:inputText rendered="#{mode eq 'edit' || mode eq
'create'}" value="#{affinityGroupDetails.name}" />
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton rendered="#{mode eq 'view'}"
+ value="EDIT"
action="#{ViewAffinityGroupDetailsUIBean.edit}"
+ alt="Edit" styleClass="buttonmed"
id="editButton"/>
+ <h:commandButton rendered="#{mode eq 'edit'}"
+ value="SAVE"
action="#{ViewAffinityGroupDetailsUIBean.save}"
+ alt="Save" styleClass="buttonmed"
id="saveButton"/>
+ <h:commandButton rendered="#{mode eq 'edit'}"
+ value="CANCEL"
action="#{ViewAffinityGroupDetailsUIBean.cancelEdit}"
immediate="true"
+ alt="Cancel" styleClass="buttonmed"
id="cancelEditButton"/>
+ <h:commandButton rendered="#{mode eq 'create'}"
+ value="CREATE"
action="#{ViewAffinityGroupDetailsUIBean.createNew}"
+ alt="Create" styleClass="buttonmed"
id="createButton"/>
+ <h:commandButton rendered="#{mode eq 'create'}"
+ value="CANCEL"
action="#{ViewAffinityGroupDetailsUIBean.cancelCreate}"
immediate="true"
+ alt="Cancel" styleClass="buttonmed"
id="cancelCreateButton"/>
+ </h:panelGrid>
+ </h:form>
+
+ <h:form id="agentsForm" rendered="#{mode eq
'view'}">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Agent Members"/>
+ </f:facet>
+
+ <ui:param name="agentsDataModel"
value="#{ViewAffinityGroupAgentMembersUIBean.dataModel}"/>
+ <rich:dataTable id="agentsDataTable"
+
rows="#{PageControl.AffinityGroupAgentMembersView.pageSize}"
+ value="#{agentsDataModel}"
+ var="agentItem"
+ width="100%"
+ columnsWidth="15%, 10%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AffinityGroupAgentMembersView"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAgent-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="agentId"
value="#{agentItem.id}"/>
+ <h:outputText value="#{agentItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.address">
+ <h:outputText styleClass="headerText"
value="Bind Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.port">
+ <h:outputText styleClass="headerText"
value="Bind Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.port}"/>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.agentToken">
+ <h:outputText styleClass="headerText"
value="Token" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.agentToken}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.lastAvailabilityReport">
+ <h:outputText styleClass="headerText"
value="Last Availability Report" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{agentItem.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{agentItem.status}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:5 for the debug 'id' column -->
+ <rich:column colspan="#{param.debug ? 7 : 4}"
width="100%">
+
+ <h:commandButton
action="#{ViewAffinityGroupAgentMembersUIBean.addAgentToAffinityGroup}"
+ value="EDIT GROUP AGENTS"
styleClass="on-pager-button buttonsmall"/>
+
+ <ui:param name="paginationDataTableName"
value="agentsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{agentsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupAgentMembersView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <h:form id="serversForm" rendered="#{mode eq
'view'}">
+ <input type="hidden" name="affinityGroupId"
value="#{param.affinityGroupId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Server Members"/>
+ </f:facet>
+
+ <ui:param name="serversDataModel"
value="#{ViewAffinityGroupServerMembersUIBean.dataModel}"/>
+ <rich:dataTable id="serversDataTable"
+
rows="#{PageControl.AffinityGroupServerMembersView.pageSize}"
+ value="#{serversDataModel}"
+ var="serverItem"
+ width="100%"
+ columnsWidth="15%, 10%, 10%, 8%, 8%, 15%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AffinityGroupServerMembersView"
/>
+ </f:facet>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{serverItem.id}"/>
+ <h:outputText value="#{serverItem.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.operationMode">
+ <h:outputText styleClass="headerText"
value="Mode" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.operationMode}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.address">
+ <h:outputText styleClass="headerText"
value="Endpoint Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.port">
+ <h:outputText styleClass="headerText"
value="HTTP Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.securePort">
+ <h:outputText styleClass="headerText"
value="Secure HTTPS Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.securePort}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="s.ctime">
+ <h:outputText styleClass="headerText"
value="Last Update Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{serverItem.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 8:7 for the debug 'id' column -->
+ <rich:column colspan="6" width="100%">
+
+ <h:commandButton
action="#{ViewAffinityGroupServerMembersUIBean.editServers}"
+ value="EDIT GROUP SERVERS"
styleClass="on-pager-button buttonsmall"/>
+
+ <ui:param name="paginationDataTableName"
value="serversDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{serversDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AffinityGroupServerMembersView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml
new file mode 100644
index 0000000..ba854ac
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml
@@ -0,0 +1,203 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="agentDetails"
value="#{ViewAgentUIBean.agent}" />
+ <ui:param name="mode" value="#{param.mode}" />
+
+ <h:form id="agentDetailsForm">
+ <input type="hidden" name="serverId"
value="#{param.serverId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">Agent Details</f:facet>
+ <table>
+ <tr>
+ <td align="right"><b>Agent
Name:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.name}" />
+ </td>
+ </tr>
+ <tr>
+ <td
align="right"><b>Address:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.address}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Port:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.port}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Token:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.agentToken}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Last Availability Report
Date:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Affinity
Group:</b></td>
+ <td align="left">
+ <h:outputLink rendered="#{mode eq 'view'}"
value="viewAffinityGroup-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="affinityGroupId"
value="#{agentDetails.affinityGroup.id}"/>
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{agentDetails.affinityGroup.name}"/>
+ </h:outputLink>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Current
Server:</b></td>
+ <td align="left">
+ <h:outputLink rendered="#{mode eq 'view'}"
value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{agentDetails.server.id}"/>
+ <h:outputText value="#{agentDetails.server.name}"
/>
+ </h:outputLink>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ </h:form>
+
+
+
+ <h:form id="failoverListForm" rendered="#{mode eq
'view'}">
+ <input type="hidden" name="agentId"
value="#{param.agentId}"/>
+ <input type="hidden" name="serverId"
value="#{param.serverId}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Agent Failover List"/>
+ </f:facet>
+
+ <ui:param name="failoverListDataModel"
value="#{ViewAgentUIBean.dataModel}"/>
+ <rich:dataTable id="failoverListDataTable"
+
rows="#{PageControl.AgentFailoverListView.pageSize}"
+ value="#{failoverListDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="20%, 16%, 16%, 16%, 16%, 16%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AgentFailoverListView" />
+ </f:facet>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="fld.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="fld.server.name">
+ <h:outputText styleClass="headerText"
value="Server Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewServer-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="serverId"
value="#{item.server.id}"/>
+ <h:outputText value="#{item.server.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="fld.server.operationMode">
+ <h:outputText styleClass="headerText"
value="Mode" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.operationMode}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="fld.server.address">
+ <h:outputText styleClass="headerText"
value="Endpoint Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="fld.server.port">
+ <h:outputText styleClass="headerText"
value="HTTP Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="fld.server.securePort">
+ <h:outputText styleClass="headerText"
value="Secure HTTPS Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.securePort}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="fld.server.mtime">
+ <h:outputText styleClass="headerText"
value="Last Update Time" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.server.mtime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="#{param.debug ? 7 : 6}"
width="100%">
+ <ui:param name="paginationDataTableName"
value="failoverListDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{failoverListDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AgentFailoverListView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml
new file mode 100644
index 0000000..65def3a
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml
@@ -0,0 +1,130 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="partitionEventForm">
+ <input type="hidden" name="eventId"
value="#{param.eventId}"/>
+
+ <ui:param name="eventDetails"
value="#{ViewPartitionEventUIBean.partitionEvent}" />
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Event Details"/>
+ </f:facet>
+ <table>
+ <tr>
+ <td align="right"><b>Event Execution
Time:</b></td>
+ <td align="left">
+ <h:outputText value="#{eventDetails.ctime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Event
Type:</b></td>
+ <td align="left">
+ <h:outputText value="#{eventDetails.eventType}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Event
Details:</b></td>
+ <td align="left">
+ <h:outputText value="#{eventDetails.eventDetail}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Initiated
By:</b></td>
+ <td align="left">
+ <h:outputText value="#{eventDetails.subjectName}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Execution
Status:</b></td>
+ <td align="left">
+ <h:outputText
value="#{eventDetails.executionStatus}"/>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Agent Assignments"/>
+ </f:facet>
+
+ <ui:param name="partitionEventDataModel"
value="#{ViewPartitionEventUIBean.dataModel}"/>
+
+ <h:outputText value="No agents were reassigned as a result of this
partition event"
+ rendered="#{partitionEventDataModel.rowCount eq
0}"/>
+
+ <rich:dataTable rendered="#{partitionEventDataModel.rowCount gt
0}"
+ id="partitionEventDataTable"
+
rows="#{PageControl.PartitionEventsDetailsView.pageSize}"
+ value="#{partitionEventDataModel}"
+ var="item"
+ width="50%"
+ columnsWidth="50%, 50%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="PartitionEventsDetailsView"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="ped.agentName">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.agentName}"/>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="ped.serverName">
+ <h:outputText styleClass="headerText"
value="Server Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.serverName}"/>
+
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="2" width="100%">
+ <ui:param name="paginationDataTableName"
value="partitionEventDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{partitionEventDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.PartitionEventsDetailsView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <h:outputLink value="listPartitionEvents-plain.xhtml">
+ <h:outputText value="Return to Partition Events List"/>
+ </h:outputLink>
+
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml
new file mode 100644
index 0000000..f3b94ab
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml
@@ -0,0 +1,206 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="serverDetails"
value="#{ViewServerUIBean.server}" />
+ <ui:param name="mode" value="#{param.mode}" />
+
+ <h:form id="serverDetailsForm">
+ <input type="hidden" name="serverId"
value="#{param.serverId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">Server Details</f:facet>
+ <table>
+ <tr>
+ <td align="right"><b>Server
Name:</b></td>
+ <td align="left">
+ <h:outputText value="#{serverDetails.name}" />
+ </td>
+ </tr>
+ <tr>
+ <td
align="right"><b>Address:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{serverDetails.address}"/>
+ <h:inputText rendered="#{mode eq 'edit'}"
value="#{serverDetails.address}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Port:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{serverDetails.port}"/>
+ <h:inputText rendered="#{mode eq 'edit'}"
value="#{serverDetails.port}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Secure
Port:</b></td>
+ <td align="left">
+ <h:outputText rendered="#{mode eq 'view'}"
value="#{serverDetails.securePort}"/>
+ <h:inputText rendered="#{mode eq 'edit'}"
value="#{serverDetails.securePort}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Operation
Mode:</b></td>
+ <td align="left">
+ <h:outputText
value="#{serverDetails.operationMode}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Affinity
Group:</b></td>
+ <td align="left">
+ <h:outputText
value="#{serverDetails.affinityGroup.name}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Installation
Date:</b></td>
+ <td align="left">
+ <h:outputText value="#{serverDetails.ctime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right"><b>Last Update
Time:</b></td>
+ <td align="left">
+ <h:outputText value="#{serverDetails.mtime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton rendered="#{mode eq 'view'}"
+ value="EDIT"
action="#{ViewServerUIBean.edit}"
+ alt="Edit" styleClass="buttonmed"
id="editButton"/>
+ <h:commandButton rendered="#{mode eq 'edit'}"
+ value="SAVE"
action="#{ViewServerUIBean.save}"
+ alt="Save" styleClass="buttonmed"
id="saveButton"/>
+ <h:commandButton rendered="#{mode eq 'edit'}"
+ value="CANCEL"
action="#{ViewServerUIBean.cancel}" immediate="true"
+ alt="Cancel" styleClass="buttonmed"
id="cancelButton"/>
+ </h:panelGrid>
+ </h:form>
+
+ <h:form id="connectedAgentsForm" rendered="#{mode eq
'view'}">
+ <input type="hidden" name="serverId"
value="#{param.serverId}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Connected Agents"/>
+ </f:facet>
+
+ <ui:param name="connectedAgentsDataModel"
value="#{ViewServerUIBean.dataModel}"/>
+ <rich:dataTable id="connectedAgentsDataTable"
+
rows="#{PageControl.ServerConnectedAgentsView.pageSize}"
+ value="#{connectedAgentsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 15%, 10%, 10%, 10%, 10%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="ServerConnectedAgentsView"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAgents" />
+ </f:facet>
+
+ <onc:select name="selectedAgents"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Agent Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="viewAgent-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="agentId"
value="#{item.id}"/>
+ <f:param name="serverId"
value="#{param.serverId}"/>
+ <h:outputText value="#{item.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.address">
+ <h:outputText styleClass="headerText"
value="Bind Address" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.address}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.port">
+ <h:outputText styleClass="headerText"
value="Bind Port" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.port}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.lastAvailabilityReport">
+ <h:outputText styleClass="headerText"
value="Last Availability Report" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.lastAvailabilityReport}">
+ <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz"
timeZone="#{ServerInfoUIBean.timeZone}"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Affinity Group" />
+ </f:facet>
+
+ <h:outputLink value="viewAffinityGroup-plain.xhtml">
+ <f:param name="mode" value="view"/>
+ <f:param name="affinityGroupId"
value="#{item.affinityGroup.id}"/>
+ <h:outputText value="#{item.affinityGroup.name}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <!-- colspan 9:6 for the debug 'id' column -->
+ <rich:column colspan="6" width="100%">
+ <ui:param name="paginationDataTableName"
value="connectedAgentsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{connectedAgentsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ServerConnectedAgentsView}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit 9c6f7cd5ed5a619166ba67faf7042f59899c1677
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 12:37:25 2010 -0400
reformat, cosmetic
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 6eead0b..469fda4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -49,11 +49,9 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
public static final String VIEW_PATH = "Administration";
-
private ViewId currentSectionViewId;
private ViewId currentPageViewId;
-
private SectionStack sectionStack;
private Canvas contentCanvas;
@@ -76,14 +74,12 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
sectionStack.setWidth(250);
sectionStack.setHeight100();
-
treeGrids.put("Security", buildSecuritySection());
treeGrids.put("Configuration", buildSystemConfigurationSection());
treeGrids.put("Cluster", buildManagementClusterSection());
treeGrids.put("Reports", buildReportsSection());
treeGrids.put("Security", buildSecuritySection());
-
for (final String name : treeGrids.keySet()) {
TreeGrid grid = treeGrids.get(name);
@@ -93,7 +89,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
}
});
-
SectionStackSection section = new SectionStackSection(name);
section.setExpanded(true);
section.addItem(grid);
@@ -101,23 +96,20 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
sectionStack.addSection(section);
}
-
addMember(sectionStack);
addMember(contentCanvas);
}
-
private HTMLFlow defaultView() {
- String contents = "<h1>Administration</h1>\n" +
- "From this section, the RHQ global settings can be administered.
This includes configuring \n" +
- "<a href=\"\">Security</a>, setting up <a
href=\"\">Plugins</a> and other stuff.";
+ String contents = "<h1>Administration</h1>\n"
+ + "From this section, the RHQ global settings can be administered. This
includes configuring \n"
+ + "<a href=\"\">Security</a>, setting up <a
href=\"\">Plugins</a> and other stuff.";
HTMLFlow flow = new HTMLFlow(contents);
flow.setPadding(20);
return flow;
}
-
private TreeGrid buildSecuritySection() {
final TreeGrid securityTreeGrid = new TreeGrid();
@@ -136,19 +128,14 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
final TreeNode remoteAgentInstall = new TreeNode("Remote Agent
Install");
remoteAgentInstall.setIcon("global/Agent_16.png");
-
- tree.setRoot(new TreeNode("security",
- manageUsersNode,
- manageRolesNode,
- discoveryQueue,
- remoteAgentInstall));
+
+ tree.setRoot(new TreeNode("security", manageUsersNode, manageRolesNode,
discoveryQueue, remoteAgentInstall));
securityTreeGrid.setData(tree);
return securityTreeGrid;
}
-
private TreeGrid buildManagementClusterSection() {
final TreeGrid mgmtClusterTreeGrid = new TreeGrid();
@@ -161,18 +148,14 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
final TreeNode manageAffinityGroupsNode = new TreeNode("Affinity
Groups");
final TreeNode managePartitionEventsNode = new TreeNode("Partition
Events");
- tree.setRoot(new TreeNode("clustering",
- manageServersNode,
- manageAgentsNode,
- manageAffinityGroupsNode,
- managePartitionEventsNode));
+ tree.setRoot(new TreeNode("clustering", manageServersNode,
manageAgentsNode, manageAffinityGroupsNode,
+ managePartitionEventsNode));
mgmtClusterTreeGrid.setData(tree);
return mgmtClusterTreeGrid;
}
-
private TreeGrid buildSystemConfigurationSection() {
final TreeGrid systemConfigTreeGrid = new TreeGrid();
@@ -186,15 +169,14 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
final TreeNode manageLicense = new TreeNode("License");
final TreeNode managePlugins = new TreeNode("Plugins");
- tree.setRoot(new TreeNode("System Configuration",
- manageSettings, manageTemplates, manageDownloads, manageLicense,
managePlugins));
+ tree.setRoot(new TreeNode("System Configuration", manageSettings,
manageTemplates, manageDownloads,
+ manageLicense, managePlugins));
systemConfigTreeGrid.setData(tree);
return systemConfigTreeGrid;
}
-
private TreeGrid buildReportsSection() {
final TreeGrid reportsTreeGrid = new TreeGrid();
@@ -212,7 +194,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
return reportsTreeGrid;
}
-
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
@@ -222,7 +203,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
contentCanvas.markForRedraw();
}
-
private void renderContentView(ViewPath viewPath) {
currentSectionViewId = viewPath.getCurrent();
@@ -231,7 +211,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
String section = currentSectionViewId.getPath();
String page = currentPageViewId.getPath();
-
Canvas content = null;
if ("Reports".equals(section)) {
@@ -239,7 +218,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
content = new
FullHTMLPane("/rhq/admin/report/resourceInstallReport-body.xhtml");
}
-
} else if ("Security".equals(section)) {
if ("Manage Users".equals(page)) {
@@ -268,7 +246,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
url = addQueryStringParam(url, "nomenu=true");
content = new FullHTMLPane(url);
-
} else if ("Cluster".equals(section)) {
String url = null;
if ("Servers".equals(page)) {
@@ -284,30 +261,24 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
content = new FullHTMLPane(url);
}
-
for (String name : treeGrids.keySet()) {
TreeGrid treeGrid = treeGrids.get(name);
if (name.equals(section)) {
-// treeGrid.setSelectedPaths(page);
+ // treeGrid.setSelectedPaths(page);
} else {
treeGrid.deselectAllRecords();
}
}
-
-
setContent(content);
-
if (content instanceof BookmarkableView) {
((BookmarkableView) content).renderView(viewPath.next().next());
}
-
}
-
public void renderView(ViewPath viewPath) {
if (!viewPath.isCurrent(currentSectionViewId) ||
!viewPath.isNext(currentPageViewId)) {
@@ -320,7 +291,6 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
}
}
-
}
private static String addQueryStringParam(String url, String param) {
commit 0d845ab5f35094598072d401ced32debc832812a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 12 11:53:17 2010 -0400
minor improvements
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
index 0015742..56f84b6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
@@ -267,10 +267,10 @@ public class ResourceSummaryView extends EnhancedDynamicForm
implements Resource
setValue("name", resource.getName());
setValue("description", resource.getDescription());
setValue("location", resource.getLocation());
- setValue("version", resource.getVersion());
- setValue("parent", resource.getParentResource() == null ? null :
- ("<a href=\"#Resource/" +
resource.getParentResource().getId() + "\">" +
- resource.getParentResource().getName() +
"</a>"));
-
+ setValue("version", (resource.getVersion() != null) ?
resource.getVersion() : "<i>none</i>");
+ Resource parentResource = resource.getParentResource();
+ setValue("parent", parentResource != null ?
+ ("<a href=\"#Resource/" + parentResource.getId() +
"\">" +
+ parentResource.getName() + "</a>") :
"<i>none</i>");
}
}
commit aad7ce9eabe9d79aeb035bd17f98f2ef8ffa7410
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 12 11:26:01 2010 -0400
fix logic that determines which resource tabs are enabled
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 68d92d5..1be470e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -202,46 +202,34 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
ResourcePermission permissions = this.resourceComposite.getResourcePermission();
ResourceFacets facets = this.resourceComposite.getResourceFacets();
- // TODO (ips): No perms should be needed to view Monitoring and Alerts tabs.
+ // Summary, Monitoring, Inventory, and Alerts tabs are always enabled.
- if (permissions.isMeasure()) {
- topTabSet.enableTab(monitoringTab);
- } else {
- topTabSet.disableTab(monitoringTab);
- }
+ monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
- if (facets.isOperation() && permissions.isControl()) {
+ if (facets.isOperation()) {
topTabSet.enableTab(operationsTab);
} else {
topTabSet.disableTab(operationsTab);
}
- if (permissions.isAlert()) {
- topTabSet.enableTab(alertsTab);
- } else {
- topTabSet.disableTab(alertsTab);
- }
-
- if (!facets.isConfiguration() && permissions.isConfigureRead()) {
+ if (facets.isConfiguration() && permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
} else {
topTabSet.disableTab(configurationTab);
}
- if (facets.isEvent() && permissions.isMeasure()) {
+ if (facets.isEvent()) {
topTabSet.enableTab(eventsTab);
} else {
topTabSet.disableTab(eventsTab);
}
- if (facets.isContent() && permissions.isContent()) {
+ if (facets.isContent()) {
topTabSet.enableTab(contentTab);
} else {
topTabSet.disableTab(contentTab);
}
- // only enable "Call Time" sub-tab for those that implement it
- monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
if (topTabSet.getSelectedTab().getDisabled()) {
topTabSet.selectTab(0);
commit d00cabef04eb1ae458a9dcf4b1f217e6d4c7b76e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 12 11:06:03 2010 -0400
add new EnhancedDynamicForm GWT component that supports fields that can be toggled
back and forth between view and edit mode; add support for setting name, description, and
location fields on both Resources and groups
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
index 96745a8..8b6f809 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
@@ -119,6 +119,10 @@ public class ResourceComposite implements Serializable {
return resourcePermission;
}
+ public void setResourcePermission(ResourcePermission resourcePermission) {
+ this.resourcePermission = resourcePermission;
+ }
+
@XmlTransient
public ResourceFacets getResourceFacets() {
return resourceFacets;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java
index 3e8f61a..50ed0ae 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java
@@ -26,10 +26,15 @@ import com.smartgwt.client.widgets.HTMLPane;
*/
public class FullHTMLPane extends HTMLPane {
- public FullHTMLPane(String url) {
+ public FullHTMLPane() {
setWidth100();
setHeight100();
setContentsType(ContentsType.PAGE);
+ }
+
+ public FullHTMLPane(String url) {
+ this();
setContentsURL(url);
}
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
new file mode 100644
index 0000000..02185e7
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
@@ -0,0 +1,156 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.components.form;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.FormItemIfFunction;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.FormItemIcon;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
+import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
+import com.smartgwt.client.widgets.form.fields.events.IconClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.IconClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
+import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public class EnhancedDynamicForm extends DynamicForm {
+ public EnhancedDynamicForm(JavaScriptObject jsObj) {
+ super(jsObj);
+ }
+
+ public EnhancedDynamicForm() {
+ super();
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+ setNumCols(4);
+ setColWidths("25%", "25%", "25%",
"25%");
+ setWrapItemTitles(false);
+ setWidth("90%");
+ }
+
+ @Override
+ public void setItems(FormItem... items) {
+ List<FormItem> itemsList = new ArrayList<FormItem>();
+ List<String> togglableTextItemNames = new ArrayList<String>();
+ for (FormItem item : items) {
+ if (item instanceof TogglableTextItem) {
+ final TogglableTextItem togglableTextItem = (TogglableTextItem) item;
+ togglableTextItemNames.add(togglableTextItem.getName());
+
+ final StaticTextItem staticTextItem =
+ new
StaticTextItem(getStaticTextItemName(togglableTextItem.getName()),
+ togglableTextItem.getTitle());
+ staticTextItem.setAttribute("editing", false);
+
+ FormItemIcon editIcon = new FormItemIcon();
+ editIcon.setName("Edit");
+ editIcon.setSrc("[SKIN]/actions/edit.png");
+ staticTextItem.setIcons(editIcon);
+ staticTextItem.setShowIcons(true);
+
+ staticTextItem.addIconClickHandler(new IconClickHandler() {
+ public void onIconClick(IconClickEvent iconClickEvent) {
+ if ("Edit".equals(iconClickEvent.getIcon().getName()))
{
+ staticTextItem.setAttribute("editing", true);
+ markForRedraw();
+ }
+ }
+ });
+ staticTextItem.setShowIfCondition(new FormItemIfFunction() {
+ public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ boolean editing =
staticTextItem.getAttributeAsBoolean("editing");
+ return !editing;
+ }
+ });
+ staticTextItem.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+ public void
onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
+ staticTextItem.setAttribute("editing", true);
+ markForRedraw();
+ }
+ });
+ staticTextItem.setRedrawOnChange(true);
+ itemsList.add(staticTextItem);
+
+ togglableTextItem.addKeyPressHandler(new KeyPressHandler() {
+ public void onKeyPress(KeyPressEvent keyPressEvent) {
+ if (keyPressEvent.getKeyName().equals("Enter")) {
+ updateValue(staticTextItem, togglableTextItem);
+ }
+ }
+ });
+ togglableTextItem.addBlurHandler(new BlurHandler() {
+ public void onBlur(BlurEvent blurEvent) {
+ updateValue(staticTextItem, togglableTextItem);
+ }
+ });
+ togglableTextItem.setShowIfCondition(new FormItemIfFunction() {
+ public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ boolean editing =
staticTextItem.getAttributeAsBoolean("editing");
+ return editing;
+ }
+ });
+ itemsList.add(togglableTextItem);
+ } else {
+ itemsList.add(item);
+ }
+ }
+
+ super.setItems((FormItem[]) itemsList.toArray(new FormItem[itemsList.size()]));
+
+ // SmartGWT annoyingly barfs if getValue() is called on a form item before
it's been added to a form, so
+ // we wait until after we've added all of the items to the form to set the
values of the static items we
+ // added, because only at that point can we grab the values of the corresponding
togglable items.
+ for (String name : togglableTextItemNames) {
+ String value = getValueAsString(name);
+ setValue(getStaticTextItemName(name), value);
+ }
+ }
+
+ private String getStaticTextItemName(String togglableTextItemName) {
+ return "static" + togglableTextItemName;
+ }
+
+ private void updateValue(StaticTextItem staticTextItem, TogglableTextItem textItem)
{
+ String value = (String) textItem.getValue();
+ staticTextItem.setValue(value);
+ staticTextItem.setAttribute("editing", false);
+ for (ValueUpdatedHandler handler : textItem.getValueUpdatedHandlers()) {
+ handler.onValueUpdated(value);
+ }
+ markForRedraw();
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
new file mode 100644
index 0000000..399cb7e
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java
@@ -0,0 +1,61 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.components.form;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer
+ */
+public class TogglableTextItem extends TextItem {
+ List<ValueUpdatedHandler> valueUpdatedHandlers = new
ArrayList<ValueUpdatedHandler>();
+
+ public TogglableTextItem() {
+ }
+
+ public TogglableTextItem(JavaScriptObject jsObj) {
+ super(jsObj);
+ }
+
+ public TogglableTextItem(String name) {
+ super(name);
+ }
+
+ public TogglableTextItem(String name, String title) {
+ super(name, title);
+ }
+
+ public void addValueUpdatedHandler(ValueUpdatedHandler handler) {
+ this.valueUpdatedHandlers.add(handler);
+ }
+
+ public List<ValueUpdatedHandler> getValueUpdatedHandlers() {
+ return valueUpdatedHandlers;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java
new file mode 100644
index 0000000..ac35115
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java
@@ -0,0 +1,8 @@
+package org.rhq.enterprise.gui.coregui.client.components.form;
+
+/**
+ * @author Ian Springer
+ */
+public interface ValueUpdatedHandler {
+ void onValueUpdated(String newValue);
+}
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 e7857cd..53741a9 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
@@ -29,6 +29,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -39,6 +40,8 @@ public interface ResourceGWTService extends RemoteService {
PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria);
+ PageList<ResourceComposite> findResourceCompositesByCriteria(ResourceCriteria
criteria);
+
List<Resource> getResourceLineage(int resourceId);
List<Resource> getResourceLineageAndSiblings(int resourceId);
@@ -61,4 +64,11 @@ public interface ResourceGWTService extends RemoteService {
void ignoreResources(Integer[] resourceIds);
void unignoreResources(Integer[] resourceIds);
+
+ void updateResourceName(int resourceId, String name);
+
+ void updateResourceDescription(int resourceId, String description);
+
+ void updateResourceLocation(int resourceId, String location);
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
index 5644554..9134199 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
@@ -45,4 +45,11 @@ public interface ResourceGroupGWTService extends RemoteService {
ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds);
void deleteResourceGroup(int groupId);
+
+ void updateResourceGroupName(int groupId, String name);
+
+ void updateResourceGroupDescription(int groupId, String description);
+
+ void updateResourceGroupLocation(int groupId, String location);
+
}
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 7ce294f..51c225a 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
@@ -246,13 +246,17 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
- // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
- selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
- String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
- String path = "ResourceGroup/" +
this.groupComposite.getResourceGroup().getId() + tabPath;
+ if (this.groupComposite == null) {
+ History.fireCurrentHistoryState();
+ } else {
+ // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
+ selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
+ String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
+ String path = "ResourceGroup/" +
this.groupComposite.getResourceGroup().getId() + tabPath;
- // But still add an item to the history, specifying false to tell it not to fire
an event.
- History.newItem(path, false);
+ // But still add an item to the history, specifying false to tell it not to
fire an event.
+ History.newItem(path, false);
+ }
}
public void renderView(ViewPath viewPath) {
@@ -282,4 +286,5 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
tab.getLayout().selectTab(subtabName);
}
}
-}
\ No newline at end of file
+}
+
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
index 57ecbcd..e9078cd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
@@ -18,11 +18,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.SpacerItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -30,16 +29,25 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.GroupDefinition;
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.components.form.EnhancedDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
+import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
/**
- * The group Inventory>Overview tab.
+ * The group Inventory>Overview subtab.
*
* @author Ian Springer
*/
public class OverviewView extends VLayout {
+ private ResourceGroupGWTServiceAsync resourceGroupService =
GWTServiceLookup.getResourceGroupService();
private ResourceGroupComposite groupComposite;
public OverviewView(ResourceGroupComposite groupComposite) {
@@ -51,31 +59,55 @@ public class OverviewView extends VLayout {
protected void onInit() {
super.onInit();
- ResourceGroup group = this.groupComposite.getResourceGroup();
+ final ResourceGroup group = this.groupComposite.getResourceGroup();
HLayout spacer = new HLayout();
spacer.setHeight(15);
addMember(spacer);
- DynamicForm generalPropsForm = new DynamicForm();
- generalPropsForm.setNumCols(4);
- generalPropsForm.setColWidths("25%", "25%", "25%",
"25%");
- generalPropsForm.setWrapItemTitles(false);
- setWidth("90%");
+ final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm();
- ArrayList<FormItem> formItems = new ArrayList<FormItem>();
- ArrayList<String> itemIds = new ArrayList<String>();
+ List<FormItem> formItems = new ArrayList<FormItem>();
+ // TODO: Uncomment the below header if we decide to add other stuff to this page
besides the general props.
//HeaderItem headerItem = new HeaderItem("header", "General
Properties");
//headerItem.setValue("General Properties");
- //formItems.add(headerItem);
+ //formItems.add(headerItem);
- StaticTextItem nameItem = new StaticTextItem("nameItem",
"Name");
+ boolean dynamic = (group.getGroupDefinition() != null);
+
+ final FormItem nameItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ nameItem.setName("name");
+ nameItem.setTitle("Name");
nameItem.setValue(group.getName());
+ if (nameItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newName) {
+ final String oldName = group.getName();
+
OverviewView.this.resourceGroupService.updateResourceGroupName(group.getId(),
+ newName, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource group with id "
+ + group.getId()
+ + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ nameItem.setValue(oldName);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Name of
Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
+ group.setName(newName);
+ }
+ });
+ }
+ });
+ }
formItems.add(nameItem);
- itemIds.add(nameItem.getName());
- StaticTextItem typeItem = new StaticTextItem("typeItem", "Member
Type");
+ StaticTextItem typeItem = new StaticTextItem("memberType", "Member
Type");
ResourceType type = group.getResourceType();
if (type != null) {
typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
@@ -84,56 +116,106 @@ public class OverviewView extends VLayout {
typeItem.setValue("<i>Mixed</i>");
}
formItems.add(typeItem);
- itemIds.add(typeItem.getName());
- StaticTextItem countItem = new StaticTextItem("countItem", "Member
Count");
+ StaticTextItem countItem = new StaticTextItem("memberCount",
"Member Count");
long memberCount = this.groupComposite.getImplicitUp() +
this.groupComposite.getImplicitDown();
countItem.setValue(memberCount);
formItems.add(countItem);
- itemIds.add(countItem.getName());
- StaticTextItem descriptionItem = new StaticTextItem("descriptionItem",
"Description");
- String description = group.getDescription();
- descriptionItem.setValue((description != null) ? description :
"<i>none</i>");
+ final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ descriptionItem.setName("description");
+ descriptionItem.setTitle("Description");
+ descriptionItem.setValue(group.getDescription());
+ if (descriptionItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
+ togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newDescription) {
+ final String oldDescription = group.getDescription();
+
OverviewView.this.resourceGroupService.updateResourceGroupDescription(group.getId(),
+ newDescription, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource group with id "
+ + group.getId()
+ + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ descriptionItem.setValue(oldDescription);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Description of Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
+ group.setDescription(newDescription);
+ }
+ });
+ }
+ });
+ }
formItems.add(descriptionItem);
- itemIds.add(descriptionItem.getName());
- StaticTextItem dynamicItem = new StaticTextItem("dynamicItem",
"Dynamic?");
- dynamicItem.setValue((group.getGroupDefinition() != null) ? "yes" :
"no");
+ final FormItem locationItem = (dynamic) ? new StaticTextItem() : new
TogglableTextItem();
+ locationItem.setName("location");
+ locationItem.setTitle("Location");
+ locationItem.setValue(group.getLocation());
+ if (locationItem instanceof TogglableTextItem) {
+ final TogglableTextItem togglableLocationItem = (TogglableTextItem)
locationItem;
+ togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newLocation) {
+ final String oldLocation = group.getLocation();
+
OverviewView.this.resourceGroupService.updateResourceGroupLocation(group.getId(),
+ newLocation, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource group with id "
+ + group.getId()
+ + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ locationItem.setValue(oldLocation);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Location
of Resource group with id "
+ + group.getId() + " was changed from
\""
+ + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
+ group.setLocation(newLocation);
+ }
+ });
+ }
+ });
+ }
+ formItems.add(locationItem);
+
+ StaticTextItem dynamicItem = new StaticTextItem("dynamic",
"Dynamic?");
+ dynamicItem.setValue(dynamic ? "yes" : "no");
formItems.add(dynamicItem);
- itemIds.add(dynamicItem.getName());
- StaticTextItem recursiveItem = new StaticTextItem("recursiveItem",
"Recursive?");
+ StaticTextItem recursiveItem = new StaticTextItem("recursive",
"Recursive?");
recursiveItem.setValue((group.isRecursive()) ? "yes" :
"no");
formItems.add(recursiveItem);
- itemIds.add(recursiveItem.getName());
- StaticTextItem createdItem = new StaticTextItem("createdItem",
"Created");
+ StaticTextItem createdItem = new StaticTextItem("created",
"Created");
createdItem.setValue(new Date(group.getCtime()));
formItems.add(createdItem);
- itemIds.add(createdItem.getName());
- StaticTextItem lastModifiedItem = new
StaticTextItem("lastModifiedItem", "Last Modified");
+ StaticTextItem lastModifiedItem = new StaticTextItem("lastModified",
"Last Modified");
lastModifiedItem.setValue(new Date(group.getMtime()));
formItems.add(lastModifiedItem);
- itemIds.add(lastModifiedItem.getName());
- StaticTextItem lastModifiedByItem = new
StaticTextItem("lastModifiedByItem", "Last Modified By");
+ StaticTextItem lastModifiedByItem = new
StaticTextItem("lastModifiedBy", "Last Modified By");
lastModifiedByItem.setValue(group.getModifiedBy());
formItems.add(lastModifiedByItem);
- itemIds.add(lastModifiedByItem.getName());
-
- StaticTextItem groupDefinitionItem = new
StaticTextItem("groupDefinitionItem", "Group Definition");
- GroupDefinition groupDefinition = group.getGroupDefinition();
- // TODO (ips): Make this a link to the group def.
- groupDefinitionItem.setValue((groupDefinition != null) ?
groupDefinition.getName() : "<i>none</i>");
- formItems.add(groupDefinitionItem);
- itemIds.add(groupDefinitionItem.getName());
+
+ if (dynamic) {
+ StaticTextItem groupDefinitionItem = new
StaticTextItem("groupDefinition", "Group Definition");
+ GroupDefinition groupDefinition = group.getGroupDefinition();
+ // TODO (ips): Make this a link to the group def.
+ groupDefinitionItem.setValue(groupDefinition.getName());
+ formItems.add(groupDefinitionItem);
+ }
generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()]));
addMember(generalPropsForm);
- if (groupDefinition != null) {
+ if (dynamic) {
spacer = new HLayout();
spacer.setHeight(10);
addMember(spacer);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index 2e2617e..70c5445 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@ -34,8 +34,8 @@ import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
@@ -50,7 +50,6 @@ public class InventoryView extends HLayout implements BookmarkableView
{
public static final String VIEW_PATH = "Inventory";
-
private ViewId currentSectionViewId;
private ViewId currentPageViewId;
@@ -58,9 +57,9 @@ public class InventoryView extends HLayout implements BookmarkableView
{
private Canvas currentContent;
private LinkedHashMap<String, TreeGrid> treeGrids = new
LinkedHashMap<String, TreeGrid>();
-
private SectionStack sectionStack;
+
@Override
protected void onInit() {
super.onInit();
@@ -110,9 +109,9 @@ public class InventoryView extends HLayout implements BookmarkableView
{
private ResourceSearchView buildResourceSearchView() {
ResourceSearchView searchView = new ResourceSearchView();
searchView.addResourceSelectedListener(new ResourceSelectListener() {
- public void onResourceSelected(Resource resource) {
+ public void onResourceSelected(ResourceComposite resourceComposite) {
//CoreGUI.setContent(new ResourceView(resource));
- CoreGUI.goTo("Resource/" + resource.getId());
+ CoreGUI.goTo("Resource/" +
resourceComposite.getResource().getId());
}
});
return searchView;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
index e64f27b..21806ab 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java
@@ -18,12 +18,19 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
/**
* @author Greg Hinkle
*/
public interface ResourceSelectListener {
- void onResourceSelected(Resource resource);
+ /**
+ * An event handler that is called then the user selects a Resource.
+ *
+ * @param resourceComposite a Resource composite for the Resource that was just
selected by the user; the Resource
+ * wrapped by the composite's ResourceType will be
mostly fetched.
+ */
+ void onResourceSelected(ResourceComposite resourceComposite);
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 92d74eb..68d92d5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -18,19 +18,13 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
-import java.util.EnumSet;
-import java.util.Set;
-
import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
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.resource.composite.ResourceFacets;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -40,7 +34,6 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
@@ -48,10 +41,9 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/**
- * Right panel of the resource view.
+ * Right panel of the Resource view.
*
* @author Greg Hinkle
*/
@@ -60,9 +52,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
private static final String DEFAULT_TAB_NAME = "Summary";
- private Resource resource;
- private ResourcePermission permissions;
- private ResourceType type;
+ private ResourceComposite resourceComposite;
private TwoLevelTab summaryTab;
private TwoLevelTab monitoringTab;
@@ -77,9 +67,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
private ResourceTitleBar titleBar;
- public void setResource(Resource resource) {
- this.resource = resource;
- }
@Override
protected void onDraw() {
@@ -134,13 +121,14 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
// CoreGUI.addBreadCrumb(getPlace());
}
- public void onResourceSelected(Resource resource) {
+ public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resource = resource;
+ this.resourceComposite = resourceComposite;
- titleBar.setResource(resource);
+ final Resource resource = this.resourceComposite.getResource();
+ this.titleBar.setResource(resource);
- summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
+ summaryTab.updateSubTab("Overview", new
ResourceOverviewView(this.resourceComposite));
summaryTab.updateSubTab("Timeline", new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id="
+ resource.getId()));
@@ -204,80 +192,56 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
// topTabSet.setSelectedTab(selectedTab);
- updateTabStatus();
+ completeTabUpdate();
}
- private void updateTabStatus() {
- // Go and get the type with all needed metadata
- // and then get the permissions for this resource
-
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
- ResourceTypeRepository.MetadataType.events,
- ResourceTypeRepository.MetadataType.resourceConfigurationDefinition,
- ResourceTypeRepository.MetadataType.measurements), new
ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
-
- ResourceDetailView.this.type = type;
-
-
GWTServiceLookup.getAuthorizationService().getImplicitResourcePermissions(
- ResourceDetailView.this.resource.getId(), new
AsyncCallback<Set<Permission>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
load resource permissions", caught);
- }
-
- public void onSuccess(Set<Permission> result) {
- ResourceDetailView.this.permissions = new
ResourcePermission(result);
- completeTabUpdate();
- }
- });
- }
- });
- }
private void completeTabUpdate() {
- if (!permissions.isMeasure()) {
- topTabSet.disableTab(monitoringTab);
- } else {
+ ResourcePermission permissions = this.resourceComposite.getResourcePermission();
+ ResourceFacets facets = this.resourceComposite.getResourceFacets();
+
+ // TODO (ips): No perms should be needed to view Monitoring and Alerts tabs.
+
+ if (permissions.isMeasure()) {
topTabSet.enableTab(monitoringTab);
+ } else {
+ topTabSet.disableTab(monitoringTab);
}
- if (type.getOperationDefinitions() == null ||
type.getOperationDefinitions().isEmpty()
- || !permissions.isControl()) {
- topTabSet.disableTab(operationsTab);
- } else {
+ if (facets.isOperation() && permissions.isControl()) {
topTabSet.enableTab(operationsTab);
+ } else {
+ topTabSet.disableTab(operationsTab);
}
- if (!permissions.isAlert()) {
- topTabSet.disableTab(alertsTab);
- } else {
+ if (permissions.isAlert()) {
topTabSet.enableTab(alertsTab);
+ } else {
+ topTabSet.disableTab(alertsTab);
}
- if (type.getResourceConfigurationDefinition() == null ||
!permissions.isConfigureRead()) {
- topTabSet.disableTab(configurationTab);
- } else {
+ if (!facets.isConfiguration() && permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
+ } else {
+ topTabSet.disableTab(configurationTab);
}
- if (type.getEventDefinitions() == null || type.getEventDefinitions().isEmpty() ||
!permissions.isMeasure()) {
+ if (facets.isEvent() && permissions.isMeasure()) {
topTabSet.enableTab(eventsTab);
} else {
- topTabSet.enableTab(eventsTab);
+ topTabSet.disableTab(eventsTab);
}
- if (type.getPackageTypes() == null || type.getPackageTypes().isEmpty() ||
!permissions.isContent()) {
- topTabSet.disableTab(contentTab);
- } else {
+ if (facets.isContent() && permissions.isContent()) {
topTabSet.enableTab(contentTab);
+ } else {
+ topTabSet.disableTab(contentTab);
}
// only enable "Call Time" sub-tab for those that implement it
- monitoringTab.setSubTabEnabled("Call Time", implementsCallTime(type));
+ monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
if (topTabSet.getSelectedTab().getDisabled()) {
topTabSet.selectTab(0);
@@ -286,25 +250,22 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.markForRedraw();
}
- private boolean implementsCallTime(ResourceType type) {
- for (MeasurementDefinition definition : type.getMetricDefinitions()) {
- if (definition.getDataType() == DataType.CALLTIME) {
- return true;
- }
- }
- return false;
- }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
- // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
- selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
- String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
- String path = "Resource/" + this.resource.getId() + tabPath;
+ if (this.resourceComposite == null) {
+ History.fireCurrentHistoryState();
+ } else {
+ // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
+ selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
+ String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
+ String path = "Resource/" +
this.resourceComposite.getResource().getId() + tabPath;
- // But still add an item to the history, specifying false to tell it not to fire
an event.
- History.newItem(path, false);
+ // But still add an item to the history, specifying false to tell it not to
fire an event.
+ History.newItem(path, false);
+ }
}
+
public void renderView(ViewPath viewPath) {
// e.g. #Resource/10010/Inventory/Overview
String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; //
e.g. "Inventory"
@@ -312,6 +273,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
selectTab(tabName, subTabName);
}
+
public void selectTab(String tabName, String subtabName) {
if (tabName == null) {
tabName = DEFAULT_TAB_NAME;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
index f7b5c6e..39e748f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
@@ -24,6 +24,8 @@ import com.smartgwt.client.widgets.layout.HLayout;
import org.rhq.core.domain.criteria.ResourceCriteria;
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.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -32,8 +34,11 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath;
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.InventoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.EnumSet;
+
/**
* @author Greg Hinkle
*/
@@ -41,7 +46,7 @@ public class ResourceView extends HLayout implements BookmarkableView {
private Canvas contentCanvas;
- private Resource currentResource;
+ private ResourceComposite currentResource;
//private Resource resourcePlatform;
private ResourceTreeView treeView;
@@ -61,60 +66,70 @@ public class ResourceView extends HLayout implements BookmarkableView
{
setWidth100();
setHeight100();
-
treeView = new ResourceTreeView();
addMember(treeView);
contentCanvas = new Canvas();
addMember(contentCanvas);
-
// created above
// detailView = new ResourceDetailView();
treeView.addResourceSelectListener(detailView);
-
setContent(detailView);
-
}
+
public void setSelectedResource(final int resourceId, final ViewPath view) {
- Resource resource = this.treeView.getResource(resourceId);
- if (resource != null) {
- setSelectedResource(resource, view);
- } else {
- ResourceCriteria criteria = new ResourceCriteria();
- criteria.addFilterId(resourceId);
- criteria.fetchTags(true);
- //criteria.fetchParentResource(true);
- resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
- "] does not exist or is not accessible.",
Message.Severity.Warning));
-
- CoreGUI.goTo(InventoryView.VIEW_PATH);
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(resourceId);
+ criteria.fetchTags(true);
+ //criteria.fetchParentResource(true);
+ resourceService.findResourceCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
+ "] does not exist or is not accessible.",
Message.Severity.Warning));
+
+ CoreGUI.goTo(InventoryView.VIEW_PATH);
+ }
+
+ public void onSuccess(PageList<ResourceComposite> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Resource with id [" + resourceId +
"] does not exist."));
+ } else {
+ final ResourceComposite resourceComposite = result.get(0);
+ loadResourceType(resourceComposite, view);
}
+ }
+ });
+ }
+
- public void onSuccess(PageList<Resource> result) {
- if (result.isEmpty()) {
- //noinspection ThrowableInstanceNeverThrown
- onFailure(new Exception("Resource with id [" +
resourceId + "] does not exist."));
- } else {
- Resource resource = result.get(0);
- setSelectedResource(resource, view);
- }
+ private void loadResourceType(final ResourceComposite resourceComposite, final
ViewPath view) {
+ final Resource resource = resourceComposite.getResource();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.events,
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ resource.setResourceType(type);
+ completeSetSelectedResource(resourceComposite, view);
}
});
- }
}
- private void setSelectedResource(Resource resource, ViewPath viewPath) {
- this.currentResource = resource;
- this.treeView.setSelectedResource(resource, viewPath.getCurrent());
- this.detailView.onResourceSelected(resource);
+
+ private void completeSetSelectedResource(ResourceComposite resourceComposite,
ViewPath viewPath) {
+ this.currentResource = resourceComposite;
+ this.treeView.setSelectedResource(resourceComposite.getResource(),
viewPath.getCurrent());
+ this.detailView.onResourceSelected(resourceComposite);
}
+
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
contentCanvas.getChildren()[0].destroy();
@@ -132,7 +147,7 @@ public class ResourceView extends HLayout implements BookmarkableView
{
Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentResource == null || currentResource.getId() != resourceId) {
+ if (currentResource == null || currentResource.getResource().getId() !=
resourceId) {
// The previous history item did not already point to this Resource.
setSelectedResource(resourceId, viewPath);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java
index cfa77c0..32c0f44 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java
@@ -25,6 +25,8 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert;
import com.smartgwt.client.data.Criteria;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
@@ -39,8 +41,8 @@ public class ResourceAlertHistoryView extends AlertsView
super(createCriteria(resourceId), EXCLUDED_FIELD_NAMES);
}
- public void onResourceSelected(Resource resource) {
- refresh(createCriteria(resource.getId()));
+ public void onResourceSelected(ResourceComposite resourceComposite) {
+ refresh(createCriteria(resourceComposite.getResource().getId()));
}
private static Criteria createCriteria(int resourceId) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
index d77e08b..770c43b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
@@ -24,6 +24,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
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.enterprise.gui.coregui.client.CoreGUI;
import
org.rhq.enterprise.gui.coregui.client.components.measurement.MeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -32,7 +33,6 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -48,12 +48,9 @@ import java.util.List;
*/
public class GraphListView extends VLayout implements ResourceSelectListener {
-
private Resource resource;
private Label loadingLabel = new Label("Loading...");
- public GraphListView() {
- }
public GraphListView(Resource resource) {
this.resource = resource;
@@ -83,7 +80,6 @@ public class GraphListView extends VLayout implements
ResourceSelectListener {
private void buildGraphs() {
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(
resource.getResourceType().getId(),
EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
new ResourceTypeRepository.TypeLoadedCallback() {
@@ -139,18 +135,18 @@ public class GraphListView extends VLayout implements
ResourceSelectListener {
);
}
+
private void buildGraph(MeasurementDefinition def,
List<MeasurementDataNumericHighLowComposite> data) {
SmallGraphView graph = new SmallGraphView(resource.getId(), def, data);
graph.setWidth("95%");
graph.setHeight(220);
addMember(graph);
-
}
- public void onResourceSelected(Resource resource) {
- this.resource = resource;
+ public void onResourceSelected(ResourceComposite resourceComposite) {
+ this.resource = resourceComposite.getResource();
buildGraphs();
markForRedraw();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
index bb01526..92cd3ff 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java
@@ -20,36 +20,42 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
-import org.rhq.enterprise.gui.coregui.client.components.SimpleCollapsiblePanel;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
/**
* @author Greg Hinkle
*/
-public class ResourceOverviewView extends VLayout {
+public class ResourceOverviewView extends VLayout implements ResourceSelectListener {
+ private ResourceSummaryView summaryView;
+ private FullHTMLPane summaryPane;
+ private ResourceComposite resourceComposite;
- private Resource resource;
-
-
- public ResourceOverviewView(Resource resource) {
- this.resource = resource;
+ public ResourceOverviewView(ResourceComposite resourceComposite) {
+ this.resourceComposite = resourceComposite;
}
-
@Override
protected void onDraw() {
super.onDraw();
- ResourceSummaryView summaryView = new ResourceSummaryView();
- summaryView.onResourceSelected(resource);
-
- addMember(summaryView);
+ this.summaryView = new ResourceSummaryView();
+ addMember(this.summaryView);
+ this.summaryPane = new FullHTMLPane();
+ addMember(this.summaryPane);
- FullHTMLPane summaryPane = new
FullHTMLPane("/rhq/resource/summary/overview-plain.xhtml?id=" +
resource.getId());
- addMember(summaryPane);
-
+ if (this.resourceComposite != null) {
+ onResourceSelected(this.resourceComposite);
+ }
+ }
+ @Override
+ public void onResourceSelected(ResourceComposite resourceComposite) {
+ this.resourceComposite = resourceComposite;
+ this.summaryView.onResourceSelected(resourceComposite);
+
this.summaryPane.setContentsURL("/rhq/resource/summary/overview-plain.xhtml?id="
+ + resourceComposite.getResource().getId());
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
index 6f1228c..0015742 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
@@ -26,7 +26,6 @@ import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.HeaderItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -38,59 +37,64 @@ import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementDefinition;
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.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem;
+import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler;
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.ResourceSelectListener;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
-public class ResourceSummaryView extends DynamicForm implements ResourceSelectListener {
+public class ResourceSummaryView extends EnhancedDynamicForm implements
ResourceSelectListener {
- private Resource resource;
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+ private ResourceComposite resourceComposite;
@Override
protected void onDraw() {
super.onDraw();
- setNumCols(4);
- setWrapItemTitles(false);
setLeft("10%");
setWidth("80%");
}
- public void onResourceSelected(Resource resource) {
+ public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resource = resource;
+ this.resourceComposite = resourceComposite;
+ Resource resource = resourceComposite.getResource();
+ // Load metric defs.
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
try {
buildForm(type);
- loadValues();
+ loadTraitValues();
} catch (Exception e) {
SC.say("Form load failure");
e.printStackTrace();
}
}
});
-
-
- markForRedraw();
}
- private void loadValues() {
+ private void loadTraitValues() {
+ final Resource resource = resourceComposite.getResource();
GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource(
resource.getId(),
DisplayType.SUMMARY,
new AsyncCallback<List<MeasurementDataTrait>>() {
public void onFailure(Throwable caught) {
- SC.say("Failed to load traits");
- CoreGUI.getErrorHandler().handleError("Failed to load traits
information for resource",caught);
+ CoreGUI.getErrorHandler().handleError("Failed to load traits
for " + resource + ".",
+ caught);
}
public void onSuccess(List<MeasurementDataTrait> result) {
@@ -111,7 +115,7 @@ public class ResourceSummaryView extends DynamicForm implements
ResourceSelectLi
}
private void buildForm(ResourceType type) {
- ArrayList<MeasurementDefinition> traits = new
ArrayList<MeasurementDefinition>();
+ List<MeasurementDefinition> traits = new
ArrayList<MeasurementDefinition>();
for (MeasurementDefinition measurement : type.getMetricDefinitions()) {
if (measurement.getDataType() == DataType.TRAIT &&
measurement.getDisplayType() == DisplayType.SUMMARY) {
@@ -125,39 +129,122 @@ public class ResourceSummaryView extends DynamicForm implements
ResourceSelectLi
}
});
-
- ArrayList<FormItem> formItems = new ArrayList<FormItem>();
- ArrayList<String> itemIds = new ArrayList<String>();
+ List<FormItem> formItems = new ArrayList<FormItem>();
HeaderItem headerItem = new HeaderItem("header", "Summary");
headerItem.setValue("Summary");
formItems.add(headerItem);
- StaticTextItem typeItem = new StaticTextItem("typeItem",
"Type");
+ StaticTextItem typeItem = new StaticTextItem("type",
"Type");
typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
formItems.add(typeItem);
- itemIds.add(typeItem.getName());
- StaticTextItem descriptionItem = new StaticTextItem("descriptionItem",
"Description");
+ final Resource resource = this.resourceComposite.getResource();
+ boolean modifiable =
this.resourceComposite.getResourcePermission().isInventory();
+
+ final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ nameItem.setName("name");
+ nameItem.setTitle("Name");
+ nameItem.setValue(resource.getName());
+ if (nameItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newName) {
+ final String oldName = resource.getName();
+
ResourceSummaryView.this.resourceService.updateResourceName(resource.getId(),
+ newName, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
name of Resource with id "
+ + resource.getId()
+ + " from \"" + oldName +
"\" to \"" + newName + "\".", caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ nameItem.setValue(oldName);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Name of
Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldName + "\" to
\"" + newName + "\".", Message.Severity.Info));
+ resource.setName(newName);
+ }
+ });
+ }
+ });
+ }
+ formItems.add(nameItem);
+
+ final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ descriptionItem.setName("description");
+ descriptionItem.setTitle("Description");
descriptionItem.setValue(resource.getDescription());
+ if (descriptionItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableDescriptionItem = (TogglableTextItem)
descriptionItem;
+ togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newDescription) {
+ final String oldDescription = resource.getDescription();
+
ResourceSummaryView.this.resourceService.updateResourceDescription(resource.getId(),
+ newDescription, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
description of Resource with id "
+ + resource.getId()
+ + " from \"" +
oldDescription + "\" to \"" + newDescription + "\".",
caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ descriptionItem.setValue(oldDescription);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Description of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldDescription + "\" to
\"" + newDescription + "\".", Message.Severity.Info));
+ resource.setDescription(newDescription);
+ }
+ });
+ }
+ });
+ }
formItems.add(descriptionItem);
- itemIds.add(descriptionItem.getName());
- StaticTextItem versionItem = new StaticTextItem("versionItem",
"Version");
- formItems.add(versionItem);
- itemIds.add(versionItem.getName());
+ final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new
StaticTextItem();
+ locationItem.setName("location");
+ locationItem.setTitle("Location");
+ locationItem.setValue(resource.getLocation());
+ if (locationItem instanceof TogglableTextItem) {
+ TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem;
+ togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() {
+ public void onValueUpdated(final String newLocation) {
+ final String oldLocation = resource.getLocation();
+
ResourceSummaryView.this.resourceService.updateResourceLocation(resource.getId(),
+ newLocation, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to change
location of Resource with id "
+ + resource.getId()
+ + " from \"" + oldLocation
+ "\" to \"" + newLocation + "\".", caught);
+ // We failed to update it on the Server, so change back the
form item to the original value.
+ locationItem.setValue(oldLocation);
+ }
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Location
of Resource with id "
+ + resource.getId() + " was changed
from \""
+ + oldLocation + "\" to
\"" + newLocation + "\".", Message.Severity.Info));
+ resource.setLocation(newLocation);
+ }
+ });
+ }
+ });
+ }
+ formItems.add(locationItem);
- StaticTextItem parentItem = new StaticTextItem("parentItem",
"Parent");
- formItems.add(parentItem);
- itemIds.add(parentItem.getName());
+ StaticTextItem versionItem = new StaticTextItem("version",
"Version");
+ formItems.add(versionItem);
- for (MeasurementDefinition trait : traits) {
+ StaticTextItem parentItem = new StaticTextItem("parent",
"Parent");
+ formItems.add(parentItem);
+ for (MeasurementDefinition trait : traits) {
String id = trait.getDisplayName().replaceAll("\\.",
"_").replaceAll(" ", "__");
- itemIds.add(id);
StaticTextItem item = new StaticTextItem(id, trait.getDisplayName());
item.setTooltip(trait.getDescription());
@@ -176,14 +263,14 @@ public class ResourceSummaryView extends DynamicForm implements
ResourceSelectLi
formItems.add(new SpacerItem());
setItems(formItems.toArray(new FormItem[formItems.size()]));
-
- setValue("typeItem", type.getName() + " (" + type.getPlugin()
+ ")");
- setValue("descriptionItem", resource.getDescription());
- setValue("versionItem", resource.getVersion());
- setValue("parentItem", resource.getParentResource() == null ? null :
+ setValue("type", type.getName() + " (" + type.getPlugin() +
")");
+ setValue("name", resource.getName());
+ setValue("description", resource.getDescription());
+ setValue("location", resource.getLocation());
+ setValue("version", resource.getVersion());
+ setValue("parent", resource.getParentResource() == null ? null :
("<a href=\"#Resource/" +
resource.getParentResource().getId() + "\">" +
resource.getParentResource().getName() +
"</a>"));
-
}
}
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 7cd7fdd..56d91bd 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
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashSet;
@@ -35,6 +36,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite;
+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.enterprise.gui.coregui.client.gwt.ResourceGWTService;
@@ -109,15 +111,27 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
public PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria) {
try {
PageList<Resource> result =
resourceManager.findResourcesByCriteria(getSessionSubject(), criteria);
- for (Resource resource : result) {
- resource.setAgent(null);
- }
ObjectFilter.filterFieldsInCollection(result, importantFieldsSet);
- return SerialUtility.prepare(result,
"ResourceService.findResourceByCriteria");
+ return SerialUtility.prepare(result,
"ResourceService.findResourcesByCriteria");
} catch (Exception e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public PageList<ResourceComposite>
findResourceCompositesByCriteria(ResourceCriteria criteria) {
+ try {
+ PageList<ResourceComposite> result =
resourceManager.findResourceCompositesByCriteria(getSessionSubject(),
+ criteria);
+ List<Resource> resources = new
ArrayList<Resource>(result.size());
+
+ ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet);
+
+ return SerialUtility.prepare(result,
"ResourceService.findResourceCompositesByCriteria");
+ } catch (Exception e) {
+ e.printStackTrace();
throw new RuntimeException(e);
}
}
@@ -199,4 +213,15 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
discoveryBoss.unignoreResources(getSessionSubject(), resourceIds);
}
+ public void updateResourceName(int resourceId, String name) {
+ resourceManager.updateResourceName(getSessionSubject(), resourceId, name);
+ }
+
+ public void updateResourceDescription(int resourceId, String description) {
+ resourceManager.updateResourceDescription(getSessionSubject(), resourceId,
description);
+ }
+
+ public void updateResourceLocation(int resourceId, String location) {
+ resourceManager.updateResourceLocation(getSessionSubject(), resourceId,
location);
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
index 67326c1..d4dd777 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
@@ -74,4 +74,16 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl
implemen
throw new RuntimeException(e.getMessage());
}
}
+
+ public void updateResourceGroupName(int groupId, String name) {
+ groupManager.updateResourceGroupName(getSessionSubject(), groupId, name);
+ }
+
+ public void updateResourceGroupDescription(int groupId, String description) {
+ groupManager.updateResourceGroupDescription(getSessionSubject(), groupId,
description);
+ }
+
+ public void updateResourceGroupLocation(int groupId, String location) {
+ groupManager.updateResourceGroupLocation(getSessionSubject(), groupId,
location);
+ }
}
\ No newline at end of file
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 3dfc87f..4804a73 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
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -27,6 +27,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
+import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@@ -93,6 +94,7 @@ import org.rhq.core.domain.resource.composite.ResourceHealthComposite;
import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight;
import org.rhq.core.domain.resource.composite.ResourceInstallCount;
import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.composite.ResourceWithAvailability;
import org.rhq.core.domain.resource.flyweight.FlyweightCache;
import org.rhq.core.domain.resource.flyweight.ResourceFlyweight;
@@ -864,7 +866,8 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
*
* @param user
* @param category Limit the search to a given {@link ResourceCategory}
- * @param type Limit the search to to a given {@link ResourceType}
+ * @param typeName Limit the search to to {@link ResourceType}(s) with the
given name
+ * @param pluginName Limit the search to the plugin with the given name
* @param parentResource Limit the search to children of a given parent resource
* @param searchString
* @param pageControl
@@ -2040,9 +2043,7 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
// lineage is a getXXX (not findXXX) because it logically returns a single object,
but modeled as a list here
public @XmlJavaTypeAdapter(value = ResourceListAdapter.class)
List<Resource> findResourceLineage(Subject subject, int resourceId) {
- List<Resource> result = null;
-
- result = getResourceLineage(resourceId);
+ List<Resource> result = getResourceLineage(resourceId);
for (Resource resource : result) {
if (!authorizationManager.canViewResource(subject, resource.getId())) {
@@ -2069,19 +2070,21 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
}
public PageList<ResourceComposite> findResourceCompositesByCriteria(Subject
subject, ResourceCriteria criteria) {
- PageList<Resource> intermediate = findResourcesByCriteria(subject,
criteria);
+ PageList<Resource> resources = findResourcesByCriteria(subject, criteria);
List<ResourceComposite> results = new
ArrayList<ResourceComposite>();
- for (Resource next : intermediate) {
- AvailabilityType availType =
next.getCurrentAvailability().getAvailabilityType();
- Resource parent = next.getParentResource();
- ResourceComposite composite = new ResourceComposite(next, parent,
availType);
-
composite.setResourceFacets(typeManager.getResourceFacets(next.getResourceType().getId()));
- // TODO: jmarques: need to set resource permissions here, or alter criteria
projection to include it
+ for (Resource resource : resources) {
+ AvailabilityType availType =
resource.getCurrentAvailability().getAvailabilityType();
+ Resource parent = resource.getParentResource();
+ ResourceComposite composite = new ResourceComposite(resource, parent,
availType);
+
composite.setResourceFacets(typeManager.getResourceFacets(resource.getResourceType().getId()));
+ Set<Permission> permissions =
authorizationManager.getImplicitResourcePermissions(subject, resource.getId());
+ composite.setResourcePermission(new ResourcePermission(permissions));
+ // TODO: jmarques: Alter criteria projection to include permissions.
results.add(composite);
}
- return new PageList<ResourceComposite>(results, (int)
intermediate.getTotalSize(), intermediate
+ return new PageList<ResourceComposite>(results, resources.getTotalSize(),
resources
.getPageControl());
}
@@ -2152,4 +2155,39 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
DisambiguationUpdateStrategy updateStrategy) {
return Disambiguator.disambiguate(results, updateStrategy, extractor,
entityManager);
}
+
+ public void updateResourceName(Subject subject, int resourceId, String name) {
+ if (name == null) {
+ throw new IllegalArgumentException("Resource name cannot be
null.");
+ }
+ Resource resource = getResourceToBeModified(subject, resourceId);
+ resource.setName(name);
+ resource.setMtime(System.currentTimeMillis());
+ }
+
+ public void updateResourceDescription(Subject subject, int resourceId, String
description) {
+ Resource resource = getResourceToBeModified(subject, resourceId);
+ resource.setDescription(description);
+ resource.setMtime(System.currentTimeMillis());
+ }
+
+ public void updateResourceLocation(Subject subject, int resourceId, String location)
{
+ Resource resource = getResourceToBeModified(subject, resourceId);
+ resource.setLocation(location);
+ resource.setMtime(System.currentTimeMillis());
+ }
+
+ private Resource getResourceToBeModified(Subject subject, int resourceId) {
+ Resource resource = entityManager.find(Resource.class, resourceId);
+
+ if (resource == null) {
+ throw new ResourceNotFoundException(resourceId);
+ }
+
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.MODIFY_RESOURCE, resourceId)) {
+ throw new PermissionException("User [" + subject + "] does not
have permission to modify Resource with id ["
+ + resourceId + "].");
+ }
+ return resource;
+ }
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
index 327c439..3dd1fcb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -429,7 +429,7 @@ public interface ResourceManagerLocal {
* order (for example, if a given resource is actually a child of one of the other
given resources, this method
* ensures the uninventory occurs properly).
*
- * @param user the user performing the uninventory action
+ * @param subject the user performing the uninventory action
* @param resourceIds the ID of the resource to be deleted
*
* @return the list of all resources that were deleted - in effect, this will contain
<code>resourceIds</code> and
@@ -455,4 +455,10 @@ public interface ResourceManagerLocal {
*/
<T> ResourceNamesDisambiguationResult<T> disambiguate(List<T>
results, IntExtractor<? super T> resourceIdExtractor,
DisambiguationUpdateStrategy updateStrategy);
+
+ void updateResourceName(Subject subject, int resourceId, String name);
+
+ void updateResourceDescription(Subject subject, int resourceId, String description);
+
+ void updateResourceLocation(Subject subject, int resourceId, String location);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
index d633909..2eb9d62 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -43,7 +43,6 @@ import org.rhq.enterprise.server.system.ServerVersion;
* @author Jay Shaughnessy
* @author Simeon Pinder
*/
-
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
@WebService(targetNamespace = ServerVersion.namespace)
@Remote
@@ -139,4 +138,21 @@ public interface ResourceManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId);
+ @WebMethod
+ void updateResourceName( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "resourceId") int resourceId, //
+ @WebParam(name = "name") String name);
+
+ @WebMethod
+ void updateResourceDescription( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "resourceId") int resourceId, //
+ @WebParam(name = "description") String description);
+
+ @WebMethod
+ void updateResourceLocation( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "resourceId") int resourceId, //
+ @WebParam(name = "location") String location);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index b2ed76e..987015b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -90,6 +90,7 @@ import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter;
import org.rhq.enterprise.server.operation.GroupOperationSchedule;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
+import org.rhq.enterprise.server.resource.ResourceNotFoundException;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
@@ -1424,4 +1425,39 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
}
}
+ public void updateResourceGroupName(Subject subject, int groupId, String name) {
+ if (name == null) {
+ throw new IllegalArgumentException("Group name cannot be null.");
+ }
+ ResourceGroup group = getResourceGroupToBeModified(subject, groupId);
+ group.setName(name);
+ group.setMtime(System.currentTimeMillis());
+ }
+
+ public void updateResourceGroupDescription(Subject subject, int groupId, String
description) {
+ ResourceGroup group = getResourceGroupToBeModified(subject, groupId);
+ group.setDescription(description);
+ group.setMtime(System.currentTimeMillis());
+ }
+
+ public void updateResourceGroupLocation(Subject subject, int groupId, String
location) {
+ ResourceGroup group = getResourceGroupToBeModified(subject, groupId);
+ group.setDescription(location);
+ group.setMtime(System.currentTimeMillis());
+ }
+
+ private ResourceGroup getResourceGroupToBeModified(Subject subject, int groupId) {
+ ResourceGroup group = entityManager.find(ResourceGroup.class, groupId);
+
+ if (group == null) {
+ throw new ResourceGroupNotFoundException(groupId);
+ }
+
+ if (!authorizationManager.hasGroupPermission(subject, Permission.MODIFY_RESOURCE,
groupId)) {
+ throw new PermissionException("User [" + subject + "] does not
have permission to modify Resource group with id ["
+ + groupId + "].");
+ }
+ return group;
+ }
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
index 5975099..8ed40b6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -138,4 +138,10 @@ public interface ResourceGroupManagerLocal {
ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
ResourceGroupCriteria criteria);
+
+ void updateResourceGroupName(Subject subject, int groupId, String name);
+
+ void updateResourceGroupDescription(Subject subject, int groupId, String
description);
+
+ void updateResourceGroupLocation(Subject subject, int groupId, String location);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
index f285fb5..8907ea9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -96,4 +96,22 @@ public interface ResourceGroupManagerRemote {
PageList<ResourceGroup> findResourceGroupsByCriteria( //
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "criteria") ResourceGroupCriteria criteria);
+
+ @WebMethod
+ void updateResourceGroupName( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "groupId") int groupId, //
+ @WebParam(name = "name") String name);
+
+ @WebMethod
+ void updateResourceGroupDescription( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "groupId") int groupId, //
+ @WebParam(name = "description") String description);
+
+ @WebMethod
+ void updateResourceGroupLocation( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "groupId") int groupId, //
+ @WebParam(name = "location") String location);
}
commit 36c35567dbd5482c3878af2e7fef96b68fb81fad
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 12 11:22:31 2010 -0400
remove AS keyword - Oracle doesn't like it.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index f36ad4a..07b448b 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3152,7 +3152,7 @@
<schema-addColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2"
precision="100"/>
<schema-directSQL>
<statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy
column with existing user names or null if user does not exist">
- UPDATE RHQ_RESOURCE_GROUP AS g SET MODIFIED_BY_VARCHAR = (SELECT
NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY)
+ UPDATE RHQ_RESOURCE_GROUP g SET MODIFIED_BY_VARCHAR = (SELECT
NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY)
</statement>
<statement desc="RESOURCE_GROUP: Make unknown usernames as
rhqadmin in tmp modifiedBy column">
UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR =
'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL
@@ -3172,7 +3172,7 @@
<schema-addColumn table="RHQ_RESOURCE"
column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2"
precision="100"/>
<schema-directSQL>
<statement desc="RESOURCE: Populate the tmp modifiedBy column
with existing user names or null if user does not exist">
- UPDATE RHQ_RESOURCE AS r SET MODIFIED_BY_VARCHAR = (SELECT NAME
FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY)
+ UPDATE RHQ_RESOURCE r SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM
RHQ_SUBJECT WHERE ID = r.MODIFIED_BY)
</statement>
<statement desc="RESOURCE: Make unknown usernames as rhqadmin
in tmp modifiedBy column">
UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin'
WHERE MODIFIED_BY_VARCHAR IS NULL
commit 910702a4e6da5c6c7cd223f9ad7de12eac8d156c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:10:30 2010 -0400
we don't support content at the group-level, so delete those commented-out sub-tab
references
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 4a5f363..7ce294f 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
@@ -149,13 +149,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
operationsTab.updateSubTab("History", new FullHTMLPane(
"/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=" +
groupId));
operationsTab.updateSubTab("Scheduled", new FullHTMLPane(
- //
- // eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
- //
- // contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
- // contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
- // contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
- // contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
"/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId="
+ groupId));
configurationTab.updateSubTab("Current", new FullHTMLPane(
commit a8cd0f333842f0059d06e8678cf0d38f9b5db3b5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:09:51 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group >
operation tabs
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 709e304..4a5f363 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
@@ -145,8 +145,10 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(groupId));
// inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
- //
- // operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
+
+ operationsTab.updateSubTab("History", new FullHTMLPane(
+ "/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=" +
groupId));
+ operationsTab.updateSubTab("Scheduled", new FullHTMLPane(
//
// eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
//
@@ -154,6 +156,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
// contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
// contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+ "/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId="
+ groupId));
+
configurationTab.updateSubTab("Current", new FullHTMLPane(
"/rhq/group/configuration/viewCurrent-plain.xhtml?groupId=" +
groupId));
configurationTab.updateSubTab("History", new FullHTMLPane(
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml
new file mode 100644
index 0000000..36f8b54
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml
@@ -0,0 +1,293 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <!--
+ ResourceGroup Operation Pending History
+ -->
+
+ <ui:param name="currentOperation"
value="#{ResourceGroupOperationPendingHistoryUIBean.oldestInProgressResourceGroupOperation}"
/>
+
+ <h:form id="pendingForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+ <input type="hidden" name="category"
value="#{param.category}" />
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">In Progress
Operations</f:facet>
+
+ <ui:param name="resourceGroupOperationPendingHistoryDataModel"
value="#{ResourceGroupOperationPendingHistoryUIBean.dataModel}"/>
+
+ <a4j:keepAlive
beanName="ResourceGroupOperationPendingHistoryUIBean"/>
+
+ <a4j:poll
id="resourceGroupOperationPendingHistoryDataTableReRenderer"
+ oncomplete="disableConditionalButtons();"
+ interval="60000"
+ ignoreDupResponses="true"
+
actionListener="#{ResourceGroupOperationPendingHistoryUIBean.clearDataModel}"
+ reRender="resourceGroupOperationPendingHistoryDataTable"
/>
+ <rich:dataTable
id="resourceGroupOperationPendingHistoryDataTable"
+
rows="#{PageControl.ResourceGroupOperationPendingHistory.pageSize}"
+
value="#{resourceGroupOperationPendingHistoryDataModel}"
+ var="pendingItem"
+ width="100%"
+ columnsWidth="1%, 20%, 20%, 20%, 20%, 19%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceGroupOperationPendingHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="pendingSelectedItems" />
+ </f:facet>
+
+ <onc:select name="pendingSelectedItems"
value="#{pendingItem.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Submitted" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.createdTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml"
+ <f:param name="groupId"
value="#{param.groupId}" />
+ <f:param name="opId"
value="#{pendingItem.id}" />
+ <f:param name="category"
value="#{param.category}" />
+
+ <h:outputText
value="#{pendingItem.operationDefinition.displayName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText
value="#{pendingItem.operationDefinition.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.status}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.subjectName}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6" width="100%">
+ <onc:selectCommandButton
action="#{ResourceGroupOperationPendingHistoryUIBean.cancel}"
+ value="CANCEL SELECTED"
target="pendingSelectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.control}"/>
+
+ <ui:param name="paginationDataTableName"
value="resourceGroupOperationPendingHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{resourceGroupOperationPendingHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ResourceGroupOperationPendingHistory}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <!--
+ ResourceGroup Operation Completed History
+ -->
+
+ <h:form id="historyForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+ <input type="hidden" name="category"
value="#{param.category}" />
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Completed Operations</f:facet>
+
+ <a4j:keepAlive
beanName="ResourceGroupOperationCompletedHistoryUIBean"/>
+
+ <ui:param name="resourceGroupOperationCompletedHistoryDataModel"
value="#{ResourceGroupOperationCompletedHistoryUIBean.dataModel}"/>
+
+ <h:outputText value="There are no completed operations"
rendered="#{resourceGroupOperationCompletedHistoryDataModel.rowCount eq
0}"/>
+
+ <a4j:poll
id="resourceGroupOperationCompletedHistoryDataTableReRenderer"
+ oncomplete="disableConditionalButtons();"
+ interval="60000"
+ ignoreDupResponses="true"
+
actionListener="#{ResourceGroupOperationCompletedHistoryUIBean.clearDataModel}"
+
reRender="resourceGroupOperationCompletedHistoryDataTable" />
+ <rich:dataTable
rendered="#{resourceGroupOperationCompletedHistoryDataModel.rowCount gt 0}"
+
id="resourceGroupOperationCompletedHistoryDataTable"
+
rows="#{PageControl.ResourceGroupOperationCompletedHistory.pageSize}"
+
value="#{resourceGroupOperationCompletedHistoryDataModel}"
+ var="historyItem"
+ width="100%"
+ columnsWidth="1%, 17%, 17%, 17%, 17%, 16%, 16%"
+ rowKeyVar="rowIndex"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceGroupOperationCompletedHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="completedSelectedItems" />
+ </f:facet>
+
+ <onc:select name="completedSelectedItems"
value="#{historyItem.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Submitted" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.createdTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.modifiedTime">
+ <h:outputText styleClass="headerText"
value="Date Completed" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.modifiedTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml"
+ <f:param name="groupId"
value="#{param.groupId}" />
+ <f:param name="opId"
value="#{historyItem.id}" />
+ <f:param name="category"
value="#{param.category}" />
+
+ <h:outputText
value="#{historyItem.operationDefinition.displayName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText
value="#{historyItem.operationDefinition.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText rendered="#{historyItem.status ne
'FAILURE'}" value="#{historyItem.status}"/>
+ <h:outputLink rendered="#{historyItem.status eq
'FAILURE'}"
+ value="javascript:displayMessageModal('Error
Message','#{historyItem.errorMessage}')">
+ <h:outputText value="#{historyItem.status}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.subjectName}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="7" width="100%">
+ <onc:selectCommandButton
action="#{ResourceGroupOperationCompletedHistoryUIBean.delete}"
+ value="DELETE SELECTED"
target="completedSelectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.control}"
+ onclick="return
preventDoubleClick();"/>
+
+ <ui:param name="paginationDataTableName"
value="resourceGroupOperationCompletedHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{resourceGroupOperationCompletedHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ResourceGroupOperationCompletedHistory}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <!-- use a hidden button trick (which sends the same action a column click
would) so request params aren't lost -->
+ <h:commandButton id="hiddenHistoryButton"
style="visibility: hidden;" action="#{TableSorter.obtainFromOutcome}"
/>
+
+ </rich:panel>
+ </h:form>
+
+ <script type="text/javascript">
+ var submitted = false;
+ function preventDoubleClick() {
+ if (submitted) {
+ return false;
+ } else {
+ submitted = true;
+ return true;
+ }
+ }
+ </script>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
new file mode 100644
index 0000000..8c9834e
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml
@@ -0,0 +1,232 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+<ui:param name="item"
value="#{ResourceGroupOperationHistoryDetailsUIBean.history}"/>
+
+<h:form id="operationHistoryDetailsForm">
+<input type="hidden" name="groupId"
value="${param.groupId}"/>
+<input type="hidden" name="opId"
value="${param.opId}"/>
+<input type="hidden" name="category"
value="#{param.category}"/>
+
+<a4j:keepAlive beanName="ResourceGroupOperationHistoryDetailsUIBean"
ajaxOnly="true"/>
+
+<br/>
+<h:outputLink
value="/rhq/group/operation/groupOperationHistory-plain.xhtml">
+ <f:param name="groupId" value="#{param.groupId}"/>
+ <f:param name="category" value="#{param.category}"/>
+
+ <h:outputText value="< Return to Operation History"/>
+</h:outputLink>
+
+<rich:panel styleClass="BlockContent">
+ <f:facet name="header">Details</f:facet>
+ <table>
+ <tr>
+ <td align="right" style="width:
150px;">Operation:</td>
+ <td align="left">
+ <h:outputText
value="#{item.operationDefinition.displayName}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Date Submitted:</td>
+ <td align="left">
+ <h:outputText value="#{item.createdTime}">
+ <f:converter converterId="UserDateTimeConverter"/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Date Completed:</td>
+ <td align="left">
+ <h:outputText value="#{item.modifiedTime}"
rendered="#{item.status ne 'INPROGRESS'}">
+ <f:converter converterId="UserDateTimeConverter"/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Requester:</td>
+ <td align="left">
+ <h:outputText value="#{item.subjectName}"
rendered="#{!(empty item.subjectName)}"/>
+ <h:outputText value="(unknown)" rendered="#{empty
item.subjectName}"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Status:</td>
+ <td align="left">
+ <h:outputText rendered="#{item.status eq 'SUCCESS' or
item.status eq 'INPROGRESS'}"
+ value="#{item.status}"/>
+ <h:outputLink rendered="#{item.status ne 'SUCCESS' and
item.status ne 'INPROGRESS'}"
+ value="#" id="resultsLink">
+ <h:outputText value="#{item.status}"/>
+ <rich:componentControl for="resultsModalPanel"
attachTo="resultsLink" operation="show"
+ event="onclick"/>
+ </h:outputLink>
+ <rich:modalPanel id="resultsModalPanel"
width="600" height="400"
+ style="overflow: auto;">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Results"/>
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="controls">
+ <h:panelGroup>
+ <h:graphicImage value="/images/close.png"
style="cursor:pointer"
+
id="resultsModelPanelHideLink"/>
+ <rich:componentControl
for="resultsModalPanel" attachTo="resultsModelPanelHideLink"
+ operation="hide"
event="onclick"/>
+ </h:panelGroup>
+ </f:facet>
+
+ <div class="ErrorModalBody">
+ <h:outputText value="#{item.errorMessage}"/>
+ </div>
+ </rich:modalPanel>
+ </td>
+ </tr>
+ </table>
+</rich:panel>
+
+<rich:panel styleClass="BlockContent">
+ <f:facet name="header">Parameters</f:facet>
+ <onc:config
+
configurationDefinition="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.configurationDefinition}"
+
configuration="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.configuration}"
+ readOnly="true"
+
nullConfigurationDefinitionMessage="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"/>
+</rich:panel>
+
+<rich:panel styleClass="BlockContent">
+ <f:facet name="header">Resource Operation Results</f:facet>
+
+ <h:panelGrid columns="1" styleClass="data-table">
+
+ <ui:param name="resourceGroupOperationHistoryDetailsDataModel"
+
value="#{ResourceGroupOperationHistoryDetailsUIBean.dataModel}"/>
+
+ <h:outputText value="There were no resources in the group when this
operation was executed"
+
rendered="#{resourceGroupOperationHistoryDetailsDataModel.rowCount eq 0}"/>
+
+ <rich:dataTable
rendered="#{resourceGroupOperationHistoryDetailsDataModel.rowCount gt 0}"
+ id="resourceGroupOperationHistoryDetailsDataTable"
+
rows="#{PageControl.ResourceGroupOperationHistoryDetails.pageSize}"
+
value="#{resourceGroupOperationHistoryDetailsDataModel}"
+ var="resourceHistoryItem"
+ width="100%"
+ columnsWidth="20%, 20%, 20%, 20%, 19%"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceGroupOperationHistoryDetails"/>
+ </f:facet>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.id">
+ <h:outputText styleClass="headerText"
value="ID"/>
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{resourceHistoryItem.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Submitted"/>
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{resourceHistoryItem.createdTime}">
+ <f:converter converterId="UserDateTimeConverter"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name"/>
+ </f:facet>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml">
+ <f:param name="id"
value="#{resourceHistoryItem.resource.id}"/>
+ <f:param name="opId"
value="#{resourceHistoryItem.id}"/>
+ <h:outputText
value="#{resourceHistoryItem.operationDefinition.displayName}"/>
+ </h:outputLink>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Resource"/>
+ </f:facet>
+
+ <h:outputText
value="#{resourceHistoryItem.resource.name}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.status">
+ <h:outputText styleClass="headerText"
value="Status"/>
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{resourceHistoryItem.status}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.subjectName">
+ <h:outputText styleClass="headerText"
value="User"/>
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{resourceHistoryItem.subjectName}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6" width="100%">
+ <ui:param name="paginationDataTableName"
+
value="resourceGroupOperationHistoryDetailsDataTable"/>
+ <ui:param name="paginationDataModel"
+
value="#{resourceGroupOperationHistoryDetailsDataModel}"/>
+ <ui:param name="paginationPageControl"
+
value="#{PageControl.ResourceGroupOperationHistoryDetails}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </h:panelGrid>
+
+</rich:panel>
+
+<h:outputLink
value="/rhq/group/operation/groupOperationHistory-plain.xhtml">
+ <f:param name="groupId" value="#{param.groupId}"/>
+ <f:param name="category" value="#{param.category}"/>
+
+ <h:outputText value="< Return to Operation History"/>
+</h:outputLink>
+
+</h:form>
+
+</ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml
new file mode 100644
index 0000000..23274f2
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml
@@ -0,0 +1,118 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+ <br/>
+ <!-- ResourceGroup Operation Schedules -->
+ <h:outputLink
value="/rhq/group/operation/groupOperationSchedules-plain.xhtml">
+ <f:param name="groupId" value="#{param.groupId}" />
+ <f:param name="category" value="#{param.category}" />
+
+ <h:outputText value="< Return to Operation Schedules"/>
+ </h:outputLink>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">General Info</f:facet>
+ <table>
+ <tr>
+ <td align="right" style="width:
125px;">Operation:</td>
+ <td align="left">
+ <h:outputText value="#{item.operationDisplayName}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" style="width:
125px;">Scheduled By:</td>
+ <td align="left">
+ <h:outputText value="#{item.subject.name}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" style="width: 125px;">Halt on
Failure:</td>
+ <td align="left">
+ <h:outputText value="#{item.haltOnFailure}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" style="width:
125px;">Notes:</td>
+ <td align="left">
+ <h:outputText value="#{item.description}" />
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Parameters</f:facet>
+ <onc:config
configurationDefinition="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.configurationDefinition}"
+
configuration="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.configuration}"
+ readOnly="true"
+
nullConfigurationDefinitionMessage="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"/>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Resource Operation Order"/>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Execute this operation: " />
+ <h:selectOneRadio id="executionType"
+ layout="pageDirection"
+ disabled="true"
+
value="#{ResourceGroupOperationScheduleDetailsUIBean.resourceExecutionOption}">
+ <f:selectItem
value="#{ResourceGroupExecutionTypeUIBean.concurrentOption}" />
+ <f:selectItem
value="#{ResourceGroupExecutionTypeUIBean.orderedOption}" />
+ </h:selectOneRadio>
+
+ <h:outputText value=" " />
+ <rich:orderingList id="resourceNameItems"
+ orderControlsVisible="false"
+ fastOrderControlsVisible="false"
+
value="#{ResourceGroupOperationScheduleDetailsUIBean.resourceNameItems}"
+ var="resourceNameItem"
listHeight="150" listWidth="200"
+ converter="IntegerOptionItemConverter">
+ <rich:column>
+ <h:outputText
value="#{resourceNameItem.displayName}"></h:outputText>
+ </rich:column>
+ </rich:orderingList>
+ </h:panelGrid>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Schedule Details</f:facet>
+ <onc:operationScheduler
scheduleDetails="#{ResourceGroupOperationScheduleDetailsUIBean.operationDetails}"
readOnly="true" />
+ </rich:panel>
+
+ <h:form id="scheduleForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+ <input type="hidden" name="jobId"
value="${param.jobId}"/>
+ <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton
action="#{ResourceGroupOperationScheduleUIBean.executeNow}"
+ value="EXECUTE NOW"
styleClass="buttonmed"
+
rendered="#{ResourceGroupUIBean.permissions.control}" />
+ </h:panelGrid>
+ </h:form>
+
+ <br />
+ <br />
+
+ <h:outputLink
value="/rhq/group/operation/groupOperationSchedules-plain.xhtml">
+ <f:param name="groupId" value="#{param.groupId}" />
+ <f:param name="category" value="#{param.category}" />
+
+ <h:outputText value="< Return to Operation Schedules"/>
+ </h:outputLink>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml
new file mode 100644
index 0000000..486d22a
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml
@@ -0,0 +1,173 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <!--
+ ResourceGroup Operation Definitions
+ -->
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.control}" value="You do not have permissions to
execute operations on this group"/>
+
+ <h:form id="newScheduleForm">
+ <input type="hidden" name="groupId"
value="#{param.groupId}" />
+ <input type="hidden" name="parentGroupId"
value="#{param.parentGroupId}" />
+ <input type="hidden" name="category"
value="#{param.category}" />
+
+ <c:if test="${not empty param.opId}">
+ <input type="hidden" name="opId"
value="#{param.opId}" />
+ </c:if>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Supported Operations</f:facet>
+
+ <rich:dataTable id="resourceGroupOperationDefinitionDataTable"
+ rows="0"
+
value="#{ResourceGroupOperationDefinitionUIBean.dataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="35%, 65%"
+ styleClass="resources-table"
+ headerClass="tableRowHeader"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="NONE" />
+ </f:facet>
+
+ <rich:column rendered="false">
+ <f:facet name="header">
+ <rich:spacer />
+ </f:facet>
+
+ <onc:select name="selectedItems"
value="#{item.id}" type="radio" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink action="success"
rendered="#{ResourceGroupUIBean.permissions.control}">
+ <f:param name="opId" value="#{item.id}"
/>
+ <f:param name="groupId"
value="#{param.groupId}"/>
+ <f:param name="parentGroupId"
value="#{param.parentGroupId}" />
+ <f:param name="category"
value="#{param.category}" />
+
+ <h:outputText value="#{item.displayName} *"
rendered="#{(not empty param.opId) and (param.opId == item.id)}"/>
+ <h:outputText value="#{item.displayName}"
rendered="#{(empty param.opId) or (param.opId != item.id)}"/>
+ </h:outputLink>
+
+ <h:outputText value="#{item.displayName}"
rendered="#{not ResourceGroupUIBean.permissions.control}"/>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText value="#{item.description}"/>
+ </rich:column>
+
+ </rich:dataTable>
+
+ </h:panelGrid>
+ </rich:panel>
+
+ <rich:panel rendered="#{not empty param.opId and
ResourceGroupUIBean.permissions.control}" styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Operation Parameters"/>
+ </f:facet>
+ <!-- even when things aren't rendered, they will still be executed?
-->
+ <onc:config
configurationDefinition="#{OperationDefinitionParametersUIBean.configurationDefinition}"
+
configuration="#{OperationDefinitionParametersUIBean.configuration}"
+
nullConfigurationDefinitionMessage="#{OperationDefinitionParametersUIBean.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{OperationDefinitionParametersUIBean.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"/>
+ </rich:panel>
+
+ <rich:panel rendered="#{not empty param.opId and
ResourceGroupUIBean.permissions.control}" styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Resource Operation Order"/>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Execute this operation: " />
+ <h:selectOneRadio id="executionType"
+ layout="pageDirection"
+
value="#{ResourceGroupOperationDefinitionUIBean.resourceExecutionOption}"
+ onchange="updateDependent(this,
'newScheduleForm:haltOnFailure',
'#{ResourceGroupExecutionTypeUIBean.concurrentOption.value}');">
+ <f:selectItem
value="#{ResourceGroupExecutionTypeUIBean.concurrentOption}" />
+ <f:selectItem
value="#{ResourceGroupExecutionTypeUIBean.orderedOption}" />
+ </h:selectOneRadio>
+
+ <h:outputText value=" " />
+ <rich:orderingList id="resourceNameItems"
+
value="#{ResourceGroupOperationDefinitionUIBean.resourceNameItems}"
+ var="resourceNameItem"
listHeight="150" listWidth="200"
+ converter="IntegerOptionItemConverter">
+ <rich:column>
+ <h:outputText
value="#{resourceNameItem.displayName}"></h:outputText>
+ </rich:column>
+ </rich:orderingList>
+ </h:panelGrid>
+ </rich:panel>
+
+ <rich:panel rendered="#{not empty param.opId and
ResourceGroupUIBean.permissions.control}" styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Operation Schedule Details"/>
+ </f:facet>
+ <!-- bug in rich:panel renders children even if the panel isn't
rendered -->
+ <onc:operationScheduler
scheduleDetails="#{ResourceGroupOperationScheduleUIBean.operationDetails}"/>
+ </rich:panel>
+
+ <rich:panel rendered="#{not empty param.opId and
ResourceGroupUIBean.permissions.control}" styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Other Options"/>
+ </f:facet>
+
+ <!-- Notes are for user use only, displayed back in the History view
-->
+ <!-- The Notes value must fit into the Quartz job_details.description
field. Quartz does not protect against SQL errors -->
+ <h:panelGrid columns="3">
+ <h:outputLabel for="timeout" value="Timeout:"
/>
+ <h:inputText id="timeout"
value="#{ResourceGroupOperationDefinitionUIBean.timeout}" />
+ <h:outputText value="The maximum time this operation is given to
finish, in seconds" />
+
+ <h:outputLabel for="haltOnFailure" value="Halt On
Failure:" />
+ <h:selectBooleanCheckbox id="haltOnFailure"
value="#{ResourceGroupOperationDefinitionUIBean.haltOnFailure}" />
+ <h:outputText value="If checked, an operation failure will cause
the scheduling of the remaining ordered operations to halt" />
+
+ <h:outputLabel for="notes" value="Notes:" />
+ <h:inputText id="notes" maxlength="120"
size="40"
value="#{ResourceGroupOperationDefinitionUIBean.description}" />
+ <h:outputText value="Optional notes, if the operation is scheduled
for execution later" />
+ </h:panelGrid>
+ <hr />
+ <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell"
+ rendered="#{not empty param.opId}">
+ <h:commandButton
action="#{ResourceGroupOperationScheduleUIBean.schedule}"
+ value="SCHEDULE"
styleClass="buttonmed"
+
rendered="#{ResourceGroupUIBean.permissions.control}" />
+ </h:panelGrid>
+ </rich:panel>
+ <br /><br /><br /><br />
+ <br /><br /><br /><br />
+ </h:form>
+
+ <script type="text/javascript">
+ setInputDisabled(document.getElementById('newScheduleForm:haltOnFailure'),
true, true);
+ clickAlreadySelectedElements();
+ </script>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml
new file mode 100644
index 0000000..fbc7c17
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml
@@ -0,0 +1,106 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <!-- ResourceGroup Operation Schedules -->
+ <h:form id="scheduleForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+ <input type="hidden" name="category"
value="#{param.category}" />
+
+ <!-- Operation Schedule Table -->
+ <rich:panel styleClass="BlockContent">
+
+ <ui:param name="resourceGroupOperationScheduleDataModel"
value="#{ResourceGroupOperationScheduleUIBean.dataModel}"/>
+ <rich:dataTable id="resourceGroupOperationScheduleDataTable"
+ rows="0"
+ value="#{resourceGroupOperationScheduleDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 30%, 39%, 30%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="NONE" />
+ </f:facet>
+
+ <rich:column style="width: 1px;">
+ <f:facet name="header">
+ <onc:allSelect target="selectedItems" />
+ </f:facet>
+ <onc:select name="selectedItems"
value="#{item.jobId}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Job
ID" />
+ </f:facet>
+ <h:commandLink
action="#{ResourceGroupOperationScheduleUIBean.selectScheduleToView}">
+ <h:outputText value="#{item.jobId}" />
+ </h:commandLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml"
+ <f:param name="groupId"
value="#{param.groupId}" />
+ <f:param name="jobId" value="#{item.jobId}"
/>
+ <f:param name="category"
value="#{param.category}" />
+
+ <h:outputText
value="#{item.operationDisplayName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Notes" />
+ </f:facet>
+ <h:outputText value="#{item.description}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="User" />
+ </f:facet>
+ <h:outputText value="#{item.subject.name}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="4" width="100%">
+ <onc:selectCommandButton
action="#{ResourceGroupOperationScheduleUIBean.unschedule}"
+ value="UNSCHEDULE"
target="selectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.control}"/>
+ <onc:selectCommandButton
action="#{ResourceGroupOperationScheduleUIBean.executeNow}"
+ value="EXECUTE NOW"
target="selectedItems"
+ styleClass="on-pager-button
buttonsmall"
+ low="1" high="1"
+
rendered="#{ResourceGroupUIBean.permissions.control}"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml
new file mode 100644
index 0000000..001f5bb
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml
@@ -0,0 +1,41 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <p>
+ Below is the #{param.listName}[#{param.listIndex}] item from the results of the
+ execution of the
#{ResourceGroupOperationHistoryDetailsUIBean.history.operationDefinition.displayName}
+ operation. Click OK to return to the main Operation History Details page.
+ </p>
+
+ <h:form id="viewOperationResultsMapForm">
+
+ <input type="hidden" name="id"
value="#{ResourceGroupUIBean.id}"/>
+
+ <onc:config
configurationDefinition="#{ResourceGroupOperationHistoryDetailsUIBean.results.configurationDefinition}"
+
configuration="#{ResourceGroupOperationHistoryDetailsUIBean.results.configuration}"
+ listName="#{param.listName}"
+ listIndex="#{param.listIndex}"
+ readOnly="true"/>
+
+ </h:form>
+
+ <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:panelGroup layout="block">
+ <div title="Return to Previous Page"
onclick="history.back()" class="buttonmed">OK</div>
+ </h:panelGroup>
+ </h:panelGrid>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit 62ce6dd82fc3dae5ca2f46c631256fe2e81014f7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:08:23 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group >
alerts tabs
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 cc5e636..709e304 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
@@ -148,9 +148,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
//
- // alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
- // alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
- //
// eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
//
// contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
@@ -162,6 +159,11 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
configurationTab.updateSubTab("History", new FullHTMLPane(
"/rhq/group/configuration/history-plain.xhtml?groupId=" +
groupId));
+ alertsTab.updateSubTab("History", new FullHTMLPane(
+ "/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=" +
groupId));
+ alertsTab.updateSubTab("Definitions", new FullHTMLPane(
+ "/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=" +
groupId));
+
eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId));
// topTabSet.setSelectedTab(selectedTab);
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml
new file mode 100644
index 0000000..7a677a5
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml
@@ -0,0 +1,126 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="alertDefinitionsListForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+
+ <rich:panel styleClass="BlockContent">
+ <a4j:keepAlive beanName="ListGroupAlertDefinitionsUIBean"/>
+
+ <ui:param name="alertDefinitionsDataModel"
value="#{ListGroupAlertDefinitionsUIBean.dataModel}"/>
+ <rich:dataTable id="alertDefinitionsDataTable"
+
rows="#{PageControl.GroupAlertDefinitionsList.pageSize}"
+ value="#{alertDefinitionsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 25%, 35%, 20%, 19%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="GroupAlertDefinitionsList"
/>
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAlertDefinitions" />
+ </f:facet>
+
+ <onc:select name="selectedAlertDefinitions"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Config.do">
+ <f:param name="mode" value="viewRoles"/>
+ <f:param name="groupId"
value="#{param.groupId}"/>
+ <f:param name="ad" value="#{item.id}"/>
+ <h:outputText value="#{item.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.description">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.ctime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.enabled">
+ <h:outputText styleClass="headerText"
value="Active" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.enabled}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="5" width="100%">
+ <h:commandButton
action="#{ListGroupAlertDefinitionsUIBean.createNewAlertDefinition}"
+ value="NEW DEFINITION"
styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}"
+
<f:param name="groupId"
value="${param.groupId}"/>
+ <f:param name="mode" value="new"/>
+ </h:commandButton>
+ <onc:selectCommandButton
action="#{ListGroupAlertDefinitionsUIBean.enableSelectedAlertDefinitions}"
+ value="ENABLE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListGroupAlertDefinitionsUIBean.disableSelectedAlertDefinitions}"
+ value="DISABLE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListGroupAlertDefinitionsUIBean.deleteSelectedAlertDefinitions}"
+ value="DELETE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}" />
+
+ <ui:param name="paginationDataTableName"
value="alertDefinitionsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{alertDefinitionsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.GroupAlertDefinitionsList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml
new file mode 100644
index 0000000..00aca9b
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml
@@ -0,0 +1,177 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="alertHistoryForm">
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+
+ <rich:panel styleClass="BlockContent">
+
+ <h:panelGrid columns="4" cellspacing="3">
+ <h:outputLabel for="alertDefinitionFilter" value="Group
Alert Definition Filter: " />
+ <h:selectOneMenu id="alertDefinitionFilter"
value="#{ListGroupAlertHistoryUIBean.alertDefinitionFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}" />
+
+ <f:selectItems
value="#{ListGroupAlertHistoryUIBean.alertDefinitionSelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="alertPriorityFilter" value="Alert
Priority Filter: " />
+ <h:selectOneMenu id="alertPriorityFilter"
value="#{ListGroupAlertHistoryUIBean.alertPriorityFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}" />
+
+ <f:selectItems
value="#{ListGroupAlertHistoryUIBean.alertPrioritySelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="dateFilter" value="Date Filter:
" />
+ <h:inputText id="dateFilter"
value="#{ListGroupAlertHistoryUIBean.dateFilter}"
+ onkeypress="return ignoreEnterKey(event);"
+ style="width: 300px;" />
+ <a4j:commandButton value="GO"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}"
+ styleClass="buttonmed">
+ <s:defaultAction />
+ </a4j:commandButton>
+ <h:outputText id="dateErrors"
value="#{ListGroupAlertHistoryUIBean.dateErrors}" />
+ </h:panelGrid>
+
+ <br/>
+
+ <ui:param name="alertHistoryDataModel"
value="#{ListGroupAlertHistoryUIBean.dataModel}"/>
+ <rich:dataTable id="alertHistoryDataTable"
+
rows="#{PageControl.GroupAlertHistoryList.pageSize}"
+ value="#{alertHistoryDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 20%, 20%, 20%, 30%, 9%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="GroupAlertHistoryList" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAlerts" />
+ </f:facet>
+
+ <onc:select name="selectedAlerts"
value="#{item.alert.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.alertDefinition.priority">
+ <h:outputText styleClass="headerText"
value="Priority" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:graphicImage value="/images/icons/Flag_blue_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'LOW'}"/>
+ <h:graphicImage value="/images/icons/Flag_yellow_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'MEDIUM'}"/>
+ <h:graphicImage value="/images/icons/Flag_red_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'HIGH'}"/>
+
+ <h:outputText
value="#{item.alert.alertDefinition.priority.name}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.ctime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Alerts.do">
+ <f:param name="mode" value="viewAlert" />
+ <f:param name="id"
value="#{item.alert.alertDefinition.resource.id}"/>
+ <f:param name="a" value="#{item.alert.id}"
/>
+ <h:outputText value="#{item.alert.ctime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.alertDefinition.name">
+ <h:outputText styleClass="headerText"
value="Alert Definition" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Config.do">
+ <f:param name="mode" value="viewRoles"/>
+ <f:param name="id"
value="#{item.alert.alertDefinition.resource.id}"/>
+ <f:param name="ad"
value="#{item.alert.alertDefinition.id}"/>
+ <h:outputText
value="#{item.alert.alertDefinition.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Alert
Condition" />
+ </f:facet>
+ <h:outputText value="#{item.conditionText}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Actual Value" />
+ </f:facet>
+ <h:outputText value="#{item.conditionValue}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Recovery Info" />
+ </f:facet>
+ <h:outputText value="#{item.recoveryInfo}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="7" width="100%">
+ <onc:selectCommandButton
action="#{ListGroupAlertHistoryUIBean.deleteSelectedAlerts}"
+ value="DELETE SELECTED"
target="selectedAlerts" styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}" />
+ <h:commandButton
action="#{ListGroupAlertHistoryUIBean.purgeAllAlerts}"
+ value="PURGE ALL"
styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.alert}" />
+
+ <ui:param name="paginationDataTableName"
value="alertHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{alertHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.GroupAlertHistoryList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <a4j:keepAlive beanName="ListGroupAlertHistoryUIBean"/>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
\ No newline at end of file
commit 79d8e1bb6ca9b8cb725aa2c40566ce1666d1a2a1
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:07:41 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group >
configuration tabs
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 a1f46fc..cc5e636 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
@@ -148,9 +148,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
//
- // configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
- // configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
- //
// alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
// alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
//
@@ -160,6 +157,10 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
// contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
// contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+ configurationTab.updateSubTab("Current", new FullHTMLPane(
+ "/rhq/group/configuration/viewCurrent-plain.xhtml?groupId=" +
groupId));
+ configurationTab.updateSubTab("History", new FullHTMLPane(
+ "/rhq/group/configuration/history-plain.xhtml?groupId=" +
groupId));
eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId));
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
index 1ba9b78..a1c2c45 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
@@ -90,7 +90,7 @@ public class EditGroupResourceConfigurationUIBean extends
AbstractGroupResourceC
"Failed to schedule group Resource Configuration update - cause:
" + e);
viewId = VIEW_ID;
}
- this.redirect.setViewId(viewId);
+ this.redirect.setViewId(getViewId(viewId));
this.redirect.execute();
}
@@ -100,7 +100,7 @@ public class EditGroupResourceConfigurationUIBean extends
AbstractGroupResourceC
@End
public void cancel() {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Edit
canceled.");
- this.redirect.setViewId(ViewGroupResourceConfigurationUIBean.VIEW_ID);
+
this.redirect.setViewId(getViewId(ViewGroupResourceConfigurationUIBean.VIEW_ID));
this.redirect.execute();
return;
}
@@ -111,8 +111,17 @@ public class EditGroupResourceConfigurationUIBean extends
AbstractGroupResourceC
@End
public void reset() {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "All properties
reset to original values.");
- this.redirect.setViewId(VIEW_ID);
+ this.redirect.setViewId(getViewId(VIEW_ID));
this.redirect.execute();
return;
}
+
+ private String getViewId(String toViewId) {
+ String currentViewId = FacesContextUtility.getViewId();
+ int currentPlainIndex = currentViewId.indexOf("-plain.xhtml");
+ if (currentPlainIndex != -1) {
+ toViewId = toViewId.substring(0, toViewId.length() - 6) +
"-plain.xhtml";
+ }
+ return toViewId;
+ }
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java
index 4839095..62d17d0 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java
@@ -18,15 +18,16 @@
*/
package org.rhq.enterprise.gui.configuration.group;
-import org.rhq.enterprise.gui.legacy.ParamConstants;
-
import org.jboss.seam.ScopeType;
-import org.jboss.seam.faces.Redirect;
import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.Redirect;
+
+import org.rhq.core.gui.util.FacesContextUtility;
+import org.rhq.enterprise.gui.legacy.ParamConstants;
/**
* A POJO Seam component that handles loading Resource configurations across a compatible
Group in view-only mode.
@@ -53,8 +54,17 @@ public class ViewGroupResourceConfigurationUIBean extends
AbstractGroupResourceC
@End
public void edit() {
this.redirect.setParameter(ParamConstants.GROUP_ID_PARAM, getGroup().getId());
- this.redirect.setViewId(EditGroupResourceConfigurationUIBean.VIEW_ID);
+
this.redirect.setViewId(getViewId(EditGroupResourceConfigurationUIBean.VIEW_ID));
this.redirect.execute();
return;
}
+
+ private String getViewId(String toViewId) {
+ String currentViewId = FacesContextUtility.getViewId();
+ int currentPlainIndex = currentViewId.indexOf("-plain.xhtml");
+ if (currentPlainIndex != -1) {
+ toViewId = toViewId.substring(0, toViewId.length() - 6) +
"-plain.xhtml";
+ }
+ return toViewId;
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml
new file mode 100644
index 0000000..6fad880
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml
@@ -0,0 +1,45 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <p>
+ Enter a name and a value for the property to be added to the map
'#{param.mapName}',
+ then click OK to return to the main Edit page for the
'#{EditGroupResourceConfigurationUIBean.group.name}' Configuration.
+ </p>
+
+ <h:form id="addNewOpenMapMemberPropertyForm">
+
+ <input type="hidden" name="groupId"
value="#{EditGroupResourceConfigurationUIBean.group.id}"/>
+ <input type="hidden" name="mapName"
value="#{param.mapName}"/>
+
+ <h:panelGrid columns="2" width="400">
+ <h:panelGroup>
+ Name: <h:inputText
value="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.propertyName}"/>
+ </h:panelGroup>
+ <h:panelGroup>
+ Value: <h:inputText
value="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.propertyValue}"/>
+ </h:panelGroup>
+ </h:panelGrid>
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="OK"
action="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.addProperty}"
+ alt="Click to Add Property"
styleClass="buttonmed"/>
+ <h:commandButton value="CANCEL"
action="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.cancel}"
+ immediate="true" alt="Click to Cancel"
styleClass="buttonmed"/>
+ </h:panelGrid>
+
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml
new file mode 100644
index 0000000..cd365bd
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml
@@ -0,0 +1,69 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
+ <h:form id="configSetForm"
onsubmit="prepareInputsForSubmission(this)"
+ rendered="#{ResourceGroupUIBean.permissions.configureRead and
EditGroupResourceConfigurationUIBean.configurationSet ne null}">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureWrite}"
+ value="You do not have permissions to change the
configuration of this group"/>
+
+ <input type="hidden" name="groupId"
value="#{param.groupId}"/>
+
+ <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}">
+ <h:commandButton type="submit"
action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}"
+ value="SAVE" title="Click to Save
Changes"
+ styleClass="buttonmed"/>
+ <h:commandButton type="submit" immediate="true"
+
action="#{EditGroupResourceConfigurationUIBean.reset}"
+ value="RESET" title="Click to Reset All
Properties to Their Original Values"
+ styleClass="buttonmed"/>
+ <h:commandButton type="submit" immediate="true"
+
action="#{EditGroupResourceConfigurationUIBean.cancel}"
+ value="CANCEL" title="Click to Cancel
Edits and Return to View Page"
+ styleClass="buttonmed"/>
+ </h:panelGrid>
+
+ <a4j:region selfRendered="false">
+ <a4j:outputPanel layout="block"
ajaxRendered="true" keepTransient="true">
+ <onc:configSet id="rhq_configSet"
+
configurationSet="#{EditGroupResourceConfigurationUIBean.configurationSet}"/>
+ </a4j:outputPanel>
+ </a4j:region>
+
+ <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}">
+ <h:commandButton type="submit"
action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}"
+ value="SAVE" title="Click to Save
Changes"
+ styleClass="buttonmed"/>
+ <h:commandButton type="submit" immediate="true"
+
action="#{EditGroupResourceConfigurationUIBean.reset}"
+ value="RESET" title="Click to Reset All
Properties to Their Original Values"
+ styleClass="buttonmed"/>
+ <h:commandButton type="submit" immediate="true"
+
action="#{EditGroupResourceConfigurationUIBean.cancel}"
+ value="CANCEL" title="Click to Cancel
Edits and Return to View Page"
+ styleClass="buttonmed"/>
+ </h:panelGrid>
+
+ </h:form>
+
+ <ui:remove><!--<a4j:log popup="false" level="ALL"
style="width: 800px; height: 300px;"/>--></ui:remove>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml
new file mode 100644
index 0000000..566d95b
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml
@@ -0,0 +1,281 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
+ <h:form id="historyForm"
rendered="#{ResourceGroupUIBean.permissions.configureRead}">
+ <input type="hidden" name="groupId"
value="#{param.groupId}"/>
+ <input type="hidden" name="arcuId"
value="#{param.arcuId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Group Configuration Update
History"/>
+ </f:facet>
+
+ <ui:param name="groupResourceConfigUpdateHistoryDataModel"
value="#{GroupResourceConfigurationHistoryUIBean.dataModel}"/>
+ <rich:dataTable id="groupResourceConfigUpdateHistoryDataTable"
+
rows="#{PageControl.GroupResourceConfigurationUpdateHistory.pageSize}"
+
value="#{groupResourceConfigUpdateHistoryDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 9%, 25%, 25%, 10%, 10%, 20%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="GroupResourceConfigurationUpdateHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedUpdates" />
+ </f:facet>
+
+ <onc:select name="selectedUpdates"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="arcu.id">
+ <h:outputText styleClass="headerText"
value="Version" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="arcu.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.createdTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="arcu.modifiedTime">
+ <h:outputText styleClass="headerText"
value="Last Updated" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.modifiedTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="arcu.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.status}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="arcu.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.subjectName}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Action" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/group/configuration/history-plain.xhtml">
+ <f:param name="groupId"
value="#{param.groupId}" />
+ <f:param name="arcuId" value="#{item.id}"
/>
+ <f:param name="mode" value="group" />
+ <h:outputText value="View Group Update" />
+ </h:outputLink>
+ <ui:remove>
+ <br />
+ <h:outputLink
value="/rhq/group/configuration/history-plain.xhtml">
+ <f:param name="groupId"
value="#{param.groupId}" />
+ <f:param name="arcuId" value="#{item.id}"
/>
+ <f:param name="mode" value="details" />
+ <h:outputText value="View Member Updates" />
+ </h:outputLink>
+ </ui:remove>
+
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="7" width="100%">
+ <onc:selectCommandButton
action="#{GroupResourceConfigurationHistoryUIBean.deleteSelectedUpdates}"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
+ value="DELETE SELECTED"
target="selectedUpdates"
+ styleClass="on-pager-button
buttonsmall" />
+
+ <ui:param name="paginationDataTableName"
value="groupResourceConfigUpdateHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{groupResourceConfigUpdateHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.GroupResourceConfigurationUpdateHistory}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and
param.mode eq 'group' and not empty param.arcuId}">
+ <f:facet name="header">
+ <h:outputText value="Group Configuration Update Request"/>
+ </f:facet>
+ <h:form id="configSetForm">
+ <input type="hidden" name="groupId"
value="#{param.groupId}"/>
+ <input type="hidden" name="arcuId"
value="#{param.arcuId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <a4j:region selfRendered="false">
+ <a4j:outputPanel layout="block" ajaxRendered="true"
keepTransient="true">
+ <onc:configSet id="rhq_configSet"
+
configurationSet="#{GroupResourceConfigurationHistoryDetailsUIBean.configurationSet}"
+ readOnly="true"/>
+ </a4j:outputPanel>
+ </a4j:region>
+ </h:form>
+ </rich:panel>
+
+ <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and
param.mode eq 'details' and not empty param.arcuId}">
+ <f:facet name="header">
+ <h:outputText value="Individual Resource Configuration
Updates"/>
+ </f:facet>
+
+ <h:form id="resourceConfigurationUpdateDetailsForm">
+ <input type="hidden" name="groupId"
value="#{param.groupId}"/>
+ <input type="hidden" name="arcuId"
value="#{param.arcuId}"/>
+ <input type="hidden" name="mode"
value="#{param.mode}"/>
+
+ <ui:param name="groupResourceConfigurationDetailsDataModel"
value="#{GroupResourceConfigurationHistoryDetailsUIBean.dataModel}"/>
+ <rich:dataTable id="groupResourceConfigurationDetailsDataTable"
+
rows="#{PageControl.GroupResourceConfigurationUpdateDetails.pageSize}"
+
value="#{groupResourceConfigurationDetailsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 20%, 20%, 20%, 30%, 9%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="GroupResourceConfigurationUpdateDetails" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="cu.resource.name">
+ <h:outputText styleClass="headerText"
value="Resource" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.resourceName}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="cu.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.status}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Details" />
+ </f:facet>
+
+ <h:outputText value="#{item.errorMessage}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="cu.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink
value="/rhq/resource/configuration/history-plain.xhtml">
+ <f:param name="id" value="#{item.resourceId}"
/>
+ <f:param name="configId" value="#{item.id}"
/>
+ <h:outputText value="#{item.createdTime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="cu.modifiedTime">
+ <h:outputText styleClass="headerText"
value="Last Updated" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.modifiedTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="cu.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.subjectName}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6" width="100%">
+ <ui:param name="paginationDataTableName"
value="groupResourceConfigurationDetailsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{groupResourceConfigurationDetailsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.GroupResourceConfigurationUpdateDetails}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <a4j:keepAlive
beanName="GroupResourceConfigurationHistoryUIBean"/>
+ <a4j:keepAlive
beanName="GroupResourceConfigurationHistoryDetailsUIBean"/>
+ </h:form>
+ </rich:panel>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml
new file mode 100644
index 0000000..97184d3
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml
@@ -0,0 +1,55 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
+ <h:form id="configSetForm"
rendered="#{ResourceGroupUIBean.permissions.configureRead and
ViewGroupResourceConfigurationUIBean.configurationSet ne null}">
+
+ <input type="hidden" name="groupId"
value="#{ViewGroupResourceConfigurationUIBean.group.id}" />
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureWrite}"
+ value="You do not have permissions to change the
configuration of this group"/>
+
+ <!-- edit button at top of config -->
+ <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="EDIT"
action="#{ViewGroupResourceConfigurationUIBean.edit}"
+ title="Edit this Compatible Group
Configuration"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
+ styleClass="buttonmed"/>
+ </h:panelGrid>
+
+ <a4j:region selfRendered="false">
+ <a4j:outputPanel layout="block" ajaxRendered="true"
keepTransient="true">
+ <onc:configSet id="rhq_configSet"
+
configurationSet="#{ViewGroupResourceConfigurationUIBean.configurationSet}"
+ readOnly="true"/>
+ </a4j:outputPanel>
+ </a4j:region>
+
+ <!-- edit button at bottom of config -->
+ <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="EDIT"
action="#{ViewGroupResourceConfigurationUIBean.edit}"
+ title="Edit this Compatible Group
Configuration"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
+ styleClass="buttonmed"/>
+ </h:panelGrid>
+
+ </h:form>
+
+ <ui:remove><!--<a4j:log popup="false" level="ALL"
style="width: 800px; height: 300px;"/>--></ui:remove>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit ba1bfcc92fbd25264c50513436dcade710e87e4d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:05:22 2010 -0400
reformat, cosmetic
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 3363ea8..a1f46fc 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
@@ -134,8 +134,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
int groupId = this.groupComposite.getResourceGroup().getId();
monitoringTab.updateSubTab("Graphs", new
FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId="
- inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
- inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId()));
+ groupId));
monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId="
+ groupId));
@@ -143,6 +141,9 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
+ groupId));
monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId="
+ groupId));
+
+ inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
+ inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(groupId));
// inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
commit 11ebce8b1b6188a2550f8b210d911ea225a355e0
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:04:44 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group >
events tabs
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 c2a4f35..3363ea8 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
@@ -160,6 +160,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
// contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+ eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId));
+
// topTabSet.setSelectedTab(selectedTab);
updateTabStatus();
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml
new file mode 100644
index 0000000..00547cb
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml
@@ -0,0 +1,19 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/events/history-plain.xhtml"/>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit 3cc66b4df2bdfc4252f5e5844412458f3cca4f7d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:04:13 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group >
monitor tabs
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 c7fbb97..c2a4f35 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
@@ -36,6 +36,7 @@ import
org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
@@ -130,16 +131,18 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
// summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
// summaryTab.updateSubTab("Timeline", timelinePane);
+ int groupId = this.groupComposite.getResourceGroup().getId();
- // monitoringTab.updateSubTab("Graphs", new
GraphListView(resource)); // new
FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
- // monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
- // monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
- // monitoringTab.updateSubTab("Availability", new
FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
- // monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
- // monitoringTab.updateSubTab("Call Time", new
CallTimeView(resource));
- //
+ monitoringTab.updateSubTab("Graphs", new
FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId="
inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId()));
+ + groupId));
+ monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId="
+ + groupId));
+ monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId="
+ + groupId));
+ monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId="
+ + groupId));
// inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
@@ -235,6 +238,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
topTabSet.disableTab(eventsTab);
}
+ // only enable "Call Time" sub-tab for those that implement it
+ monitoringTab.setSubTabEnabled("Call Time",
typeFacets.contains(ResourceTypeFacet.CALL_TIME));
}
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml
index 89474e1..647d131 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml
@@ -1,20 +1,14 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
-
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:onc="http://jboss.org/on/component"
-
xmlns:onf="http://jboss.org/on/function">
-
-<ui:composition>
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<table border="0" cellpadding="0" cellspacing="0"
width="100%">
<!-- chart actions -->
@@ -49,8 +43,8 @@
<!-- spacer for date/time overlay, so it doesn't overlap metric display range
-->
<tr class="BlockContent">
<td>
- <br />
- <br />
+ <br />
+ <br />
</td>
</tr>
@@ -126,6 +120,4 @@
addWindowOnResizeEvent(maxIndicatorDivHeight);
</script>
-</ui:composition>
-
-</html>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml
new file mode 100644
index 0000000..14f6b68
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml
@@ -0,0 +1,19 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/monitor/graphs.xhtml" />
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml
new file mode 100644
index 0000000..75a22f5
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml
@@ -0,0 +1,15 @@
+<ui:composition
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:include src="/rhq/common/monitor/response-plain.xhtml" />
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml
new file mode 100644
index 0000000..0641783
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml
@@ -0,0 +1,153 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.measure}" value="You don't have the measure
permission for this group and therefore can not change metric schedules"/>
+
+ <h:form id="resourceGroupSchedulesForm">
+ <!-- hack to override the default button on the page, make this button
pseudo-first in the form,
+ but take it out of the document flow and position it off the screen -->
+ <div style="position:absolute; top:-100px; ">
+ <onc:selectCommandButton id="enableAndSetSelectedSchedules"
+ name="enableAndSetSelectedSchedules"
+
action="#{ListResourceGroupMeasurementScheduleUIBean.enableAndSetSelected}"
+ value="SET"
target="selectedResourceGroupSchedules"
+ styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.measure}" />
+ </div>
+ <input type="hidden" name="groupId"
value="${param.groupId}"/>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">
+ <h:outputText value="Configure Metric Collection
Schedules"/>
+ </f:facet>
+
+ <ui:param name="resourceGroupSchedulesDataModel"
value="#{ListResourceGroupMeasurementScheduleUIBean.dataModel}"/>
+ <rich:dataTable id="resourceGroupSchedulesDataTable"
+
rows="#{PageControl.ResourceGroupMeasurementScheduleList.pageSize}"
+ value="#{resourceGroupSchedulesDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 20%, 30%, 20%, 9%, 20%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceGroupMeasurementScheduleList" />
+ </f:facet>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <onc:allSelect target="selectedResourceGroupSchedules"
/>
+ </f:facet>
+
+ <onc:select name="selectedResourceGroupSchedules"
value="#{item.measurementDefinition.id}" />
+ </rich:column>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="definition.displayName">
+ <h:outputText styleClass="headerText"
value="Metric" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{item.measurementDefinition.displayName}"/>
+ </rich:column>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText
value="#{item.measurementDefinition.description}"/>
+ </rich:column>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="definition.dataType">
+ <h:outputText styleClass="headerText"
value="Type" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText
value="#{item.measurementDefinition.dataType}"/>
+ </rich:column>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Enabled" />
+ </f:facet>
+ <h:outputText value="#{(empty item.collectionEnabled) ?
'SOME' : (item.collectionEnabled ? 'Yes' : 'No')}" />
+ </rich:column>
+
+ <rich:column style="background-color: #{item.collectionEnabled ?
'#E2F2E6' : '#E2D2D2'}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Collection Interval" />
+ </f:facet>
+
+ <h:outputText value="#{item.collectionInterval}"
rendered="#{item.collectionInterval ne 0}">
+ <f:converter converterId="DurationConverter" />
+ </h:outputText>
+ <h:outputText value="DIFFERENT"
rendered="#{item.collectionInterval eq 0}" />
+ </rich:column>
+
+ <f:facet name="footer" rendered="false">
+ <rich:columnGroup>
+ <rich:column colspan="6">
+ <h:panelGrid columns="5" width="100%"
rendered="#{ResourceGroupUIBean.permissions.measure}">
+ <onc:selectCommandButton
id="enableSelectedSchedules"
+
name="enableSelectedSchedules"
+
action="#{ListResourceGroupMeasurementScheduleUIBean.enableSelected}"
+ value="ENABLE"
target="selectedResourceGroupSchedules"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.measure}" />
+
+
+ <onc:selectCommandButton
id="disableSelectedSchedules"
+
name="disableSelectedSchedules"
+
action="#{ListResourceGroupMeasurementScheduleUIBean.disableSelected}"
+ value="DISABLE"
target="selectedResourceGroupSchedules"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.measure}" />
+
+ <h:panelGrid columns="3">
+ <h:outputText value="Collection Interval:
"/>
+ <onc:duration
binding="#{ListResourceGroupMeasurementScheduleUIBean.duration}"
+ optionList="s,m,h"/>
+ <onc:selectCommandButton
id="enableAndSetSelectedSchedules"
+
name="enableAndSetSelectedSchedules"
+
action="#{ListResourceGroupMeasurementScheduleUIBean.enableAndSetSelected}"
+ value="SET"
target="selectedResourceGroupSchedules"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceGroupUIBean.permissions.measure}"/>
+ </h:panelGrid>
+ <rich:spacer/>
+ <ui:param name="paginationDataTableName"
value="resourceGroupSchedulesDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{resourceGroupSchedulesDataModel}"/>
+ <ui:param name="paginationPageControl"
+
value="#{PageControl.ResourceGroupMeasurementScheduleList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </h:panelGrid>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+</ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml
new file mode 100644
index 0000000..a58529d
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml
@@ -0,0 +1,128 @@
+<ui:composition template="/rhq/group/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:param name="resourceGroupHealthSummaryDataModel"
+ value="#{ResourceGroupMetricsTableUIBean.dataModel}" />
+
+ <ui:include src="/rhq/common/monitor/tables.xhtml" />
+
+ <rich:panel styleClass="BlockContent">
+
+ <f:facet name="header" styleClass="BlockTitle">
+ <a name="Group member Health" />
+ Group Member Health
+ </f:facet>
+
+ <h:form id="groupHealthSummaryForm">
+
+ <!-- On submit make sure these are provided for the context of any new
instance of the UI beans -->
+ <input type="hidden" name="groupId"
+ value="#{ResourceGroupUIBean.groupId}" />
+
+ <a4j:keepAlive beanName="ResourceGroupMetricsTableUIBean"/>
+
+ <rich:dataTable id="resourceGroupHealthSummaryDataTable"
+
rows="#{PageControl.ResourceGroupHealthSummary.pageSize}"
+ value="#{resourceGroupHealthSummaryDataModel}"
+ var="healthSummary"
+ columnsWidth="1%"
+ width="100%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <rich:column width="1%">
+ <f:facet name="header">
+ <onc:allSelect target="selectedResources" />
+ </f:facet>
+
+ <onc:select name="selectedResources"
+ value="#{healthSummary.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Resource Name" />
+ </f:facet>
+
+ <h:outputLink
+ value="#{onf:getDefaultResourceTabURL()}">
+ <f:param name="id"
value="#{healthSummary.id}" />
+ <h:outputText value="#{healthSummary.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Alerts" />
+ </f:facet>
+
+ <h:outputLink
+
value="/rhq/resource/alert/listAlertHistory-plain.xhtml">
+ <f:param name="id"
value="#{healthSummary.id}"/>
+ <f:param name="mode" value="list"/>
+ <h:outputText value="#{healthSummary.alerts}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Availability" />
+ </f:facet>
+
+ <h:graphicImage
+ value="/images/icons/availability_green_16.png"
alt="Up"
+ title="Up"
+ rendered="#{healthSummary.availabilityType ==
'UP'}" />
+ <h:graphicImage
value="/images/icons/availability_red_16.png"
+ alt="Down" title="Down"
+ rendered="#{healthSummary.availabilityType ==
'DOWN'}" />
+ <h:graphicImage
+ value="/images/icons/availability_grey_16.png"
+ alt="Unknown" title="Unknown"
+ rendered="#{healthSummary.availabilityType == null}"
/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="4" width="100%">
+
+ <onc:selectCommandButton
+
action="#{ResourceGroupMetricsCompareUIBean.compareSelected}"
+ value="COMPARE METRICS"
+ target="selectedResources" low="2"
+ styleClass="on-pager-button buttonsmall" />
+
+ <ui:param name="paginationDataTableName"
+ value="resourceGroupHealthSummaryDataTable" />
+ <ui:param name="paginationDataModel"
+ value="#{resourceGroupHealthSummaryDataModel}"
/>
+ <ui:param name="paginationPageControl"
+ value="#{PageControl.ResourceGroupHealthSummary}"
/>
+ <ui:include
+ src="/rhq/resource/include/pagination-plain.xhtml"
/>
+
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+ </h:form>
+
+ </rich:panel>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml
new file mode 100644
index 0000000..2b4b0c1
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml
@@ -0,0 +1,19 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/monitor/tables.xhtml"/>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit 242e1bbd40af27e6b06027da95b0cf5ee4e2024c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:02:10 2010 -0400
move the measurement-based navigation rule to the appropriate *-navigiation.xml file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml
index 9620666..976dd89 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml
@@ -109,19 +109,4 @@
</navigation-rule>
- <navigation-rule>
-
- <from-view-id>/rhq/group/monitor/tables.xhtml</from-view-id>
-
- <!-- === compareResourcesGroupMetrics (struts) =========================
-->
-
- <navigation-case>
-
<from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action>
- <from-outcome>compareResourceGroupMetrics</from-outcome>
-
<to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id>
- <redirect />
- </navigation-case>
-
- </navigation-rule>
-
</faces-config>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
index d7ef174..ee342f0 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
@@ -70,4 +70,19 @@
</navigation-rule>
+ <navigation-rule>
+
+ <from-view-id>/rhq/group/monitor/tables.xhtml</from-view-id>
+
+ <!-- === compareResourcesGroupMetrics (struts) =========================
-->
+
+ <navigation-case>
+
<from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action>
+ <from-outcome>compareResourceGroupMetrics</from-outcome>
+
<to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id>
+ <redirect />
+ </navigation-case>
+
+ </navigation-rule>
+
</faces-config>
\ No newline at end of file
commit ede4e8b5e26a385afe77864f2d207cfb602d4df5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:01:35 2010 -0400
prepare "plain" navigation scheme for iframed-facelets for groups
* copy/paste entire XXX-navigation.xml file to XXX-plain-navigation.xml
* search/replace *.xhtml with *-plain.xhtml inside each
* do this for the follow group subsystems:
** alerts, configuration, events, measurement, operations
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml
new file mode 100644
index 0000000..854b6a6
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- Group Alert Definition List -->
+ <navigation-rule>
+
<from-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=#{param.groupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createNewAlertDefinition</from-outcome>
+
<to-view-id>/alerts/Config.do?groupId=#{param.groupId}&mode=new</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=#{param.groupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Alert History List -->
+ <navigation-rule>
+
<from-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>dateFilter</from-outcome>
+
<to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}&date=#{param.date}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml
new file mode 100644
index 0000000..e89ccd6
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+
<from-view-id>/rhq/group/configuration/editCurrent-plain.xhtml</from-view-id>
+
+ <navigation-case>
+
<from-action>#{ConfigHelperUIBean.addNewOpenMapMemberProperty}</from-action>
+
<to-view-id>/rhq/group/configuration/addSimple-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/group/configuration/addSimple-plain.xhtml</from-view-id>
+
+ <navigation-case>
+
<to-view-id>/rhq/group/configuration/editCurrent-plain.xhtml?refresh=rhq_prop</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
+
<from-view-id>/rhq/group/configuration/history-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/configuration/history-plain.xhtml?groupId=#{param.groupId}&mode=#{param.mode}&arcuId=#{param.arcuId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/configuration/history-plain.xhtml?groupId=#{param.groupId}&mode=#{param.mode}&arcuId=#{param.arcuId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+
+
+</faces-config>
+
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml
new file mode 100644
index 0000000..447874c
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+
+ <from-view-id>/rhq/group/events/history-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/events/history-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/events/history-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
+
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml
new file mode 100644
index 0000000..d2a81e0
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- ResourceGroup Measurement Schedules -->
+ <navigation-rule>
+ <from-view-id>/rhq/group/monitor/schedules-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/monitor/schedules-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/monitor/schedules-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Graphs -->
+ <navigation-rule>
+ <from-view-id>/rhq/group/monitor/graphs-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/monitor/graphs-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Tables -->
+ <navigation-rule>
+ <from-view-id>/rhq/group/monitor/tables-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/monitor/tables-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Response -->
+ <navigation-rule>
+ <from-view-id>/rhq/group/monitor/response-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/monitor/response-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/monitor/response-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
+ <from-view-id>/rhq/group/monitor/tables-plain.xhtml</from-view-id>
+
+ <!-- === compareResourcesGroupMetrics (struts) =========================
-->
+
+ <navigation-case>
+
<from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action>
+ <from-outcome>compareResourceGroupMetrics</from-outcome>
+
<to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id>
+ <redirect />
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml
new file mode 100644
index 0000000..a60e56a
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- New Resource Group Operation Schedule -->
+ <navigation-rule>
+
<from-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- schedule an operation for deferred execution -->
+ <from-outcome>viewOperationSchedules</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- schedule an operation for immediate execution -->
+ <from-outcome>viewOperationHistory</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
back here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml?groupId=#{param.groupId}&opId=#{param.opId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Resource Group Operation Schedules -->
+ <navigation-rule>
+
<from-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- schedule an operation for immediate execution -->
+ <from-outcome>viewOperationHistory</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
+
<from-view-id>/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- schedule an operation for immediate execution -->
+ <from-outcome>viewOperationHistory</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Resource Group Operation History -->
+ <navigation-rule>
+
<from-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
+
<from-view-id>/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/group/operation/view-results-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml?groupId=#{param.groupId}&opId=#{param.opId}&category=#{param.category}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index 03f80f0..1bcfe79 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -177,6 +177,12 @@
/WEB-INF/jsf-navigation-resource-group/operation-navigation.xml,
/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml,
+
/WEB-INF/jsf-navigation-auto-group/events-navigation.xml,
/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml,
commit 67479a29abb05104a075a8c5e6a4be1aea9135c6
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 02:00:07 2010 -0400
extend the "plain" layout scheme for iframed-facelets for groups
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
new file mode 100644
index 0000000..5faaa7c
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
@@ -0,0 +1,64 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+ <h1>Default Group Content</h1>
+ </ui:define>
+
+ <ui:remove>
+
+<!--
+ <f:param name="groupId" value="#{param.groupId}"/>
+ <f:param name="parentGroupId"
value="#{param.parentGroupId}"/>
+ <f:param name="category" value="#{param.category}"/>
+
+ <onc:tab name="Monitor"
image="/images/icons/Monitor_grey_16.png"
rendered="#{ResourceGroupUIBean.compatible}">
+ <onc:subtab name="Graphs"
url="/rhq/group/monitor/graphs.xhtml"/>
+ <onc:subtab name="Tables"
url="/rhq/group/monitor/tables.xhtml"/>
+ <onc:subtab name="Schedules"
url="/rhq/group/monitor/schedules.xhtml"/>
+ <c:if test="#{GlobalPermissionsUIBean.experimental}">
+ <onc:subtab name="Response"
url="/rhq/group/monitor/response.xhtml"/>
+ </c:if>
+ </onc:tab>
+
+ <onc:tab name="Inventory"
image="/images/icons/Inventory_grey_16.png">
+ <onc:subtab name="Overview"
url="/rhq/group/inventory/view.xhtml" />
+ <c:if test="#{ResourceGroupUIBean.compatible and
ResourceGroupUIBean.facets.pluginConfiguration}">
+ <onc:subtab name="Connection"
url="/rhq/group/inventory/view-connection.xhtml" />
+ </c:if>
+ </onc:tab>
+
+ <onc:tab name="Alert"
image="/images/icons/Alert_grey_16.png"
+ rendered="#{monitorEnabled and
ResourceGroupUIBean.compatible}">
+ <onc:subtab name="Definitions"
url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" />
+ <onc:subtab name="History"
url="/rhq/group/alert/listGroupAlertHistory.xhtml" />
+ </onc:tab>
+
+ <onc:tab name="Configuration" displayName="Configure"
image="/images/icons/Configure_grey_16.png"
+ rendered="#{ResourceGroupUIBean.compatible and
ResourceGroupUIBean.facets.configuration}">
+ <onc:subtab name="Current"
url="/rhq/group/configuration/viewCurrent.xhtml" />
+ <onc:subtab name="History"
url="/rhq/group/configuration/history.xhtml" />
+ </onc:tab>
+
+ <onc:tab name="Operations"
image="/images/icons/Operation_grey_16.png"
rendered="#{ResourceGroupUIBean.compatible and
ResourceGroupUIBean.facets.operation}">
+ <onc:subtab name="New"
url="/rhq/group/operation/groupOperationScheduleNew.xhtml"/>
+ <onc:subtab name="Schedules"
url="/rhq/group/operation/groupOperationSchedules.xhtml"/>
+ <onc:subtab name="History"
url="/rhq/group/operation/groupOperationHistory.xhtml"/>
+ </onc:tab>
+
+ <onc:tab name="Events"
image="/images/icons/Events_grey_16.png"
rendered="#{ResourceGroupUIBean.compatible and
ResourceGroupUIBean.facets.event}">
+ <onc:subtab name="History"
url="/rhq/group/events/history.xhtml"/>
+ </onc:tab>
+ -->
+ </ui:remove>
+
+</ui:composition>
\ No newline at end of file
commit 84c915b2f0955e7a7693c0c8f5676b0cef53419d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 01:58:45 2010 -0400
fix group-wise sub-tabs, we only support a subset of resource-wise sub-tabs
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 23da6c5..c7fbb97 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
@@ -89,7 +89,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
summaryTab.registerSubTabs("Overview", "Timeline");
monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
- monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
+ monitoringTab.registerSubTabs("Graphs", "Tables",
"Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
inventoryTab.registerSubTabs("Overview", "Members",
"Connection Settings");
commit 79ffb74e96fafa82561a329341487bf149bb8c15
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 01:57:38 2010 -0400
reformat, cosmetic
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 144442b..23da6c5 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
@@ -69,7 +69,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private ResourceGroupTitleBar titleBar;
-
@Override
protected void onDraw() {
super.onDraw();
@@ -120,7 +119,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// CoreGUI.addBreadCrumb(getPlace());
}
-
public void onGroupSelected(ResourceGroupComposite groupComposite) {
this.groupComposite = groupComposite;
@@ -181,8 +179,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
group.setResourceType(type);
-
GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(
- group.getId(), new
AsyncCallback<Set<Permission>>() {
+
GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(group.getId(),
+ new AsyncCallback<Set<Permission>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError("Failed to
load group permissions.", caught);
}
@@ -224,7 +222,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// Configuration tab is only enabled for compatible groups of a type that
supports the Configuration facet
// and when the current user has the CONFIGURE_READ permission.
- if (!typeFacets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
+ if (typeFacets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
} else {
topTabSet.disableTab(configurationTab);
@@ -239,35 +237,32 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
-
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
// Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
String path = "ResourceGroup/" +
this.groupComposite.getResourceGroup().getId() + tabPath;
-
+
// But still add an item to the history, specifying false to tell it not to fire
an event.
History.newItem(path, false);
}
-
public void renderView(ViewPath viewPath) {
// e.g. #ResourceGroup/10010/Inventory/Overview
- String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null;
// e.g. "Inventory"
+ String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; //
e.g. "Inventory"
String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath()
: null; // e.g. "Overview"
selectTab(tabName, subTabName);
}
-
public void selectTab(String tabName, String subtabName) {
if (tabName == null) {
tabName = DEFAULT_TAB_NAME;
}
- TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName);
+ TwoLevelTab tab = (TwoLevelTab) this.topTabSet.getTabByTitle(tabName);
if (tab == null) {
CoreGUI.getErrorHandler().handleError("Invalid tab name: " +
tabName);
// TODO: Should we fire a history event here to redirect to a valid
bookmark?
- tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
+ tab = (TwoLevelTab) this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
}
this.topTabSet.selectTab(tab);
if (subtabName != null) {
commit 1a767576db3dfd69412a858eef0af3dcdd920955
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 01:56:13 2010 -0400
always render call-time iframe-facelet, conditionally render the sub-tab instead
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index ea7b88e..92d74eb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -27,6 +27,8 @@ import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourcePermission;
@@ -204,7 +206,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
updateTabStatus();
- topTabSet.markForRedraw();
}
private void updateTabStatus() {
@@ -215,8 +216,8 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
resource.getResourceType().getId(),
EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.events,
- ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypeLoadedCallback() {
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition,
+ ResourceTypeRepository.MetadataType.measurements), new
ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
ResourceDetailView.this.type = type;
@@ -275,10 +276,23 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.enableTab(contentTab);
}
+ // only enable "Call Time" sub-tab for those that implement it
+ monitoringTab.setSubTabEnabled("Call Time", implementsCallTime(type));
+
if (topTabSet.getSelectedTab().getDisabled()) {
topTabSet.selectTab(0);
}
+ topTabSet.markForRedraw();
+ }
+
+ private boolean implementsCallTime(ResourceType type) {
+ for (MeasurementDefinition definition : type.getMetricDefinitions()) {
+ if (definition.getDataType() == DataType.CALLTIME) {
+ return true;
+ }
+ }
+ return false;
}
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
index aa6576f..3da09e2 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
@@ -14,20 +14,6 @@
<rich:panel styleClass="BlockContent">
- <c:if test="#{!ResourceUIBean.facets.callTime}">
- <c:if test="#{CallTimeUIBean.context.resourceId != -1}">
- Response Time Metrics are not supported for this resource.
- </c:if>
- <c:if test="#{CallTimeUIBean.context.groupId != -1}">
- Response Time Metrics are not supported for this compatible group.
- </c:if>
- <c:if test="#{CallTimeUIBean.context.parentResourceId != -1 and
CallTimeUIBean.context.resourceTypeId != -1}">
- Response Time Metrics are not supported for this auto-group.
- </c:if>
-
- </c:if>
-
- <c:if test="#{ResourceUIBean.facets.callTime}">
<h:form id="callTimeForm">
<a4j:keepAlive beanName="CallTimeUIBean"/>
@@ -165,7 +151,6 @@
</table>
</h:form>
- </c:if>
</rich:panel>
commit a18620eb8f17662207c96e6b757d59f5cce71b9a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 12 01:55:03 2010 -0400
allow sub-tabs to render as conditionally enabled/disabled buttons
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
index bc79260..eb66445 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
@@ -18,6 +18,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.tab;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
import com.smartgwt.client.types.Overflow;
@@ -27,11 +31,8 @@ import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
-import java.util.LinkedHashMap;
-
/**
* @author Greg Hinkle
*/
@@ -40,6 +41,7 @@ public class SubTabLayout extends VLayout {
ToolStrip buttonBar;
LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String,
Canvas>();
+ Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed;
String currentlySelected;
@@ -59,7 +61,6 @@ public class SubTabLayout extends VLayout {
setMargin(0);
setPadding(0);
-
buttonBar = new ToolStrip();
buttonBar.setBackgroundColor("grey");
buttonBar.setWidth100();
@@ -68,7 +69,6 @@ public class SubTabLayout extends VLayout {
addMember(buttonBar);
-
int i = 0;
for (final String title : subtabs.keySet()) {
@@ -78,18 +78,22 @@ public class SubTabLayout extends VLayout {
currentlySelected = title;
}
-
Button button = new Button(title);
button.setShowRollOver(false);
button.setActionType(SelectionType.RADIO);
button.setRadioGroup("subtabs");
button.setBorder(null);
button.setAutoFit(true);
+ if (disabledSubTabs.contains(title)) {
+ button.disable();
+ } else {
+ button.enable();
+ }
button.setBaseStyle("SubTabButton");
-// button.setStyleName("SubTabButton");
-// button.setStylePrimaryName("SubTabButton");
+ // button.setStyleName("SubTabButton");
+ // button.setStylePrimaryName("SubTabButton");
final Integer index = i++;
@@ -110,6 +114,14 @@ public class SubTabLayout extends VLayout {
selectTab(currentlySelected);
}
+ public void enableSubTab(String title) {
+ disabledSubTabs.remove(title);
+ }
+
+ public void disableSubTab(String title) {
+ disabledSubTabs.add(title);
+ }
+
public void updateSubTab(String title, Canvas canvas) {
subtabs.put(title, canvas);
if (isDrawn() && title.equals(currentlySelected)) {
@@ -121,7 +133,7 @@ public class SubTabLayout extends VLayout {
private void draw(Canvas canvas) {
if (currentlyDisplayed != null) {
currentlyDisplayed.hide();
-// removeMember(currentlyDisplayed);
+ // removeMember(currentlyDisplayed);
}
if (canvas != null) {
if (hasMember(canvas)) {
@@ -137,6 +149,9 @@ public class SubTabLayout extends VLayout {
}
}
+ public void unregisterAllSubTabs() {
+ subtabs.clear();
+ }
public void registerSubTab(String title, Canvas canvas) {
if (currentlySelected == null) {
@@ -149,8 +164,6 @@ public class SubTabLayout extends VLayout {
return currentIndex;
}
-
-
public boolean selectTab(String title) {
boolean foundTab = false;
currentlySelected = title;
@@ -164,16 +177,14 @@ public class SubTabLayout extends VLayout {
i++;
}
-
if (isDrawn()) {
- ((Button)buttonBar.getMember(currentIndex)).select();
+ ((Button) buttonBar.getMember(currentIndex)).select();
draw(subtabs.get(title));
}
-
+
return foundTab;
}
-
// ------- Event support -------
// Done with a separate handler manager from parent class on purpose (compatibility
issue)
@@ -184,13 +195,8 @@ public class SubTabLayout extends VLayout {
}
public void fireSubTabSelection() {
- TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent(
- "?",
- currentlySelected,
- -1,
- currentIndex,
- currentlyDisplayed
- );
+ TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent("?",
currentlySelected, -1, currentIndex,
+ currentlyDisplayed);
hm.fireEvent(event);
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
index 9f9e5d4..c335dc9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java
@@ -34,17 +34,24 @@ public class TwoLevelTab extends Tab {
layout = new SubTabLayout();
}
-
public void updateSubTab(String tab, Canvas canvas) {
layout.updateSubTab(tab, canvas);
}
public void registerSubTabs(String... tabs) {
- for (String tab :tabs) {
+ for (String tab : tabs) {
layout.registerSubTab(tab, null);
}
}
+ public void setSubTabEnabled(String tab, boolean enabled) {
+ if (enabled) {
+ layout.enableSubTab(tab);
+ } else {
+ layout.disableSubTab(tab);
+ }
+ }
+
public SubTabLayout getLayout() {
return layout;
}
@@ -54,6 +61,4 @@ public class TwoLevelTab extends Tab {
return layout;
}
-
-
}
commit 5b093893923a739ed2634c73e05392e917b8e7fb
Merge: 63d04ea... a13c17d...
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Aug 11 16:43:07 2010 +0200
Merge branch 'master' into resource-upgrade
diff --cc
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 136c37c,45526f7..0000000
deleted file mode 100644,100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ /dev/null
diff --cc
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index add8168,2773b4c..304cbad
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@@ -659,22 -559,10 +659,22 @@@ public class DiscoveryBossBean implemen
*/
ResourceType resourceType = resource.getResourceType();
Resource parent = resource;
+ Subject overlord = subjectManager.getOverlord();
while (parent != null && existingResource == null) {
parent = parent.getParentResource();
- existingResource =
resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent,
+ //check if the parent itself is inventoried. This might not be the case
+ //during initial sync-up for resource upgrade.
+ Resource existingParent = null;
+ if (parent != null) {
+ existingParent = entityManager.find(Resource.class,
parent.getId());
+ if (existingParent == null) {
+ //well, this parent is not known to the server, so there's
no
+ //point in trying to find a child of it...
+ continue;
+ }
+ }
+ existingResource = resourceManager.getResourceByParentAndKey(overlord,
existingParent,
- resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
+ resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
}
if (existingResource != null) {
@@@ -905,8 -808,4 +920,8 @@@
updateInventoryStatus(subject, platforms, servers, target);
}
-}
+
+ private static <T> boolean needsUpgrade(T oldValue, T newValue) {
+ return newValue != null && (oldValue == null ||
!newValue.equals(oldValue));
+ }
- }
++}
commit 84b7bda95f895864671f515285923186475638be
Merge: 484719e... a13c17d...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 11 15:49:10 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit a13c17de245205bc8b5703ab6b45fa8300942b3e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:21:50 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource >
operation tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 88e1abd..ea7b88e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -157,7 +157,17 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
- operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
+ // comment out GWT-based operation history until...
+ // 1) user can delete history if they possess the appropriate permissions
+ // 2) user can see both operation arguments and results in the history
details pop-up
+ // 3) operation arguments/results become read-only configuration data in the
history details pop-up
+ // 4) user can navigate to the group operation that spawned this resource
operation history, if appropriate
+ //operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
+ // note: enabled operation execution/schedules from left-nav, if it doesn't
already exist
+ operationsTab.updateSubTab("History", new FullHTMLPane(
+ "/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id="
+ resource.getId()));
+ operationsTab.updateSubTab("Scheduled", new FullHTMLPane(
+
"/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=" +
resource.getId()));
configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml
new file mode 100644
index 0000000..13ee0b0
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml
@@ -0,0 +1,270 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <!--
+ Resource Operation Pending History
+ -->
+
+ <ui:param name="currentOperation"
+
value="#{ResourceOperationPendingHistoryUIBean.oldestInProgressResourceOperation}"
/>
+
+ <h:form id="pendingForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">In Progress
Operations</f:facet>
+
+ <a4j:keepAlive
beanName="ResourceOperationPendingHistoryUIBean"/>
+
+ <ui:param name="resourceOperationPendingHistoryDataModel"
value="#{ResourceOperationPendingHistoryUIBean.dataModel}"/>
+
+ <a4j:poll
id="resourceOperationPendingHistoryDataTableReRenderer"
+ oncomplete="disableConditionalButtons();"
+ interval="60000"
+ ignoreDupResponses="true"
+
actionListener="#{ResourceOperationPendingHistoryUIBean.clearDataModel}"
+ reRender="resourceOperationPendingHistoryDataTable"
/>
+ <rich:dataTable id="resourceOperationPendingHistoryDataTable"
+
rows="#{PageControl.ResourceOperationPendingHistory.pageSize}"
+
value="#{resourceOperationPendingHistoryDataModel}"
+ var="pendingItem"
+ width="100%"
+ columnsWidth="1%, 15%, 15%, 20%, 30%, 19%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceOperationPendingHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="pendingSelectedItems" />
+ </f:facet>
+
+ <onc:select name="pendingSelectedItems"
value="#{pendingItem.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Submitted" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.createdTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml"
+ <f:param name="id"
value="#{param.id}" />
+ <f:param name="opId"
value="#{pendingItem.id}" />
+ <h:outputText
value="#{pendingItem.operationDefinition.displayName}"/>
+ </h:outputLink>
+
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText
value="#{pendingItem.operationDefinition.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.status}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{pendingItem.subjectName}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6">
+ <onc:selectCommandButton
action="#{ResourceOperationPendingHistoryUIBean.cancel}"
+ value="CANCEL SELECTED"
target="pendingSelectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.control}"/>
+
+ <ui:param name="paginationDataTableName"
value="resourceOperationPendingHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{resourceOperationPendingHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ResourceOperationPendingHistory}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ <!--
+ Resource Operation Completed History
+ -->
+
+ <h:form id="historyForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Completed Operations</f:facet>
+
+ <a4j:keepAlive
beanName="ResourceOperationCompletedHistoryUIBean"/>
+
+ <ui:param name="resourceOperationCompletedHistoryDataModel"
value="#{ResourceOperationCompletedHistoryUIBean.dataModel}"/>
+
+ <a4j:poll
id="resourceOperationCompletedHistoryDataTableReRenderer"
+ oncomplete="disableConditionalButtons();"
+ interval="60000"
+ ignoreDupResponses="true"
+
actionListener="#{ResourceOperationCompletedHistoryUIBean.clearDataModel}"
+ reRender="resourceOperationCompletedHistoryDataTable"
/>
+ <rich:dataTable id="resourceOperationCompletedHistoryDataTable"
+
rows="#{PageControl.ResourceOperationCompletedHistory.pageSize}"
+
value="#{resourceOperationCompletedHistoryDataModel}"
+ var="historyItem"
+ width="100%"
+ columnsWidth="1%, 12%, 12%, 17%, 37%, 11%, 11%"
+ rowKeyVar="rowIndex"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl
id="ResourceOperationCompletedHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="completedSelectedItems" />
+ </f:facet>
+
+ <onc:select name="completedSelectedItems"
value="#{historyItem.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.createdTime">
+ <h:outputText styleClass="headerText"
value="Date Submitted" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.createdTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.modifiedTime">
+ <h:outputText styleClass="headerText"
value="Date Completed" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.modifiedTime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml"
+ <f:param name="id"
value="#{param.id}" />
+ <f:param name="opId"
value="#{historyItem.id}" />
+ <h:outputText
value="#{historyItem.operationDefinition.displayName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </f:facet>
+
+ <h:outputText
value="#{historyItem.operationDefinition.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.status">
+ <h:outputText styleClass="headerText"
value="Status" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText rendered="#{historyItem.status ne
'FAILURE'}" value="#{historyItem.status}"/>
+ <onc:errorPopup popupId="completed-#{historyItem.id}"
errorMessage="#{historyItem.errorMessage}" rendered="#{historyItem.status
eq 'FAILURE'}">Failure</onc:errorPopup>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="h.subjectName">
+ <h:outputText styleClass="headerText"
value="User" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{historyItem.subjectName}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="7" width="100%">
+ <onc:selectCommandButton
action="#{ResourceOperationCompletedHistoryUIBean.delete}"
+ value="DELETE SELECTED"
target="completedSelectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.control}"/>
+
+ <ui:param name="paginationDataTableName"
value="resourceOperationCompletedHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{resourceOperationCompletedHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.ResourceOperationCompletedHistory}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <!-- use a hidden button trick (which sends the same action a column click
would) so request params aren't lost -->
+ <h:commandButton id="hiddenHistoryButton"
style="visibility: hidden;" action="#{TableSorter.obtainFromOutcome}"
/>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml
new file mode 100644
index 0000000..d7d9f27
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml
@@ -0,0 +1,122 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+ <br/>
+ <ui:param name="item"
value="#{ResourceOperationHistoryDetailsUIBean.history}" />
+
+ <h:form id="operationHistoryDetailsForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+ <input type="hidden" name="opId"
value="${param.opId}"/>
+
+ <a4j:keepAlive beanName="ResourceOperationHistoryDetailsUIBean"
ajaxOnly="true"/>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationHistory-plain.xhtml">
+ <f:param name="id" value="#{param.id}" />
+ <h:outputText value="< Return to Operation
History"/>
+ </h:outputLink>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Details</f:facet>
+ <table>
+ <tr>
+ <td align="right" style="width:
150px;">Operation:</td>
+ <td align="left">
+ <h:outputText
value="#{item.operationDefinition.displayName}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Date Submitted:</td>
+ <td align="left">
+ <h:outputText value="#{item.createdTime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Date Completed:</td>
+ <td align="left">
+ <h:outputText value="#{item.modifiedTime}"
rendered="#{item.status ne 'INPROGRESS'}"
+
<f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Requester:</td>
+ <td align="left">
+ <h:outputText value="#{item.subjectName}"
rendered="#{!(empty item.subjectName)}" />
+ <h:outputText value="(unknown)" rendered="#{empty
item.subjectName}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Status:</td>
+ <td align="left">
+ <h:outputText rendered="#{item.status eq 'SUCCESS'
or item.status eq 'INPROGRESS'}"
+ value="#{item.status}"/>
+ <h:outputLink rendered="#{item.status ne 'SUCCESS'
and item.status ne 'INPROGRESS'}"
+ value="#" id="resultsLink">
+ <h:outputText value="#{item.status}"/>
+ <rich:componentControl for="resultsModalPanel"
attachTo="resultsLink" operation="show"
event="onclick"/>
+ </h:outputLink>
+ <rich:modalPanel id="resultsModalPanel"
width="600" height="400"
+ style="overflow: auto;">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Results" />
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="controls">
+ <h:panelGroup>
+ <h:graphicImage value="/images/close.png"
style="cursor:pointer" id="resultsModelPanelHideLink"/>
+ <rich:componentControl
for="resultsModalPanel" attachTo="resultsModelPanelHideLink"
operation="hide" event="onclick"/>
+ </h:panelGroup>
+ </f:facet>
+ <div class="ErrorModalBody">
+ <h:outputText value="#{item.errorMessage}" />
+ </div>
+ </rich:modalPanel>
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Parameters</f:facet>
+ <onc:config
configurationDefinition="#{ResourceOperationHistoryDetailsUIBean.parameters.configurationDefinition}"
+
configuration="#{ResourceOperationHistoryDetailsUIBean.parameters.configuration}"
+ readOnly="true"
+
nullConfigurationDefinitionMessage="#{ResourceOperationHistoryDetailsUIBean.parameters.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{ResourceOperationHistoryDetailsUIBean.parameters.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"/>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Results</f:facet>
+ <onc:config
configurationDefinition="#{ResourceOperationHistoryDetailsUIBean.results.configurationDefinition}"
+
configuration="#{ResourceOperationHistoryDetailsUIBean.results.configuration}"
+ readOnly="true"
+
nullConfigurationDefinitionMessage="#{ResourceOperationHistoryDetailsUIBean.results.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{ResourceOperationHistoryDetailsUIBean.results.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"
+ rendered="#{item.status ne 'INPROGRESS'}"
/>
+ </rich:panel>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationHistory-plain.xhtml">
+ <f:param name="id" value="#{param.id}" />
+ <h:outputText value="< Return to Operation
History"/>
+ </h:outputLink>
+
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml
new file mode 100644
index 0000000..95f9a96
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml
@@ -0,0 +1,73 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+ <br/>
+ <!-- Resource Operation Schedules -->
+ <h:form id="scheduleForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationSchedules-plain.xhtml">
+ <f:param name="id" value="#{param.id}" />
+ <h:outputText value="< Return to Operation
Schedules"/>
+ </h:outputLink>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">General Info</f:facet>
+ <table>
+ <tr>
+ <td align="right" style="width:
125px;">Operation:</td>
+ <td align="left">
+ <h:outputText value="#{item.operationDisplayName}"
/>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" style="width:
125px;">Scheduled By:</td>
+ <td align="left">
+ <h:outputText value="#{item.subject.name}" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" style="width:
125px;">Notes:</td>
+ <td align="left">
+ <h:outputText value="#{item.description}" />
+ </td>
+ </tr>
+ </table>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Parameters</f:facet>
+ <onc:config
configurationDefinition="#{ResourceOperationScheduleDetailsUIBean.parameters.configurationDefinition}"
+
configuration="#{ResourceOperationScheduleDetailsUIBean.parameters.configuration}"
+ readOnly="true"
+
nullConfigurationDefinitionMessage="#{ResourceOperationScheduleDetailsUIBean.parameters.nullConfigurationDefinitionMessage}"
+
nullConfigurationMessage="#{ResourceOperationScheduleDetailsUIBean.parameters.nullConfigurationMessage}"
+ nullConfigurationStyle="InfoBlock"/>
+ </rich:panel>
+
+ <rich:panel styleClass="BlockContent">
+ <f:facet name="header">Schedule Details</f:facet>
+
+ <onc:operationScheduler
scheduleDetails="#{ResourceOperationScheduleDetailsUIBean.operationDetails}"
readOnly="true"/>
+ </rich:panel>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationSchedules-plain.xhtml">
+ <f:param name="id" value="#{param.id}" />
+ <h:outputText value="< Return to Operation
Schedules"/>
+ </h:outputLink>
+
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml
new file mode 100644
index 0000000..ef0b83f
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml
@@ -0,0 +1,104 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <!-- Resource Operation Schedules -->
+ <h:form id="scheduleForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <!-- Operation Schedule Table -->
+ <rich:panel styleClass="BlockContent">
+
+ <ui:param name="resourceOperationScheduleDataModel"
value="#{ResourceOperationScheduleUIBean.dataModel}"/>
+ <rich:dataTable id="resourceOperationScheduleDataTable"
+ rows="0"
+ value="#{resourceOperationScheduleDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 30%, 39%, 30%"
+ styleClass="resources-table"
+ headerClass="tableRowHeader"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="NONE" />
+ </f:facet>
+
+ <rich:column style="width: 1px;">
+ <f:facet name="header">
+ <onc:allSelect target="selectedItems" />
+ </f:facet>
+ <onc:select name="selectedItems"
value="#{item.jobId}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Job
ID" />
+ </f:facet>
+ <h:commandLink
action="#{ResourceOperationScheduleUIBean.selectScheduleToView}">
+ <h:outputText value="#{item.jobId}" />
+ </h:commandLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </f:facet>
+
+ <h:outputLink
value="/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml"
+ <f:param name="id"
value="#{param.id}" />
+ <f:param name="jobId" value="#{item.jobId}"
/>
+ <h:outputText
value="#{item.operationDisplayName}"/>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Notes" />
+ </f:facet>
+ <h:outputText value="#{item.description}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="User" />
+ </f:facet>
+ <h:outputText value="#{item.subject.name}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="4" width="100%">
+ <onc:selectCommandButton
action="#{ResourceOperationScheduleUIBean.unschedule}"
+ value="UNSCHEDULE"
target="selectedItems"
+ styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.control}"/>
+ <onc:selectCommandButton
action="#{ResourceOperationScheduleUIBean.executeNow}"
+ value="EXECUTE NOW"
target="selectedItems"
+ styleClass="on-pager-button
buttonsmall"
+ low="1" high="1"
+
rendered="#{ResourceUIBean.permissions.control}"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+
+</ui:composition>
commit 4274e4c27857fec55a502d90ba0675bcf398f290
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:21:31 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource >
alerts tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index bd39bfc..88e1abd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -162,9 +162,17 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
- alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
- alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
-
+ // comment out GWT-based alert definitions/history views until...
+ // 1) new workflow is implement for alert definition creation, with
particular attention to interaction model for alert notifications
+ // 2) user can delete/ack/purgeAll alerts if they possess the appropriate
permissions
+ // 3) user can enable/disable/delete alert definitions if they possess the
appropriate permissions
+ // 4) user can search alert history by: date alert was fired, alert priority,
or alert definition
+ //alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
+ //alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
+ alertsTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/alert/listAlertHistory-plain.xhtml?id="
+ + resource.getId()));
+ alertsTab.updateSubTab("Definitions", new FullHTMLPane(
+ "/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" +
resource.getId()));
// comment out GWT-based view until...
// 1) user can search event history by: metric display range, event source,
event details, event severity
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml
new file mode 100644
index 0000000..746eb4a
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml
@@ -0,0 +1,161 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="alertDefinitionsListForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <rich:panel styleClass="BlockContent">
+
+ <a4j:keepAlive beanName="ListAlertDefinitionsUIBean"/>
+
+ <ui:param name="alertDefinitionsDataModel"
value="#{ListAlertDefinitionsUIBean.dataModel}"/>
+ <rich:dataTable id="alertDefinitionsDataTable"
+
rows="#{PageControl.AlertDefinitionsList.pageSize}"
+ value="#{alertDefinitionsDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 25%, 30%, 20%, 5%, 14%, 5%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AlertDefinitionsList" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAlertDefinitions" />
+ </f:facet>
+
+ <onc:select name="selectedAlertDefinitions"
value="#{item.id}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.name">
+ <h:outputText styleClass="headerText"
value="Name" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Config.do">
+ <f:param name="mode" value="viewRoles"/>
+ <f:param name="id"
value="#{Resource.id}"/>
+ <f:param name="ad" value="#{item.id}"/>
+ <h:outputText value="#{item.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.description">
+ <h:outputText styleClass="headerText"
value="Description" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.description}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.ctime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.ctime}">
+ <f:converter converterId="UserDateTimeConverter" />
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.enabled">
+ <h:outputText styleClass="headerText"
value="Active" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.enabled}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Parent" />
+ </f:facet>
+
+ <h:outputLink value="/alerts/Config.do"
rendered="#{item.parentId ne 0}">
+ <f:param name="mode" value="viewRoles"/>
+ <f:param name="type"
value="#{item.resource.resourceType.id}"/>
+ <f:param name="from" value="#{item.id}"/>
+ <f:param name="ad"
value="#{item.parentId}"/>
+ <h:outputText value="View Template" />
+ </h:outputLink>
+
+ <h:outputLink value="/alerts/Config.do"
rendered="#{not empty item.groupAlertDefinition}">
+ <f:param name="mode" value="viewRoles"/>
+ <f:param name="groupId"
value="#{item.groupAlertDefinition.resourceGroup.id}"/>
+ <f:param name="from" value="#{item.id}"/>
+ <f:param name="ad"
value="#{item.groupAlertDefinition.id}"/>
+ <h:outputText value="View Group Definition" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Read
Only" />
+ </f:facet>
+
+ <h:outputText value="N/A" rendered="#{item.parentId
eq 0 and empty item.groupAlertDefinition}"/>
+ <h:outputText value="#{item.readOnly}"
rendered="#{item.parentId ne 0 or not empty item.groupAlertDefinition}"/>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="7" width="100%">
+ <h:commandButton
action="#{ListAlertDefinitionsUIBean.createNewAlertDefinition}"
+ value="NEW DEFINITION"
styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}"
+
<f:param name="id" value="${param.id}"/>
+ <f:param name="mode" value="new"/>
+ </h:commandButton>
+ <onc:selectCommandButton
action="#{ListAlertDefinitionsUIBean.enableSelectedAlertDefinitions}"
+ value="ENABLE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListAlertDefinitionsUIBean.disableSelectedAlertDefinitions}"
+ value="DISABLE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListAlertDefinitionsUIBean.deleteSelectedAlertDefinitions}"
+ value="DELETE SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListAlertDefinitionsUIBean.copySelectedAlertDefinitions}"
+ value="COPY SELECTED"
target="selectedAlertDefinitions" styleClass="on-pager-button
buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert and param.debug}" />
+
+ <ui:param name="paginationDataTableName"
value="alertDefinitionsDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{alertDefinitionsDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AlertDefinitionsList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml
new file mode 100644
index 0000000..a6cb1fb
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml
@@ -0,0 +1,210 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <h:form id="alertHistoryForm">
+ <input type="hidden" name="id"
value="${param.id}"/>
+
+ <rich:panel styleClass="BlockContent">
+
+ <h:panelGrid columns="4" cellspacing="3">
+ <h:outputLabel for="alertDefinitionFilter" value="Alert
Definition Filter: " />
+ <h:selectOneMenu id="alertDefinitionFilter"
value="#{ListAlertHistoryUIBean.alertDefinitionFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListAlertHistoryUIBean.clearDataModel}" />
+
+ <f:selectItems
value="#{ListAlertHistoryUIBean.alertDefinitionSelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="alertPriorityFilter" value="Alert
Priority Filter: " />
+ <h:selectOneMenu id="alertPriorityFilter"
value="#{ListAlertHistoryUIBean.alertPriorityFilter}"
+ style="width: 300px;">
+ <a4j:support event="onchange"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListAlertHistoryUIBean.clearDataModel}" />
+
+ <f:selectItems
value="#{ListAlertHistoryUIBean.alertPrioritySelectItems}"/>
+ </h:selectOneMenu>
+ <rich:spacer/>
+ <rich:spacer/>
+
+ <h:outputLabel for="dateFilter" value="Date Filter:
" />
+ <h:inputText id="dateFilter"
value="#{ListAlertHistoryUIBean.dateFilter}"
+ onkeypress="return ignoreEnterKey(event);"
+ style="width: 300px;" />
+ <a4j:commandButton value="GO"
+ reRender="alertHistoryDataTable,
alertHistoryDataTableScroller, dateErrors"
+
actionListener="#{ListAlertHistoryUIBean.clearDataModel}"
+ styleClass="buttonmed">
+ <s:defaultAction />
+ </a4j:commandButton>
+ <h:outputText id="dateErrors"
value="#{ListAlertHistoryUIBean.dateErrors}" />
+ </h:panelGrid>
+
+ <br/>
+
+ <ui:param name="alertHistoryDataModel"
value="#{ListAlertHistoryUIBean.dataModel}"/>
+ <rich:dataTable id="alertHistoryDataTable"
+ rows="#{PageControl.AlertHistoryList.pageSize}"
+ value="#{alertHistoryDataModel}"
+ var="item"
+ width="100%"
+ columnsWidth="1%, 15%, 20%, 20%, 20%, 7%, 8%, 9%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="AlertHistoryList" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:allSelect target="selectedAlerts" />
+ </f:facet>
+
+ <onc:select name="selectedAlerts"
value="#{item.alert.id}" />
+ </rich:column>
+
+ <rich:column rendered="#{param.debug}">
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.id">
+ <h:outputText styleClass="headerText"
value="ID" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputText value="#{item.alert.id}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.alertDefinition.priority">
+ <h:outputText styleClass="headerText"
value="Priority" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:graphicImage value="/images/icons/Flag_blue_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'LOW'}"/>
+ <h:graphicImage value="/images/icons/Flag_yellow_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'MEDIUM'}"/>
+ <h:graphicImage value="/images/icons/Flag_red_16.png"
rendered="#{item.alert.alertDefinition.priority.name == 'HIGH'}"/>
+
+ <h:outputText
value="#{item.alert.alertDefinition.priority.name}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="a.ctime">
+ <h:outputText styleClass="headerText"
value="Date Created" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Alerts.do">
+ <f:param name="mode" value="viewAlert" />
+ <f:param name="id" value="#{Resource.id}"
/>
+ <f:param name="a" value="#{item.alert.id}"
/>
+ <h:outputText value="#{item.alert.ctime}">
+ <f:converter converterId="UserDateTimeConverter"
/>
+ </h:outputText>
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.alertDefinition.name">
+ <h:outputText styleClass="headerText"
value="Alert Definition" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+
+ <h:outputLink value="/alerts/Config.do">
+ <f:param name="mode" value="viewRoles" />
+ <f:param name="id"
value="#{Resource.id}"/>
+ <f:param name="ad"
value="#{item.alert.alertDefinition.id}"/>
+ <h:outputText
value="#{item.alert.alertDefinition.name}" />
+ </h:outputLink>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Alert
Condition" />
+ </f:facet>
+ <h:outputText value="#{item.conditionText}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Actual Value" />
+ </f:facet>
+ <h:outputText value="#{item.conditionValue}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Ack by" />
+ </f:facet>
+ <h:outputText value="#{item.alert.acknowledgingSubject}"
/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="a.acknowledgeTime">
+ <h:outputText styleClass="headerText"
value="Ack date" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.alert.acknowledgeTime}">
+ <f:converter converterId="RelativeDurationConverter"
/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText"
value="Recovery Info" />
+ </f:facet>
+ <h:outputText value="#{item.recoveryInfo}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="9" width="100%">
+ <onc:selectCommandButton
action="#{ListAlertHistoryUIBean.deleteSelectedAlerts}"
+ value="DELETE SELECTED"
target="selectedAlerts" styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+ <h:commandButton
action="#{ListAlertHistoryUIBean.purgeAllAlerts}"
+ value="PURGE ALL"
styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+ <onc:selectCommandButton
action="#{ListAlertHistoryUIBean.acknowledgeSelectedAlerts}"
+ value="ACKNOWLEDGE SELECTED"
target="selectedAlerts" styleClass="on-pager-button buttonsmall"
+
rendered="#{ResourceUIBean.permissions.alert}" />
+
+
+
+ <ui:param name="paginationDataTableName"
value="alertHistoryDataTable"/>
+ <ui:param name="paginationDataModel"
value="#{alertHistoryDataModel}"/>
+ <ui:param name="paginationPageControl"
value="#{PageControl.AlertHistoryList}"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <a4j:keepAlive beanName="ListAlertHistoryUIBean"/>
+
+ </rich:panel>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
commit 0245ea3ea921514be30422fa5a6c62340f1a6736
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:20:41 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource >
content tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 8944436..bd39bfc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -166,10 +166,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
- contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
- contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
- contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
- contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
// comment out GWT-based view until...
// 1) user can search event history by: metric display range, event source,
event details, event severity
// 2) user can delete events if they possess the appropriate permissions
@@ -177,6 +173,14 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/events/history-plain.xhtml?id="
+ resource.getId()));
+ contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id="
+ + resource.getId()));
+ contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id="
+ + resource.getId()));
+ contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id="
+ + resource.getId()));
+ contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id="
+ + resource.getId()));
// topTabSet.setSelectedTab(selectedTab);
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml
index ef85b15..28cc396 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml
@@ -1,34 +1,27 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
+ <ui:define name="content">
<h:form id="currentPackageVersionsForm">
<input type="hidden" name="id"
value="${param.id}"/>
<rich:panel styleClass="BlockContent">
- <f:facet name="header"><h:outputText value="Packages
Eligible for Deployment"/></f:facet>
<p>The following packages were found from the repositories currently
subscribed to by this resource. In order
to enable more existing packages for deployment, use the subscriptions
sub-tab to subscribe this resource
to more repositories.</p>
- <a4j:keepAlive beanName="ResourcePackageVersionsUIBean"/>
+ <a4j:keepAlive beanName="ResourcePackageVersionsUIBean"/>
<ui:param name="resourcePackageVersionsDataModel"
value="#{ResourcePackageVersionsUIBean.dataModel}"/>
<rich:dataTable id="resourcePackageVersionsDataTable"
@@ -37,7 +30,7 @@
var="item"
width="100%"
columnsWidth="1%, 15%, 10%, 10%, 10%, 54%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -113,7 +106,7 @@
value="DEPLOY SELECTED"
target="selectedPackages" styleClass="on-pager-button buttonsmall"
rendered="${ResourceUIBean.permissions.content}"/>
- <ui:include
src="/rhq/resource/include/pagination.xhtml">
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml">
<ui:param name="paginationDataTableName"
value="resourcePackageVersionsDataTable"/>
<ui:param name="paginationDataModel"
value="#{resourcePackageVersionsDataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.ResourcePackageVersionsList}"/>
@@ -144,5 +137,5 @@
</rich:panel>
</h:form>
-</body>
-</html>
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml
index 01ae31c..a237c26 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml
@@ -24,7 +24,7 @@
<h:form id="contentaRequestsForm">
<input type="hidden" name="id" value="${param.id}"/>
-<rich:panel>
+<rich:panel styleClass="BlockContent">
<f:facet name="header"><h:outputText value="Currently
Executing Requests"/></f:facet>
<i><h:outputText value="There are no currently executing content
requests"
@@ -37,7 +37,7 @@
var="item"
width="100%"
columnsWidth="16%, 17%, 16%, 16%, 16%, 16%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -124,7 +124,7 @@
<ui:param name="paginationDataTableName"
value="contentInProgressRequestsDataTable"/>
<ui:param name="paginationDataModel"
value="#{ListInProgressContentRequestsUIBean.dataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.ContentInProgressRequestsList}"/>
- <ui:include src="../include/pagination.xhtml"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
</rich:column>
</rich:columnGroup>
</f:facet>
@@ -134,13 +134,12 @@
</rich:panel>
-<rich:panel>
+<rich:panel styleClass="BlockContent">
<f:facet name="header"><h:outputText value="Completed
Requests"/></f:facet>
<i><h:outputText value="There are no completed content requests"
rendered="#{ListCompletedContentRequestsUIBean.dataModel.rowCount eq
0}"/></i>
-
<rich:dataTable
rendered="#{ListCompletedContentRequestsUIBean.dataModel.rowCount gt 0}"
binding="#{ListCompletedContentRequestsUIBean.dataTable}"
id="contentCompletedRequestsDataTable"
@@ -149,7 +148,7 @@
var="item"
width="100%"
columnsWidth="16%, 17%, 16%, 16%, 16%, 16%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -236,18 +235,16 @@
<ui:param name="paginationDataTableName"
value="contentCompletedRequestsDataTable"/>
<ui:param name="paginationDataModel"
value="#{ListCompletedContentRequestsUIBean.dataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.ContentCompletedRequestsList}"/>
- <ui:include src="../include/pagination.xhtml"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
</rich:column>
</rich:columnGroup>
</f:facet>
</rich:dataTable>
-
-
</rich:panel>
-<rich:panel>
+<rich:panel styleClass="BlockContent">
<f:facet name="header"><h:outputText value="Full Package
Audit Trail"/></f:facet>
<p>The following is a complete listing of all of the package operations that
have occurred on this resource.
@@ -266,7 +263,7 @@
var="item"
width="100%"
columnsWidth="20%, 20%, 20%, 10%, 20%, 10%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -346,15 +343,13 @@
<ui:param name="paginationDataTableName"
value="auditTrailDataTable"/>
<ui:param name="paginationDataModel"
value="#{AuditTrailUIBean.dataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.AuditTrailList}"/>
- <ui:include src="../include/pagination.xhtml"/>
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml"/>
</rich:column>
</rich:columnGroup>
</f:facet>
-
</rich:dataTable>
-
</rich:panel>
</h:form>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml
index cf93350..61d62b0 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml
@@ -1,24 +1,16 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
-
xmlns:a4j="http://richfaces.org/a4j">
-
-
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
+ <ui:define name="content">
<a4j:keepAlive beanName="ListPackageHistoryUIBean"/>
@@ -73,7 +65,6 @@
var="item"
width="100%"
columnsWidth="20%, 20%, 20%, 20%, 20%"
- headerClass="tableRowHeader"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -153,5 +144,5 @@
<h:outputLink
value="/rhq/resource/content/view-plain.xhtml?id=#{param.id}">
<h:outputText value="Return to Packages"/>
</h:outputLink>
-</body>
-</html>
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml
index c5fb200..c5e970d 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml
@@ -1,30 +1,24 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
+ <ui:define name="content">
+
<!-- CURRENT REPOS -->
<h:form id="currentRepoForm">
<input type="hidden" name="id"
value="${param.id}"/>
<rich:panel styleClass="BlockContent">
<f:facet name="header"><h:outputText value="Current
Resource Subscriptions"/></f:facet>
- <a4j:keepAlive beanName="ResourceReposUIBean"/>
+ <a4j:keepAlive beanName="ResourceReposUIBean"/>
<ui:param name="resourceReposDataModel"
value="#{ResourceReposUIBean.dataModel}"/>
<rich:dataTable id="resourceReposDataTable"
@@ -33,7 +27,7 @@
var="item"
width="100%"
columnsWidth="1%, 25%, 40%, 5%, 15%, 15%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -115,7 +109,7 @@
styleClass="on-pager-button
buttonsmall"
rendered="${GlobalPermissionsUIBean.inventory}"/>
- <ui:include
src="/rhq/resource/include/pagination.xhtml">
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml">
<ui:param name="paginationDataTableName"
value="resourceReposDataTable"/>
<ui:param name="paginationDataModel"
value="#{resourceReposDataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.ResourceReposList}"/>
@@ -137,7 +131,7 @@
<rich:panel styleClass="BlockContent">
<f:facet name="header"><h:outputText value="Available
Repositories"/></f:facet>
- <a4j:keepAlive beanName="AvailableResourceReposUIBean"/>
+ <a4j:keepAlive beanName="AvailableResourceReposUIBean"/>
<ui:param name="availableResourceReposDataModel"
value="#{AvailableResourceReposUIBean.dataModel}"/>
<rich:dataTable id="availableResourceReposDataTable"
@@ -146,7 +140,7 @@
var="item"
width="100%"
columnsWidth="1%, 25%, 40%, 5%, 15%, 15%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -228,7 +222,7 @@
styleClass="on-pager-button
buttonsmall"
rendered="${GlobalPermissionsUIBean.inventory}"/>
- <ui:include
src="/rhq/resource/include/pagination.xhtml">
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml">
<ui:param name="paginationDataTableName"
value="availableResourceReposDataTable"/>
<ui:param name="paginationDataModel"
value="#{availableResourceReposDataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.AvailableResourceReposList}"/>
@@ -254,6 +248,5 @@
</h:form>
-</body>
-
-</html>
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml
index 918c3ce..7ff59f3 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml
@@ -1,41 +1,28 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
+ <ui:define name="content">
+
<!-- Content Table -->
<h:form id="contentForm">
<input type="hidden" name="id"
value="${param.id}"/>
<rich:panel styleClass="BlockContent">
-
- <f:facet name="header"><h:outputText value="Deployed
Content"/></f:facet>
-
- <a4j:log level="debug" width="400"/>
-
-
<h:panelGrid columns="3" width="100%">
<h:panelGroup>
<h:outputText value="Filter: " />
<h:inputText id="search"
value="#{ListPackagesUIBean.search}">
<a4j:support event="onchange"
- status="commonStatus"
reRender="packagesDataTable,
packagesDataTableScroller"
actionListener="#{ListPackagesUIBean.clearDataModel}"/>
</h:inputText>
@@ -46,7 +33,6 @@
<h:selectOneMenu id="packageTypeFilter"
value="#{ListPackagesUIBean.packageTypeFilter}">
<a4j:support event="onchange"
- status="commonStatus"
reRender="packagesDataTable,
packagesDataTableScroller"
actionListener="#{ListPackagesUIBean.clearDataModel}"/>
<f:selectItems
value="#{ListPackagesUIBean.packageTypes}" />
@@ -58,7 +44,6 @@
<h:selectOneMenu id="packageVersionFilter"
value="#{ListPackagesUIBean.packageVersionFilter}">
<a4j:support event="onchange"
- status="commonStatus"
reRender="packagesDataTable,
packagesDataTableScroller"
actionListener="#{ListPackagesUIBean.clearDataModel}"/>
<f:selectItems
value="#{ListPackagesUIBean.packageVersions}" />
@@ -66,9 +51,9 @@
</h:panelGroup>
</h:panelGrid>
+ <br/>
- <a4j:keepAlive beanName="ListPackagesUIBean"/>
-
+ <a4j:keepAlive beanName="ListPackagesUIBean"/>
<ui:param name="packagesDataModel"
value="#{ListPackagesUIBean.dataModel}"/>
<rich:dataTable id="packagesDataTable"
@@ -77,7 +62,7 @@
var="item"
width="100%"
columnsWidth="1%, 35%, 30%, 15%, 19%"
- headerClass="tableRowHeader"
+ styleClass="resources-table"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -153,7 +138,7 @@
<onc:selectCommandButton
action="#{DeletePackagesUIBean.beginDeleteWorkflow}"
value="DELETE SELECTED"
target="selectedPackages" styleClass="on-pager-button
buttonsmall"/>
- <ui:include src="../include/pagination.xhtml">
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml">
<ui:param name="paginationDataTableName"
value="packagesDataTable"/>
<ui:param name="paginationDataModel"
value="#{packagesDataModel}"/>
<ui:param name="paginationPageControl"
value="#{PageControl.InstalledPackagesList}"/>
@@ -166,5 +151,5 @@
</rich:panel>
</h:form>
-</body>
-</html>
+ </ui:define>
+</ui:composition>
commit 6c658cc0dbcff6b9090e71d05349e5b71e170fcd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:19:59 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource >
events tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 63e34e8..8944436 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -165,12 +165,17 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
- eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+ // comment out GWT-based view until...
+ // 1) user can search event history by: metric display range, event source,
event details, event severity
+ // 2) user can delete events if they possess the appropriate permissions
+ //eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId()));
+ eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/events/history-plain.xhtml?id="
+ + resource.getId()));
// topTabSet.setSelectedTab(selectedTab);
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml
index fc68398..21bbc81 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml
@@ -1,5 +1,5 @@
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
@@ -10,11 +10,6 @@
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css" />
-</head>
-<body>
-
<h:form id="eventHistoryForm"
<a4j:keepAlive beanName="EventHistoryUIBean"/>
@@ -36,16 +31,12 @@
</c:if>
<rich:panel styleClass="BlockContent">
- <f:facet name="header">
- <h:outputText value="Events" />
- </f:facet>
<h:panelGrid columns="3" cellspacing="3">
<h:outputLabel for="sourceFilter" value="Source Filter:
" />
<h:inputText id="sourceFilter"
value="#{EventHistoryUIBean.sourceFilter}"
style="width: 300px;">
<a4j:support event="onchange"
- status="commonStatus"
reRender="eventHistoryDataTable,
eventHistoryDataTableScroller"
actionListener="#{EventHistoryUIBean.clearDataModel}" />
</h:inputText>
@@ -56,7 +47,6 @@
onkeypress="return ignoreEnterKey(event);"
style="width: 300px;" />
<a4j:support event="onchange"
- status="commonStatus"
reRender="eventHistoryDataTable,
eventHistoryDataTableScroller"
actionListener="#{EventHistoryUIBean.clearDataModel}" />
<rich:spacer/>
@@ -65,7 +55,6 @@
<h:selectManyCheckbox id="severityFilter"
value="#{EventHistoryUIBean.severityFilter}"
style="width: 300px;">
<a4j:support event="onchange"
- status="commonStatus"
reRender="eventHistoryDataTable,eventHistoryDataTableScroller"
actionListener="#{EventHistoryUIBean.clearDataModel}" />
@@ -73,7 +62,6 @@
</h:selectManyCheckbox>
<a4j:commandButton value="GO"
- status="commonStatus"
reRender="eventHistoryDataTable,eventHistoryDataTableScroller"
actionListener="#{EventHistoryUIBean.clearDataModel}"
styleClass="buttonmed">
@@ -91,7 +79,6 @@
var="item"
width="100%"
styleClass="resources-table"
- headerClass="tableRowHeader"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -178,7 +165,7 @@
<ui:param name="paginationDataTableName"
value="eventHistoryDataTable" />
<ui:param name="paginationDataModel"
value="#{eventHistoryDataModel}" />
<ui:param name="paginationPageControl"
value="#{PageControl.EventsHistoryList}" />
- <ui:include
src="/rhq/resource/include/pagination.xhtml" />
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml" />
</rich:column>
</rich:columnGroup>
</f:facet>
@@ -252,6 +239,4 @@
</rich:modalPanel>
</h:form>
-</body>
-</html>
-
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml
new file mode 100644
index 0000000..4cc4ca4
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml
@@ -0,0 +1,20 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/events/history-plain.xhtml"/>
+
+ </ui:define>
+
+</ui:composition>
+
commit 74ac7e6a4910b36c67e211350d2a84e3ba6c80ff
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:19:04 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource >
monitor tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index e4cec95..63e34e8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -143,12 +143,16 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
+ resource.getId()));
monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); //
new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
- monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
- monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
- monitoringTab.updateSubTab("Availability", new
FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
- monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
- monitoringTab.updateSubTab("Call Time", new CallTimeView(resource));
-
+ monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id="
+ + resource.getId()));
+ monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id="
+ + resource.getId()));
+ monitoringTab.updateSubTab("Availability", new FullHTMLPane(
+ "/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
+ monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id="
+ + resource.getId()));
+ monitoringTab.updateSubTab("Call Time", new
FullHTMLPane("/rhq/resource/monitor/response-plain.xhtml?id="
+ + resource.getId()));
inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
new file mode 100644
index 0000000..aa6576f
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml
@@ -0,0 +1,173 @@
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+
+ <rich:panel styleClass="BlockContent">
+
+ <c:if test="#{!ResourceUIBean.facets.callTime}">
+ <c:if test="#{CallTimeUIBean.context.resourceId != -1}">
+ Response Time Metrics are not supported for this resource.
+ </c:if>
+ <c:if test="#{CallTimeUIBean.context.groupId != -1}">
+ Response Time Metrics are not supported for this compatible group.
+ </c:if>
+ <c:if test="#{CallTimeUIBean.context.parentResourceId != -1 and
CallTimeUIBean.context.resourceTypeId != -1}">
+ Response Time Metrics are not supported for this auto-group.
+ </c:if>
+
+ </c:if>
+
+ <c:if test="#{ResourceUIBean.facets.callTime}">
+ <h:form id="callTimeForm">
+ <a4j:keepAlive beanName="CallTimeUIBean"/>
+
+ <!-- On submit make sure these are provided for the context of any new
instance of the UI beans -->
+ <c:if test="#{CallTimeUIBean.context.resourceId != -1}">
+ <input type="hidden" name="id"
value="#{CallTimeUIBean.context.resourceId}" />
+ </c:if>
+ <c:if test="#{CallTimeUIBean.context.groupId != -1}">
+ <input type="hidden" name="groupId"
value="#{CallTimeUIBean.context.groupId}" />
+ </c:if>
+ <c:if
+ test="#{CallTimeUIBean.context.parentResourceId != -1}">
+ <input type="hidden" name="parent"
value="#{CallTimeUIBean.context.parentResourceId}" />
+ </c:if>
+ <c:if test="#{CallTimeUIBean.context.resourceTypeId != -1}">
+ <input type="hidden" name="type"
value="#{CallTimeUIBean.context.resourceTypeId}" />
+ </c:if>
+
+ <h:panelGrid columns="3" cellspacing="3">
+ <h:outputLabel for="destinationFilter" value="Destination
Filter: " />
+ <h:inputText id="destinationFilter"
value="#{CallTimeUIBean.destinationFilter}"
+ onkeypress="return ignoreEnterKey(event);"
+ style="width: 300px;" />
+ <a4j:commandButton value="GO" reRender="callTimeDataTable,
callTimeDataTableScroller"
+
actionListener="#{CallTimeUIBean.clearDataModel}"
+ styleClass="buttonmed">
+ <s:defaultAction/>
+ </a4j:commandButton>
+ </h:panelGrid>
+
+ <ui:param name="callTimeDataModel"
value="#{CallTimeUIBean.dataModel}" />
+ <rich:dataTable id="callTimeDataTable"
+ value="#{callTimeDataModel}"
+ rows="#{PageControl.CallTimeHistory.pageSize}"
+ var="item"
+ width="100%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
+
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
+
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
+
+ <f:facet name="PageControlView">
+ <onc:paginationControl id="CallTimeHistory" />
+ </f:facet>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="calltimedatavalue.key.callDestination">
+ <h:outputText value="Destination" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{onf:elideString(item.callDestination, 50,
'left')}" title="#{item.callDestination}"/>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="SUM(calltimedatavalue.count)">
+ <h:outputText value="Request Count" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.count}" />
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="MIN(calltimedatavalue.minimum)">
+ <h:outputText value="Minimum" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.minimum}">
+ <f:converter converterId="ShortDurationConverter"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)">
+ <h:outputText value="Average" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.average}">
+ <f:converter converterId="ShortDurationConverter"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="MAX(calltimedatavalue.maximum)">
+ <h:outputText value="Maximum" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.maximum}">
+ <f:converter converterId="ShortDurationConverter"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader
sort="SUM(calltimedatavalue.total)">
+ <h:outputText value="Total" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.total}">
+ <f:converter converterId="ShortDurationConverter"/>
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="6" width="100%">
+ <ui:param name="paginationDataTableName"
value="callTimeDataTable" />
+ <ui:param name="paginationDataModel"
value="#{callTimeDataModel}" />
+ <ui:param name="paginationPageControl"
value="#{PageControl.CallTimeHistory}" />
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <table>
+ <tr>
+ <td><onc:metric optionList="m,h,d" /></td>
+ <td>
+ <h:commandLink rendered="#{not
MetricComponentUtilityUIBean.readOnly}"
+
action="#{MetricComponentUtilityUIBean.update}"
+
<img src="/images/dash-button_go-arrow.gif" alt="Apply
Metric Settings "/>
+ </h:commandLink>
+ <h:commandLink
rendered="#{MetricComponentUtilityUIBean.readOnly}"
+
action="#{MetricComponentUtilityUIBean.switchToSimpleMode}">
+ <h:outputText value="Switch to Simple Mode" />
+ </h:commandLink>
+ </td>
+ </tr>
+ </table>
+
+ </h:form>
+ </c:if>
+
+ </rich:panel>
+
+ </ui:define>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml
index b75b9b2..b6664e3 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml
@@ -1,28 +1,19 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:c="http://java.sun.com/jstl/core"
-
xmlns:onc="http://jboss.org/on/component"
-
xmlns:onf="http://jboss.org/on/function"
-
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-
-<ui:composition>
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
<rich:panel styleClass="BlockContent">
- <f:facet name="header" styleClass="BlockTitle">
- <a name="Numeric Metrics" />
- Numeric Metrics
- </f:facet>
-
<h:form id="metricsTableForm">
<!-- On submit make sure these are provided for the context of any new
instance of the UI beans -->
<c:if test="#{MetricsTableUIBean.context.resourceId != -1}">
@@ -43,11 +34,12 @@
value="#{MetricsTableUIBean.context.resourceTypeId}" />
</c:if>
-
<rich:dataTable value="#{MetricsTableUIBean.metricSummaries}"
width="100%"
var="metric"
- columnsWidth="1%"
+ columnsWidth="1%,40%,12%,12%,12%,12%,12%"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -159,10 +151,10 @@
</td>
</tr>
</table>
+
</h:form>
</rich:panel>
-</ui:composition>
-
-</html>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml
index 545e523..27f9d7a 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml
@@ -1,29 +1,16 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-
-<body>
- <f:facet name="header" styleClass="BlockTitle">
- <a name="AvailabilityHistory"/>
- Availability History
- </f:facet>
-
+ <ui:define name="content">
<h:panelGroup layout="block"
rendered="#{ListAvailabilityHistoryUIBean.dataModel.rowCount == 0}">
This resource does not currently have any availability history.
@@ -135,8 +122,7 @@
rendered="#{availability.availabilityType ==
'DOWN'}"/>
<h:graphicImage
value="/images/icons/availability_grey_16.png" alt="Unknown"
title="Unknown"
rendered="#{availability.availabilityType ==
null}"/>
-
- <h:outputText
value="#{availability.availabilityType}"/>
+ <h:outputText value="
#{availability.availabilityType}"/>
</rich:column>
<rich:column
@@ -181,7 +167,7 @@
<rich:columnGroup>
<rich:column colspan="4">
- <ui:include
src="../include/pagination.xhtml">
+ <ui:include
src="/rhq/resource/include/pagination-plain.xhtml">
<ui:param name="paginationDataTableName"
value="availabilityHistoryDataTable"/>
<ui:param name="paginationDataModel"
value="#{availabilityHistoryDataModel}"/>
<ui:param name="paginationPageControl"
@@ -195,6 +181,7 @@
</h:form>
</rich:panel>
-</body>
-</html>
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml
new file mode 100644
index 0000000..e19932a
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml
@@ -0,0 +1,14 @@
+<ui:composition
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:include src="/rhq/common/monitor/response-plain.xhtml" />
+
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml
index a9d1ab3..8854225 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml
@@ -1,10 +1,5 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
@@ -14,13 +9,13 @@
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
- <h:outputText rendered="#{not ResourceUIBean.permissions.measure}"
value="You don't have the measure permission for this resource and therefore can
not change metric schedules"/>
+ <ui:define name="content">
+ <rich:panel styleClass="BlockContent">
+
+ <h:outputText rendered="#{not ResourceUIBean.permissions.measure}"
+ value="You don't have the measure permission for this
resource and therefore can not change metric schedules"/>
<h:form id="resourceSchedulesForm">
<!-- hack to override the default button on the page, make this button
pseudo-first in the form,
@@ -33,13 +28,6 @@
rendered="#{ResourceUIBean.permissions.measure}" />
</div>
<input type="hidden" name="id"
value="${param.id}"/>
-
- <rich:panel styleClass="BlockContent">
- <f:facet name="header">
- <h:outputText value="Configure Metric Collection
Schedules"/>
- </f:facet>
-
- <h:panelGrid columns="1" styleClass="data-table">
<ui:param name="resourceSchedulesDataModel"
value="#{ListResourceMeasurementScheduleUIBean.dataModel}"/>
<rich:dataTable id="resourceSchedulesDataTable"
@@ -49,7 +37,6 @@
width="100%"
columnsWidth="1%, 20%, 30%, 20%, 9%, 20%"
styleClass="resources-table"
- headerClass="tableRowHeader"
footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -163,10 +150,9 @@
</f:facet>
</rich:dataTable>
-
- </h:panelGrid>
-
- </rich:panel>
</h:form>
-</body>
-</html>
+
+ </rich:panel>
+
+ </ui:define>
+</ui:composition>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml
index 9038116..61a1014 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml
@@ -1,30 +1,19 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
+<ui:composition template="/rhq/resource/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:onc="http://jboss.org/on/component"
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head>
- <link rel="stylesheet" href="/css/win.css"
type="text/css"/>
-</head>
-<body>
+ <ui:define name="content">
+
<rich:panel styleClass="BlockContent">
- <f:facet name="header" styleClass="BlockTitle">
- <a name="Traits"/>
- Traits
- </f:facet>
-
<rich:dataTable value="#{ResourceMetricsTableUIBean.traitSummaries}"
width="100%"
var="metric"
@@ -80,6 +69,8 @@
<rich:dataTable value="#{ResourceMetricsTableUIBean.traitHistory}"
width="100%"
var="history"
+ styleClass="resources-table"
+ footerClass="on-pager-footer"
onRowMouseOver="this.style.backgroundColor='#E7E7E7'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -101,5 +92,5 @@
</rich:dataTable>
</rich:panel>
-</body>
-</html>
+ </ui:define>
+</ui:composition>
diff --git
a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
index b3079dd..0ea6e12 100644
---
a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -759,10 +759,6 @@
<position
name="Monitor.Schedules"
placement="after" />
- <activators>
- <facet
- name="call_time" />
- </activators>
</tab>
<!-- Inventory Subtabs -->
commit 8ff2464dbb943f9e87f7ad57d0dd87b53c2d94fb
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:15:25 2010 -0400
reformat, cosmetic
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 7415ba7..e4cec95 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -32,9 +32,7 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
-import org.rhq.enterprise.gui.coregui.client.alert.definitions.AlertDefinitionsView;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
@@ -43,14 +41,10 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -59,7 +53,8 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
*
* @author Greg Hinkle
*/
-public class ResourceDetailView extends VLayout implements BookmarkableView,
ResourceSelectListener, TwoLevelTabSelectedHandler {
+public class ResourceDetailView extends VLayout implements BookmarkableView,
ResourceSelectListener,
+ TwoLevelTabSelectedHandler {
private static final String DEFAULT_TAB_NAME = "Summary";
@@ -80,7 +75,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
private ResourceTitleBar titleBar;
-
public void setResource(Resource resource) {
this.resource = resource;
}
@@ -92,7 +86,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
setWidth100();
setHeight100();
-
// The Tabs section
topTabSet = new TwoLevelTabSet();
@@ -126,8 +119,8 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
contentTab = new TwoLevelTab("Content",
"/images/icons/Content_grey_16.png");
contentTab.registerSubTabs("Deployed", "New",
"Subscriptions", "History");
- topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab, eventsTab, contentTab);
-
+ topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab,
+ eventsTab, contentTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -136,7 +129,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
addMember(topTabSet);
-// CoreGUI.addBreadCrumb(getPlace());
+ // CoreGUI.addBreadCrumb(getPlace());
}
public void onResourceSelected(Resource resource) {
@@ -144,11 +137,10 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
this.resource = resource;
titleBar.setResource(resource);
-
- FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
- summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
- summaryTab.updateSubTab("Timeline", timelinePane);
+ summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
+ summaryTab.updateSubTab("Timeline", new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id="
+ + resource.getId()));
monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); //
new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
@@ -177,45 +169,42 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
-// topTabSet.setSelectedTab(selectedTab);
+ // topTabSet.setSelectedTab(selectedTab);
updateTabStatus();
topTabSet.markForRedraw();
}
-
private void updateTabStatus() {
// Go and get the type with all needed metadata
// and then get the permissions for this resource
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.content,
- ResourceTypeRepository.MetadataType.operations,
- ResourceTypeRepository.MetadataType.events,
-
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
-
- ResourceDetailView.this.type = type;
-
- GWTServiceLookup.getAuthorizationService().
-
getImplicitResourcePermissions(ResourceDetailView.this.resource.getId(),
- new AsyncCallback<Set<Permission>>()
{
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError("Failed to load resource permissions",
caught);
- }
-
- public void onSuccess(Set<Permission>
result) {
- ResourceDetailView.this.permissions = new
ResourcePermission(result);
- completeTabUpdate();
- }
- });
- }
- });
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.events,
+ ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+
+ ResourceDetailView.this.type = type;
+
+
GWTServiceLookup.getAuthorizationService().getImplicitResourcePermissions(
+ ResourceDetailView.this.resource.getId(), new
AsyncCallback<Set<Permission>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
load resource permissions", caught);
+ }
+
+ public void onSuccess(Set<Permission> result) {
+ ResourceDetailView.this.permissions = new
ResourcePermission(result);
+ completeTabUpdate();
+ }
+ });
+ }
+ });
}
-
private void completeTabUpdate() {
if (!permissions.isMeasure()) {
@@ -224,13 +213,13 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.enableTab(monitoringTab);
}
- if (type.getOperationDefinitions() == null ||
type.getOperationDefinitions().isEmpty() || !permissions.isControl()) {
+ if (type.getOperationDefinitions() == null ||
type.getOperationDefinitions().isEmpty()
+ || !permissions.isControl()) {
topTabSet.disableTab(operationsTab);
} else {
topTabSet.enableTab(operationsTab);
}
-
if (!permissions.isAlert()) {
topTabSet.disableTab(alertsTab);
} else {
@@ -255,14 +244,12 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.enableTab(contentTab);
}
-
if (topTabSet.getSelectedTab().getDisabled()) {
topTabSet.selectTab(0);
}
}
-
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
// Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
@@ -273,24 +260,22 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
History.newItem(path, false);
}
-
public void renderView(ViewPath viewPath) {
// e.g. #Resource/10010/Inventory/Overview
- String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null;
// e.g. "Inventory"
+ String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; //
e.g. "Inventory"
String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath()
: null; // e.g. "Overview"
selectTab(tabName, subTabName);
}
-
public void selectTab(String tabName, String subtabName) {
if (tabName == null) {
tabName = DEFAULT_TAB_NAME;
}
- TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName);
+ TwoLevelTab tab = (TwoLevelTab) this.topTabSet.getTabByTitle(tabName);
if (tab == null) {
CoreGUI.getErrorHandler().handleError("Invalid tab name: " +
tabName);
// TODO: Should we fire a history event here to redirect to a valid
bookmark?
- tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
+ tab = (TwoLevelTab) this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
}
this.topTabSet.selectTab(tab);
if (subtabName != null) {
commit e666b220a74d9784863570d292662fc5259781b1
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:10:53 2010 -0400
prepare "plain" navigation scheme for iframed-facelets
* copy/paste entire XXX-navigation.xml file to XXX-plain-navigation.xml
* search/replace *.xhtml with *-plain.xhtml inside each
* do this for the follow resource subsystems:
** alerts, content, events, measurement, operations
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml
new file mode 100644
index 0000000..2bbef2d
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- Alert Definition List -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createNewAlertDefinition</from-outcome>
+
<to-view-id>/alerts/Config.do?id=#{param.id}&mode=new&nomenu=true</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Alert Templates List -->
+ <navigation-rule>
+ <from-view-id>/rhq/admin/listAlertTemplates-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/listAlertTemplates-plain.xhtml?type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createNewAlertTemplate</from-outcome>
+
<to-view-id>/alerts/Config.do?type=#{param.type}&mode=new&nomenu=true</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/admin/listAlertTemplates-plain.xhtml?type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Alert History List -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>dateFilter</from-outcome>
+
<to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}&date=#{param.date}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- CRUD for alert notification templates -->
+ <navigation-rule>
+
<from-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>create</from-outcome>
+
<to-view-id>/rhq/admin/alert/template/notification/new-plain.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/alert/template/notification/new-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{NewAlertNotificationTemplateUIBean.createdTemplateId}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+
<to-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml</from-view-id>
+
+ <!-- navigation cases for CRUD of general properties -->
+ <navigation-case>
+
<from-action>#{AlertNotificationTemplateDetailsUIBean.edit}</from-action>
+
<to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=edit&templateId=#{param.templateId}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+
<from-action>#{AlertNotificationTemplateDetailsUIBean.save}</from-action>
+
<to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{param.templateId}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+
<from-action>#{AlertNotificationTemplateDetailsUIBean.cancel}</from-action>
+
<to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{param.templateId}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <!-- navigation case to go to the common page for editing alert notifications
-->
+ <navigation-case>
+
<from-action>#{AlertNotificationTemplateDetailsUIBean.editNotifications}</from-action>
+
<to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=template&contextId=#{param.templateId}</to-view-id>
+ <redirect />
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- alert notifications and custom sender UI -->
+ <navigation-rule>
+
<from-view-id>/rhq/common/alert/notification/details-plain.xhtml</from-view-id>
+
+ <!-- refresh *with* notification ID when: -->
+ <!-- 1) selecting an alert notification element from the table -->
+ <!-- 2) save alert notifications that use a configuration-based rendering
schemes -->
+ <!-- 3) save alert notifications that use custom rendering schemes -->
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=#{param.context}&contextId=#{param.contextId}&contextSubId=#{param.contextSubId}&nid=#{alertNotificationsUIBean.activeNotification.id}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <!-- clicking remove button should refresh but deselect the active
notification -->
+ <navigation-case>
+
<from-action>#{alertNotificationsUIBean.removeSelected}</from-action>
+
<to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=#{param.context}&contextId=#{param.contextId}&contextSubId=#{param.contextSubId}</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml
new file mode 100644
index 0000000..14db2d7
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml
@@ -0,0 +1,491 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/subscription-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+
<from-action>#{ResourceReposUIBean.deleteSelectedResourceRepos}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+
<from-action>#{AvailableResourceReposUIBean.subscribeSelectedResourceRepos}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/resource/content/view-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/content/view-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+<!--
+ <navigation-case>
+
<from-action>#{ListPackagesUIBean.deleteSelectedInstalledPackages}</from-action>
+ <from-outcome>successOrFailure</from-outcome>
+
<to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+-->
+
+ <navigation-case>
+
<from-action>#{DeletePackagesUIBean.beginDeleteWorkflow}</from-action>
+ <from-outcome>beginDeleteWorkflow</from-outcome>
+
<to-view-id>/rhq/resource/content/confirm-delete-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/resource/content/deploy-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>uploadNew</from-outcome>
+
<to-view-id>/rhq/resource/content/create-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{CreateNewPackageUIBean.deployExisting}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/rhq/resource/content/update-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>uploadNew</from-outcome>
+
<to-view-id>/rhq/resource/content/create-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{CreateNewPackageUIBean.deployExisting}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ </navigation-rule>
+
+
+
+ <navigation-rule>
+ <from-view-id>/rhq/resource/content/history-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>showContentServiceRequestDetails</from-outcome>
+
<to-view-id>/rhq/resource/content/history-request-plain.xhtml?id=#{param.id}&selectedRequestId=#{param.selectedRequestId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>showHistoryItem</from-outcome>
+
<to-view-id>/rhq/resource/content/audit-trail-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/history-request-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>showHistoryItem</from-outcome>
+
<to-view-id>/rhq/resource/content/history-request-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>returnToAllRequests</from-outcome>
+
<to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/history-request-item-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>returnToRequest</from-outcome>
+
<to-view-id>/rhq/resource/content/history-request-plain.xhtml?id=#{param.id}&selectedRequestId=#{param.selectedRequestId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>stepDetails</from-outcome>
+
<to-view-id>/rhq/resource/content/history-request-step-details-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}&stepId=#{param.stepId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/history-request-step-details-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>returnToHistory</from-outcome>
+
<to-view-id>/rhq/resource/content/history-request-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/resource/content/create-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{CreateNewPackageUIBean.createPackage}</from-action>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+
<to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/confirm-create-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>successOrFailure</from-outcome>
+
<to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+
<to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/content/confirm-delete-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>successOrFailure</from-outcome>
+
<to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+
<to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Repo List -->
+ <navigation-rule>
+ <from-view-id>/rhq/content/listRepos-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createNewRepo</from-outcome>
+ <to-view-id>/rhq/content/createRepo-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>importRepos</from-outcome>
+ <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/rhq/content/importRepos-plain.xhtml</from-view-id>
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ <navigation-case>
+ <!-- import failed -->
+ <from-outcome>failed</from-outcome>
+ <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Repo View -->
+ <navigation-rule>
+ <from-view-id>/rhq/content/repo-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/content/repo-plain.xhtml?mode=view&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>edit</from-outcome>
+
<to-view-id>/rhq/content/repo-plain.xhtml?mode=edit&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>associateWithContentProviders</from-outcome>
+
<to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>subscribeResources</from-outcome>
+
<to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/content/repo-plain.xhtml?mode=view&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Content Source List -->
+ <navigation-rule>
+
<from-view-id>/rhq/content/listContentProviders-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>createNewContentSource</from-outcome>
+
<to-view-id>/rhq/content/createContentProvider-plain.xhtml?mode=new</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Content Source View -->
+ <navigation-rule>
+ <from-view-id>/rhq/content/contentProvider-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=view&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>edit</from-outcome>
+
<to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=edit&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=view&id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/content/contentProvider-view-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/content/contentProvider-edit-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.addNewMap}</from-action>
+
<to-view-id>/rhq/content/contentProvider-add-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Content Source Creation -->
+ <navigation-rule>
+
<from-view-id>/rhq/content/createContentProvider-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/content/createContentProvider-edit-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.addNewMap}</from-action>
+
<to-view-id>/rhq/content/createContentProvider-add-map-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>save</from-outcome>
+
<to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+
<to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/content/createContentProvider-edit-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+
<to-view-id>/rhq/content/createContentProvider-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/content/createContentProvider-add-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+
<to-view-id>/rhq/content/createContentProvider-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/content/contentProvider-view-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/content/contentProvider-edit-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/content/contentProvider-add-map-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Repo Creation -->
+ <navigation-rule>
+ <from-view-id>/rhq/content/createRepo-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>save</from-outcome>
+ <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+ <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Repo Associations With Content Sources -->
+ <navigation-rule>
+ <from-view-id>/rhq/content/repoAssociations-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- Repo Subscriptions -->
+ <navigation-rule>
+
<from-view-id>/rhq/content/repoSubscriptions-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>search</from-outcome>
+
<to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml
new file mode 100644
index 0000000..ef6b120
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <navigation-rule>
+
+ <from-view-id>/rhq/resource/events/history-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/events/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/events/history-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
+
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml
new file mode 100644
index 0000000..9578b33
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- Resource Measurement Schedules -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/monitor/schedules-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/monitor/schedules-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/monitor/schedules-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Graphs -->
+ <navigation-rule>
+ <from-view-id>/rhq/resource/monitor/graphs-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/monitor/graphs-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Tables -->
+ <navigation-rule>
+ <from-view-id>/rhq/resource/monitor/tables-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/monitor/tables-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <!-- changing metric display range on Monitor > Response -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/monitor/response-plain.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go
here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/monitor/response-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/monitor/response-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml
new file mode 100644
index 0000000..9750c4c
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- New Resource Operation Schedule -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml</from-view-id>
+ <navigation-case>
+ <!-- schedule an operation for deferred execution -->
+ <from-outcome>viewOperationSchedules</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- schedule an operation for immediate execution -->
+ <from-outcome>viewOperationHistory</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success',
go back here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml?id=#{param.id}&opId=#{param.opId}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success',
go back here -->
+ <from-outcome>validationError</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Resource Operation Schedules -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml</from-view-id>
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success',
go here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- schedule an operation for immediate execution -->
+ <from-outcome>viewOperationHistory</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- Resource Operation History -->
+ <navigation-rule>
+
<from-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml</from-view-id>
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success',
go here -->
+ <from-outcome>success</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+
<to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+
<from-view-id>/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{ConfigHelperUIBean.accessMap}</from-action>
+
<to-view-id>/rhq/resource/operation/view-results-map-plain.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index 8d69a36..03f80f0 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -161,6 +161,12 @@
/WEB-INF/jsf-navigation/measurement-navigation.xml,
/WEB-INF/jsf-navigation/summary-navigation.xml,
/WEB-INF/jsf-navigation/test-navigation.xml,
+
+ /WEB-INF/jsf-navigation/alert-plain-navigation.xml,
+ /WEB-INF/jsf-navigation/content-plain-navigation.xml,
+ /WEB-INF/jsf-navigation/events-plain-navigation.xml,
+ /WEB-INF/jsf-navigation/operation-plain-navigation.xml,
+ /WEB-INF/jsf-navigation/measurement-plain-navigation.xml,
/WEB-INF/jsf-navigation-definition/group-definition-navigation.xml,
commit d5dfe2ed9d42af51c6c3d3793f79e315c52ed092
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:08:28 2010 -0400
create a "plain" pagination scheme for iframed-facelets
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml
new file mode 100644
index 0000000..8a4debb
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:onf="http://jboss.org/on/function">
+
+ <body>
+
+ <f:view>
+
+ Usage: The following parameters must be set in the calling page
+
+ paginationDataTableName - Name of the data table to be controlled
+ paginationDataModel - Data model of the underlying table being controlled (used
for total row count)
+ paginationPageControl - Page control value to set when changing the number of
rows per page
+
+ <ui:composition>
+
+ <h:panelGroup layout="block" style="float: right;
margin-right: 30px">
+ <ui:param name="paginationDataScrollerName"
value="#{paginationDataTableName}Scroller"/>
+ <c:if test="#{empty paginationUIBean}">
+ <ui:param name="paginationSettingUIBean"
value="#{PageControlSettingsUIBean}" />
+ </c:if>
+ <c:if test="#{not empty paginationUIBean}">
+ <ui:param name="paginationSettingUIBean"
value="#{paginationUIBean}" />
+ </c:if>
+
+ <table>
+ <tr>
+ <td nowrap="nowrap">
+
+
+ <h:outputText value="Total: #{paginationDataModel.rowCount}"
+ style="margin-right: 1em; font-weight: bold;
"/>
+ <h:outputText value="Items Per Page:
#{paginationPageControl.pageSize}"
+ style="font-weight: bold; "
+ rendered="#{paginationDataModel.rowCount gt
paginationSettingUIBean.minimumPageSize
+ and not paginationPageControl.unlimited
+ and not
(onf:length(paginationSettingUIBean.pageSizes) gt 1)}" />
+ <h:outputText value="Items Per Page:"
+ style="margin-right: 1em; font-weight: bold; "
+ rendered="#{paginationDataModel.rowCount gt
paginationSettingUIBean.minimumPageSize
+ and not paginationPageControl.unlimited
+ and
(onf:length(paginationSettingUIBean.pageSizes) gt 1)}"/>
+ <h:selectOneListbox id="currentPageSize"
+ size="1"
+ value="#{paginationPageControl.pageSize}"
+ rendered="#{paginationDataModel.rowCount gt
paginationSettingUIBean.minimumPageSize
+ and not paginationPageControl.unlimited
+ and
(onf:length(paginationSettingUIBean.pageSizes) gt 1)}">
+ <a4j:support event="onchange"
+ reRender="#{paginationDataTableName},
#{paginationDataScrollerName}"/>
+ <f:selectItems
value="#{paginationSettingUIBean.pageSizes}" />
+ </h:selectOneListbox>
+
+ </td>
+ <td nowrap="nowrap">
+
+ <!-- Limit to 7 pages until e find a general fix for RHQ-1813 -->
+ <rich:datascroller id="#{paginationDataScrollerName}"
+ for="#{paginationDataTableName}"
+ rendered="#{not
paginationPageControl.unlimited}"
+ selectedStyle="font-weight: bold;"
+ inactiveStyle="font-weight: normal;"
+ stepControls="show"
+ fastControls="hide"
+ boundaryControls="hide"
+ maxPages="7"
+
page="#{paginationPageControl.pageNumber}">
+ <f:facet name="next">
+ <h:panelGroup>
+ <h:graphicImage value="/images/tbb_pageright.gif"
style="padding: 0px 5px 0px 7px;" />
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="next_disabled">
+ <h:panelGroup>
+ <h:graphicImage
value="/images/tbb_pageright_gray.gif" style="padding: 0px 5px 0px
7px;" />
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="previous">
+ <h:panelGroup>
+ <h:graphicImage value="/images/tbb_pageleft.gif"
style="padding: 0px 5px 0px 7px;" />
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="previous_disabled">
+ <h:panelGroup>
+ <h:graphicImage
value="/images/tbb_pageleft_gray.gif" style="padding: 0px 5px 0px
7px;" />
+ </h:panelGroup>
+ </f:facet>
+ </rich:datascroller>
+
+ </td>
+ </tr>
+ </table>
+
+
+ </h:panelGroup>
+
+ <div style="clear: both;"/>
+
+ </ui:composition>
+ </f:view>
+
+ </body>
+</html>
\ No newline at end of file
commit 5a37b80f0cee3cf67c9aea9ca386019555ece295
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:08:08 2010 -0400
create a "plain" layout scheme for iframed-facelets
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml
new file mode 100644
index 0000000..157b598
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml
@@ -0,0 +1,39 @@
+<ui:composition template="/rhq/layout/main-plain-layout.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <ui:define name="body-area">
+
+ <!-- work around for IE and its broken box model. Without the concrete height
value, the nav pane will shrink on hover. -->
+ <!--[if IE]>
+ <div id="contentParent" style="height: 100%">
+ <![endif]-->
+ <!--[if !IE]><!-->
+ <div id="contentParent">
+ <!--<![endif]-->
+ <div id="centerContentWrapper"
class="content-right">
+ <div style="left: 0; right: 0; height: 100%;">
+
+ <!-- Shows the results of the last action executed. -->
+ <h:messages showSummary="true"
+ showDetail="true"
+ infoClass="InfoBlock"
+ warnClass="WarnBlock"
+ errorClass="ErrorBlock"
+ fatalClass="FatalBlock"
+ globalOnly="true"
+ layout="table"
+ width="100%" />
+
+ <ui:insert name="content"><p>Default Entity
Content</p></ui:insert>
+ </div>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml
new file mode 100644
index 0000000..ffb0bda
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml
@@ -0,0 +1,310 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+<head>
+ <title>${msg["product.shortName"]} - #{(!empty pageTitle) ? pageTitle
: defaultPageTitle}</title>
+
+ <meta http-equiv="Expires" content="-1"/>
+ <meta http-equiv="Pragma" content="no-cache"/>
+ <meta http-equiv="Max-Age" content="0"/>
+ <meta http-equiv="Cache-Control" content="no-cache"/>
+ <ui:insert name="metaHeaders"></ui:insert>
+
+ <link rel="stylesheet" type="text/css"
media="screen" href="/css/win.css"/>
+ <link rel="stylesheet" type="text/css"
media="screen" href="/css/form-style.css"/>
+ <link rel="stylesheet" type="text/css"
media="screen" href="/css/menu.css"/>
+
+ <script type="text/javascript"
src="/js/functions.js"></script>
+ <script type="text/javascript"
src="/js/prototype.js"></script>
+ <script type="text/javascript"
src="/js/window.js"></script>
+ <script type="text/javascript"
src="/js/effects.js"></script>
+ <!--<script type="text/javascript"
src="/js/debug.js"></script>-->
+ <script type="text/javascript"
src="/js/formValues.js"></script>
+ <script type="text/javascript"
src="/js/rhq.js"></script>
+ <script type="text/javascript"
src="/js/popup.js"></script>
+ <link href="/css/theme/default.css" rel="stylesheet"
type="text/css"/>
+ <link href="/css/theme/alphacube.css" rel="stylesheet"
type="text/css"/>
+ <link href="/css/theme/debug.css" rel="stylesheet"
type="text/css"/>
+
+ <link rel="icon" type="image/png"
href="/images/favicon.png"/>
+ <link rel="apple-touch-icon" href="/images/favicon.png"/>
+
+ <!-- Trims up the headers of RF toggle panel headers -->
+ <style type="text/css">
+ .BlockTitle {
+ padding-top: 3px;
+ padding-bottom: 3px;
+ }
+ HTML, BODY { overflow: hidden; }
+ </style>
+
+
+<style type="text/css">
+
+.dr-pnl {
+ border-style: none;
+ padding: 0;
+}
+
+.dr-pnl-b {
+ border-color: white;
+ padding: 0;
+ margin: 0;
+}
+
+.dr-pnl-h { /* Files */
+ background-image: none;
+ background-color: rgb(164, 178, 185);
+ font-family: sans-serif;
+ font-size: 10px;
+}
+
+.dr-pmenu-group-self-label { /* filename */
+ color: rgb(109, 120, 124);
+ font-family: sans-serif;
+ font-size: 9px;
+ white-space: nowrap;
+}
+
+.rich-pmenu { /* Defines styles for panel menu */
+
+}
+.rich-pmenu-disabled-element { /* Defines styles for panel menu disabled element */
+
+}
+.rich-pmenu-group { /* styles for panel menu group */
+ background-image: none;
+ background-color: rgb(217, 223, 227);
+}
+
+.rich-pmenu-group-self-label { /* directory - Defines styles for panel menu group label
*/
+ font-family: sans-serif;
+ font-size: 9px;
+ color: rgb(102, 102, 102);
+ white-space: nowrap;
+}
+.rich-pmenu-item { /* Defines styles for panel menu item */
+ background-color: rgb(223, 228, 232);
+ color: rgb(217, 223, 227);
+ border-style: none;
+ margin: 0;
+ padding: 0;
+ padding-left: 15px;
+
+}
+.rich-pmenu-nowrap { /* Defines styles for panel menu wrapper */
+
+}
+.rich-pmenu-selected-element { /* Defines styles for panel menu selected element */
+ background-color: white;
+ font-style: normal;
+ font-weight: bold;
+ color: #00ff99;
+
+}
+.rich-pmenu-top-group { /* Defines styles for panel menu top group element */
+ padding-left: 15px;
+}
+.rich-pmenu-top-group-div { /* Defines styles for panel menu top group div element */
+ border-style: none;
+ border-bottom-style: dotted;
+ border-bottom-color: white;
+ margin: 0;
+ padding: 0;
+}
+
+.raw-outer-table-left-col {
+ background-color: rgb(217, 223, 227);
+}
+
+.raw-outer-table-left-col-footer {
+ background-color: rgb(217, 223, 227);
+ width: 100%;
+}
+
+.raw-outer-table-left-col-footer-content {
+ font-family: sans-serif;
+ font-size: 9px;
+ font-weight: bold;
+ color: gray;
+ padding-left: 10px;
+}
+
+.rawConfigUndoButton {
+ font-size: 9px;
+ font-weight: bold;
+ color: #666666;
+ background-color: #FFFFFF;
+ border: 1px solid #B0B0B0;
+ padding: 0px 5px;
+ cursor: pointer;
+ text-decoration: none
+}
+
+.rawCancelButton {
+ font-size: 11px;
+ font-weight: bold;
+ color: #E6E8ED;
+ background-color: #828CA3;
+ border: 1px outset #626C83;
+ padding: 1px 10px;
+ cursor: pointer;
+ text-decoration: none;
+ margin-left: 5px;
+}
+
+.rawConfigFileNameCol {
+ color: rgb(109, 120, 124);
+ font-family: sans-serif;
+ font-size: 9px;
+ white-space: nowrap;
+}
+
+.rawConfigUndoCol {
+ width: 25%;
+ text-align: right;
+}
+
+.rawConfigFileHeader {
+ color: gray;
+ white-space: nowrap;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+.rawConfigFileContents {
+ font-family: sans-serif;
+ color: gray;
+ background-color: white;
+ border-style: solid;
+ border-width: thin;
+ border-color: rgb(102, 102, 102);
+ width: 100%;
+ height: 300px;
+ overflow-x: auto;
+ overflow-y: scroll;
+}
+
+
+
+ </style>
+
+
+
+ <link rel="stylesheet" type="text/css"
media="screen" href="/css/tabular.css"/>
+ <link rel="stylesheet" type="text/css"
media="screen" href="/css/layout.css"/>
+
+ <script type="text/javascript">
+ var imagePath = "/images/";
+ </script>
+
+</head>
+
+<body bgcolor="#FFFFFF" style="height: 100%;">
+
+<ui:remove>
+ <!-- Set the content type to "text/html" (overriding the default of
"application/xhtml+xml") to force
+Firefox and other Gecko-based browsers to render the page in "Almost Standards"
(i.e. transitional) mode. -->
+</ui:remove>
+<f:view contentType="text/html">
+
+
+ <f:loadBundle basename="ApplicationResources" var="msg"/>
+
+ <!-- =================== PAGE HEADER =================== -->
+
+ <script language="javascript" type="text/javascript">
+ //this has to be defined before the resize trackers inside
+ //the PageBody element because they depend on the values
+ //computed inside this tracker function.
+ WindowResizeTracker.addListener(function() {
+ var header = $('PageHeader');
+ var borderHeight = 2; //set in the inline style of div PageHeader
+
+ if (Prototype.Browser.IE) {
+ header.style.height = WindowResizeTracker.currentSizes.windowHeight +
'px';
+ } else {
+ header.style.height = (WindowResizeTracker.currentSizes.windowHeight -
borderHeight) + 'px';
+ }
+ header.style.width = WindowResizeTracker.currentSizes.windowWidth +
'px';
+
+ var body = $('PageBody');
+ //0 = menu height (and the top position of PageBody)
+ body.style.height = (WindowResizeTracker.currentSizes.windowHeight - 0 -
borderHeight) + 'px';
+ body.style.width = header.style.width;
+
+ document.body.style.height = WindowResizeTracker.currentSizes.windowHeight +
'px';
+ });
+ </script>
+ <!-- work around for IE and its broken box model. Without the concrete height
value, the nav pane will shrink on hover. -->
+ <!--[if IE]>
+ <div id="PageHeader" style="border-bottom: 2px solid #999;
position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: 100%">
+ <![endif]-->
+ <!--[if !IE]><!-->
+ <div id="PageHeader" style="border-bottom: 2px solid #999;
position: absolute; top: 0; bottom: 0; left: 0; right: 0;">
+ <!--<![endif]-->
+
+ <!-- work around for IE and its broken box model. Without the concrete height
value, the nav pane will shrink on hover. -->
+ <!--[if IE]>
+ <div id="PageBody" style="width: 100%; position: absolute; top:
0px; bottom: 0; height: 100%;">
+ <![endif]-->
+ <!--[if !IE]><!-->
+ <div id="PageBody" style="width: 100%; position: absolute; top:
0px; bottom: 0;">
+ <!--<![endif]-->
+ <ui:insert name="body-area">Default Page
Body</ui:insert>
+ </div>
+
+ </div>
+
+
+
+ <!-- =================== BODY =================== -->
+
+
+ <div id="about" class="dialog" style="display: none;
position: absolute; top: 0; left: 0;">
+ <div class="DisplayContent" style="margin: 0;">
+ <div style="margin:5px">
+ <p class="compact">
+ <span
class="DisplaySubhead">${msg['footer.aboutLink']}</span><br/>
+ <span
class="DisplayLabel">${msg['footer.version']}:
${msg['product.version']}</span><br/>
+ <span
class="DisplayLabel">${msg['footer.buildNumber']}:
${msg['product.buildNumber']}</span>
+ </p>
+
+ <p class="compact">
+
<f:verbatim>${msg['footer.copyright']}</f:verbatim>
${msg['about.Copyright.Content']}
+ </p>
+
+ <p class="compact">
+ ${msg['about.MoreInfo.Label']}<br/>
+ <a
href="mailto:${msg['about.MoreInfo.LinkSales']}">${msg['about.MoreInfo.LinkSales']}</a><br/>
+ <a
href="mailto:${msg['about.MoreInfo.LinkSupport']}">${msg['about.MoreInfo.LinkSupport']}</a>
+ </p>
+ </div>
+ </div>
+ </div>
+
+ <!-- work-around to enable us to embed richfaces components inside the
onc:simpleTrigger;
+without this, the page will throw a javascript error "{blah} is not defined"
or
+"{yadda} is not a constructor", and the pop-up action will not work -->
+ <rich:calendar rendered="false"/>
+ <rich:inputNumberSpinner rendered="false"/>
+
+</f:view>
+
+<script type="text/javascript">
+ addWindowOnLoadEvent(disableConditionalButtons);
+</script>
+
+</body>
+</html>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml
new file mode 100644
index 0000000..6f2cd02
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml
@@ -0,0 +1,17 @@
+<ui:composition template="/rhq/entity/layout/main-plain.xhtml"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component"
+
xmlns:onf="http://jboss.org/on/function"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:define name="content">
+ <h1>Default Resource Content</h1>
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
commit b0cac99b444d86edc047a3a1bc031907207c2350
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 07:00:40 2010 -0400
criteria objects with customized sorting should not get LEFT JOIN treatment
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 3216ec7..82ffd48 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
@@ -342,6 +342,12 @@ public final class CriteriaQueryGenerator {
boolean doNotPrefixAlias = isNumber(suffix) ||
criteria.hasCustomizedSorting();
String sortFragment = doNotPrefixAlias ? suffix : (alias + "." +
suffix);
+ if (criteria.hasCustomizedSorting()) {
+ // customized sorting does not get LEFT JOIN expressions added
+ orderingFieldTokens.add(sortFragment + " " + ordering);
+ continue;
+ }
+
int lastDelimiterIndex = sortFragment.lastIndexOf('.');
if (lastDelimiterIndex == -1) {
// does not require joins, just add the ordering field token directly
@@ -568,8 +574,8 @@ public final class CriteriaQueryGenerator {
try {
Class<?> entityClass = criteria.getPersistentClass();
- SearchTranslationManager searchManager = new
SearchTranslationManager(subject,
- SearchSubsystem.get(entityClass));
+ SearchTranslationManager searchManager = new
SearchTranslationManager(subject, SearchSubsystem
+ .get(entityClass));
searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling
'AND' to the where clause
commit 56cdad77b1f9e576bdeb7f27eec7d6f4ea929351
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 01:01:03 2010 -0400
Don't allow "Step X of Y" for wizard-based flows to wrap to next line
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 a8ff10b..3d88005 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
@@ -206,6 +206,7 @@ public class WizardView extends VLayout {
currentStep = stepIndex;
stepLabel.setContents("Step " + (stepIndex + 1) + " of " +
wizardSteps.size());
+ stepLabel.setWrap(false);
WizardStep step = wizardSteps.get(currentStep);
commit 4bed8786b2d15c9ace92b938e1b9e160dde5d65e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Aug 11 00:30:37 2010 -0400
fix 2 compilation errors where Set could not be assigned to EnumSet
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java
index 9e853f0..2c572fb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java
@@ -60,7 +60,7 @@ public class GroupActivationContext extends
AbstractResourceOrGroupActivationCon
// lazy load
if (this.facets == null) {
ResourceFacets resourceFacets =
this.resourceTypeManager.getResourceFacets(getResourceType().getId());
- this.facets = resourceFacets.getFacets();
+ this.facets = EnumSet.copyOf(resourceFacets.getFacets());
}
return this.facets;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java
index 510f584..de91285 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java
@@ -62,7 +62,7 @@ public class ResourceActivationContext extends
AbstractResourceOrGroupActivation
if (this.facets == null) {
ResourceFacets resourceFacets =
this.resourceTypeManager.getResourceFacets(resource.getResourceType()
.getId());
- this.facets = resourceFacets.getFacets();
+ this.facets = EnumSet.copyOf(resourceFacets.getFacets());
}
return this.facets;
}
commit 6e66afbb63d19bad003c6c26b08b31c8c7135171
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 10 18:23:34 2010 -0400
fix bookmarking/history for Resource tabs
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 1204539..144442b 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
@@ -92,7 +92,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
- inventoryTab = new TwoLevelTab(DEFAULT_TAB_NAME,
"/images/icons/Inventory_grey_16.png");
+ inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
inventoryTab.registerSubTabs("Overview", "Members",
"Connection Settings");
operationsTab = new TwoLevelTab("Operations",
"/images/icons/Operation_grey_16.png");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index d16d403..c75f6e8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -116,14 +116,14 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
public void renderView(ViewPath viewPath) {
if (viewPath.isEnd()) {
// default detail view
- viewPath.getViewPath().add(new ViewId("Summary"));
+ viewPath.getViewPath().add(new ViewId("Inventory"));
viewPath.getViewPath().add(new ViewId("Overview"));
}
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId)
{
- // The previous bookmark did not already point to this group.
+ // The previous history item did not already point to this group.
setSelectedGroup(groupId, viewPath);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index a40f10a..7415ba7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -25,7 +25,6 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.resource.Resource;
@@ -62,6 +61,8 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
*/
public class ResourceDetailView extends VLayout implements BookmarkableView,
ResourceSelectListener, TwoLevelTabSelectedHandler {
+ private static final String DEFAULT_TAB_NAME = "Summary";
+
private Resource resource;
private ResourcePermission permissions;
private ResourceType type;
@@ -79,9 +80,6 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
private ResourceTitleBar titleBar;
- private ViewId tabView;
- private ViewId subtabView;
-
public void setResource(Resource resource) {
this.resource = resource;
@@ -146,10 +144,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
this.resource = resource;
titleBar.setResource(resource);
-
- int selectedTab = topTabSet.getSelectedTabNumber();
-
-
+
FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
summaryTab.updateSubTab("Timeline", timelinePane);
@@ -269,43 +264,43 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
+ // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
+ selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
-// System.out.println("TAB: " + currentView.getPath() + tabPath);
+ String path = "Resource/" + this.resource.getId() + tabPath;
- if (resource != null) {
- String path = "Resource/" + resource.getId() + tabPath;
- History.newItem(path, false);
- }
+ // But still add an item to the history, specifying false to tell it not to fire
an event.
+ History.newItem(path, false);
}
public void renderView(ViewPath viewPath) {
- // TODO: Implement this method.
-
- if (viewPath.isEnd()) {
- // default
-
- } else {
-
- tabView = viewPath.getCurrent();
- subtabView = viewPath.getNext();
-
- for (Tab t : topTabSet.getTabs()) {
- TwoLevelTab tab = (TwoLevelTab) t;
-
- if (tab.getTitle().equals(tabView.getPath())) {
- topTabSet.selectTab(tab); //tabView.getPath());
-
- tab.getLayout().selectTab(subtabView.getPath());
-
+ // e.g. #Resource/10010/Inventory/Overview
+ String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null;
// e.g. "Inventory"
+ String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath()
: null; // e.g. "Overview"
+ selectTab(tabName, subTabName);
+ }
- }
+ public void selectTab(String tabName, String subtabName) {
+ if (tabName == null) {
+ tabName = DEFAULT_TAB_NAME;
+ }
+ TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName);
+ if (tab == null) {
+ CoreGUI.getErrorHandler().handleError("Invalid tab name: " +
tabName);
+ // TODO: Should we fire a history event here to redirect to a valid
bookmark?
+ tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
+ }
+ this.topTabSet.selectTab(tab);
+ if (subtabName != null) {
+ if (!tab.getLayout().selectTab(subtabName)) {
+ CoreGUI.getErrorHandler().handleError("Invalid subtab name: " +
subtabName);
+ // TODO: Should we fire a history event here to redirect to a valid
bookmark?
+ return;
}
-
-
+ tab.getLayout().selectTab(subtabName);
}
-
-
}
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
index e342628..f7b5c6e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
@@ -133,16 +133,13 @@ public class ResourceView extends HLayout implements
BookmarkableView {
Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentResource == null || currentResource.getId() != resourceId) {
-
+ // The previous history item did not already point to this Resource.
setSelectedResource(resourceId, viewPath);
-
- this.treeView.renderView(viewPath);
-
- viewPath.next();
-
- this.detailView.renderView(viewPath);
-
}
+
+ viewPath.next();
+ this.treeView.renderView(viewPath);
+ this.detailView.renderView(viewPath);
}
}
commit 92f76547ae768f78379d0abbd9fde4b3d0e375e8
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 10 17:33:32 2010 -0400
fix bookmarks/history for group tabs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
index 9b07011..bc79260 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
@@ -151,12 +151,14 @@ public class SubTabLayout extends VLayout {
- public void selectTab(String title) {
+ public boolean selectTab(String title) {
+ boolean foundTab = false;
currentlySelected = title;
int i = 0;
for (String sub : subtabs.keySet()) {
if (sub.equals(title)) {
currentIndex = i;
+ foundTab = true;
break;
}
i++;
@@ -167,11 +169,11 @@ public class SubTabLayout extends VLayout {
((Button)buttonBar.getMember(currentIndex)).select();
draw(subtabs.get(title));
}
+
+ return foundTab;
}
-
-
// ------- Event support -------
// Done with a separate handler manager from parent class on purpose (compatibility
issue)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
index a8bc6cd..b12304c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.tab;
-import com.google.gwt.event.shared.DefaultHandlerRegistration;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
import com.smartgwt.client.widgets.tab.Tab;
@@ -26,15 +25,12 @@ import com.smartgwt.client.widgets.tab.TabSet;
import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
-import java.util.ArrayList;
-
/**
* @author Greg Hinkle
*/
public class TwoLevelTabSet extends TabSet implements TabSelectedHandler,
TwoLevelTabSelectedHandler {
-
public void setTabs(TwoLevelTab... tabs) {
super.setTabs(tabs);
for (TwoLevelTab tab : tabs) {
@@ -48,9 +44,6 @@ public class TwoLevelTabSet extends TabSet implements
TabSelectedHandler, TwoLev
}
-
-
-
// ------- Event support -------
// Done with a separate handler manager from parent class on purpose (compatibility
issue)
@@ -80,5 +73,15 @@ public class TwoLevelTabSet extends TabSet implements
TabSelectedHandler, TwoLev
m.fireEvent(tabSelectedEvent);
}
+
+ public Tab getTabByTitle(String title) {
+ Tab[] tabs = getTabs();
+ for (Tab tab : tabs) {
+ if (tab.getTitle().equals(title)) {
+ return tab;
+ }
+ }
+ return null;
+ }
}
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 7ce23a7..1204539 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
@@ -25,7 +25,6 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.resource.ResourceType;
@@ -36,7 +35,6 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
@@ -51,11 +49,12 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
* Right panel of the group view.
*
* @author Greg Hinkle
+ * @author Ian Springer
*/
public class ResourceGroupDetailView extends VLayout implements BookmarkableView,
TwoLevelTabSelectedHandler {
+ private static final String DEFAULT_TAB_NAME = "Inventory";
private ResourceGroupComposite groupComposite;
- private ResourceType groupType;
private ResourcePermission permissions;
private TwoLevelTab summaryTab;
@@ -70,8 +69,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private ResourceGroupTitleBar titleBar;
- private ViewId tabView;
- private ViewId subtabView;
@Override
protected void onDraw() {
@@ -95,7 +92,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
- inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
+ inventoryTab = new TwoLevelTab(DEFAULT_TAB_NAME,
"/images/icons/Inventory_grey_16.png");
inventoryTab.registerSubTabs("Overview", "Members",
"Connection Settings");
operationsTab = new TwoLevelTab("Operations",
"/images/icons/Operation_grey_16.png");
@@ -123,6 +120,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// CoreGUI.addBreadCrumb(getPlace());
}
+
public void onGroupSelected(ResourceGroupComposite groupComposite) {
this.groupComposite = groupComposite;
@@ -183,7 +181,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
group.setResourceType(type);
- ResourceGroupDetailView.this.groupType = type;
GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(
group.getId(), new
AsyncCallback<Set<Permission>>() {
public void onFailure(Throwable caught) {
@@ -242,34 +239,44 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
+
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
+ // Switch tabs directly, rather than letting the history framework do it, to
avoid redrawing the outer views.
+ selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId());
String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
- // System.out.println("TAB: " + currentView.getPath() +
tabPath);
-
- if (groupComposite != null) {
- String path = "ResourceGroup/" +
groupComposite.getResourceGroup().getId() + tabPath;
- History.newItem(path, false);
- }
+ String path = "ResourceGroup/" +
this.groupComposite.getResourceGroup().getId() + tabPath;
+
+ // But still add an item to the history, specifying false to tell it not to fire
an event.
+ History.newItem(path, false);
}
- public void renderView(ViewPath viewPath) {
- if (viewPath.isEnd()) {
- // default
- } else {
- tabView = viewPath.getCurrent();
- subtabView = viewPath.getNext();
-
- for (Tab t : topTabSet.getTabs()) {
- TwoLevelTab tab = (TwoLevelTab) t;
- if (tab.getTitle().equals(tabView.getPath())) {
- topTabSet.selectTab(tabView.getPath());
+ public void renderView(ViewPath viewPath) {
+ // e.g. #ResourceGroup/10010/Inventory/Overview
+ String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null;
// e.g. "Inventory"
+ String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath()
: null; // e.g. "Overview"
+ selectTab(tabName, subTabName);
+ }
- tab.getLayout().selectTab(subtabView.getPath());
- }
+ public void selectTab(String tabName, String subtabName) {
+ if (tabName == null) {
+ tabName = DEFAULT_TAB_NAME;
+ }
+ TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName);
+ if (tab == null) {
+ CoreGUI.getErrorHandler().handleError("Invalid tab name: " +
tabName);
+ // TODO: Should we fire a history event here to redirect to a valid
bookmark?
+ tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME);
+ }
+ this.topTabSet.selectTab(tab);
+ if (subtabName != null) {
+ if (!tab.getLayout().selectTab(subtabName)) {
+ CoreGUI.getErrorHandler().handleError("Invalid subtab name: " +
subtabName);
+ // TODO: Should we fire a history event here to redirect to a valid
bookmark?
+ return;
}
+ tab.getLayout().selectTab(subtabName);
}
-
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index f45b169..d16d403 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -123,15 +123,12 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId)
{
-
+ // The previous bookmark did not already point to this group.
setSelectedGroup(groupId, viewPath);
-
- this.treeView.setSelectedGroup(groupId);
-
- viewPath.next();
-
- this.detailView.renderView(viewPath);
}
+
+ viewPath.next();
+ this.detailView.renderView(viewPath);
}
}
commit 484719eea50ab62afc6938632b0861b87712458d
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 10 22:50:17 2010 +0200
Put some more developer URLs in there.
diff --git a/pom.xml b/pom.xml
index ed621bf..bc895da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1139,6 +1139,7 @@
<developer>
<name>Greg Hinkle</name>
<timezone>-5</timezone>
+ <
url>http://www.jroller.com/ghinkle/</url>
</developer>
<developer>
<name>Lukas Krejci</name>
@@ -1159,6 +1160,7 @@
<developer>
<name>John 'Mazz' Mazzitelli</name>
<timezone>-5</timezone>
+ <url>http://management-platform.blogspot.com</url>
</developer>
<developer>
<name>Simeon Pinder</name>
commit c9c6d348a082f89c8f4a18edc2afb3d5e7498cc4
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 10 12:56:19 2010 -0400
implement group Inventory>Overview subtab, with the exception of the ability to
edit the group's name and description
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
index cc3cb50..c05d5ef 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -23,12 +23,14 @@
package org.rhq.core.domain.resource.composite;
import java.io.Serializable;
-import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
import org.rhq.core.domain.resource.ResourceTypeFacet;
/**
- * The set of facets a Resource supports - used to determine which quicknav icons and
tabs to display in the UI.
+ * The set of facets a Resource or compatible Resource group supports - used to determine
which quick-nav icons and tabs
+ * to display in the GUI.
*
* @author Ian Springer
*/
@@ -39,18 +41,22 @@ public class ResourceFacets implements Serializable {
public static ResourceFacets ALL = new ResourceFacets(-1, true, true, true, true,
true, true, true, true);
/*
* immutable private member data makes this object safe to use in a concurrent
environment, such as a
- * concurrent-access cache of ResourceFacets objects
+ * concurrent-access cache of ResourceFacets objects (TODO (ips): make these final
again?)
*/
- private final int resourceTypeId;
- private final boolean measurement;
- private final boolean event;
- private final boolean pluginConfiguration;
- private final boolean configuration;
- private final boolean operation;
- private final boolean content;
- private final boolean callTime;
- private final boolean support;
- private EnumSet<ResourceTypeFacet> facets;
+ private int resourceTypeId;
+ private boolean measurement;
+ private boolean event;
+ private boolean pluginConfiguration;
+ private boolean configuration;
+ private boolean operation;
+ private boolean content;
+ private boolean callTime;
+ private boolean support;
+ private Set<ResourceTypeFacet> facets;
+
+ // no-arg constructor required by GWT compiler
+ public ResourceFacets() {
+ }
public ResourceFacets(int resourceTypeId, boolean measurement, boolean event, boolean
pluginConfiguration,
boolean configuration, boolean operation, boolean content, boolean callTime,
boolean support) {
@@ -163,12 +169,12 @@ public class ResourceFacets implements Serializable {
*
* @return an enum representation of the facets
*/
- public EnumSet<ResourceTypeFacet> getFacets() {
+ public Set<ResourceTypeFacet> getFacets() {
return facets;
}
private void initEnum() {
- this.facets = EnumSet.noneOf(ResourceTypeFacet.class);
+ this.facets = new HashSet<ResourceTypeFacet>();
if (measurement)
this.facets.add(ResourceTypeFacet.MEASUREMENT);
if (event)
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
index 6a837c9..5199ba2 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java
@@ -53,6 +53,8 @@ public class ResourceGroupComposite implements Serializable {
private ResourceFacets resourceFacets;
+ // TODO: Expose authz permissions current user has for the group.
+
private class GroupDefinitionMember extends ResourceGroup {
public void setGroupCategory(GroupCategory category) {
super.setGroupCategory(category);
@@ -101,8 +103,8 @@ public class ResourceGroupComposite implements Serializable {
} else if (this.resourceGroup.getGroupCategory() == GroupCategory.MIXED) {
this.category = GroupCategory.MIXED;
} else {
- throw new IllegalArgumentException("Unknown category " +
this.resourceGroup.getGroupCategory()
- + " for ResourceGroup " + this.resourceGroup.getName());
+ throw new IllegalArgumentException("Unknown category [" +
this.resourceGroup.getGroupCategory()
+ + "] for ResourceGroup [" + this.resourceGroup.getName() +
"]");
}
this.resourceFacets = facets;
@@ -218,6 +220,6 @@ public class ResourceGroupComposite implements Serializable {
+ this.resourceGroup.getName() //
+ ", implicit[up/down/avail=," + this.implicitUp + "/" +
this.implicitDown + "/" + this.implicitAvail + "]"
+ ", explicit[up/down/avail=," + this.explicitUp + "/" +
this.explicitDown + "/" + this.explicitAvail + "]"
- + ", permission=" + "]";
+ + ", facets=" + this.resourceFacets + "]";
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
index c6f5800..5644554 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
@@ -18,18 +18,16 @@
*/
package org.rhq.enterprise.gui.coregui.client.gwt;
-
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria;
import org.rhq.core.domain.resource.group.GroupDefinition;
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 com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
-
-
/**
* @author Greg Hinkle
*/
@@ -38,6 +36,8 @@ public interface ResourceGroupGWTService extends RemoteService {
PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria
criteria);
+ PageList<ResourceGroupComposite>
findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria);
+
PageList<GroupDefinition>
findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria);
void ensureMembershipMatches(int groupId, int[] resourceIds);
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 c3d6a43..7ce23a7 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
@@ -29,9 +29,11 @@ import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.ResourceTypeFacet;
import org.rhq.core.domain.resource.composite.ResourcePermission;
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.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
@@ -52,10 +54,9 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
*/
public class ResourceGroupDetailView extends VLayout implements BookmarkableView,
TwoLevelTabSelectedHandler {
- private ResourceGroup group;
- private ResourcePermission permissions;
-
+ private ResourceGroupComposite groupComposite;
private ResourceType groupType;
+ private ResourcePermission permissions;
private TwoLevelTab summaryTab;
private TwoLevelTab monitoringTab;
@@ -122,15 +123,13 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// CoreGUI.addBreadCrumb(getPlace());
}
- public void onGroupSelected(ResourceGroup group) {
+ public void onGroupSelected(ResourceGroupComposite groupComposite) {
- this.group = group;
+ this.groupComposite = groupComposite;
- titleBar.setGroup(group);
+ this.titleBar.setGroup(groupComposite.getResourceGroup());
- int selectedTab = topTabSet.getSelectedTabNumber();
-
- // TODO all of the tabs
+ // TODO: Implement the rest of the tabs.
// FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
// summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
@@ -143,8 +142,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
// monitoringTab.updateSubTab("Call Time", new
CallTimeView(resource));
//
- inventoryTab.updateSubTab("Overview", new OverviewView());
- inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(this.group.getId()));
+ inventoryTab.updateSubTab("Overview", new
OverviewView(this.groupComposite));
+ inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId()));
// inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
@@ -170,10 +169,11 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
private void updateTabStatus() {
- // Go and get the type with all needed metadata
- // and then get the permissions for this resource
+ final ResourceGroup group = this.groupComposite.getResourceGroup();
if (group.getGroupCategory() == GroupCategory.COMPATIBLE) {
+
+ // Load the fully fetched ResourceType.
ResourceType groupType = group.getResourceType();
ResourceTypeRepository.Cache.getInstance().getResourceTypes(
groupType.getId(),
@@ -182,13 +182,12 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
-
+ group.setResourceType(type);
ResourceGroupDetailView.this.groupType = type;
-
GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(
- ResourceGroupDetailView.this.group.getId(), new
AsyncCallback<Set<Permission>>() {
+ group.getId(), new
AsyncCallback<Set<Permission>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
load group permissions", caught);
+ CoreGUI.getErrorHandler().handleError("Failed to
load group permissions.", caught);
}
public void onSuccess(Set<Permission> result) {
@@ -203,36 +202,42 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private void completeTabUpdate() {
- if (!permissions.isMeasure()) {
- topTabSet.disableTab(monitoringTab);
- } else {
- topTabSet.enableTab(monitoringTab);
- }
+ // Summary and Inventory tabs are always enabled.
+ topTabSet.enableTab(summaryTab);
+ topTabSet.enableTab(inventoryTab);
- if (groupType.getOperationDefinitions() == null ||
groupType.getOperationDefinitions().isEmpty()
- || !permissions.isControl()) {
- topTabSet.disableTab(operationsTab);
+ GroupCategory groupCategory =
groupComposite.getResourceGroup().getGroupCategory();
+
+ // Monitoring and Alerts tabs are always enabled for compatible groups and always
disabled for mixed groups.
+ if (groupCategory == GroupCategory.COMPATIBLE) {
+ topTabSet.enableTab(monitoringTab);
+ topTabSet.enableTab(alertsTab);
} else {
- topTabSet.enableTab(operationsTab);
+ topTabSet.disableTab(monitoringTab);
+ topTabSet.disableTab(alertsTab);
}
- if (!permissions.isAlert()) {
- topTabSet.disableTab(alertsTab);
+ // Operations tab is only enabled for compatible groups of a type that supports
the Operations facet.
+ Set<ResourceTypeFacet> typeFacets =
groupComposite.getResourceFacets().getFacets();
+ if (typeFacets.contains(ResourceTypeFacet.OPERATION)) {
+ topTabSet.enableTab(operationsTab);
} else {
- topTabSet.enableTab(alertsTab);
+ topTabSet.disableTab(operationsTab);
}
- if (groupType.getResourceConfigurationDefinition() == null ||
!permissions.isConfigureRead()) {
- topTabSet.disableTab(configurationTab);
- } else {
+ // Configuration tab is only enabled for compatible groups of a type that
supports the Configuration facet
+ // and when the current user has the CONFIGURE_READ permission.
+ if (!typeFacets.contains(ResourceTypeFacet.CONFIGURATION) &&
permissions.isConfigureRead()) {
topTabSet.enableTab(configurationTab);
+ } else {
+ topTabSet.disableTab(configurationTab);
}
- if (groupType.getEventDefinitions() == null ||
groupType.getEventDefinitions().isEmpty()
- || !permissions.isMeasure()) {
+ // Events tab is only enabled for compatible groups of a type that supports the
Events facet.
+ if (typeFacets.contains(ResourceTypeFacet.EVENT)) {
topTabSet.enableTab(eventsTab);
} else {
- topTabSet.enableTab(eventsTab);
+ topTabSet.disableTab(eventsTab);
}
}
@@ -241,22 +246,16 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
// System.out.println("TAB: " + currentView.getPath() +
tabPath);
- if (group != null) {
- String path = "ResourceGroup/" + group.getId() + tabPath;
+ if (groupComposite != null) {
+ String path = "ResourceGroup/" +
groupComposite.getResourceGroup().getId() + tabPath;
History.newItem(path, false);
}
}
public void renderView(ViewPath viewPath) {
-
- Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
-
-
if (viewPath.isEnd()) {
// default
-
} else {
-
tabView = viewPath.getCurrent();
subtabView = viewPath.getNext();
@@ -269,9 +268,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
tab.getLayout().selectTab(subtabView.getPath());
}
-
}
-
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index 8faaae8..f45b169 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -27,7 +27,7 @@ import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
-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.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -45,11 +45,10 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
private Canvas contentCanvas;
- private ResourceGroup currentGroup;
- //private Resource resourcePlatform;
+ private ResourceGroupComposite currentGroup;
private ResourceGroupTreeView treeView;
- private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
+ private ResourceGroupDetailView detailView;
private ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
@@ -58,6 +57,7 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
}
+
@Override
protected void onInit() {
super.onInit();
@@ -65,58 +65,45 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
setWidth100();
setHeight100();
-
treeView = new ResourceGroupTreeView();
addMember(treeView);
contentCanvas = new Canvas();
addMember(contentCanvas);
-
- // created above
detailView = new ResourceGroupDetailView();
// treeView.addResourceSelectListener(detailView);
-
setContent(detailView);
-
}
- public void setSelectedGroup(final int groupId, final ViewPath view) {
- ResourceGroup group = this.treeView.getGroup(groupId);
- if (group != null) {
- setSelectedGroup(group, view);
- } else {
- ResourceGroupCriteria criteria = new ResourceGroupCriteria();
- criteria.addFilterId(groupId);
- criteria.fetchTags(true);
- groupService.findResourceGroupsByCriteria(criteria, new
AsyncCallback<PageList<ResourceGroup>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Group with id
[" + groupId +
- "] does not exist or is not accessible.",
Message.Severity.Warning));
-
- CoreGUI.goTo(InventoryView.VIEW_PATH);
- }
- public void onSuccess(PageList<ResourceGroup> result) {
- if (result.isEmpty()) {
- //noinspection ThrowableInstanceNeverThrown
- onFailure(new Exception("Group with id [" + groupId +
"] does not exist."));
- } else {
- ResourceGroup group = result.get(0);
- setSelectedGroup(group, view);
- }
+ public void setSelectedGroup(final int groupId, final ViewPath view) {
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addFilterId(groupId);
+ //criteria.fetchTags(true);
+ groupService.findResourceGroupCompositesByCriteria(criteria, new
AsyncCallback<PageList<ResourceGroupComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getMessageCenter().notify(new Message("Group with id ["
+ groupId +
+ "] does not exist or is not accessible.",
Message.Severity.Warning));
+ caught.printStackTrace();
+ CoreGUI.goTo(InventoryView.VIEW_PATH);
+ }
+
+ public void onSuccess(PageList<ResourceGroupComposite> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Group with id [" + groupId +
"] does not exist."));
+ } else {
+ currentGroup = result.get(0);
+ treeView.setSelectedGroup(currentGroup.getResourceGroup().getId());
+ detailView.onGroupSelected(currentGroup);
}
- });
- }
+ }
+ });
}
- private void setSelectedGroup(ResourceGroup group, ViewPath viewPath) {
- this.currentGroup = group;
- this.treeView.setSelectedGroup(group.getId());
- this.detailView.onGroupSelected(group);
- }
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
@@ -135,7 +122,7 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentGroup == null || currentGroup.getId() != groupId) {
+ if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId)
{
setSelectedGroup(groupId, viewPath);
@@ -144,7 +131,6 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
viewPath.next();
this.detailView.renderView(viewPath);
-
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
index bd79780..1730ac3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
@@ -43,8 +43,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
*/
public class ResourceGroupTreeView extends VLayout {
- private int groupId;
- private ResourceGroup group;
private TreeGrid treeGrid;
public ResourceGroupTreeView() {
@@ -52,24 +50,19 @@ public class ResourceGroupTreeView extends VLayout {
setHeight100();
}
-
@Override
protected void onInit() {
super.onInit();
-
this.treeGrid = new TreeGrid();
this.treeGrid.setWidth100();
this.treeGrid.setHeight100();
treeGrid.setShowRoot(true);
addMember(this.treeGrid);
-
-
}
public void setSelectedGroup(int groupId) {
- this.groupId = groupId;
GWTServiceLookup.getClusterService().getClusterTree(groupId,
new AsyncCallback<ClusterFlyweight>() {
public void onFailure(Throwable caught) {
@@ -80,33 +73,9 @@ public class ResourceGroupTreeView extends VLayout {
loadTree(result);
}
});
-
- // TODO: Get the group from the ResourceGroupTreeView in case it was already
loaded.
- ResourceGroupCriteria criteria = new ResourceGroupCriteria();
- criteria.addFilterId(groupId);
- criteria.fetchTags(true);
-
GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria,
- new AsyncCallback<PageList<ResourceGroup>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load
group", caught);
- }
-
- public void onSuccess(PageList<ResourceGroup> result) {
- group = result.get(0);
- }
- });
-
}
- ResourceGroup getGroup(int groupId) {
- // TODO: Get the group from the ResourceGroupTreeView in case it was already
loaded.
- return this.group;
- }
-
-
private void loadTree(ClusterFlyweight root) {
-
-
TreeNode rootNode = new TreeNode(root.getName());
loadTree(rootNode, root);
@@ -116,7 +85,6 @@ public class ResourceGroupTreeView extends VLayout {
treeGrid.setData(tree);
markForRedraw();
-
}
public void loadTree(TreeNode parent, ClusterFlyweight parentNode) {
@@ -125,14 +93,8 @@ public class ResourceGroupTreeView extends VLayout {
ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
HashMap<Integer,TreeNode> typeNodes = new HashMap<Integer,
TreeNode>();
-
for (ClusterFlyweight child : parentNode.getChildren()) {
-
-
-
-
-
TreeNode node = new TreeNode(child.getName());
childNodes.add(node);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
index c5aeb38..57ecbcd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
@@ -1,12 +1,147 @@
+/*
+ * 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.inventory;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.group.GroupDefinition;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+
+import java.util.ArrayList;
+import java.util.Date;
/**
+ * The group Inventory>Overview tab.
+ *
* @author Ian Springer
*/
public class OverviewView extends VLayout {
+ private ResourceGroupComposite groupComposite;
+
+ public OverviewView(ResourceGroupComposite groupComposite) {
+ super();
+ this.groupComposite = groupComposite;
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ ResourceGroup group = this.groupComposite.getResourceGroup();
+
+ HLayout spacer = new HLayout();
+ spacer.setHeight(15);
+ addMember(spacer);
+
+ DynamicForm generalPropsForm = new DynamicForm();
+ generalPropsForm.setNumCols(4);
+ generalPropsForm.setColWidths("25%", "25%", "25%",
"25%");
+ generalPropsForm.setWrapItemTitles(false);
+ setWidth("90%");
+
+ ArrayList<FormItem> formItems = new ArrayList<FormItem>();
+ ArrayList<String> itemIds = new ArrayList<String>();
+
+ //HeaderItem headerItem = new HeaderItem("header", "General
Properties");
+ //headerItem.setValue("General Properties");
+ //formItems.add(headerItem);
+
+ StaticTextItem nameItem = new StaticTextItem("nameItem",
"Name");
+ nameItem.setValue(group.getName());
+ formItems.add(nameItem);
+ itemIds.add(nameItem.getName());
+
+ StaticTextItem typeItem = new StaticTextItem("typeItem", "Member
Type");
+ ResourceType type = group.getResourceType();
+ if (type != null) {
+ typeItem.setTooltip("Plugin: " + type.getPlugin() +
"\n<br>" + "Type: " + type.getName());
+ typeItem.setValue(type.getName() + " (" + type.getPlugin() +
")");
+ } else {
+ typeItem.setValue("<i>Mixed</i>");
+ }
+ formItems.add(typeItem);
+ itemIds.add(typeItem.getName());
+
+ StaticTextItem countItem = new StaticTextItem("countItem", "Member
Count");
+ long memberCount = this.groupComposite.getImplicitUp() +
this.groupComposite.getImplicitDown();
+ countItem.setValue(memberCount);
+ formItems.add(countItem);
+ itemIds.add(countItem.getName());
+
+ StaticTextItem descriptionItem = new StaticTextItem("descriptionItem",
"Description");
+ String description = group.getDescription();
+ descriptionItem.setValue((description != null) ? description :
"<i>none</i>");
+ formItems.add(descriptionItem);
+ itemIds.add(descriptionItem.getName());
+
+ StaticTextItem dynamicItem = new StaticTextItem("dynamicItem",
"Dynamic?");
+ dynamicItem.setValue((group.getGroupDefinition() != null) ? "yes" :
"no");
+ formItems.add(dynamicItem);
+ itemIds.add(dynamicItem.getName());
+
+ StaticTextItem recursiveItem = new StaticTextItem("recursiveItem",
"Recursive?");
+ recursiveItem.setValue((group.isRecursive()) ? "yes" :
"no");
+ formItems.add(recursiveItem);
+ itemIds.add(recursiveItem.getName());
+
+ StaticTextItem createdItem = new StaticTextItem("createdItem",
"Created");
+ createdItem.setValue(new Date(group.getCtime()));
+ formItems.add(createdItem);
+ itemIds.add(createdItem.getName());
+
+ StaticTextItem lastModifiedItem = new
StaticTextItem("lastModifiedItem", "Last Modified");
+ lastModifiedItem.setValue(new Date(group.getMtime()));
+ formItems.add(lastModifiedItem);
+ itemIds.add(lastModifiedItem.getName());
+
+ StaticTextItem lastModifiedByItem = new
StaticTextItem("lastModifiedByItem", "Last Modified By");
+ lastModifiedByItem.setValue(group.getModifiedBy());
+ formItems.add(lastModifiedByItem);
+ itemIds.add(lastModifiedByItem.getName());
+
+ StaticTextItem groupDefinitionItem = new
StaticTextItem("groupDefinitionItem", "Group Definition");
+ GroupDefinition groupDefinition = group.getGroupDefinition();
+ // TODO (ips): Make this a link to the group def.
+ groupDefinitionItem.setValue((groupDefinition != null) ?
groupDefinition.getName() : "<i>none</i>");
+ formItems.add(groupDefinitionItem);
+ itemIds.add(groupDefinitionItem.getName());
+
+ generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()]));
+ addMember(generalPropsForm);
- // TODO: Group general properties go here.
-
+ if (groupDefinition != null) {
+ spacer = new HLayout();
+ spacer.setHeight(10);
+ addMember(spacer);
+
+ HTMLFlow note = new HTMLFlow();
+ note.setContents("<b>*</b> Dynamic group names and
descriptions are managed, and therefore are not editable.");
+ note.setAlign(Alignment.CENTER);
+ addMember(note);
+ }
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
index 981fb60..6f1228c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java
@@ -144,7 +144,6 @@ public class ResourceSummaryView extends DynamicForm implements
ResourceSelectLi
formItems.add(descriptionItem);
itemIds.add(descriptionItem.getName());
-
StaticTextItem versionItem = new StaticTextItem("versionItem",
"Version");
formItems.add(versionItem);
itemIds.add(versionItem.getName());
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
index 48e9961..67326c1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java
@@ -22,6 +22,7 @@ import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria;
import org.rhq.core.domain.resource.group.GroupDefinition;
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.gwt.ResourceGroupGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
@@ -39,13 +40,15 @@ public class ResourceGroupGWTServiceImpl extends
AbstractGWTServiceImpl implemen
private ResourceGroupManagerLocal groupManager =
LookupUtil.getResourceGroupManager();
private GroupDefinitionManagerLocal definitionManager =
LookupUtil.getGroupDefinitionManager();
-
public PageList<ResourceGroup>
findResourceGroupsByCriteria(ResourceGroupCriteria criteria) {
return
SerialUtility.prepare(groupManager.findResourceGroupsByCriteria(getSessionSubject(),
criteria),
"ResourceGroupService.findResourceGroupsByCriteria");
}
- // TODO GH: build and expose findResourceGroupCompositesByCriteria
+ public PageList<ResourceGroupComposite>
findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria) {
+ return
SerialUtility.prepare(groupManager.findResourceGroupCompositesByCriteria(getSessionSubject(),
criteria),
+ "ResourceGroupService.findResourceGroupCompositesByCriteria");
+ }
public PageList<GroupDefinition>
findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria) {
return
SerialUtility.prepare(definitionManager.findGroupDefinitionsByCriteria(getSessionSubject(),
criteria),
commit 14cb5621315e2cfecdad8bb54c8d995b95340820
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:26:56 2010 -0400
Group List View and Create Wizard Work
- converted group list view to extend Table instead of VLayout with single table
- added group delete to list view
- changed button and confirm text for consistency (now like bundle buttons)
- removed checkboxes from list view
- added some core gui refresh to list view
- simplified wizard invoke style
- left justify create step and increase text box sizes
- improve Next/Previous handling
- respect selected compatible type on member selection page
- fetch only the required resources for compatible group member select
- fix issues with member filtering
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 f29a064..8171d96 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
@@ -18,51 +18,52 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
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.components.wizard.WizardView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/**
* @author Greg Hinkle
*/
-public class ResourceGroupListView extends VLayout {
-
- private Table table;
+public class ResourceGroupListView extends Table {
public ResourceGroupListView() {
- this(null);
-
+ super("Resource Groups");
+ setWidth100();
+ setHeight100();
}
- /**
- * Resource Group list filtered by a given criteria
- * @param criteria
- */
public ResourceGroupListView(Criteria criteria) {
+ super("Resource Groups", criteria);
+ }
- setWidth100();
- setHeight100();
+ @Override
+ protected void onInit() {
+ super.onInit();
- final ResourceGroupsDataSource datasource =
ResourceGroupsDataSource.getInstance();
+ // setHeaderIcon("?_24.png");
- table = new Table("Resource Groups", criteria);
- table.setDataSource(datasource);
+ final ResourceGroupsDataSource datasource =
ResourceGroupsDataSource.getInstance();
+ setDataSource(datasource);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE);
- table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
- table.getListGrid().setResizeFieldsInRealTime(true);
+ getListGrid().setSelectionType(SelectionStyle.SIMPLE);
+ //table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
@@ -81,26 +82,38 @@ public class ResourceGroupListView extends VLayout {
ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
availabilityField.setAlign(Alignment.CENTER);
- table.getListGrid().setFields(idField, nameField, descriptionField,
typeNameField, pluginNameField,
- categoryField, availabilityField);
-
- table.addTableAction("Delete Groups", Table.SelectionEnablement.ANY,
- "Are you sure you want to delete # groups?", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- // TODO: Implement this method.
+ getListGrid().setFields(idField, nameField, descriptionField, typeNameField,
pluginNameField, categoryField,
+ availabilityField);
+
+ addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected resource groups?",
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selections) {
+ ResourceGroupsDataSource ds = (ResourceGroupsDataSource)
getDataSource();
+ for (ListGridRecord selection : selections) {
+ ResourceGroupGWTServiceAsync resourceGroupManager =
GWTServiceLookup.getResourceGroupService();
+ final ResourceGroup object = ds.copyValues(selection);
+ resourceGroupManager.deleteResourceGroup(object.getId(), new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+ "Failed to delete resource group [" +
object.getName() + "]", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Deleted resource group [" +
object.getName() + "]", Severity.Info));
+
+ CoreGUI.refresh();
+ }
+ });
+ }
}
});
- table.addTableAction("New Group", new TableAction() {
+ addTableAction("New", new TableAction() {
public void executeAction(ListGridRecord[] selection) {
- WizardView view = new WizardView(new GroupCreateWizard());
- view.displayDialog();
+ new GroupCreateWizard().startBundleWizard();
}
});
-
-
- addMember(table);
-
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
index debe24d..aaaaeaa 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
@@ -28,6 +28,7 @@ import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageList;
@@ -115,7 +116,24 @@ public class ResourceGroupsDataSource extends
RPCDataSource<ResourceGroup> {
@Override
public ResourceGroup copyValues(ListGridRecord from) {
- return null; // TODO: Implement this method.
+ Integer idAttrib = from.getAttributeAsInt("id");
+ String nameAttrib = from.getAttribute("name");
+ String descriptionAttrib = from.getAttribute("description");
+ String typeNameAttrib = from.getAttribute("typeName");
+ String pluginNameAttrib = from.getAttribute("pluginName");
+ ResourceType rt = null;
+
+ ResourceGroup rg = new ResourceGroup(nameAttrib);
+ rg.setId(idAttrib);
+ rg.setDescription(descriptionAttrib);
+ if (null != typeNameAttrib) {
+ rt = new ResourceType();
+ rt.setName(typeNameAttrib);
+ rt.setPlugin(pluginNameAttrib);
+ rg.setResourceType(rt);
+ }
+
+ return rg;
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
index 96b6017..032cc75 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
@@ -52,19 +52,22 @@ public class GroupCreateStep extends AbstractWizardStep {
form = new DynamicForm();
form.setValuesManager(new ValuesManager());
- form.setNumCols(4);
+ form.setWidth100();
+ form.setNumCols(2);
TextItem name = new TextItem("name", "Name");
name.setRequired(true);
-
- TextItem location = new TextItem("location",
"Location");
+ name.setWidth(300);
TextAreaItem description = new AutoFitTextAreaItem("description",
"Description");
+ description.setWidth(300);
+
+ TextItem location = new TextItem("location",
"Location");
+ location.setWidth(300);
CheckboxItem recursive = new CheckboxItem("recursive",
"Recursive");
LinkedHashMap<String, Canvas> options = new LinkedHashMap<String,
Canvas>();
-
options.put("Mixed", null);
IPickTreeItem typeSelectItem = new IPickTreeItem("type",
"Type");
@@ -81,16 +84,25 @@ public class GroupCreateStep extends AbstractWizardStep {
options.put("Compatible", form2);
RadioGroupWithComponentsItem kind = new
RadioGroupWithComponentsItem("kind", "Group Type", options, form);
- kind.setValue("Mixed Resources");
+ kind.setValue("Mixed");
- form.setFields(name, location, description, recursive, kind);
+ form.setFields(name, description, location, recursive, kind);
}
return form;
}
public boolean nextPage() {
- return form.validate();
+ boolean valid = form.validate();
+ if (valid) {
+ RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem)
form.getField("kind");
+ if ("Compatible".equals(kind.getSelected())) {
+ DynamicForm form2 = (DynamicForm) kind.getSelectedComponent();
+ valid = (null != form2.getValue("type"));
+ }
+ }
+
+ return valid;
}
public String getName() {
@@ -103,11 +115,16 @@ public class GroupCreateStep extends AbstractWizardStep {
group.setLocation(form.getValueAsString("location"));
group.setRecursive(form.getValue("recursive") != null ? true : false);
- if (form.getValue("type") != null) {
- ResourceType type = new ResourceType();
- type.setId(Integer.parseInt(form.getValueAsString("type")));
- group.setResourceType(type);
+ RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem)
form.getField("kind");
+ if ("Compatible".equals(kind.getSelected())) {
+ DynamicForm form2 = (DynamicForm) kind.getSelectedComponent();
+ if (null != form2.getValue("type")) {
+ ResourceType rt = new ResourceType();
+ rt.setId(Integer.parseInt(form2.getValueAsString("type")));
+ group.setResourceType(rt);
+ }
}
+
return group;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 4c8b074..55d1588 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -28,6 +28,7 @@ import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.IButton;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
@@ -68,6 +69,18 @@ public class GroupCreateWizard extends AbstractWizard {
return null; // TODO: Implement this method.
}
+ /**
+ * @return only the rt id is set
+ */
+ public ResourceType getCompatibleGroupResourceType() {
+ ResourceGroup rg = createStep.getGroup();
+ ResourceType rt = null;
+ if (null != rg) {
+ rt = rg.getResourceType();
+ }
+ return rt;
+ }
+
public void cancel() {
// TODO: Implement this method.
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
index 5f13657..cc79abc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
@@ -26,6 +26,7 @@ import java.util.HashSet;
import com.smartgwt.client.widgets.Canvas;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
@@ -34,16 +35,20 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.Resour
*/
public class GroupMembersStep extends AbstractWizardStep {
- private GroupCreateWizard wizard;
- private ResourceSelector selector;
+ private GroupCreateWizard wizard = null;
+ private ResourceSelector selector = null;
+ private ResourceType requireType = null;
public GroupMembersStep(GroupCreateWizard wizard) {
this.wizard = wizard;
}
public Canvas getCanvas() {
- if (selector == null) {
+ ResourceType rt = wizard.getCompatibleGroupResourceType();
+ if ((selector == null) || (rt != requireType)) {
selector = new ResourceSelector();
+ requireType = rt;
+ selector.setRequireType(rt);
}
return selector;
}
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 af8931b..c0731b8 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
@@ -98,6 +98,24 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
public void executeFetch(final DSRequest request, final DSResponse response) {
+ ResourceCriteria criteria = getFetchCriteria(request);
+
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to fetch resource
data", caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+
+ dataRetrieved(result, response, request);
+ }
+ });
+ }
+
+ protected ResourceCriteria getFetchCriteria(final DSRequest request) {
+
ResourceCriteria criteria = new ResourceCriteria();
criteria.setPageControl(getPageControl(request));
@@ -164,18 +182,7 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
criteria.addFilterTagName((String)
request.getCriteria().getValues().get("tagName"));
}
- resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to fetch resource
data", caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(PageList<Resource> result) {
-
- dataRetrieved(result, response, request);
- }
- });
+ return criteria;
}
@Override
@@ -221,7 +228,7 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
record.setAttribute("id", from.getId());
record.setAttribute(NAME.propertyName(), from.getName());
record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
- record.setAttribute(TYPE.propertyName(), from.getResourceType().getName());
+ record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
record.setAttribute(CATEGORY.propertyName(),
from.getResourceType().getCategory().getDisplayName());
record.setAttribute("icon",
from.getResourceType().getCategory().getDisplayName() + "_"
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index 1274e14..0d25f38 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -18,12 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
+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 java.util.ArrayList;
import java.util.Collection;
import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.Criterion;
+import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.IPickTreeItem;
@@ -31,7 +37,9 @@ import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
@@ -42,18 +50,18 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class ResourceSelector extends AbstractSelector<Resource> {
- private Integer requireTypeId;
+ private ResourceType requireType;
public ResourceSelector() {
super();
}
- public Integer getRequireTypeId() {
- return requireTypeId;
+ public ResourceType getRequireType() {
+ return requireType;
}
- public void setRequireTypeId(Integer requireTypeId) {
- this.requireTypeId = requireTypeId;
+ public void setRequireType(ResourceType requireType) {
+ this.requireType = requireType;
markForRedraw();
}
@@ -70,10 +78,15 @@ public class ResourceSelector extends AbstractSelector<Resource>
{
typeSelectItem.setEmptyMenuMessage("Loading...");
typeSelectItem.setShowIcons(true);
- if (requireTypeId != null) {
- typeSelectItem.setValue(requireTypeId);
- typeSelectItem.setDisabled(true);
- availableFilterForm.setItems(search, typeSelectItem);
+ if (requireType != null) {
+ // TODO: Currently ignore the typeSelectItem widget because we already know
the type.
+ // Alternatively, we could display it disabled but we'd want the type
name to be displayed as the
+ // value. To get this to display the type name I think we need to pre-fetch
the type tree here. We could
+ // potentially optimize typeSelectItem.setValue(requireType.getId()) to build
a tree that includes only
+ // this single type.
+ //typeSelectItem.setValue(requireType.getId());
+ //typeSelectItem.setDisabled(true);
+ availableFilterForm.setItems(search);
} else {
SelectItem categorySelect = new SelectItem("category",
"Category");
categorySelect.setValueMap("Platform", "Server",
"Service");
@@ -91,23 +104,23 @@ public class ResourceSelector extends
AbstractSelector<Resource> {
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
String search = (String) availableFilterForm.getValue("search");
- String type = (String) availableFilterForm.getValue("type");
+ String type = availableFilterForm.getValueAsString("type");
String category = (String) availableFilterForm.getValue("category");
ArrayList<Criterion> criteria = new ArrayList<Criterion>(3);
if (null != search) {
- criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
+ criteria.add(new Criterion(NAME.propertyName(), OperatorId.CONTAINS,
search));
}
if (null != type) {
// If type is a number its a typeId, otherwise a plugin name
try {
Integer.parseInt(type);
- criteria.add(new Criterion("type", OperatorId.EQUALS, type));
+ criteria.add(new Criterion(TYPE.propertyName(), OperatorId.EQUALS,
type));
} catch (NumberFormatException nfe) {
- criteria.add(new Criterion("plugin", OperatorId.EQUALS,
type));
+ criteria.add(new Criterion(PLUGIN.propertyName(), OperatorId.EQUALS,
type));
}
}
if (null != category) {
- criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ criteria.add(new Criterion(CATEGORY.propertyName(), OperatorId.EQUALS,
category));
}
AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
.size()]));
@@ -127,5 +140,21 @@ public class ResourceSelector extends
AbstractSelector<Resource> {
}
return records;
}
+
+ @Override
+ protected ResourceCriteria getFetchCriteria(final DSRequest request) {
+ ResourceCriteria result = super.getFetchCriteria(request);
+
+ // additional filters
+ if (null != requireType) {
+ result.addFilterResourceTypeId(requireType.getId());
+ }
+
+ // additional return data
+ result.fetchResourceType(true);
+
+ return result;
+ }
+
}
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
index c6499a3..156119e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
@@ -1,9 +1,9 @@
-<html>
- <head>
- <meta http-equiv="Refresh" content="0;
URL=/coregui/CoreGUI.html#Dashboard"/>
- </head>
- <body>
- <p>Redirecting to <a
href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p>
- </body>
-</html>
-
+<html>
+ <head>
+ <meta http-equiv="Refresh" content="0;
URL=/coregui/CoreGUI.html#Dashboard"/>
+ </head>
+ <body>
+ <p>Redirecting to <a
href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p>
+ </body>
+</html>
+
commit ab5237ba41268de18da049c127ad1d83a380378b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:18:03 2010 -0400
cosmetic changes only
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
index 227e783..03a2198 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
@@ -22,8 +22,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.ListIterator;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
@@ -48,7 +46,6 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
*/
public class ResourceTypePluginTreeDataSource extends DataSource {
-
private ResourceTypeGWTServiceAsync resourceTypeService =
GWTServiceLookup.getResourceTypeGWTService();
public ResourceTypePluginTreeDataSource() {
@@ -57,7 +54,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setDataProtocol(DSProtocol.CLIENTCUSTOM);
setDataFormat(DSDataFormat.CUSTOM);
-
DataSourceTextField idField = new DataSourceTextField("id",
"ID");
idField.setPrimaryKey(true);
@@ -70,7 +66,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
DataSourceTextField resourceTypeField = new
DataSourceTextField("category", "Category");
-
setFields(idField, parentIdField, resourceNameField, resourceKeyField,
resourceTypeField);
}
@@ -80,17 +75,16 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
// Asume success
response.setStatus(0);
switch (request.getOperationType()) {
- case FETCH:
- executeFetch(request, response);
- break;
- default:
- break;
+ case FETCH:
+ executeFetch(request, response);
+ break;
+ default:
+ break;
}
return request.getData();
}
-
protected void executeFetch(final DSRequest request, final DSResponse response) {
String parentIdString =
request.getCriteria().getAttributeAsString("parentId");
@@ -98,26 +92,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
processResponse(request.getRequestId(), response);
} else {
-
ResourceTypeCriteria criteria = new ResourceTypeCriteria();
criteria.fetchParentResourceTypes(true);
criteria.setPageControl(PageControl.getUnlimitedInstance());
- resourceTypeService.findResourceTypesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceType>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load
resource type tree data", caught);
- }
-
- public void onSuccess(PageList<ResourceType> result) {
- response.setData(buildNodes(result));
- processResponse(request.getRequestId(), response);
- }
- });
+ resourceTypeService.findResourceTypesByCriteria(criteria, new
AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load resource
type tree data", caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+ response.setData(buildNodes(result));
+ processResponse(request.getRequestId(), response);
+ }
+ });
}
}
-
public static TreeNode[] buildNodes(PageList<ResourceType> result) {
HashMap<String, PluginTreeNode> pluginNodes = new HashMap<String,
PluginTreeNode>();
@@ -127,12 +118,11 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
if (type.getParentResourceTypes() == null ||
type.getParentResourceTypes().isEmpty()) {
PluginTreeNode pluginNode = pluginNodes.get(type.getPlugin());
- if (pluginNode == null) {
- pluginNode = new PluginTreeNode(type.getPlugin());
- pluginNodes.put(type.getPlugin(), pluginNode);
- nodes.add(pluginNode);
- }
-
+ if (pluginNode == null) {
+ pluginNode = new PluginTreeNode(type.getPlugin());
+ pluginNodes.put(type.getPlugin(), pluginNode);
+ nodes.add(pluginNode);
+ }
nodes.add(new ResourceTypeTreeNode(type, type.getPlugin()));
} else {
@@ -152,7 +142,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
return treeNodes;
}
-
/**
* Returns a prepopulated PageControl based on the provided DSRequest. This will set
sort fields,
* pagination, but *not* filter fields.
@@ -166,7 +155,8 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
if (request.getStartRow() == null || request.getEndRow() == null) {
pageControl = new PageControl();
} else {
- pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow() - request.getStartRow());
+ pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow()
+ - request.getStartRow());
}
// Initialize sorting.
@@ -183,7 +173,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
return pageControl;
}
-
public static class PluginTreeNode extends TreeNode {
String id;
@@ -195,19 +184,22 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setParentID(null);
setAttribute("name", pluginName + " Plugin");
-// setAttribute("plugin",pluginName);
+ // setAttribute("plugin",pluginName);
setIcon("types/plugin_16.png"); // todo doesn't work
setEnabled(true);
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
PluginTreeNode that = (PluginTreeNode) o;
- if (!id.equals(that.id)) return false;
+ if (!id.equals(that.id))
+ return false;
return true;
}
@@ -245,20 +237,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setIsFolder(true);
}
-
public ResourceType getResourceType() {
return resourceType;
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
ResourceTypeTreeNode that = (ResourceTypeTreeNode) o;
- if (!id.equals(that.id)) return false;
- if (parentId != null ? !parentId.equals(that.parentId) : that.parentId !=
null) return false;
+ if (!id.equals(that.id))
+ return false;
+ if (parentId != null ? !parentId.equals(that.parentId) : that.parentId !=
null)
+ return false;
return true;
}
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 9d354f4..d761dbd 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
@@ -18,36 +18,16 @@
*/
package org.rhq.enterprise.gui.coregui.client.menu;
-import com.google.gwt.dom.client.Document;
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.Window;
import com.google.gwt.user.client.ui.Hyperlink;
-import com.smartgwt.client.types.ContentsType;
-import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.DrawEvent;
-import com.smartgwt.client.widgets.events.DrawHandler;
-import com.smartgwt.client.widgets.events.ShowContextMenuEvent;
-import com.smartgwt.client.widgets.events.ShowContextMenuHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuBar;
-import com.smartgwt.client.widgets.menu.MenuItem;
-import com.smartgwt.client.widgets.menu.MenuItemSeparator;
-import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
/**
@@ -57,13 +37,12 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard",
"Inventory", "Reports", "Bundles",
"Administration"};
+ public static final String[] SECTIONS = { "Dashboard",
"Inventory", "Reports", "Bundles",
"Administration" };
private String selected = "Dashboard";
private HTMLFlow linksPane;
-
protected void onDraw() {
super.onDraw();
@@ -81,7 +60,6 @@ public class MenuBarView extends VLayout {
}
});
-
ToolStrip topStrip = new ToolStrip();
topStrip.setHeight(34);
topStrip.setWidth100();
@@ -104,16 +82,16 @@ public class MenuBarView extends VLayout {
topStrip.addMember(new LayoutSpacer());
- HLayout helpLayout = new HLayout();
-// Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
-// loggedInAs.setWrap(false);
-// loggedInAs.setValign(VerticalAlignment.CENTER);
-// helpLayout.addMember(loggedInAs);
+ //HLayout helpLayout = new HLayout();
+ // Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
+ // loggedInAs.setWrap(false);
+ // loggedInAs.setValign(VerticalAlignment.CENTER);
+ // helpLayout.addMember(loggedInAs);
topStrip.addMember(new Hyperlink("Help", "Help"));
topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
-// helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
-// topStrip.addMember(helpLayout);
+ // helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
+ // topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm();
links.setNumCols(SECTIONS.length * 2);
@@ -148,7 +126,7 @@ public class MenuBarView extends VLayout {
private String setupLinks() {
StringBuilder headerString = new StringBuilder(
- "<table style=\"height: 34px;\"
cellpadding=\"0\" cellspacing=\"0\"><tr>");
+ "<table style=\"height: 34px;\" cellpadding=\"0\"
cellspacing=\"0\"><tr>");
boolean first = true;
for (String section : SECTIONS) {
@@ -162,7 +140,8 @@ public class MenuBarView extends VLayout {
styleClass += "Selected";
}
- headerString.append("<td class=\"" + styleClass +
"\" onclick=\"document.location='#" + section + "'\"
>");
+ headerString.append("<td id=\"" + section + "\"
class=\"" + styleClass
+ + "\" onclick=\"document.location='#" + section +
"'\" >");
headerString.append(section);
headerString.append("</td>\n");
@@ -174,5 +153,4 @@ public class MenuBarView extends VLayout {
return headerString.toString();
}
-
}
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 a288517..95436d4 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
@@ -20,11 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.util;
import java.util.Collection;
-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 com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSource;
@@ -32,6 +27,10 @@ import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.DSProtocol;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+
/**
* Base GWT-RPC oriented DataSource class.
*
@@ -59,21 +58,21 @@ public abstract class RPCDataSource<T> extends DataSource {
DSResponse response = createResponse(request);
switch (request.getOperationType()) {
- case FETCH:
- executeFetch(request, response);
- break;
- case ADD:
- executeAdd(request, response);
- break;
- case UPDATE:
- executeUpdate(request, response);
- break;
- case REMOVE:
- executeRemove(request, response);
- break;
- default:
- super.transformRequest(request);
- break;
+ case FETCH:
+ executeFetch(request, response);
+ break;
+ case ADD:
+ executeAdd(request, response);
+ break;
+ case UPDATE:
+ executeUpdate(request, response);
+ break;
+ case REMOVE:
+ executeRemove(request, response);
+ break;
+ default:
+ super.transformRequest(request);
+ break;
}
} catch (Throwable t) {
CoreGUI.getErrorHandler().handleError("Failure in datasource [" +
request.getOperationType() + "]", t);
@@ -95,7 +94,8 @@ public abstract class RPCDataSource<T> extends DataSource {
if (request.getStartRow() == null || request.getEndRow() == null) {
pageControl = new PageControl();
} else {
- pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow() - request.getStartRow());
+ pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow()
+ - request.getStartRow());
}
// Initialize sorting.
@@ -112,7 +112,6 @@ public abstract class RPCDataSource<T> extends DataSource {
return pageControl;
}
-
public ListGridRecord[] buildRecords(Collection<T> list) {
if (list == null) {
return null;
@@ -126,7 +125,6 @@ public abstract class RPCDataSource<T> extends DataSource {
return records;
}
-
/**
* Extensions should implement this method to retrieve data. Paging solutions should
use
* {@link #getPageControl(com.smartgwt.client.data.DSRequest)}. All implementations
should call processResponse()
@@ -138,12 +136,10 @@ public abstract class RPCDataSource<T> extends DataSource {
*/
protected abstract void executeFetch(final DSRequest request, final DSResponse
response);
-
public abstract T copyValues(ListGridRecord from);
public abstract ListGridRecord copyValues(T from);
-
/**
* Executed on <code>REMOVE</code> operation. <code>processResponse
(requestId, response)</code>
* should be called when operation completes (either successful or failure).
commit 622cb7544ac6e28d4557a68e9f57420387d9c5de
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:14:32 2010 -0400
cosmetic changes only
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 3dc9f4c..8b2726c 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
@@ -18,15 +18,11 @@
*/
package org.rhq.enterprise.gui.coregui.client.bundle.list;
-import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle;
import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite;
@@ -63,7 +59,6 @@ public class BundlesListView extends Table {
setHeaderIcon("subsystems/bundle/Bundle_24.png");
-
setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60");
@@ -71,27 +66,26 @@ public class BundlesListView extends Table {
getListGrid().getField("link").setType(ListGridFieldType.LINK);
getListGrid().getField("link").setTarget("_self");
-// getListGrid().getField("name").setCellFormatter(new CellFormatter()
{
-// public String format(Object o, ListGridRecord listGridRecord, int i, int
i1) {
-// return "";//<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
-// }
-// });
+ // getListGrid().getField("name").setCellFormatter(new
CellFormatter() {
+ // public String format(Object o, ListGridRecord listGridRecord, int
i, int i1) {
+ // return "";//<a href=\"#Bundles/Bundle/"
+ listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
+ // }
+ // });
getListGrid().getField("description").setWidth("25%");
getListGrid().getField("latestVersion").setWidth("25%");
getListGrid().getField("versionsCount").setWidth("*");
getListGrid().setSelectionType(SelectionStyle.SIMPLE);
-// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
addTableAction("New", Table.SelectionEnablement.ALWAYS, null, new
TableAction() {
public void executeAction(ListGridRecord[] selection) {
new BundleCreateWizard().startBundleWizard();
-
}
});
- addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected bundle?", new TableAction() {
+ addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected bundles?", new TableAction() {
public void executeAction(ListGridRecord[] selections) {
BundlesWithLatestVersionDataSource ds =
(BundlesWithLatestVersionDataSource) getDataSource();
for (ListGridRecord selection : selections) {
@@ -148,7 +142,6 @@ public class BundlesListView extends Table {
});
}
-
public int getMatches() {
return this.getListGrid().getTotalRows();
}
commit c955fb2c40e390155061148cfd3a29b1f3d86d30
Merge: 26a4756... 370ab8f...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:30:02 2010 -0400
Merge branch 'master' into master-jay
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
commit 370ab8f832b9297e15f11bc025dd7463fecaa93e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:28:24 2010 -0400
Line terminator commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
index c6499a3..156119e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
@@ -1,9 +1,9 @@
-<html>
- <head>
- <meta http-equiv="Refresh" content="0;
URL=/coregui/CoreGUI.html#Dashboard"/>
- </head>
- <body>
- <p>Redirecting to <a
href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p>
- </body>
-</html>
-
+<html>
+ <head>
+ <meta http-equiv="Refresh" content="0;
URL=/coregui/CoreGUI.html#Dashboard"/>
+ </head>
+ <body>
+ <p>Redirecting to <a
href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p>
+ </body>
+</html>
+
commit 26a47567f821070bd960de598effdf0000976d33
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:26:56 2010 -0400
Group List View and Create Wizard Work
- converted group list view to extend Table instead of VLayout with single table
- added group delete to list view
- changed button and confirm text for consistency (now like bundle buttons)
- removed checkboxes from list view
- added some core gui refresh to list view
- simplified wizard invoke style
- left justify create step and increase text box sizes
- improve Next/Previous handling
- respect selected compatible type on member selection page
- fetch only the required resources for compatible group member select
- fix issues with member filtering
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 d66a328..8171d96 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
@@ -18,50 +18,52 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
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.components.wizard.WizardView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/**
* @author Greg Hinkle
*/
-public class ResourceGroupListView extends VLayout {
-
- private Table table;
+public class ResourceGroupListView extends Table {
public ResourceGroupListView() {
- this(null);
-
+ super("Resource Groups");
+ setWidth100();
+ setHeight100();
}
- /**
- * Resource Group list filtered by a given criteria
- * @param criteria
- */
public ResourceGroupListView(Criteria criteria) {
+ super("Resource Groups", criteria);
+ }
- setWidth100();
- setHeight100();
+ @Override
+ protected void onInit() {
+ super.onInit();
- final ResourceGroupsDataSource datasource =
ResourceGroupsDataSource.getInstance();
+ // setHeaderIcon("?_24.png");
- table = new Table("Resource Groups", criteria);
- table.setDataSource(datasource);
+ final ResourceGroupsDataSource datasource =
ResourceGroupsDataSource.getInstance();
+ setDataSource(datasource);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE);
- table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
- table.getListGrid().setResizeFieldsInRealTime(true);
+ getListGrid().setSelectionType(SelectionStyle.SIMPLE);
+ //table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
@@ -80,26 +82,38 @@ public class ResourceGroupListView extends VLayout {
ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
availabilityField.setAlign(Alignment.CENTER);
- table.getListGrid().setFields(idField, nameField, descriptionField,
typeNameField, pluginNameField,
- categoryField, availabilityField);
-
- table.addTableAction("Delete Groups", Table.SelectionEnablement.ANY,
- "Are you sure you want to delete # groups?", new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- // TODO: Implement this method.
+ getListGrid().setFields(idField, nameField, descriptionField, typeNameField,
pluginNameField, categoryField,
+ availabilityField);
+
+ addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected resource groups?",
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selections) {
+ ResourceGroupsDataSource ds = (ResourceGroupsDataSource)
getDataSource();
+ for (ListGridRecord selection : selections) {
+ ResourceGroupGWTServiceAsync resourceGroupManager =
GWTServiceLookup.getResourceGroupService();
+ final ResourceGroup object = ds.copyValues(selection);
+ resourceGroupManager.deleteResourceGroup(object.getId(), new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(
+ "Failed to delete resource group [" +
object.getName() + "]", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Deleted resource group [" +
object.getName() + "]", Severity.Info));
+
+ CoreGUI.refresh();
+ }
+ });
+ }
}
});
- table.addTableAction("New Group", new TableAction() {
+ addTableAction("New", new TableAction() {
public void executeAction(ListGridRecord[] selection) {
- WizardView view = new WizardView(new GroupCreateWizard());
- view.displayDialog();
+ new GroupCreateWizard().startBundleWizard();
}
});
-
-
- addMember(table);
-
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
index debe24d..aaaaeaa 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
@@ -28,6 +28,7 @@ import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageList;
@@ -115,7 +116,24 @@ public class ResourceGroupsDataSource extends
RPCDataSource<ResourceGroup> {
@Override
public ResourceGroup copyValues(ListGridRecord from) {
- return null; // TODO: Implement this method.
+ Integer idAttrib = from.getAttributeAsInt("id");
+ String nameAttrib = from.getAttribute("name");
+ String descriptionAttrib = from.getAttribute("description");
+ String typeNameAttrib = from.getAttribute("typeName");
+ String pluginNameAttrib = from.getAttribute("pluginName");
+ ResourceType rt = null;
+
+ ResourceGroup rg = new ResourceGroup(nameAttrib);
+ rg.setId(idAttrib);
+ rg.setDescription(descriptionAttrib);
+ if (null != typeNameAttrib) {
+ rt = new ResourceType();
+ rt.setName(typeNameAttrib);
+ rt.setPlugin(pluginNameAttrib);
+ rg.setResourceType(rt);
+ }
+
+ return rg;
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
index 96b6017..032cc75 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
@@ -52,19 +52,22 @@ public class GroupCreateStep extends AbstractWizardStep {
form = new DynamicForm();
form.setValuesManager(new ValuesManager());
- form.setNumCols(4);
+ form.setWidth100();
+ form.setNumCols(2);
TextItem name = new TextItem("name", "Name");
name.setRequired(true);
-
- TextItem location = new TextItem("location",
"Location");
+ name.setWidth(300);
TextAreaItem description = new AutoFitTextAreaItem("description",
"Description");
+ description.setWidth(300);
+
+ TextItem location = new TextItem("location",
"Location");
+ location.setWidth(300);
CheckboxItem recursive = new CheckboxItem("recursive",
"Recursive");
LinkedHashMap<String, Canvas> options = new LinkedHashMap<String,
Canvas>();
-
options.put("Mixed", null);
IPickTreeItem typeSelectItem = new IPickTreeItem("type",
"Type");
@@ -81,16 +84,25 @@ public class GroupCreateStep extends AbstractWizardStep {
options.put("Compatible", form2);
RadioGroupWithComponentsItem kind = new
RadioGroupWithComponentsItem("kind", "Group Type", options, form);
- kind.setValue("Mixed Resources");
+ kind.setValue("Mixed");
- form.setFields(name, location, description, recursive, kind);
+ form.setFields(name, description, location, recursive, kind);
}
return form;
}
public boolean nextPage() {
- return form.validate();
+ boolean valid = form.validate();
+ if (valid) {
+ RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem)
form.getField("kind");
+ if ("Compatible".equals(kind.getSelected())) {
+ DynamicForm form2 = (DynamicForm) kind.getSelectedComponent();
+ valid = (null != form2.getValue("type"));
+ }
+ }
+
+ return valid;
}
public String getName() {
@@ -103,11 +115,16 @@ public class GroupCreateStep extends AbstractWizardStep {
group.setLocation(form.getValueAsString("location"));
group.setRecursive(form.getValue("recursive") != null ? true : false);
- if (form.getValue("type") != null) {
- ResourceType type = new ResourceType();
- type.setId(Integer.parseInt(form.getValueAsString("type")));
- group.setResourceType(type);
+ RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem)
form.getField("kind");
+ if ("Compatible".equals(kind.getSelected())) {
+ DynamicForm form2 = (DynamicForm) kind.getSelectedComponent();
+ if (null != form2.getValue("type")) {
+ ResourceType rt = new ResourceType();
+ rt.setId(Integer.parseInt(form2.getValueAsString("type")));
+ group.setResourceType(rt);
+ }
}
+
return group;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 4c8b074..55d1588 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -28,6 +28,7 @@ import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.IButton;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
@@ -68,6 +69,18 @@ public class GroupCreateWizard extends AbstractWizard {
return null; // TODO: Implement this method.
}
+ /**
+ * @return only the rt id is set
+ */
+ public ResourceType getCompatibleGroupResourceType() {
+ ResourceGroup rg = createStep.getGroup();
+ ResourceType rt = null;
+ if (null != rg) {
+ rt = rg.getResourceType();
+ }
+ return rt;
+ }
+
public void cancel() {
// TODO: Implement this method.
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
index 5f13657..cc79abc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
@@ -26,6 +26,7 @@ import java.util.HashSet;
import com.smartgwt.client.widgets.Canvas;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
@@ -34,16 +35,20 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.Resour
*/
public class GroupMembersStep extends AbstractWizardStep {
- private GroupCreateWizard wizard;
- private ResourceSelector selector;
+ private GroupCreateWizard wizard = null;
+ private ResourceSelector selector = null;
+ private ResourceType requireType = null;
public GroupMembersStep(GroupCreateWizard wizard) {
this.wizard = wizard;
}
public Canvas getCanvas() {
- if (selector == null) {
+ ResourceType rt = wizard.getCompatibleGroupResourceType();
+ if ((selector == null) || (rt != requireType)) {
selector = new ResourceSelector();
+ requireType = rt;
+ selector.setRequireType(rt);
}
return selector;
}
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 49ec0e4..03deb9b 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
@@ -98,6 +98,24 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
public void executeFetch(final DSRequest request, final DSResponse response) {
+ ResourceCriteria criteria = getFetchCriteria(request);
+
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to fetch resource
data", caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+
+ dataRetrieved(result, response, request);
+ }
+ });
+ }
+
+ protected ResourceCriteria getFetchCriteria(final DSRequest request) {
+
ResourceCriteria criteria = new ResourceCriteria();
criteria.setPageControl(getPageControl(request));
@@ -158,18 +176,7 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
criteria.addFilterTagName((String)
request.getCriteria().getValues().get("tagName"));
}
- resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to fetch resource
data", caught);
- response.setStatus(RPCResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
-
- public void onSuccess(PageList<Resource> result) {
-
- dataRetrieved(result, response, request);
- }
- });
+ return criteria;
}
@Override
@@ -215,7 +222,7 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
record.setAttribute("id", from.getId());
record.setAttribute(NAME.propertyName(), from.getName());
record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
- record.setAttribute(TYPE.propertyName(), from.getResourceType().getName());
+ record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
record.setAttribute(CATEGORY.propertyName(),
from.getResourceType().getCategory().getDisplayName());
record.setAttribute("icon",
from.getResourceType().getCategory().getDisplayName() + "_"
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index 1274e14..0d25f38 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -18,12 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
+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 java.util.ArrayList;
import java.util.Collection;
import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.Criterion;
+import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.IPickTreeItem;
@@ -31,7 +37,9 @@ import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
@@ -42,18 +50,18 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*/
public class ResourceSelector extends AbstractSelector<Resource> {
- private Integer requireTypeId;
+ private ResourceType requireType;
public ResourceSelector() {
super();
}
- public Integer getRequireTypeId() {
- return requireTypeId;
+ public ResourceType getRequireType() {
+ return requireType;
}
- public void setRequireTypeId(Integer requireTypeId) {
- this.requireTypeId = requireTypeId;
+ public void setRequireType(ResourceType requireType) {
+ this.requireType = requireType;
markForRedraw();
}
@@ -70,10 +78,15 @@ public class ResourceSelector extends AbstractSelector<Resource>
{
typeSelectItem.setEmptyMenuMessage("Loading...");
typeSelectItem.setShowIcons(true);
- if (requireTypeId != null) {
- typeSelectItem.setValue(requireTypeId);
- typeSelectItem.setDisabled(true);
- availableFilterForm.setItems(search, typeSelectItem);
+ if (requireType != null) {
+ // TODO: Currently ignore the typeSelectItem widget because we already know
the type.
+ // Alternatively, we could display it disabled but we'd want the type
name to be displayed as the
+ // value. To get this to display the type name I think we need to pre-fetch
the type tree here. We could
+ // potentially optimize typeSelectItem.setValue(requireType.getId()) to build
a tree that includes only
+ // this single type.
+ //typeSelectItem.setValue(requireType.getId());
+ //typeSelectItem.setDisabled(true);
+ availableFilterForm.setItems(search);
} else {
SelectItem categorySelect = new SelectItem("category",
"Category");
categorySelect.setValueMap("Platform", "Server",
"Service");
@@ -91,23 +104,23 @@ public class ResourceSelector extends
AbstractSelector<Resource> {
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
String search = (String) availableFilterForm.getValue("search");
- String type = (String) availableFilterForm.getValue("type");
+ String type = availableFilterForm.getValueAsString("type");
String category = (String) availableFilterForm.getValue("category");
ArrayList<Criterion> criteria = new ArrayList<Criterion>(3);
if (null != search) {
- criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
+ criteria.add(new Criterion(NAME.propertyName(), OperatorId.CONTAINS,
search));
}
if (null != type) {
// If type is a number its a typeId, otherwise a plugin name
try {
Integer.parseInt(type);
- criteria.add(new Criterion("type", OperatorId.EQUALS, type));
+ criteria.add(new Criterion(TYPE.propertyName(), OperatorId.EQUALS,
type));
} catch (NumberFormatException nfe) {
- criteria.add(new Criterion("plugin", OperatorId.EQUALS,
type));
+ criteria.add(new Criterion(PLUGIN.propertyName(), OperatorId.EQUALS,
type));
}
}
if (null != category) {
- criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ criteria.add(new Criterion(CATEGORY.propertyName(), OperatorId.EQUALS,
category));
}
AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
.size()]));
@@ -127,5 +140,21 @@ public class ResourceSelector extends
AbstractSelector<Resource> {
}
return records;
}
+
+ @Override
+ protected ResourceCriteria getFetchCriteria(final DSRequest request) {
+ ResourceCriteria result = super.getFetchCriteria(request);
+
+ // additional filters
+ if (null != requireType) {
+ result.addFilterResourceTypeId(requireType.getId());
+ }
+
+ // additional return data
+ result.fetchResourceType(true);
+
+ return result;
+ }
+
}
}
commit d46570b01227074b6c53ccb45fadf6e05b1a3d6d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:18:03 2010 -0400
cosmetic changes only
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
index 227e783..03a2198 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
@@ -22,8 +22,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.ListIterator;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
@@ -48,7 +46,6 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
*/
public class ResourceTypePluginTreeDataSource extends DataSource {
-
private ResourceTypeGWTServiceAsync resourceTypeService =
GWTServiceLookup.getResourceTypeGWTService();
public ResourceTypePluginTreeDataSource() {
@@ -57,7 +54,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setDataProtocol(DSProtocol.CLIENTCUSTOM);
setDataFormat(DSDataFormat.CUSTOM);
-
DataSourceTextField idField = new DataSourceTextField("id",
"ID");
idField.setPrimaryKey(true);
@@ -70,7 +66,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
DataSourceTextField resourceTypeField = new
DataSourceTextField("category", "Category");
-
setFields(idField, parentIdField, resourceNameField, resourceKeyField,
resourceTypeField);
}
@@ -80,17 +75,16 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
// Asume success
response.setStatus(0);
switch (request.getOperationType()) {
- case FETCH:
- executeFetch(request, response);
- break;
- default:
- break;
+ case FETCH:
+ executeFetch(request, response);
+ break;
+ default:
+ break;
}
return request.getData();
}
-
protected void executeFetch(final DSRequest request, final DSResponse response) {
String parentIdString =
request.getCriteria().getAttributeAsString("parentId");
@@ -98,26 +92,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
processResponse(request.getRequestId(), response);
} else {
-
ResourceTypeCriteria criteria = new ResourceTypeCriteria();
criteria.fetchParentResourceTypes(true);
criteria.setPageControl(PageControl.getUnlimitedInstance());
- resourceTypeService.findResourceTypesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceType>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load
resource type tree data", caught);
- }
-
- public void onSuccess(PageList<ResourceType> result) {
- response.setData(buildNodes(result));
- processResponse(request.getRequestId(), response);
- }
- });
+ resourceTypeService.findResourceTypesByCriteria(criteria, new
AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load resource
type tree data", caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+ response.setData(buildNodes(result));
+ processResponse(request.getRequestId(), response);
+ }
+ });
}
}
-
public static TreeNode[] buildNodes(PageList<ResourceType> result) {
HashMap<String, PluginTreeNode> pluginNodes = new HashMap<String,
PluginTreeNode>();
@@ -127,12 +118,11 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
if (type.getParentResourceTypes() == null ||
type.getParentResourceTypes().isEmpty()) {
PluginTreeNode pluginNode = pluginNodes.get(type.getPlugin());
- if (pluginNode == null) {
- pluginNode = new PluginTreeNode(type.getPlugin());
- pluginNodes.put(type.getPlugin(), pluginNode);
- nodes.add(pluginNode);
- }
-
+ if (pluginNode == null) {
+ pluginNode = new PluginTreeNode(type.getPlugin());
+ pluginNodes.put(type.getPlugin(), pluginNode);
+ nodes.add(pluginNode);
+ }
nodes.add(new ResourceTypeTreeNode(type, type.getPlugin()));
} else {
@@ -152,7 +142,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
return treeNodes;
}
-
/**
* Returns a prepopulated PageControl based on the provided DSRequest. This will set
sort fields,
* pagination, but *not* filter fields.
@@ -166,7 +155,8 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
if (request.getStartRow() == null || request.getEndRow() == null) {
pageControl = new PageControl();
} else {
- pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow() - request.getStartRow());
+ pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow()
+ - request.getStartRow());
}
// Initialize sorting.
@@ -183,7 +173,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
return pageControl;
}
-
public static class PluginTreeNode extends TreeNode {
String id;
@@ -195,19 +184,22 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setParentID(null);
setAttribute("name", pluginName + " Plugin");
-// setAttribute("plugin",pluginName);
+ // setAttribute("plugin",pluginName);
setIcon("types/plugin_16.png"); // todo doesn't work
setEnabled(true);
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
PluginTreeNode that = (PluginTreeNode) o;
- if (!id.equals(that.id)) return false;
+ if (!id.equals(that.id))
+ return false;
return true;
}
@@ -245,20 +237,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setIsFolder(true);
}
-
public ResourceType getResourceType() {
return resourceType;
}
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
ResourceTypeTreeNode that = (ResourceTypeTreeNode) o;
- if (!id.equals(that.id)) return false;
- if (parentId != null ? !parentId.equals(that.parentId) : that.parentId !=
null) return false;
+ if (!id.equals(that.id))
+ return false;
+ if (parentId != null ? !parentId.equals(that.parentId) : that.parentId !=
null)
+ return false;
return true;
}
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 9d354f4..d761dbd 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
@@ -18,36 +18,16 @@
*/
package org.rhq.enterprise.gui.coregui.client.menu;
-import com.google.gwt.dom.client.Document;
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.Window;
import com.google.gwt.user.client.ui.Hyperlink;
-import com.smartgwt.client.types.ContentsType;
-import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.DrawEvent;
-import com.smartgwt.client.widgets.events.DrawHandler;
-import com.smartgwt.client.widgets.events.ShowContextMenuEvent;
-import com.smartgwt.client.widgets.events.ShowContextMenuHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuBar;
-import com.smartgwt.client.widgets.menu.MenuItem;
-import com.smartgwt.client.widgets.menu.MenuItemSeparator;
-import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
/**
@@ -57,13 +37,12 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard",
"Inventory", "Reports", "Bundles",
"Administration"};
+ public static final String[] SECTIONS = { "Dashboard",
"Inventory", "Reports", "Bundles",
"Administration" };
private String selected = "Dashboard";
private HTMLFlow linksPane;
-
protected void onDraw() {
super.onDraw();
@@ -81,7 +60,6 @@ public class MenuBarView extends VLayout {
}
});
-
ToolStrip topStrip = new ToolStrip();
topStrip.setHeight(34);
topStrip.setWidth100();
@@ -104,16 +82,16 @@ public class MenuBarView extends VLayout {
topStrip.addMember(new LayoutSpacer());
- HLayout helpLayout = new HLayout();
-// Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
-// loggedInAs.setWrap(false);
-// loggedInAs.setValign(VerticalAlignment.CENTER);
-// helpLayout.addMember(loggedInAs);
+ //HLayout helpLayout = new HLayout();
+ // Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
+ // loggedInAs.setWrap(false);
+ // loggedInAs.setValign(VerticalAlignment.CENTER);
+ // helpLayout.addMember(loggedInAs);
topStrip.addMember(new Hyperlink("Help", "Help"));
topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
-// helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
-// topStrip.addMember(helpLayout);
+ // helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
+ // topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm();
links.setNumCols(SECTIONS.length * 2);
@@ -148,7 +126,7 @@ public class MenuBarView extends VLayout {
private String setupLinks() {
StringBuilder headerString = new StringBuilder(
- "<table style=\"height: 34px;\"
cellpadding=\"0\" cellspacing=\"0\"><tr>");
+ "<table style=\"height: 34px;\" cellpadding=\"0\"
cellspacing=\"0\"><tr>");
boolean first = true;
for (String section : SECTIONS) {
@@ -162,7 +140,8 @@ public class MenuBarView extends VLayout {
styleClass += "Selected";
}
- headerString.append("<td class=\"" + styleClass +
"\" onclick=\"document.location='#" + section + "'\"
>");
+ headerString.append("<td id=\"" + section + "\"
class=\"" + styleClass
+ + "\" onclick=\"document.location='#" + section +
"'\" >");
headerString.append(section);
headerString.append("</td>\n");
@@ -174,5 +153,4 @@ public class MenuBarView extends VLayout {
return headerString.toString();
}
-
}
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 a288517..95436d4 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
@@ -20,11 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.util;
import java.util.Collection;
-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 com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSource;
@@ -32,6 +27,10 @@ import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.DSProtocol;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+
/**
* Base GWT-RPC oriented DataSource class.
*
@@ -59,21 +58,21 @@ public abstract class RPCDataSource<T> extends DataSource {
DSResponse response = createResponse(request);
switch (request.getOperationType()) {
- case FETCH:
- executeFetch(request, response);
- break;
- case ADD:
- executeAdd(request, response);
- break;
- case UPDATE:
- executeUpdate(request, response);
- break;
- case REMOVE:
- executeRemove(request, response);
- break;
- default:
- super.transformRequest(request);
- break;
+ case FETCH:
+ executeFetch(request, response);
+ break;
+ case ADD:
+ executeAdd(request, response);
+ break;
+ case UPDATE:
+ executeUpdate(request, response);
+ break;
+ case REMOVE:
+ executeRemove(request, response);
+ break;
+ default:
+ super.transformRequest(request);
+ break;
}
} catch (Throwable t) {
CoreGUI.getErrorHandler().handleError("Failure in datasource [" +
request.getOperationType() + "]", t);
@@ -95,7 +94,8 @@ public abstract class RPCDataSource<T> extends DataSource {
if (request.getStartRow() == null || request.getEndRow() == null) {
pageControl = new PageControl();
} else {
- pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow() - request.getStartRow());
+ pageControl = PageControl.getExplicitPageControl(request.getStartRow(),
request.getEndRow()
+ - request.getStartRow());
}
// Initialize sorting.
@@ -112,7 +112,6 @@ public abstract class RPCDataSource<T> extends DataSource {
return pageControl;
}
-
public ListGridRecord[] buildRecords(Collection<T> list) {
if (list == null) {
return null;
@@ -126,7 +125,6 @@ public abstract class RPCDataSource<T> extends DataSource {
return records;
}
-
/**
* Extensions should implement this method to retrieve data. Paging solutions should
use
* {@link #getPageControl(com.smartgwt.client.data.DSRequest)}. All implementations
should call processResponse()
@@ -138,12 +136,10 @@ public abstract class RPCDataSource<T> extends DataSource {
*/
protected abstract void executeFetch(final DSRequest request, final DSResponse
response);
-
public abstract T copyValues(ListGridRecord from);
public abstract ListGridRecord copyValues(T from);
-
/**
* Executed on <code>REMOVE</code> operation. <code>processResponse
(requestId, response)</code>
* should be called when operation completes (either successful or failure).
commit 82e6eafb41602e32be7645382b43fa53f252e707
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 10 12:14:32 2010 -0400
cosmetic changes only
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 3dc9f4c..8b2726c 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
@@ -18,15 +18,11 @@
*/
package org.rhq.enterprise.gui.coregui.client.bundle.list;
-import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle;
import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite;
@@ -63,7 +59,6 @@ public class BundlesListView extends Table {
setHeaderIcon("subsystems/bundle/Bundle_24.png");
-
setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60");
@@ -71,27 +66,26 @@ public class BundlesListView extends Table {
getListGrid().getField("link").setType(ListGridFieldType.LINK);
getListGrid().getField("link").setTarget("_self");
-// getListGrid().getField("name").setCellFormatter(new CellFormatter()
{
-// public String format(Object o, ListGridRecord listGridRecord, int i, int
i1) {
-// return "";//<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
-// }
-// });
+ // getListGrid().getField("name").setCellFormatter(new
CellFormatter() {
+ // public String format(Object o, ListGridRecord listGridRecord, int
i, int i1) {
+ // return "";//<a href=\"#Bundles/Bundle/"
+ listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
+ // }
+ // });
getListGrid().getField("description").setWidth("25%");
getListGrid().getField("latestVersion").setWidth("25%");
getListGrid().getField("versionsCount").setWidth("*");
getListGrid().setSelectionType(SelectionStyle.SIMPLE);
-// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
+ // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
addTableAction("New", Table.SelectionEnablement.ALWAYS, null, new
TableAction() {
public void executeAction(ListGridRecord[] selection) {
new BundleCreateWizard().startBundleWizard();
-
}
});
- addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected bundle?", new TableAction() {
+ addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete
the selected bundles?", new TableAction() {
public void executeAction(ListGridRecord[] selections) {
BundlesWithLatestVersionDataSource ds =
(BundlesWithLatestVersionDataSource) getDataSource();
for (ListGridRecord selection : selections) {
@@ -148,7 +142,6 @@ public class BundlesListView extends Table {
});
}
-
public int getMatches() {
return this.getListGrid().getTotalRows();
}
commit a5187a89792700e0852b59a679444a5b352bbd11
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Aug 10 10:21:15 2010 -0400
trivial - remove end-of-line spaces
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 5d47fc1..f36ad4a 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -1539,7 +1539,7 @@
<statement targetDBVendor="postgresql">
ALTER TABLE RHQ_REPO
ADD CONSTRAINT RHQ_REPO_PKEY PRIMARY KEY ( ID )
- </statement>
+ </statement>
<statement>
ALTER TABLE RHQ_CHANNEL_CONTENT_SRC_MAP
RENAME TO RHQ_REPO_CONTENT_SRC_MAP
@@ -3065,20 +3065,20 @@
FOREIGN KEY ( DASHBOARD_ID )
REFERENCES RHQ_DASHBOARD ( ID )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
-
+
<!-- rhq 3.0.0.final release at this point. -->
-
+
<!-- 2.89 corrects problems in 3.0.0.final *new* installs. The problems
it
fixes are not present in an upgraded db. As such, ignore any errors.
- -->
+ -->
<schemaSpec version="2.89">
<schema-deleteColumn ignoreError="true"
table="RHQ_ALERT" column="TRIGGERED_OPERATION" />
<schema-deleteColumn ignoreError="true"
table="RHQ_ALERT_DEFINITION" column="operation_def_id" />
-
+
<schema-alterColumn ignoreError="true"
table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED"
nullable="false" />
-
+
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_MAP" column="BUNDLE_ID"
nullable="false" />
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_MAP" column="TAG_ID"
nullable="false" />
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="BUNDLE_VERSION_ID"
nullable="false" />
@@ -3090,27 +3090,27 @@
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RESOURCE_MAP" column="RESOURCE_ID"
nullable="false" />
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RESOURCE_MAP" column="TAG_ID"
nullable="false" />
<schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RES_GROUP_MAP" column="RESOURCE_GROUP_ID"
nullable="false" />
- <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID"
nullable="false" />
</schemaSpec>
<!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems
it
fixes are not present in a new db. As such, ignore any errors.
- -->
- <schemaSpec version="2.90">
- <schema-dropSequence ignoreError="true"
name="rhq_tag_id_seq" />
+ -->
+ <schemaSpec version="2.90">
+ <schema-dropSequence ignoreError="true"
name="rhq_tag_id_seq" />
<schema-dropSequence ignoreError="true"
name="rhq_advisory_buglist_seq" />
-
+
<schema-createSequence ignoreError="true"
name="RHQ_ADVISORY_BUGLIST_ID_SEQ" initial="10001" />
-
+
<schema-alterColumn ignoreError="true"
table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="TRUE"
/>
-
+
<schema-alterColumn ignoreError="true"
table="RHQ_BUNDLE_TYPE" column="RESOURCE_TYPE_ID"
nullable="FALSE" />
-
+
<schema-alterColumn ignoreError="true"
table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME"
nullable="FALSE" />
<schema-deleteColumn ignoreError="true"
table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" />
<schema-alterColumn ignoreError="true"
table="RHQ_SAVED_SEARCH" column="NAME" nullable="FALSE"
/>
-
+
<schema-directSQL ignoreError="true">
<statement desc="Creating RHQ_SAVED_SEARCH foreign key
relation to RHQ_SUBJECT">
ALTER TABLE RHQ_SAVED_SEARCH
@@ -3119,7 +3119,7 @@
REFERENCES RHQ_SUBJECT (ID)
</statement>
</schema-directSQL>
-
+
</schemaSpec>
<schemaSpec version="2.91">
@@ -3132,7 +3132,7 @@
</statement>
</schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.92">
<!-- if some role previously had CONFIGURE perm (now called
CONFIGURE_WRITE), give it the implied perm
CONFIGURE_READ so users don't experience an unexpected
permission restriction after upgrade -->
@@ -3157,14 +3157,14 @@
<statement desc="RESOURCE_GROUP: Make unknown usernames as
rhqadmin in tmp modifiedBy column">
UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR =
'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL
</statement>
- </schema-directSQL>
+ </schema-directSQL>
<schema-deleteColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY" />
<schema-directSQL>
<statement desc="RESOURCE_GROUP: Renaming new varchar
MODIFIED_BY column">
ALTER TABLE RHQ_RESOURCE_GROUP
RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<schemaSpec version="2.93.2">
@@ -3177,14 +3177,14 @@
<statement desc="RESOURCE: Make unknown usernames as rhqadmin
in tmp modifiedBy column">
UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin'
WHERE MODIFIED_BY_VARCHAR IS NULL
</statement>
- </schema-directSQL>
+ </schema-directSQL>
<schema-deleteColumn table="RHQ_RESOURCE"
column="MODIFIED_BY" />
<schema-directSQL>
<statement desc="RESOURCE: Renaming new varchar MODIFIED_BY
column">
ALTER TABLE RHQ_RESOURCE
RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<schemaSpec version="2.93.3">
commit 7a1accc180497bc215e3e416a0f19c74f6dc1647
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Aug 10 10:18:39 2010 -0400
bz 622491 - make the db upgrade re-typing of the MODIFIED_BY column more efficient
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 8c404b7..5d47fc1 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3149,48 +3149,42 @@
<!-- BZ 622491 - 2.93.x - modifiedBy should only be username, not a
subject ID and should be size 100 -->
<schemaSpec version="2.93.1">
<!-- first do the RHQ_RESOURCE_GROUP table -->
- <schema-addColumn table="RHQ_RESOURCE_GROUP"
column="TMP_MODIFIED_BY" columnType="VARCHAR2"
precision="100"/>
+ <schema-addColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2"
precision="100"/>
<schema-directSQL>
<statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy
column with existing user names or null if user does not exist">
- UPDATE RHQ_RESOURCE_GROUP AS g SET TMP_MODIFIED_BY = (SELECT NAME
FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY)
+ UPDATE RHQ_RESOURCE_GROUP AS g SET MODIFIED_BY_VARCHAR = (SELECT
NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY)
</statement>
<statement desc="RESOURCE_GROUP: Make unknown usernames as
rhqadmin in tmp modifiedBy column">
- UPDATE RHQ_RESOURCE_GROUP SET TMP_MODIFIED_BY =
'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL
- </statement>
- <statement desc="RESOURCE_GROUP: Null out IDs from existing
modifiedBy column to prepare for conversion to varchar column">
- UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = NULL
+ UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR =
'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY" columnType="VARCHAR2" precision="100"
/>
+ <schema-deleteColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY" />
<schema-directSQL>
- <statement desc="RESOURCE_GROUP: Populate the new-typed
modifiedBy column with user names from tmp column">
- UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = TMP_MODIFIED_BY
+ <statement desc="RESOURCE_GROUP: Renaming new varchar
MODIFIED_BY column">
+ ALTER TABLE RHQ_RESOURCE_GROUP
+ RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY
</statement>
</schema-directSQL>
- <schema-deleteColumn table="RHQ_RESOURCE_GROUP"
column="TMP_MODIFIED_BY" />
</schemaSpec>
<schemaSpec version="2.93.2">
<!-- second do the RHQ_RESOURCE table -->
- <schema-addColumn table="RHQ_RESOURCE"
column="TMP_MODIFIED_BY" columnType="VARCHAR2"
precision="100"/>
+ <schema-addColumn table="RHQ_RESOURCE"
column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2"
precision="100"/>
<schema-directSQL>
<statement desc="RESOURCE: Populate the tmp modifiedBy column
with existing user names or null if user does not exist">
- UPDATE RHQ_RESOURCE AS r SET TMP_MODIFIED_BY = (SELECT NAME FROM
RHQ_SUBJECT WHERE ID = r.MODIFIED_BY)
+ UPDATE RHQ_RESOURCE AS r SET MODIFIED_BY_VARCHAR = (SELECT NAME
FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY)
</statement>
<statement desc="RESOURCE: Make unknown usernames as rhqadmin
in tmp modifiedBy column">
- UPDATE RHQ_RESOURCE SET TMP_MODIFIED_BY = 'rhqadmin'
WHERE TMP_MODIFIED_BY IS NULL
- </statement>
- <statement desc="RESOURCE: Null out IDs from existing
modifiedBy column to prepare for conversion to varchar column">
- UPDATE RHQ_RESOURCE SET MODIFIED_BY = NULL
+ UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin'
WHERE MODIFIED_BY_VARCHAR IS NULL
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_RESOURCE"
column="MODIFIED_BY" columnType="VARCHAR2" precision="100"
/>
+ <schema-deleteColumn table="RHQ_RESOURCE"
column="MODIFIED_BY" />
<schema-directSQL>
- <statement desc="RESOURCE: Populate the new-typed modifiedBy
column with user names from tmp column">
- UPDATE RHQ_RESOURCE SET MODIFIED_BY = TMP_MODIFIED_BY
+ <statement desc="RESOURCE: Renaming new varchar MODIFIED_BY
column">
+ ALTER TABLE RHQ_RESOURCE
+ RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY
</statement>
</schema-directSQL>
- <schema-deleteColumn table="RHQ_RESOURCE"
column="TMP_MODIFIED_BY" />
</schemaSpec>
<schemaSpec version="2.93.3">
commit 0331a532c08ed27468b827f277ae80b2179c8eb4
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 9 23:09:49 2010 -0400
Initial commit for RHQScript.groovy which is the base class for scripts run by the
plugin
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
index 1f12a36..de0184c 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
@@ -6,6 +6,7 @@ import org.rhq.enterprise.server.plugin.pc.ControlFacet
import org.rhq.enterprise.server.plugin.pc.ControlResults
import org.rhq.core.domain.configuration.Configuration
import org.rhq.core.domain.configuration.PropertySimple
+import org.codehaus.groovy.control.CompilerConfiguration
class GroovyScriptPluginComponent implements ServerPluginComponent, ControlFacet {
@@ -26,13 +27,17 @@ class GroovyScriptPluginComponent implements ServerPluginComponent,
ControlFacet
}
ControlResults invoke(String name, Configuration parameters) {
+ def compilerConfig = new CompilerConfiguration()
+ compilerConfig.scriptBaseClass = RHQScript.class.name
+
def scriptName = parameters.getSimpleValue("script", null)
- def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader)
+ def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig)
def scriptRoots = new URL[1]
scriptRoots[0] = new File(scriptName).toURI().toURL()
def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
-
+ scriptEngine.config = compilerConfig
+
def scriptResult = scriptEngine.run(scriptName, new Binding())
ControlResults results = new ControlResults()
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
new file mode 100644
index 0000000..38bcad7
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/RHQScript.groovy
@@ -0,0 +1,19 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.rhq.enterprise.server.util.LookupUtil
+
+class RHQScript extends Script {
+
+ Object run() {
+ super.run()
+ }
+
+ def propertyMissing(String name) {
+ if (name.endsWith("Manager")) {
+ def method = "get$name"
+ return LookupUtil."$method"()
+ }
+ return null // TODO Should we instead some sort of property not found exception
+ }
+
+}
commit fe85bc399b56ef1e904280bede87baac4927133a
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Mon Aug 9 22:08:15 2010 -0400
Commenting out classpath parameter for now due to BZ 622996
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-add-map.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-add-map.xhtml
new file mode 100644
index 0000000..ea074f8
--- /dev/null
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-add-map.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:onc="http://jboss.org/on/component">
+
+<ui:composition template="/rhq/admin/plugin/plugin-details-map.xhtml">
+ <ui:param name="actionVerb" value="Add to" />
+ <ui:param name="editBreadCrumb" value="true" />
+
+ <ui:define name="mapConfig">
+ <onc:config
configurationDefinition="#{editPluginConfigurationUIBean.currentConfigurationDefinition}"
+
configuration="#{editPluginConfigurationUIBean.currentConfiguration}"
+ listName="#{param.listName}" />
+
+ <h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:commandButton value="OK" type="submit"
action="#{editPluginConfigurationUIBean.finishMap}"
+ alt="Click to Add Map"
styleClass="buttonmed"/>
+ <h:commandButton value="RESET" type="reset"
immediate="true"
+ alt="Click to Reset Fields"
styleClass="buttonmed"/>
+ </h:panelGrid>
+ </ui:define>
+</ui:composition>
+
+</html>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit-map.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit-map.xhtml
new file mode 100644
index 0000000..e69de29
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
index c952fa7..c4c6678 100644
---
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -13,19 +13,20 @@
<c:simple-property name="script"
required="true"
description="The pat of the script to execute.
Can be relative or absolute." />
- <c:list-property name="classpathList"
displayName="classpath" required="false">
- <c:map-property name="classpathMap">
- <c:simple-property name="path"
- description="A file system path that can
refer to a classes directory, a
- single JAR file, or a directory containing
multiple JAR files."/>
- <c:simple-property name="libDir"
displayName="JAR Directory" default="no">
- <c:property-options>
- <c:option value="yes"
name="Yes"/>
- <c:option value="no"
name="No"/>
- </c:property-options>
- </c:simple-property>
- </c:map-property>
- </c:list-property>
+ <!--<c:list-property name="classpathList"
displayName="classpath" required="false">-->
+ <!--<c:map-property name="classpathMap">-->
+ <!--<c:simple-property name="path"-->
+ <!--required="true"-->
+ <!--description="A file system path
that can refer to a classes directory, a-->
+ <!--single JAR file, or a directory
containing multiple JAR files."/>-->
+ <!--<c:simple-property name="libDir"
displayName="JAR Directory" default="no"
required="false">-->
+ <!--<c:property-options>-->
+ <!--<c:option value="yes"
name="Yes"/>-->
+ <!--<c:option value="no"
name="No"/>-->
+ <!--</c:property-options>-->
+ <!--</c:simple-property>-->
+ <!--</c:map-property>-->
+ <!--</c:list-property>-->
</serverplugin:parameters>
<serverplugin:results>
<c:simple-property name="results"/>
commit b81af62dd724a889d03b1344587f720065ace6f9
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 9 19:04:14 2010 -0400
finish wiring up #ResourceGroup/10017 bookmark to group detail view; implement group
Inventory>Members subtab
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 d66a328..f29a064 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
@@ -32,6 +32,7 @@ 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.components.wizard.WizardView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
/**
* @author Greg Hinkle
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 a902bc5..c3d6a43 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
@@ -41,10 +41,12 @@ import
org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.OverviewView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/**
- * Right panel of the resource view.
+ * Right panel of the group view.
*
* @author Greg Hinkle
*/
@@ -62,7 +64,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private TwoLevelTab alertsTab;
private TwoLevelTab configurationTab;
private TwoLevelTab eventsTab;
- private TwoLevelTab contentTab;
private TwoLevelTabSet topTabSet;
@@ -94,7 +95,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
- inventoryTab.registerSubTabs("Children", "Connection
Settings");
+ inventoryTab.registerSubTabs("Overview", "Members",
"Connection Settings");
operationsTab = new TwoLevelTab("Operations",
"/images/icons/Operation_grey_16.png");
operationsTab.registerSubTabs("History", "Scheduled");
@@ -108,11 +109,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
eventsTab = new TwoLevelTab("Events",
"/images/icons/Events_grey_16.png");
eventsTab.registerSubTabs("History");
- contentTab = new TwoLevelTab("Content",
"/images/icons/Content_grey_16.png");
- contentTab.registerSubTabs("Deployed", "New",
"Subscriptions", "History");
-
topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab,
- eventsTab, contentTab);
+ eventsTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -124,7 +122,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// CoreGUI.addBreadCrumb(getPlace());
}
- public void onResourceSelected(ResourceGroup group) {
+ public void onGroupSelected(ResourceGroup group) {
this.group = group;
@@ -145,9 +143,9 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
// monitoringTab.updateSubTab("Call Time", new
CallTimeView(resource));
//
- //
- // inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
- // inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
+ inventoryTab.updateSubTab("Overview", new OverviewView());
+ inventoryTab.updateSubTab("Members",
ResourceSearchView.getMembersOf(this.group.getId()));
+ // inventoryTab.updateSubTab("Connection Settings", new
GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(),
ConfigurationEditor.ConfigType.plugin));
//
// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
//
@@ -237,12 +235,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
topTabSet.enableTab(eventsTab);
}
- if (groupType.getPackageTypes() == null || groupType.getPackageTypes().isEmpty()
|| !permissions.isContent()) {
- topTabSet.disableTab(contentTab);
- } else {
- topTabSet.enableTab(contentTab);
- }
-
}
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index 3aade28..8faaae8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -26,15 +26,17 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
@@ -49,7 +51,7 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
private ResourceGroupTreeView treeView;
private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
- private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+ private ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
public ResourceGroupTopView() {
@@ -80,42 +82,41 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
setContent(detailView);
}
-/*
- public void setSelectedResource(final int resourceId, final ViewPath view) {
- Resource resource = this.treeView.getResource(resourceId);
- if (resource != null) {
- setSelectedResource(resource, view);
+
+ public void setSelectedGroup(final int groupId, final ViewPath view) {
+ ResourceGroup group = this.treeView.getGroup(groupId);
+ if (group != null) {
+ setSelectedGroup(group, view);
} else {
- ResourceCriteria criteria = new ResourceCriteria();
- criteria.addFilterId(resourceId);
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addFilterId(groupId);
criteria.fetchTags(true);
- //criteria.fetchParentResource(true);
- resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ groupService.findResourceGroupsByCriteria(criteria, new
AsyncCallback<PageList<ResourceGroup>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
+ CoreGUI.getMessageCenter().notify(new Message("Group with id
[" + groupId +
"] does not exist or is not accessible.",
Message.Severity.Warning));
CoreGUI.goTo(InventoryView.VIEW_PATH);
}
- public void onSuccess(PageList<Resource> result) {
+ public void onSuccess(PageList<ResourceGroup> result) {
if (result.isEmpty()) {
//noinspection ThrowableInstanceNeverThrown
- onFailure(new Exception("Resource with id [" +
resourceId + "] does not exist."));
+ onFailure(new Exception("Group with id [" + groupId +
"] does not exist."));
} else {
- Resource resource = result.get(0);
- setSelectedResource(resource, view);
+ ResourceGroup group = result.get(0);
+ setSelectedGroup(group, view);
}
}
});
}
}
- private void setSelectedResource(Resource resource, ViewPath viewPath) {
- this.currentResource = resource;
- this.treeView.setSelectedResource(resource, viewPath.getCurrent());
- this.detailView.onResourceSelected(resource);
- }*/
+ private void setSelectedGroup(ResourceGroup group, ViewPath viewPath) {
+ this.currentGroup = group;
+ this.treeView.setSelectedGroup(group.getId());
+ this.detailView.onGroupSelected(group);
+ }
public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0)
@@ -134,18 +135,12 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
-
-
-
if (currentGroup == null || currentGroup.getId() != groupId) {
-// setSelectedResource(resourceId, viewPath);
+ setSelectedGroup(groupId, viewPath);
this.treeView.setSelectedGroup(groupId);
-
-
-
viewPath.next();
this.detailView.renderView(viewPath);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
index ef5406d..bd79780 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
@@ -31,7 +31,10 @@ import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
+import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -40,9 +43,8 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
*/
public class ResourceGroupTreeView extends VLayout {
-
private int groupId;
-
+ private ResourceGroup group;
private TreeGrid treeGrid;
public ResourceGroupTreeView() {
@@ -79,10 +81,27 @@ public class ResourceGroupTreeView extends VLayout {
}
});
+ // TODO: Get the group from the ResourceGroupTreeView in case it was already
loaded.
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addFilterId(groupId);
+ criteria.fetchTags(true);
+
GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceGroup>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
group", caught);
+ }
- }
+ public void onSuccess(PageList<ResourceGroup> result) {
+ group = result.get(0);
+ }
+ });
+ }
+ ResourceGroup getGroup(int groupId) {
+ // TODO: Get the group from the ResourceGroupTreeView in case it was already
loaded.
+ return this.group;
+ }
private void loadTree(ClusterFlyweight root) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
new file mode 100644
index 0000000..c5aeb38
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java
@@ -0,0 +1,12 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory;
+
+import com.smartgwt.client.widgets.layout.VLayout;
+
+/**
+ * @author Ian Springer
+ */
+public class OverviewView extends VLayout {
+
+ // TODO: Group general properties go here.
+
+}
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 358021d..8b81f4c 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
@@ -43,7 +43,7 @@ public enum ResourceDataSourceField {
private String propertyName;
/**
- * The display name for the field or proeprty
+ * The display name for the field or property
*/
private String title;
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 49ec0e4..af8931b 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
@@ -119,6 +119,12 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
criteria.addFilterIds(oids);
}
+ // Fetch member Resources of the group with the specified id.
+ if (request.getCriteria().getValues().get("groupId") != null) {
+ int groupId = Integer.parseInt((String)
request.getCriteria().getValues().get("groupId"));
+ criteria.addFilterImplicitGroupIds(groupId);
+ }
+
if (request.getCriteria().getValues().get(NAME.propertyName()) != null) {
criteria.addFilterName((String)
request.getCriteria().getValues().get(NAME.propertyName()));
}
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 166d26a..1642c64 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
@@ -39,6 +39,8 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import javax.persistence.Id;
+
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;
@@ -167,4 +169,9 @@ public class ResourceSearchView extends Table {
public static ResourceSearchView getChildrenOf(int resourceId) {
return new ResourceSearchView(new Criteria("parentId",
String.valueOf(resourceId)), "Child Resources");
}
+
+ public static ResourceSearchView getMembersOf(int groupId) {
+ return new ResourceSearchView(new Criteria("groupId",
String.valueOf(groupId)), "Member Resources");
+ }
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
index 2f85ae3..e342628 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java
@@ -19,7 +19,6 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
commit f6409557d36ab77f8baa69cb4dc4d11c5fedc39c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 9 17:17:45 2010 -0400
BZ 622491 - do not have subject ID foreign key in "modifiedBy" columns - we
only log usernames
this prevents errors when someone deletes a user. change RHQ_RESOURCE
and RHQ_RESOURCE_GROUP to have VARCHAR modifiedBy rather than integer.
This also fixes db-upgrade so existing data can be upgraded.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 3e129f3..81498dc 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.92</db.schema.version>
+ <db.schema.version>2.93.3</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml
index e4c6977..161830f 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml
@@ -59,7 +59,7 @@
<table name="RHQ_PARTITION_EVENT">
<column name="ID" default="sequence-only"
initial="10001"
primarykey="true" required="true"
type="INTEGER"/>
- <column name="SUBJECT_NAME" required="true"
size="255" type="VARCHAR2"/>
+ <column name="SUBJECT_NAME" required="true"
size="100" type="VARCHAR2"/>
<column name="CTIME" required="true"
type="LONG"/>
<column name="EVENT_TYPE" required="true"
size="50" type="VARCHAR2"/>
<column name="EVENT_DETAIL" required="false"
size="512" type="VARCHAR2"/>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index da048e1..3233d47 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -95,7 +95,7 @@
<column name="ITIME" type="LONG"/>
<column name="RES_CONFIGURATION_ID" type="INTEGER"
references="RHQ_CONFIG"/>
<column name="PLUGIN_CONFIGURATION_ID" type="INTEGER"
references="RHQ_CONFIG"/>
- <column name="MODIFIED_BY" required="false"
type="INTEGER"/>
+ <column name="MODIFIED_BY" required="false"
size="100" type="VARCHAR2"/>
<column name="LOCATION" required="false"
size="100" type="VARCHAR2"/>
<column name="PARENT_RESOURCE_ID" type="INTEGER"
references="RHQ_RESOURCE"/>
<column name="PRODUCT_VERSION_ID" type="INTEGER"
references="RHQ_PRD_VER"/>
@@ -160,8 +160,7 @@
<!-- Compatible groups only -->
<column name="CTIME" type="LONG"/>
<column name="MTIME" type="LONG"/>
- <column name="MODIFIED_BY" required="false"
type="INTEGER"/>
- <!-- TODO: Reorder to allow this references="RHQ_SUBJECT" -->
+ <column name="MODIFIED_BY" required="false"
size="100" type="VARCHAR2"/>
<column name="RECURSIVE" type="BOOLEAN"/>
<column name="GROUP_DEFINITION_ID" required="false"
type="INTEGER" references="RHQ_GROUP_DEF"/>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index f3b3106..8c404b7 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3146,6 +3146,58 @@
</schema-directSQL>
</schemaSpec>
+ <!-- BZ 622491 - 2.93.x - modifiedBy should only be username, not a
subject ID and should be size 100 -->
+ <schemaSpec version="2.93.1">
+ <!-- first do the RHQ_RESOURCE_GROUP table -->
+ <schema-addColumn table="RHQ_RESOURCE_GROUP"
column="TMP_MODIFIED_BY" columnType="VARCHAR2"
precision="100"/>
+ <schema-directSQL>
+ <statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy
column with existing user names or null if user does not exist">
+ UPDATE RHQ_RESOURCE_GROUP AS g SET TMP_MODIFIED_BY = (SELECT NAME
FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY)
+ </statement>
+ <statement desc="RESOURCE_GROUP: Make unknown usernames as
rhqadmin in tmp modifiedBy column">
+ UPDATE RHQ_RESOURCE_GROUP SET TMP_MODIFIED_BY =
'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL
+ </statement>
+ <statement desc="RESOURCE_GROUP: Null out IDs from existing
modifiedBy column to prepare for conversion to varchar column">
+ UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = NULL
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_RESOURCE_GROUP"
column="MODIFIED_BY" columnType="VARCHAR2" precision="100"
/>
+ <schema-directSQL>
+ <statement desc="RESOURCE_GROUP: Populate the new-typed
modifiedBy column with user names from tmp column">
+ UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = TMP_MODIFIED_BY
+ </statement>
+ </schema-directSQL>
+ <schema-deleteColumn table="RHQ_RESOURCE_GROUP"
column="TMP_MODIFIED_BY" />
+ </schemaSpec>
+
+ <schemaSpec version="2.93.2">
+ <!-- second do the RHQ_RESOURCE table -->
+ <schema-addColumn table="RHQ_RESOURCE"
column="TMP_MODIFIED_BY" columnType="VARCHAR2"
precision="100"/>
+ <schema-directSQL>
+ <statement desc="RESOURCE: Populate the tmp modifiedBy column
with existing user names or null if user does not exist">
+ UPDATE RHQ_RESOURCE AS r SET TMP_MODIFIED_BY = (SELECT NAME FROM
RHQ_SUBJECT WHERE ID = r.MODIFIED_BY)
+ </statement>
+ <statement desc="RESOURCE: Make unknown usernames as rhqadmin
in tmp modifiedBy column">
+ UPDATE RHQ_RESOURCE SET TMP_MODIFIED_BY = 'rhqadmin'
WHERE TMP_MODIFIED_BY IS NULL
+ </statement>
+ <statement desc="RESOURCE: Null out IDs from existing
modifiedBy column to prepare for conversion to varchar column">
+ UPDATE RHQ_RESOURCE SET MODIFIED_BY = NULL
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_RESOURCE"
column="MODIFIED_BY" columnType="VARCHAR2" precision="100"
/>
+ <schema-directSQL>
+ <statement desc="RESOURCE: Populate the new-typed modifiedBy
column with user names from tmp column">
+ UPDATE RHQ_RESOURCE SET MODIFIED_BY = TMP_MODIFIED_BY
+ </statement>
+ </schema-directSQL>
+ <schema-deleteColumn table="RHQ_RESOURCE"
column="TMP_MODIFIED_BY" />
+ </schemaSpec>
+
+ <schemaSpec version="2.93.3">
+ <!-- third, maintain consistency across data model - everywhere else,
SUBJECT_NAME is of size 100, make this one 100 too -->
+ <schema-alterColumn table="RHQ_PARTITION_EVENT"
column="SUBJECT_NAME" columnType="VARCHAR2" precision="100"
/>
+ </schemaSpec>
+
</dbupgrade>
</target>
</project>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index 8f4e45f..40deb43 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -60,7 +60,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.alert.AlertDefinition;
-import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
@@ -904,9 +903,8 @@ public class Resource implements Comparable<Resource>,
Serializable {
@Column(name = "ITIME")
private Long itime = System.currentTimeMillis(); // time inventory status changed
- @JoinColumn(name = "MODIFIED_BY")
- @ManyToOne(fetch = FetchType.LAZY)
- private Subject modifiedBy;
+ @Column(name = "MODIFIED_BY")
+ private String modifiedBy;
@Column(name = "LOCATION")
private String location;
@@ -1220,11 +1218,11 @@ public class Resource implements Comparable<Resource>,
Serializable {
this.mtime = System.currentTimeMillis();
}
- public Subject getModifiedBy() {
+ public String getModifiedBy() {
return this.modifiedBy;
}
- public void setModifiedBy(Subject modifiedBy) {
+ public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java
index 082d14d..4a15ff4 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java
@@ -1,37 +1,35 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.domain.resource.group;
import java.io.Serializable;
+
import javax.persistence.Column;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
+
import org.jetbrains.annotations.NotNull;
-import org.rhq.core.domain.auth.Subject;
/**
* This is the abstract base class for groups containing either {@link
org.rhq.core.domain.resource.Resource}s or groups
@@ -58,16 +56,14 @@ public abstract class Group implements Serializable {
@Column(name = "MTIME")
private Long mtime;
- @JoinColumn(name = "MODIFIED_BY")
- @ManyToOne(fetch = FetchType.LAZY)
- private Subject modifiedBy;
+ @Column(name = "MODIFIED_BY")
+ private String modifiedBy;
/* no-arg constructor required by EJB spec */
protected Group() {
}
- public Group(@NotNull
- String name) {
+ public Group(@NotNull String name) {
this.name = name;
}
@@ -76,8 +72,7 @@ public abstract class Group implements Serializable {
return name;
}
- public void setName(@NotNull
- String name) {
+ public void setName(@NotNull String name) {
this.name = name;
}
@@ -113,11 +108,11 @@ public abstract class Group implements Serializable {
this.mtime = mtime;
}
- public Subject getModifiedBy() {
+ public String getModifiedBy() {
return modifiedBy;
}
- public void setModifiedBy(Subject modifiedBy) {
+ public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java
index e638691..cb15696 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java
@@ -114,7 +114,7 @@ public class ResourceGroupUIBean {
return this.resourceGroup.getMtime();
}
- public Subject getModifiedBy() {
+ public String getModifiedBy() {
return this.resourceGroup.getModifiedBy();
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java
index bc62589..ecc1253 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java
@@ -25,21 +25,20 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.domain.resource.ResourceErrorType;
import org.rhq.core.domain.resource.ResourceType;
@@ -51,7 +50,6 @@ import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.measurement.AvailabilityManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
-import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility;
import org.rhq.enterprise.server.perspective.PerspectiveManagerLocal;
import org.rhq.enterprise.server.perspective.Tab;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
@@ -172,7 +170,7 @@ public class ResourceUIBean {
return this.resource.getMtime();
}
- public Subject getModifiedBy() {
+ public String getModifiedBy() {
return this.resource.getModifiedBy();
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java
index 6f0e89d..63d64ce 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java
@@ -105,7 +105,7 @@ public abstract class GroupController extends BaseDispatchAction {
GroupCategory category = group.getGroupCategory();
log.trace("finding most recent modifier for resource [" + groupId +
"]");
- Subject modifier = group.getModifiedBy();
+ String modifier = group.getModifiedBy();
// TODO: jmarques - how are we going to do control on ResourceGroups?
boolean isControllable =
LookupUtil.getOperationManager().isGroupOperationSupported(subject, group.getId());
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
index 8e997ef..986c01d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
@@ -63,8 +63,7 @@
</h:panelGroup>
<h:panelGroup layout="block">
- <b>Last Modified By: </b>
#{ResourceGroupUIBean.modifiedBy.firstName} #{ResourceGroupUIBean.modifiedBy.lastName}
- (<a
href="mailto:#{ResourceGroupUIBean.modifiedBy.emailAddress}">#{ResourceGroupUIBean.modifiedBy.name}</a>)
+ <b>Last Modified By: </b> #{ResourceGroupUIBean.modifiedBy}
</h:panelGroup>
<h:panelGroup layout="block">
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index 185562a..2773b4c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -370,7 +370,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
Resource parentResource = this.resourceManager.getResourceById(creator,
resource.getParentResource()
.getId());
resource.setAgent(parentResource.getAgent());
- resource.setModifiedBy(creator);
+ resource.setModifiedBy(creator.getName());
// Manually added resources are auto-committed.
resource.setInventoryStatus(InventoryStatus.COMMITTED);
@@ -746,7 +746,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
}
resource.setItime(System.currentTimeMillis());
- resource.setModifiedBy(subjectManager.getOverlord());
+ resource.setModifiedBy(subjectManager.getOverlord().getName());
for (Resource childResource : resource.getChildResources()) {
initAutoDiscoveredResource(childResource, resource);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index e291c25..b2ed76e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -162,7 +162,7 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
long time = System.currentTimeMillis();
group.setCtime(time);
group.setMtime(time);
- group.setModifiedBy(user);
+ group.setModifiedBy(user.getName());
entityManager.persist(group);
@@ -191,7 +191,7 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
long time = System.currentTimeMillis();
group.setMtime(time);
- group.setModifiedBy(user);
+ group.setModifiedBy(user.getName());
ResourceGroup newlyAttachedGroup = entityManager.merge(group);
if (changeType == RecursivityChangeType.AddedRecursion) {
@@ -341,13 +341,6 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
}
private void initLazyFields(ResourceGroup group) {
- /*
- * initialize modifiedBy field, which is now a lazily- loaded relationship to
speed up the GroupHub stuff
- */
- if (group.getModifiedBy() != null) {
- group.getModifiedBy().getId();
- }
-
group.getAlertDefinitions().size();
}
@@ -1347,7 +1340,6 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
} else {
composite = new ResourceGroupComposite(0L, 0.0, 0L, 0.0, group, facets);
}
- group.getModifiedBy().getFirstName();
return composite;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java
index 0a46d5a..709b95a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java
@@ -257,7 +257,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal {
platform.setAgent(this.coreTest.getTestAgent());
platform.setDescription("test platform created by " +
this.getClass().getName());
platform.setLocation("San Pedro Sula, Honduras");
- platform.setModifiedBy(subjectManager.getOverlord());
+ platform.setModifiedBy(subjectManager.getOverlord().getName());
//platform.addIP(createTestIp());
String serverName = "BogusServer ";
@@ -273,7 +273,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal {
Resource server = new Resource(installPath, name, getTestServerType());
server.setParentResource(platform);
server.setDescription("test server created by " +
this.getClass().getName());
- server.setModifiedBy(subjectManager.getOverlord());
+ server.setModifiedBy(subjectManager.getOverlord().getName());
for (int i = 0; i < servicesPerServer; i++) {
String childName = name + " child service " + i;
@@ -286,7 +286,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal {
private Resource createTestService(Resource parent, String name) {
Resource service = new Resource(name, name, getTestServiceType());
service.setDescription("test service created by " +
this.getClass().getName());
- service.setModifiedBy(subjectManager.getOverlord());
+ service.setModifiedBy(subjectManager.getOverlord().getName());
return service;
}
commit d0eb8c4ecb7efc470b6a562a388b6cd8549194cc
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 9 15:30:54 2010 -0400
add index.html to portal-war that redirects to coregui war (forgot to include this in
my commit last Friday); fix potential NPEs in JBossASTomcatConnectorComponent when one of
the conn props has a null value
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
new file mode 100644
index 0000000..c6499a3
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <meta http-equiv="Refresh" content="0;
URL=/coregui/CoreGUI.html#Dashboard"/>
+ </head>
+ <body>
+ <p>Redirecting to <a
href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p>
+ </body>
+</html>
+
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java
index 94788e7..0256469 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java
@@ -1,6 +1,6 @@
/*
* Jopr Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -36,7 +36,7 @@ import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
import org.rhq.plugins.jmx.MBeanResourceComponent;
/**
- * JON plugin component for representing Tomcat connectors. Much of the functionality is
left to the super class,
+ * RHQ plugin component for representing Tomcat connectors. Much of the functionality is
left to the super class,
* however the metrics required special handling.
*
* @author Jason Dobies
@@ -113,18 +113,19 @@ public class JBossASTomcatConnectorComponent extends
MBeanResourceComponent<JBos
String theProperty = property;
Configuration pluginConfiguration =
getResourceContext().getPluginConfiguration();
- String address =
pluginConfiguration.getSimple(PROPERTY_ADDRESS).getStringValue();
- String port = pluginConfiguration.getSimple(PROPERTY_PORT).getStringValue();
- String schema = pluginConfiguration.getSimple(PROPERTY_SCHEMA).getStringValue();
- String dash = pluginConfiguration.getSimple(PROPERTY_DASH).getStringValue();
+ String address = pluginConfiguration.getSimpleValue(PROPERTY_ADDRESS,
"");
+ String port = pluginConfiguration.getSimpleValue(PROPERTY_PORT, "");
+ String schema = pluginConfiguration.getSimpleValue(PROPERTY_SCHEMA,
"");
+ String dash = pluginConfiguration.getSimpleValue(PROPERTY_DASH, "");
theProperty = theProperty.replace("%address%", address);
theProperty = theProperty.replace("%port%", port);
theProperty = theProperty.replace("%schema%", schema);
theProperty = theProperty.replace("%dash%", dash);
- if (log.isDebugEnabled())
- log.debug("Finding metrics for: " + theProperty);
+ if (log.isDebugEnabled()) {
+ log.debug("Finding metrics for [" + theProperty +
"]...");
+ }
return theProperty;
}
commit 0278a042c81c28a4ef19d86dcb2240870831b037
Merge: 9723759... 92ddd5c...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 9 10:43:39 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 0efa7953b22a7877ab594bba2f4ebc2382875ef0
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Sun Aug 8 22:23:01 2010 -0400
Initial commit for groovy-script server plugin
With this commit there is initial support for running a specified
script. The plugin descriptor has meta data in place for specifying
a classpath, but support for an additional classpath has not been
implemented yet.
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml
b/modules/enterprise/server/plugins/groovy-script/pom.xml
new file mode 100644
index 0000000..a8a98b2
--- /dev/null
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-plugins-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>groovy-script-server-plugin</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+
+ <name>RHQ Enterprise Server Groovy Script Plugin</name>
+
+ <scm>
+
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/ente...
+
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>copy-libs</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>1.7.1</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <!--
+ <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>
+ -->
+ </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-serverplugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</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>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>
+
+ <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>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+</project>
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
new file mode 100644
index 0000000..1f12a36
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/GroovyScriptPluginComponent.groovy
@@ -0,0 +1,45 @@
+package org.rhq.enterprise.server.plugins.groovy
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent
+import org.rhq.enterprise.server.plugin.pc.ServerPluginContext
+import org.rhq.enterprise.server.plugin.pc.ControlFacet
+import org.rhq.enterprise.server.plugin.pc.ControlResults
+import org.rhq.core.domain.configuration.Configuration
+import org.rhq.core.domain.configuration.PropertySimple
+
+class GroovyScriptPluginComponent implements ServerPluginComponent, ControlFacet {
+
+ void initialize(ServerPluginContext context) {
+
+ }
+
+ void start() {
+
+ }
+
+ void stop() {
+
+ }
+
+ void shutdown() {
+
+ }
+
+ ControlResults invoke(String name, Configuration parameters) {
+ def scriptName = parameters.getSimpleValue("script", null)
+
+ def scriptClassLoader = new
GroovyClassLoader(Thread.currentThread().contextClassLoader)
+ def scriptRoots = new URL[1]
+ scriptRoots[0] = new File(scriptName).toURI().toURL()
+ def scriptEngine = new GroovyScriptEngine(scriptRoots, scriptClassLoader)
+
+ def scriptResult = scriptEngine.run(scriptName, new Binding())
+
+ ControlResults results = new ControlResults()
+ results.complexResults.put(new PropertySimple("results", scriptResult))
+
+ return results;
+ }
+
+
+}
diff --git
a/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
new file mode 100644
index 0000000..c952fa7
--- /dev/null
+++
b/modules/enterprise/server/plugins/groovy-script/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -0,0 +1,35 @@
+<generic-plugin name="GroovyScriptServerPlugin"
+ displayName="Groovy Script Server Plugin"
+ description="A plugin that executes Groovy scripts on the RHQ
server"
+ package="org.rhq.enterprise.server.plugins.groovy"
+ disabledOnDiscovery="true"
+ version="2.0"
+ xmlns="urn:xmlns:rhq-serverplugin.generic"
+ xmlns:serverplugin="urn:xmlns:rhq-serverplugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+ <serverplugin:plugin-component class="GroovyScriptPluginComponent">
+ <serverplugin:control name="execute" description="Executes a
Groovy script">
+ <serverplugin:parameters>
+ <c:simple-property name="script"
+ required="true"
+ description="The pat of the script to execute.
Can be relative or absolute." />
+ <c:list-property name="classpathList"
displayName="classpath" required="false">
+ <c:map-property name="classpathMap">
+ <c:simple-property name="path"
+ description="A file system path that can
refer to a classes directory, a
+ single JAR file, or a directory containing
multiple JAR files."/>
+ <c:simple-property name="libDir"
displayName="JAR Directory" default="no">
+ <c:property-options>
+ <c:option value="yes"
name="Yes"/>
+ <c:option value="no"
name="No"/>
+ </c:property-options>
+ </c:simple-property>
+ </c:map-property>
+ </c:list-property>
+ </serverplugin:parameters>
+ <serverplugin:results>
+ <c:simple-property name="results"/>
+ </serverplugin:results>
+ </serverplugin:control>
+ </serverplugin:plugin-component>
+</generic-plugin>
\ No newline at end of file
commit 92ddd5c12dcae2e15ec901a6ce2451d231cd0ae7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Aug 8 20:41:10 2010 -0400
rename one of the locateProperty methods because they both have the same type erasure
diff --git
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
index 0ee5348..53b9c5f 100644
---
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
+++
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
@@ -134,7 +134,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
return located;
}
- private PropertySimple locateProperty(List<PropertySimple> properties, String
name) {
+ private PropertySimple locatePropertySimple(List<PropertySimple> properties,
String name) {
PropertySimple located = null;
if ((properties != null) && (name != null) &&
(name.trim().length() > 0)) {
// List<Entry> list = properties.getEntry();
@@ -150,7 +150,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
}
private PropertySimple getSimple(List<PropertySimple> list, String name) {
- Property property = locateProperty(list, name);
+ Property property = locatePropertySimple(list, name);
return (PropertySimple) property;
}
commit 66ebfe1fab70d87284d58c0fbe1f05df287b004a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Aug 8 20:36:02 2010 -0400
add newly exposed AlertDefinitionManager remote methods to the WebservicesManagerBean
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index c188ffe..e5f2802 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -213,6 +213,18 @@ public class WebservicesManagerBean implements WebservicesRemote {
return alertDefinitionManager.findAlertDefinitionsByCriteria(subject, criteria);
}
+ public int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) {
+ return alertDefinitionManager.enableAlertDefinitions(subject,
alertDefinitionIds);
+ }
+
+ public int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) {
+ return alertDefinitionManager.disableAlertDefinitions(subject,
alertDefinitionIds);
+ }
+
+ public int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) {
+ return alertDefinitionManager.removeAlertDefinitions(subject,
alertDefinitionIds);
+ }
+
//ALERTDEFINITIONMANAGER: END ----------------------------------
//AVAILABILITYMANAGER: BEGIN ----------------------------------
commit f4cb54aecbdbd4f25ad2326f072a04eb6ccc5092
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Aug 8 18:11:57 2010 -0400
only find enabled alert definitions by default
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 8eb7efd..9ddf148 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
@@ -53,7 +53,7 @@ public class AlertDefinitionCriteria extends Criteria {
private List<Integer> filterResourceGroupIds; // requires overrides
private Boolean filterEnabled;
private String filterOperationName; // requires overrides
- private Boolean filterDeleted;
+ private Boolean filterDeleted = false; // find enabled definitions by default
private boolean fetchAlerts;
private boolean fetchConditions;
commit 9363b498345b7977798274b27637f8a360f4675d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Aug 8 18:02:10 2010 -0400
move existing enable/disable/delete methods to remote API for AlertDefinitionManager
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
index ec64487..6908301 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
@@ -47,10 +47,6 @@ public interface AlertDefinitionManagerLocal {
int createAlertDefinition(Subject subject, AlertDefinition alertDefinition, Integer
resourceId)
throws InvalidAlertDefinitionException;
- int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
-
- int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
-
boolean isEnabled(Integer definitionId);
boolean isTemplate(Integer definitionId);
@@ -59,8 +55,6 @@ public interface AlertDefinitionManagerLocal {
boolean isResourceAlertDefinition(Integer definitionId);
- int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
-
List<AlertDefinition> findAllRecoveryDefinitionsById(Subject subject, Integer
alertDefinitionId);
void copyAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
@@ -81,4 +75,10 @@ public interface AlertDefinitionManagerLocal {
AlertDefinition getAlertDefinition(Subject subject, int alertDefinitionId);
PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject,
AlertDefinitionCriteria criteria);
+
+ int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
+
+ int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
+
+ int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java
index b47a4ef..3ed890b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java
@@ -44,4 +44,19 @@ public interface AlertDefinitionManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "criteria") AlertDefinitionCriteria criteria);
+ @WebMethod
+ int enableAlertDefinitions(//
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds);
+
+ @WebMethod
+ int disableAlertDefinitions(//
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds);
+
+ @WebMethod
+ int removeAlertDefinitions(//
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds);
+
}
commit f99b214e185bab099b59590fe03ee7e04bd95693
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:12:21 2010 -0400
[BZ-610859] Fix issue in AS5 plugin discovery component that initializes
the log event source with the wrong name. When adding a second log
event source it introduces the name mismatch.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index 5068f2d..94cad13 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -32,18 +32,20 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.maven.artifact.versioning.ComparableVersion;
-import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
@@ -53,20 +55,18 @@ import
org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.ClassLoaderFacet;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.util.FileUtils;
import org.rhq.core.system.ProcessInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstallationInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstanceInfo;
-import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.helper.JBossProductType;
+import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.util.JnpConfig;
-import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
-
/**
* A Resource discovery component for JBoss AS Server Resources, which include the
following:
*
@@ -79,7 +79,7 @@ import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
* @author Mark Spritzler
*/
public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryComponent,
ClassLoaderFacet,
- ManualAddFacet {
+ ManualAddFacet {
private static final String CHANGE_ME = "***CHANGE_ME***";
private static final String JBOSS_SERVICE_XML = "conf" + File.separator +
"jboss-service.xml";
private static final String JBOSS_NAMING_SERVICE_XML = "deploy" +
File.separator + "naming-service.xml";
@@ -98,14 +98,9 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
private static final List<String> CLIENT_JARS = Arrays.asList(
// NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the
client dir via its
// MANIFEST.MF Class-Path.
- "client/jbossall-client.jar",
- "client/trove.jar",
- "client/javassist.jar",
- "common/lib/jboss-security-aspects.jar",
- "lib/jboss-managed.jar",
- "lib/jboss-metatype.jar",
- "lib/jboss-dependency.jar"
- );
+ "client/jbossall-client.jar", "client/trove.jar",
"client/javassist.jar",
+ "common/lib/jboss-security-aspects.jar",
"lib/jboss-managed.jar", "lib/jboss-metatype.jar",
+ "lib/jboss-dependency.jar");
private static final List<String> AS6_CLIENT_JARS = new
ArrayList<String>(CLIENT_JARS);
static {
@@ -132,8 +127,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
}
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig,
- ResourceDiscoveryContext
discoveryContext)
- throws InvalidPluginConfigurationException {
+ ResourceDiscoveryContext discoveryContext) throws
InvalidPluginConfigurationException {
// Set default values on any props that are not set.
//setPluginConfigurationDefaults(pluginConfiguration);
@@ -152,10 +146,11 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
}
@SuppressWarnings("unchecked")
- public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context,
DiscoveredResourceDetails details)
- throws Exception {
+ public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context,
DiscoveredResourceDetails details)
+ throws Exception {
Configuration pluginConfig = details.getPluginConfiguration();
- String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
List<URL> clientJars = new ArrayList<URL>();
@@ -236,8 +231,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
jnpURL));
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.HOME_DIR,
installHome.getAbsolutePath()));
- pluginConfiguration.put(new PropertySimple(
- ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR,
configDir));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR,
+ configDir));
// Set the optional props...
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_NAME,
@@ -247,19 +242,17 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
JBossASDiscoveryUtils.UserInfo userInfo =
JBossASDiscoveryUtils.getJmxInvokerUserInfo(configDir);
if (userInfo != null) {
- pluginConfiguration.put(
- new
PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
- userInfo.getUsername()));
- pluginConfiguration.put(
- new
PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
- userInfo.getPassword()));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
+ userInfo.getUsername()));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
+ userInfo.getPassword()));
}
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR);
if (javaHome == null && log.isDebugEnabled()) {
log.warn("Unable to determine the JAVA_HOME environment variable for
the JBoss AS process - "
+ " the Agent is probably running as a user that does not have
access to the AS process's "
- + " environment.");
+ + " environment.");
}
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.JAVA_HOME,
javaHome));
@@ -281,15 +274,17 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
try {
return new
InProcessJBossASDiscovery().discoverInProcessJBossAS(discoveryContext);
} catch (Throwable t) {
- log.debug("In-process JBoss AS discovery failed - we are probably not
running embedded within JBoss AS.", t);
+ log
+ .debug("In-process JBoss AS discovery failed - we are probably not
running embedded within JBoss AS.",
+ t);
return null;
}
}
private DiscoveredResourceDetails createResourceDetails(ResourceDiscoveryContext
discoveryContext,
Configuration pluginConfig, @Nullable ProcessInfo processInfo,
JBossInstallationInfo installInfo) {
- String serverHomeDir = pluginConfig.getSimple(
-
ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR).getStringValue();
+ String serverHomeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR)
+ .getStringValue();
File absoluteConfigPath = resolvePathRelativeToHomeDir(pluginConfig,
serverHomeDir);
// Canonicalize the config path, so it's consistent no matter how it's
entered.
@@ -298,8 +293,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
// JON: fix for JBNADM-2634 - do not resolve symlinks (ips, 12/18/07)
String key = FileUtils.getCanonicalPath(absoluteConfigPath.getPath());
- String bindAddress = pluginConfig.getSimple(
-
ApplicationServerPluginConfigurationProperties.BIND_ADDRESS).getStringValue();
+ String bindAddress =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.BIND_ADDRESS)
+ .getStringValue();
String namingUrl =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.NAMING_URL)
.getStringValue();
@@ -316,7 +311,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION;
File deployDir = new File(absoluteConfigPath, "deploy");
-
+
File rhqInstallerWar = new File(deployDir, "rhq-installer.war");
File rhqInstallerWarUndeployed = new File(deployDir,
"rhq-installer.war.rej");
boolean isRhqServer = rhqInstallerWar.exists() ||
rhqInstallerWarUndeployed.exists();
@@ -325,13 +320,15 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
// We know this is an RHQ Server. Let's add an event source for its
server log file, but disable it by default.
configureEventSourceForServerLogFile(pluginConfig);
}
- String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(),
isRhqServer);
+ String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(),
+ absoluteConfigPath.getName(), isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, installInfo.getVersion(),
description, pluginConfig, processInfo);
}
- public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName, boolean isRhq) {
+ public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName,
+ boolean isRhq) {
if (isRhq) {
return hostname + " RHQ Server";
@@ -359,12 +356,12 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
return hostnameToUse + " " + configurationName;
}
}
-
+
private void configureEventSourceForServerLogFile(Configuration pluginConfig) {
File rhqLogFile = resolvePathRelativeToHomeDir(pluginConfig,
"../logs/rhq-server-log4j.log");
if (rhqLogFile.exists() && !rhqLogFile.isDirectory()) {
try {
- PropertyMap serverLogEventSource = new
PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new
PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, rhqLogFile
.getCanonicalPath()));
@@ -426,7 +423,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
File logDir = new File(configDir, "log");
File serverLogFile = new File(logDir, "server.log");
if (serverLogFile.exists() && !serverLogFile.isDirectory()) {
- PropertyMap serverLogEventSource = new PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new
PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH,
serverLogFile));
serverLogEventSource.put(new PropertySimple(
@@ -445,7 +442,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
boolean supported = (version.compareTo(minimumVersion) >= 0);
if (!supported) {
log.debug(productType + " version " + version + " is not
supported by this plugin (minimum " + productType
- + " version is " + minimumVersion + ") -
skipping...");
+ + " version is " + minimumVersion + ") -
skipping...");
}
return supported;
}
@@ -454,7 +451,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
private static File resolvePathRelativeToHomeDir(Configuration pluginConfig, @NotNull
String path) {
File configDir = new File(path);
if (!configDir.isAbsolute()) {
- String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
configDir = new File(homeDir, path);
}
return configDir;
commit e964a36a6766596718d0317631a5342688533ae4
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:10:24 2010 -0400
up the mc4j version
diff --git a/.classpath b/.classpath
index 35714ec..dc15df6 100644
--- a/.classpath
+++ b/.classpath
@@ -202,7 +202,7 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14.jar"
sourcepath="/M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar"
sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.14/org-mc4j-ems-1.2.14.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar"
sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
commit 37d5573d9992b6158c9c47014fa42e874bee32ab
Merge: 163db5e... c08cbb0...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:14:07 2010 -0400
Merge branch 'master' into master-jay
commit 163db5e31289289df03123e0b8374646a487679a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:12:21 2010 -0400
[BZ-610859] Fix issue in AS5 plugin discovery component that initializes
the log event source with the wrong name. When adding a second log
event source it introduces the name mismatch.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index 5068f2d..94cad13 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -32,18 +32,20 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.maven.artifact.versioning.ComparableVersion;
-import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
@@ -53,20 +55,18 @@ import
org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.ClassLoaderFacet;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.util.FileUtils;
import org.rhq.core.system.ProcessInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstallationInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstanceInfo;
-import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.helper.JBossProductType;
+import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.util.JnpConfig;
-import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
-
/**
* A Resource discovery component for JBoss AS Server Resources, which include the
following:
*
@@ -79,7 +79,7 @@ import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
* @author Mark Spritzler
*/
public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryComponent,
ClassLoaderFacet,
- ManualAddFacet {
+ ManualAddFacet {
private static final String CHANGE_ME = "***CHANGE_ME***";
private static final String JBOSS_SERVICE_XML = "conf" + File.separator +
"jboss-service.xml";
private static final String JBOSS_NAMING_SERVICE_XML = "deploy" +
File.separator + "naming-service.xml";
@@ -98,14 +98,9 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
private static final List<String> CLIENT_JARS = Arrays.asList(
// NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the
client dir via its
// MANIFEST.MF Class-Path.
- "client/jbossall-client.jar",
- "client/trove.jar",
- "client/javassist.jar",
- "common/lib/jboss-security-aspects.jar",
- "lib/jboss-managed.jar",
- "lib/jboss-metatype.jar",
- "lib/jboss-dependency.jar"
- );
+ "client/jbossall-client.jar", "client/trove.jar",
"client/javassist.jar",
+ "common/lib/jboss-security-aspects.jar",
"lib/jboss-managed.jar", "lib/jboss-metatype.jar",
+ "lib/jboss-dependency.jar");
private static final List<String> AS6_CLIENT_JARS = new
ArrayList<String>(CLIENT_JARS);
static {
@@ -132,8 +127,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
}
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig,
- ResourceDiscoveryContext
discoveryContext)
- throws InvalidPluginConfigurationException {
+ ResourceDiscoveryContext discoveryContext) throws
InvalidPluginConfigurationException {
// Set default values on any props that are not set.
//setPluginConfigurationDefaults(pluginConfiguration);
@@ -152,10 +146,11 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
}
@SuppressWarnings("unchecked")
- public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context,
DiscoveredResourceDetails details)
- throws Exception {
+ public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context,
DiscoveredResourceDetails details)
+ throws Exception {
Configuration pluginConfig = details.getPluginConfiguration();
- String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
List<URL> clientJars = new ArrayList<URL>();
@@ -236,8 +231,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
jnpURL));
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.HOME_DIR,
installHome.getAbsolutePath()));
- pluginConfiguration.put(new PropertySimple(
- ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR,
configDir));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR,
+ configDir));
// Set the optional props...
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_NAME,
@@ -247,19 +242,17 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
JBossASDiscoveryUtils.UserInfo userInfo =
JBossASDiscoveryUtils.getJmxInvokerUserInfo(configDir);
if (userInfo != null) {
- pluginConfiguration.put(
- new
PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
- userInfo.getUsername()));
- pluginConfiguration.put(
- new
PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
- userInfo.getPassword()));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
+ userInfo.getUsername()));
+ pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
+ userInfo.getPassword()));
}
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR);
if (javaHome == null && log.isDebugEnabled()) {
log.warn("Unable to determine the JAVA_HOME environment variable for
the JBoss AS process - "
+ " the Agent is probably running as a user that does not have
access to the AS process's "
- + " environment.");
+ + " environment.");
}
pluginConfiguration.put(new
PropertySimple(ApplicationServerPluginConfigurationProperties.JAVA_HOME,
javaHome));
@@ -281,15 +274,17 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
try {
return new
InProcessJBossASDiscovery().discoverInProcessJBossAS(discoveryContext);
} catch (Throwable t) {
- log.debug("In-process JBoss AS discovery failed - we are probably not
running embedded within JBoss AS.", t);
+ log
+ .debug("In-process JBoss AS discovery failed - we are probably not
running embedded within JBoss AS.",
+ t);
return null;
}
}
private DiscoveredResourceDetails createResourceDetails(ResourceDiscoveryContext
discoveryContext,
Configuration pluginConfig, @Nullable ProcessInfo processInfo,
JBossInstallationInfo installInfo) {
- String serverHomeDir = pluginConfig.getSimple(
-
ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR).getStringValue();
+ String serverHomeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR)
+ .getStringValue();
File absoluteConfigPath = resolvePathRelativeToHomeDir(pluginConfig,
serverHomeDir);
// Canonicalize the config path, so it's consistent no matter how it's
entered.
@@ -298,8 +293,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
// JON: fix for JBNADM-2634 - do not resolve symlinks (ips, 12/18/07)
String key = FileUtils.getCanonicalPath(absoluteConfigPath.getPath());
- String bindAddress = pluginConfig.getSimple(
-
ApplicationServerPluginConfigurationProperties.BIND_ADDRESS).getStringValue();
+ String bindAddress =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.BIND_ADDRESS)
+ .getStringValue();
String namingUrl =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.NAMING_URL)
.getStringValue();
@@ -316,7 +311,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION;
File deployDir = new File(absoluteConfigPath, "deploy");
-
+
File rhqInstallerWar = new File(deployDir, "rhq-installer.war");
File rhqInstallerWarUndeployed = new File(deployDir,
"rhq-installer.war.rej");
boolean isRhqServer = rhqInstallerWar.exists() ||
rhqInstallerWarUndeployed.exists();
@@ -325,13 +320,15 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
// We know this is an RHQ Server. Let's add an event source for its
server log file, but disable it by default.
configureEventSourceForServerLogFile(pluginConfig);
}
- String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(),
isRhqServer);
+ String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(),
+ absoluteConfigPath.getName(), isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, installInfo.getVersion(),
description, pluginConfig, processInfo);
}
- public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName, boolean isRhq) {
+ public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName,
+ boolean isRhq) {
if (isRhq) {
return hostname + " RHQ Server";
@@ -359,12 +356,12 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
return hostnameToUse + " " + configurationName;
}
}
-
+
private void configureEventSourceForServerLogFile(Configuration pluginConfig) {
File rhqLogFile = resolvePathRelativeToHomeDir(pluginConfig,
"../logs/rhq-server-log4j.log");
if (rhqLogFile.exists() && !rhqLogFile.isDirectory()) {
try {
- PropertyMap serverLogEventSource = new
PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new
PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, rhqLogFile
.getCanonicalPath()));
@@ -426,7 +423,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
File logDir = new File(configDir, "log");
File serverLogFile = new File(logDir, "server.log");
if (serverLogFile.exists() && !serverLogFile.isDirectory()) {
- PropertyMap serverLogEventSource = new PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new
PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH,
serverLogFile));
serverLogEventSource.put(new PropertySimple(
@@ -445,7 +442,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
boolean supported = (version.compareTo(minimumVersion) >= 0);
if (!supported) {
log.debug(productType + " version " + version + " is not
supported by this plugin (minimum " + productType
- + " version is " + minimumVersion + ") -
skipping...");
+ + " version is " + minimumVersion + ") -
skipping...");
}
return supported;
}
@@ -454,7 +451,8 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
private static File resolvePathRelativeToHomeDir(Configuration pluginConfig, @NotNull
String path) {
File configDir = new File(path);
if (!configDir.isAbsolute()) {
- String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir =
pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
configDir = new File(homeDir, path);
}
return configDir;
commit 9c0a2cdf3c38a73b75d71f29aa49e41e6af8f639
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:10:24 2010 -0400
up the mc4j version
diff --git a/.classpath b/.classpath
index 35714ec..dc15df6 100644
--- a/.classpath
+++ b/.classpath
@@ -202,7 +202,7 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14.jar"
sourcepath="/M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar"
sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.14/org-mc4j-ems-1.2.14.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar"
sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
commit c08cbb09014fa0ea01fed9d528d5a5e60c573152
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 6 17:19:40 2010 -0400
log more information about the bad property so when this happens its easier to trace
down where the problem was caused
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java
index 0719c61..ce51bcc 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java
@@ -146,7 +146,8 @@ public class PropertyList extends Property {
}
if (!property.getName().equals(this.memberPropertyName)) {
- throw new IllegalStateException("All properties in a PropertyList must
have the same name.");
+ throw new IllegalStateException("All properties in a PropertyList
(id=[" + getId() + "], name=[" + getName()
+ + "]) must have the same name: [" + property.getName() +
"] != [" + this.memberPropertyName + "]");
}
getList().add(property);
commit ca6a1a9e6c921dc1bade752bfe3f417377621695
Merge: 5b29f99... 187c15f...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 6 18:56:31 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 5b29f99f39c53f46cbbc9069f821847cb8f4becd
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Aug 6 18:53:57 2010 +0200
BZ-618214 Copy the system wide snmp preferences for fresh migrations of pre RHQ 3
systems to RHQ 3+
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 09703ee..3e129f3 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -45,6 +45,7 @@
<dependency>
<groupId>i18nlog</groupId>
<artifactId>i18nlog</artifactId>
+ <version>${i18nlog.version}</version>
</dependency>
<dependency>
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
index 7ddfad2..89ae85a 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
@@ -71,6 +71,8 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask
{
upgradeEmailNotifications();
upgradeSNMPNotifications();
upgradeOperationNotifications();
+
+ upgradeSNMPPreferences();
}
private void upgradeSubjectNotificationLogs() throws SQLException {
@@ -281,6 +283,103 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
}
}
+ /**
+ * Copy the system wide snmp preferences. This happens only on
+ * a fresh migration from pre RHQ3 and only if the user has
+ * actually changed the provided defaults.
+ */
+ private void upgradeSNMPPreferences() throws SQLException {
+ String oldPrefsSQL = "" //
+ + " SELECT property_key,property_value"
+ + " FROM RHQ_SYSTEM_CONFIG"
+ + " WHERE property_key LIKE 'SNMP%'";
+
+ String[] keyToProp = { //
+ "SNMP_AGENT_ADDRESS","agentAddress", //
+ "SNMP_AUTH_PASSPHRASE","authPassphrase", //
+ "SNMP_AUTH_PROTOCOL","authProtocol", //
+ "SNMP_COMMUNITY","community",//
+ "SNMP_CONTEXT_NAME","targetContext",//
+ "SNMP_ENGINE_ID","engineId",//
+ "SNMP_ENTERPRISE_OID","enterpriseOid",//
+ "SNMP_GENERIC_ID","genericId",//
+ "SNMP_PRIVACY_PROTOCOL","privacyProtocol",//
+ "SNMP_PRIV_PASSPHRASE","privacyPassphrase",//
+ "SNMP_SECURITY_NAME","securityName",//
+ "SNMP_SPECIFIC_ID","specificId",//
+ "SNMP_TRAP_OID","trapOid",//
+ "SNMP_VERSION","snmpVersion"
+ };
+
+ /*
+ * Check if there is already a config present.
+ * Only run the copy on a fresh upgrade from a pre RHQ 3 version.
+ */
+ int configId = getPluginConfigurationId("alert-snmp");
+ if (configId!=0) {
+ System.out.println("Already found a snmp configuration, not copying the
old one over.");
+ return;
+ }
+
+ // Get the properties from the database
+ List<Object[]> data = databaseType.executeSelectSql(connection,
oldPrefsSQL);
+
+ // check if the user actually did set up the snmp settings in the older version
+ // If not, don't bother, as the plugin will set up its defaults later on.
+ for (Object[] next : data) {
+ String key = (String) next[0];
+ if (key.equals("SNMP_VERSION")) {
+ String val = (String) next[1];
+ if (val==null || val.equals("")) {
+ System.out.println("No SNMP config set in old db version, so not
copying");
+ return;
+ }
+ }
+ }
+
+ // We have work to do ...
+ configId = databaseType.getNextSequenceValue(connection, "rhq_config",
"id");
+ String insertConfigSQL = getInsertConfigSQL(configId);
+ databaseType.executeSql(connection, insertConfigSQL);
+
+ for (Object[] next : data) {
+ // find property
+ String propertyName = null;
+ for (int i = 0 ; i< keyToProp.length ; i++) {
+ if (keyToProp[i].equals(next[0])) {
+ propertyName = keyToProp[i+1];
+ break;
+ }
+ }
+ if (propertyName==null) {
+ System.err.println("Input property " + next[0] + " is not
encoded");
+ System.err.println("Not copying the SNMP preferences");
+
+ }
+
+ String propertyValue = (String) next[1];
+
+ int propertyId = databaseType.getNextSequenceValue(connection,
"rhq_config_property", "id");
+ String insertPropertySQL = getInsertPropertySQL(propertyId, configId,
propertyName, propertyValue);
+ databaseType.executeSql(connection, insertPropertySQL);
+ }
+ }
+
+ int getPluginConfigurationId(String pluginName) throws SQLException {
+ String getConfigIdSQL = "" //
+ + " SELECT plugin_config_id " //
+ + " FROM rhq_plugin" //
+ + " WHERE name = '" + pluginName + "'";
+ List<Object[]> data = databaseType.executeSelectSql(connection,
getConfigIdSQL);
+
+ if (data==null || data.size()==0)
+ return 0;
+ Object[] idos = data.get(0);
+ return (Integer)idos[0];
+
+ }
+
+
private void persist(List<Object[]> data, String propertyName, String sender,
String delimiter,
boolean bufferWithDelimiter) throws SQLException {
int definitionId = -1;
commit 187c15f60aca609f18587382665d060de15a8492
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 6 03:01:09 2010 -0400
opps, I swapped agent and server addresses by mistake.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
index 2cc16b6..dd017ab 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
@@ -132,8 +132,8 @@ public class SSHInstallUtility {
public AgentInstallInfo installAgent(String parentPath) {
String serverAddress = LookupUtil.getServerManager().getServer().getAddress();
- AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(),
agentVersion, accessInfo
- .getHost(), serverAddress);
+ AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(),
agentVersion, serverAddress,
+ accessInfo.getHost());
executeCommand("uname -a", "Machine uname", info);
executeCommand("java -version", "Java Version Check", info);
commit ea0888854eff323615fe3b9c81efacce49b9c8f9
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Aug 6 00:53:03 2010 -0400
finish up the remote agent install UI. error messages aren't ideal and can use
improvement
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
index 055b5f4..5326eaa 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
@@ -49,18 +49,14 @@ public class AgentInstallInfo implements Serializable {
public static final int DEFAULT_AGENT_PORT = 16163;
public AgentInstallInfo() {
- this(null, null);
}
- public AgentInstallInfo(String serverAddress, String agentAddress) {
- this.serverAddress = serverAddress;
- this.agentAddress = agentAddress;
- }
-
- public AgentInstallInfo(String path, String owner, String version) {
+ public AgentInstallInfo(String path, String owner, String version, String
serverAddress, String agentAddress) {
this.path = path;
this.owner = owner;
this.version = version;
+ this.serverAddress = serverAddress;
+ this.agentAddress = agentAddress;
}
public String getPath() {
@@ -87,6 +83,22 @@ public class AgentInstallInfo implements Serializable {
this.version = version;
}
+ public String getServerAddress() {
+ return serverAddress;
+ }
+
+ public void setServerAddress(String serverAddress) {
+ this.serverAddress = serverAddress;
+ }
+
+ public String getAgentAddress() {
+ return agentAddress;
+ }
+
+ public void setAgentAddress(String agentAddress) {
+ this.agentAddress = agentAddress;
+ }
+
public void addStep(AgentInstallStep step) {
steps.add(step);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
index 621771f..926fa49 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
@@ -25,11 +25,11 @@ package org.rhq.enterprise.gui.coregui.client.admin.agent.install;
import java.util.ArrayList;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ExpansionMode;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.HeaderItem;
import com.smartgwt.client.widgets.form.fields.PasswordItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -59,11 +59,17 @@ public class RemoteAgentInstallView extends VLayout {
private RemoteInstallGWTServiceAsync remoteInstallService =
GWTServiceLookup.getRemoteInstallService();
- private DynamicForm form;
+ private DynamicForm connectionForm;
+ private DynamicForm buttonsForm;
+ private ButtonItem installButton;
+ private ButtonItem startButton;
+ private ButtonItem stopButton;
private VLayout agentInfoLayout;
public RemoteAgentInstallView() {
- setMembersMargin(10);
+ setMembersMargin(1);
+ setWidth100();
+ setHeight100();
}
@Override
@@ -71,152 +77,275 @@ public class RemoteAgentInstallView extends VLayout {
super.onInit();
addMember(getConnectionForm());
+ addMember(getButtons());
agentInfoLayout = new VLayout();
agentInfoLayout.setWidth100();
+ agentInfoLayout.setHeight100();
+ agentInfoLayout.setMembersMargin(1);
addMember(agentInfoLayout);
}
- DynamicForm getConnectionForm() {
-
- form = new DynamicForm();
- form.setWidth100();
+ private DynamicForm getConnectionForm() {
+ connectionForm = new DynamicForm();
+ connectionForm.setWidth100();
+ connectionForm.setNumCols(3);
+ connectionForm.setWrapItemTitles(false);
+ connectionForm.setColWidths("25%", "50%", "25%");
+ connectionForm.setMargin(20);
HeaderItem connectionHeader = new HeaderItem();
connectionHeader.setValue("Connection Information");
TextItem host = new TextItem("host", "Hostname");
host.setRequired(true);
+ host.setWidth("100%");
+ host.setPrompt("The host where the agent is or will be installed");
+ host.setColSpan(2);
+
+ TextItem port = new TextItem("port", "Port");
+ port.setRequired(false);
+ port.setWidth("90");
+ port.setPrompt("The port the SSH server is listening to. If not specified,
the default is 22");
+ port.setColSpan(1);
TextItem username = new TextItem("username", "Username");
username.setRequired(true);
+ username.setWidth("100%");
+ username.setPrompt("The name of the user whose credentials are passed to the
host via SSH");
+ username.setColSpan(2);
PasswordItem password = new PasswordItem("password",
"Password");
- // password.setRequired(true);
+ password.setRequired(false);
+ password.setWidth("100%");
+ password.setPrompt("The credentials that are used to authenticate the user
on the host via SSH");
+ password.setColSpan(2);
TextItem agentInstallPath = new TextItem("agentInstallPath",
"Agent Install Path");
agentInstallPath.setRequired(true);
+ agentInstallPath.setWidth("100%");
+ agentInstallPath
+ .setPrompt("Where the agent is or will be installed. If you aren't
sure where an agent is installed, enter a parent directory and click the 'Find
Agent' button to scan that directory and below. If you enter an empty path, common
locations are searched on the host for an agent install.");
+ agentInstallPath.setStartRow(true);
+ agentInstallPath.setEndRow(false);
+
+ ButtonItem findAgentInstallPathButton = new
ButtonItem("findAgentInstallPathButton", "Find Agent");
+ findAgentInstallPathButton.setStartRow(false);
+ findAgentInstallPathButton.setEndRow(true);
+ findAgentInstallPathButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ if (connectionForm.validate()) {
+ findAgentInstallPath();
+ }
+ }
+ });
- ButtonItem statusCheck = new ButtonItem("updateStatus", "Update
Status");
-
- final StaticTextItem agentStatus = new StaticTextItem("agentStatus",
"Agent Status");
+ StaticTextItem agentStatus = new StaticTextItem("agentStatus",
"Agent Status");
+ agentStatus.setDefaultValue("-Click Update Status Button-");
agentStatus.setRedrawOnChange(true);
-
- statusCheck.addClickHandler(new ClickHandler() {
+ agentStatus.setRedrawOnChange(true);
+ agentStatus.setWidth("100%");
+ agentStatus.setStartRow(true);
+ agentStatus.setEndRow(false);
+
+ ButtonItem statusCheckButton = new ButtonItem("updateStatus",
"Update Status");
+ statusCheckButton.setStartRow(false);
+ statusCheckButton.setEndRow(true);
+ statusCheckButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- if (form.validate()) {
+ if (connectionForm.validate()) {
agentStatusCheck();
}
}
});
- ButtonItem startButton = new ButtonItem("start", "Start
Agent");
+ connectionForm.setFields(connectionHeader, host, port, username, password,
agentInstallPath,
+ findAgentInstallPathButton, agentStatus, statusCheckButton);
+
+ return connectionForm;
+ }
+
+ private DynamicForm getButtons() {
+ buttonsForm = new DynamicForm();
+ buttonsForm.setWidth("75%");
+ buttonsForm.setNumCols(4);
+ buttonsForm.setMargin(20);
+ buttonsForm.setColWidths("10%", "30%", "30%",
"30%");
+
+ HeaderItem buttonsHeader = new HeaderItem();
+ buttonsHeader.setValue("Operations");
+
+ SpacerItem spacerItem = new SpacerItem();
+ spacerItem.setStartRow(true);
+ spacerItem.setEndRow(false);
+
+ installButton = new ButtonItem("install", "Install Agent");
+ installButton.setStartRow(false);
+ installButton.setEndRow(false);
+ installButton.setRedrawOnChange(true);
+ installButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ if (connectionForm.validate()) {
+ installAgent();
+ }
+ }
+ });
+
+ startButton = new ButtonItem("start", "Start Agent");
+ startButton.setStartRow(false);
startButton.setEndRow(false);
- // startButton.setShowIfCondition(new FormItemIfFunction() {
- // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- // return form.getValue("agentStatus") != null
&& !"Agent Not
Installed".equals(form.getValue("agentStatus"));
- // }
- // });
+ // startButton.setShowIfCondition(new FormItemIfFunction() {
+ // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ // return form.getValue("agentStatus") != null &&
!"Agent Not Installed".equals(form.getValue("agentStatus"));
+ // }
+ // });
startButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- remoteInstallService.startAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
- new AsyncCallback<String>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to start
agent", caught);
- }
-
- public void onSuccess(String result) {
- CoreGUI.getMessageCenter().notify(
- new Message("Agent successfully started.",
Message.Severity.Info));
- agentStatusCheck();
- }
- });
+ if (connectionForm.validate()) {
+ startAgent();
+ }
}
});
- ButtonItem stopButton = new ButtonItem("stop", "Stop
Agent");
+ stopButton = new ButtonItem("stop", "Stop Agent");
stopButton.setStartRow(false);
- // stopButton.setShowIfCondition(new FormItemIfFunction() {
- // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- // return form.getValue("agentStatus") != null
&& !"Agent Not
Installed".equals(form.getValue("agentStatus"));
- // }
- // });
+ stopButton.setEndRow(true);
stopButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- remoteInstallService.stopAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
- new AsyncCallback<String>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to stop
agent", caught);
- }
-
- public void onSuccess(String result) {
- CoreGUI.getMessageCenter().notify(
- new Message("Agent successfully stopped.",
Message.Severity.Info));
- agentStatusCheck();
- }
- });
+ if (connectionForm.validate()) {
+ stopAgent();
+ }
}
});
- ButtonItem installButton = new ButtonItem("install", "Install
Agent");
- installButton.setRedrawOnChange(true);
- // installButton.setShowIfCondition(new FormItemIfFunction() {
- // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
- // return form.getValue("agentStatus") != null
&& "Agent Not
Installed".equals(form.getValue("agentStatus"));
- // }
- // });
+ buttonsForm.setFields(buttonsHeader, spacerItem, installButton, startButton,
stopButton);
+ return buttonsForm;
+ }
- installButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- remoteInstallService.installAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
- new AsyncCallback<AgentInstallInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to install
agent", caught);
- }
-
- public void onSuccess(AgentInstallInfo result) {
- CoreGUI.getMessageCenter().notify(
- new Message("Agent successfully installed.",
Message.Severity.Info));
-
- for (Canvas child : agentInfoLayout.getChildren()) {
- child.destroy();
- }
- agentInfoLayout.addMember(buildInstallInfoCanvas(result));
- agentInfoLayout.markForRedraw();
- agentStatusCheck();
- }
- });
- }
- });
+ private void findAgentInstallPath() {
+ disableButtons(true);
- form.setFields(connectionHeader, host, username, password, agentInstallPath,
statusCheck, agentStatus,
- new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton,
new SpacerItem());
+ final String parentPath = getAgentInstallPath();
- return form;
+ remoteInstallService.findAgentInstallPath(getRemoteAccessInfo(), parentPath, new
AsyncCallback<String>() {
+ public void onFailure(Throwable caught) {
+ disableButtons(false);
+ CoreGUI.getErrorHandler().handleError("Error occurred while trying
to find agent install path", caught);
+ }
+
+ public void onSuccess(String result) {
+ disableButtons(false);
+ if (result != null) {
+ connectionForm.setValue("agentInstallPath", result);
+ } else {
+ String err;
+ if (parentPath == null || parentPath.length() == 0) {
+ err = "Could not find an agent installed when looking in
common locations";
+ } else {
+ err = "Could not find an agent installed at or under ["
+ parentPath + "]";
+ }
+ CoreGUI.getErrorHandler().handleError(err);
+ }
+ agentStatusCheck();
+ }
+ });
}
private void agentStatusCheck() {
+ disableButtons(true);
remoteInstallService.agentStatus(getRemoteAccessInfo(), getAgentInstallPath(),
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
- form.setValue("agentStatus", caught.getMessage());
+ disableButtons(false);
+ connectionForm.setValue("agentStatus", caught.getMessage());
+ }
+
+ public void onSuccess(String result) {
+ disableButtons(false);
+ connectionForm.setValue("agentStatus", result);
+ }
+ });
+ }
+
+ private void installAgent() {
+ disableButtons(true);
+
+ // FOR TESTING WITHOUT DOING A REAL INSTALL - START
+ // AgentInstallInfo result = new AgentInstallInfo("mypath",
"myown", "1.1", "localHOST", "serverHOST");
+ // for (int i = 1; i < 20; i++)
+ // result.addStep(new AgentInstallStep("cmd" + i,
"desc" + i, i, "result" + i, i * 10));
+ // for (Canvas child : agentInfoLayout.getChildren())
+ // child.destroy();
+ // buildInstallInfoCanvas(agentInfoLayout, result);
+ // agentInfoLayout.markForRedraw();
+ // disableButtons(false);
+ // if (true)
+ // return;
+ // FOR TESTING WITHOUT DOING A REAL INSTALL - END
+
+ remoteInstallService.installAgent(getRemoteAccessInfo(), getAgentInstallPath(),
+ new AsyncCallback<AgentInstallInfo>() {
+ public void onFailure(Throwable caught) {
+ disableButtons(false);
+ CoreGUI.getErrorHandler().handleError("Failed to install
agent", caught);
+ }
+
+ public void onSuccess(AgentInstallInfo result) {
+ disableButtons(false);
+ CoreGUI.getMessageCenter().notify(
+ new Message("Agent installation completed",
Message.Severity.Info));
+
+ for (Canvas child : agentInfoLayout.getChildren()) {
+ child.destroy();
+ }
+ buildInstallInfoCanvas(agentInfoLayout, result);
+ agentInfoLayout.markForRedraw();
+ agentStatusCheck();
+ }
+ });
+ }
+
+ private void startAgent() {
+ disableButtons(true);
+ remoteInstallService.startAgent(getRemoteAccessInfo(), getAgentInstallPath(), new
AsyncCallback<String>() {
+ public void onFailure(Throwable caught) {
+ disableButtons(false);
+ CoreGUI.getErrorHandler().handleError("Failed to start agent",
caught);
}
public void onSuccess(String result) {
- form.setValue("agentStatus", result);
+ disableButtons(false);
+ CoreGUI.getMessageCenter().notify(new Message("Agent start results:
" + result, Message.Severity.Info));
+ agentStatusCheck();
}
});
}
- private Canvas buildInstallInfoCanvas(AgentInstallInfo info) {
+ private void stopAgent() {
+ disableButtons(true);
+ remoteInstallService.stopAgent(getRemoteAccessInfo(), getAgentInstallPath(), new
AsyncCallback<String>() {
+ public void onFailure(Throwable caught) {
+ disableButtons(false);
+ CoreGUI.getErrorHandler().handleError("Failed to stop agent",
caught);
+ }
- VLayout installInfo = new VLayout();
- installInfo.setWidth100();
+ public void onSuccess(String result) {
+ disableButtons(false);
+ CoreGUI.getMessageCenter().notify(new Message("Agent stop results:
" + result, Message.Severity.Info));
+ agentStatusCheck();
+ }
+ });
+ }
+ private void buildInstallInfoCanvas(VLayout installInfo, AgentInstallInfo info) {
DynamicForm infoForm = new DynamicForm();
+ infoForm.setMargin(20);
infoForm.setWidth100();
+ infoForm.setHeight100();
+
HeaderItem infoHeader = new HeaderItem();
infoHeader.setValue("Agent Installation Information");
+
StaticTextItem version = new StaticTextItem("version",
"Version");
version.setValue(info.getVersion());
@@ -229,9 +358,13 @@ public class RemoteAgentInstallView extends VLayout {
StaticTextItem config = new StaticTextItem("config",
"Configuration");
config.setValue(info.getConfigurationStartString());
- infoForm.setFields(infoHeader, version, path, owner, config);
+ CanvasItem listCanvas = new CanvasItem();
+ listCanvas.setShowTitle(false);
+ listCanvas.setColSpan(2);
- installInfo.addMember(infoForm);
+ VLayout listLayout = new VLayout(0);
+ listLayout.setWidth100();
+ listLayout.setHeight100();
ListGrid listGrid = new ListGrid() {
@Override
@@ -241,29 +374,25 @@ public class RemoteAgentInstallView extends VLayout {
return canvas;
}
};
- listGrid.setWidth(800);
- listGrid.setHeight(500);
+ listGrid.setWidth100();
+ listGrid.setHeight100();
listGrid.setCanExpandRecords(true);
listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
listGrid.setDetailField("result");
-
- listGrid.setAutoFitData(Autofit.VERTICAL);
ListGridField step = new ListGridField("description",
"Step");
+ ListGridField result = new ListGridField("result",
"Result");
ListGridField resultCode = new ListGridField("resultCode", "Result
Code", 90);
ListGridField duration = new ListGridField("duration",
"Duration", 90);
-
- listGrid.setFields(step, resultCode, duration);
-
+ listGrid.setFields(step, result, resultCode, duration);
listGrid.setData(getStepRecords(info));
- installInfo.addMember(listGrid);
-
- for (ListGridRecord rec : listGrid.getRecords()) {
- listGrid.expandRecord(rec);
- }
+ listLayout.addMember(listGrid);
+ listCanvas.setCanvas(listLayout);
- return installInfo;
+ infoForm.setFields(infoHeader, version, path, owner, config, listCanvas);
+ installInfo.addMember(infoForm);
+ return;
}
private ListGridRecord[] getStepRecords(AgentInstallInfo info) {
@@ -272,7 +401,11 @@ public class RemoteAgentInstallView extends VLayout {
for (AgentInstallStep step : info.getSteps()) {
ListGridRecord rec = new ListGridRecord();
rec.setAttribute("description", step.getDescription());
- rec.setAttribute("result", step.getResult());
+ String result = step.getResult();
+ if (result == null || result.trim().length() == 0) {
+ result = "Result code=" + step.getResultCode();
+ }
+ rec.setAttribute("result", result);
rec.setAttribute("resultCode", "" +
step.getResultCode());
rec.setAttribute("duration",
MeasurementConverterClient.format((double) step.getDuration(),
MeasurementUnits.MILLISECONDS, true));
@@ -282,15 +415,32 @@ public class RemoteAgentInstallView extends VLayout {
return steps.toArray(new ListGridRecord[steps.size()]);
}
+ private void disableButtons(boolean disabled) {
+ installButton.setDisabled(disabled);
+ startButton.setDisabled(disabled);
+ stopButton.setDisabled(disabled);
+ buttonsForm.setDisabled(disabled);
+ }
+
private RemoteAccessInfo getRemoteAccessInfo() {
- String host = form.getValueAsString("host");
- String username = form.getValueAsString("username");
- String password = form.getValueAsString("password");
- RemoteAccessInfo info = new RemoteAccessInfo(host, username, password);
+ String host = connectionForm.getValueAsString("host");
+ String port = connectionForm.getValueAsString("port");
+ String username = connectionForm.getValueAsString("username");
+ String password = connectionForm.getValueAsString("password");
+
+ int portInt;
+ try {
+ portInt = Integer.parseInt(port);
+ } catch (NumberFormatException e) {
+ portInt = 22;
+ }
+ connectionForm.setValue("port", portInt);
+
+ RemoteAccessInfo info = new RemoteAccessInfo(host, portInt, username, password);
return info;
}
private String getAgentInstallPath() {
- return form.getValueAsString("agentInstallPath");
+ return connectionForm.getValueAsString("agentInstallPath");
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
index 321cf77..f29598f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
@@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.server.gwt;
import org.rhq.core.domain.install.remote.AgentInstallInfo;
import org.rhq.core.domain.install.remote.RemoteAccessInfo;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.gui.coregui.client.gwt.RemoteInstallGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.install.remote.RemoteInstallManagerLocal;
@@ -38,37 +39,65 @@ public class RemoteInstallGWTServiceImpl extends
AbstractGWTServiceImpl implemen
private RemoteInstallManagerLocal remoteInstallManager =
LookupUtil.getRemoteInstallManager();
public boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String
agentInstallPath) {
- return
SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(),
remoteAccessInfo,
- agentInstallPath), "RemoteInstallService.agentInstallCheck");
+ try {
+ return
SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.agentInstallCheck");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
- return
SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(),
remoteAccessInfo,
- parentPath), "RemoteInstallService.installAgent");
+ try {
+ return
SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(),
remoteAccessInfo,
+ parentPath), "RemoteInstallService.installAgent");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
- return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(),
remoteAccessInfo,
- agentInstallPath), "RemoteInstallService.startAgent");
+ try {
+ return
SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.startAgent");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
- return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(),
remoteAccessInfo,
- agentInstallPath), "RemoteInstallService.stopAgent");
+ try {
+ return
SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.stopAgent");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
- return
SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(),
remoteAccessInfo,
- agentInstallPath), "RemoteInstallService.agentStatus");
+ try {
+ return
SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.agentStatus");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
- return
SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(),
remoteAccessInfo,
- parentPath)), "RemoteInstallService.findAgentInstallPath");
+ try {
+ return
SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(),
+ remoteAccessInfo, parentPath)),
"RemoteInstallService.findAgentInstallPath");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
- return
SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(),
remoteAccessInfo,
- parentPath)), "RemoteInstallService.remotePathDiscover");
+ try {
+ return
SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(),
+ remoteAccessInfo, parentPath)),
"RemoteInstallService.remotePathDiscover");
+ } catch (Exception e) {
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
index c81b478..2cc16b6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
@@ -131,7 +131,9 @@ public class SSHInstallUtility {
public AgentInstallInfo installAgent(String parentPath) {
- AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(),
agentVersion);
+ String serverAddress = LookupUtil.getServerManager().getServer().getAddress();
+ AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(),
agentVersion, accessInfo
+ .getHost(), serverAddress);
executeCommand("uname -a", "Machine uname", info);
executeCommand("java -version", "Java Version Check", info);
@@ -151,18 +153,16 @@ public class SSHInstallUtility {
executeCommand("java -jar '" + parentPath + "/" +
agentFile + "' '--install=" + parentPath + "'",
"Install Agent", info);
- String serverAddress = LookupUtil.getServerManager().getServer().getAddress();
-
log.info("Will start new agent @ [" + accessInfo.getHost() + "]
pointing to server @ [" + serverAddress + "]");
String agentScript = parentPath + "/rhq-agent/bin/rhq-agent.sh"; //
NOTE: NOT the wrapper script
- String properties = new AgentInstallInfo(serverAddress,
accessInfo.getHost()).getConfigurationStartString();
+ String startStringArgs = info.getConfigurationStartString();
// Tell the script to store a pid file to make the wrapper script work
String envCmd1 = "RHQ_AGENT_IN_BACKGROUND='" + parentPath +
"/rhq-agent/bin/rhq-agent.pid'";
String envCmd2 = "export RHQ_AGENT_IN_BACKGROUND";
- String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup
'" + agentScript + "' " + properties + " &";
+ String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup
'" + agentScript + "' " + startStringArgs + " &";
executeCommand(startCommand, "Start New Agent", info);
return info;
@@ -236,7 +236,7 @@ public class SSHInstallUtility {
}
private String executeCommand(String command, String description) {
- return executeCommand(command, description, new AgentInstallInfo(null, null));
+ return executeCommand(command, description, new AgentInstallInfo());
}
private String executeCommand(String command, String description, AgentInstallInfo
info) {
commit 972375977f77b3c84da1a835b85537eedb0bc05d
Merge: 7e02dc7... 0ffb520...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 5 23:31:02 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 0ffb52081be378fcdcbbec84aea534a65969fe2d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 5 15:18:07 2010 -0400
[BZ-618659] [BZ-621662] Work around the fact that H2 does not yet support
blob update. This amounts to special casing H2 in the PackageVersion
handling. Also, update H2 version from 1.1.117 to 1.2.139 to get relevant
bug fixes, move to H2's latest db format, and set ourselves up for moving
forward again when/if H2 adds blob update support.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
index 896b396..ef66a51 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
@@ -172,6 +172,8 @@ public class DatabaseTypeFactory {
} else if (db_name.indexOf("h2") != -1) {
if (db_version.startsWith("1.1")) {
database_type_class = H2v11DatabaseType.class;
+ } else if (db_version.startsWith("1.2")) {
+ database_type_class = H2v12DatabaseType.class;
}
} else if (db_name.indexOf("sql server") != -1) {
if (db_version.startsWith("09.00") ||
db_version.startsWith("9.00")) { // SQL Server 2005
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
new file mode 100644
index 0000000..42d164b
--- /dev/null
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.core.db;
+
+/**
+ * H2 database version 1.2 which extends the abstract support for H2 database.
+ *
+ * @author Joseph Marques
+ */
+public class H2v12DatabaseType extends H2DatabaseType {
+ /**
+ * @see DatabaseType#getName()
+ */
+ @Override
+ public String getName() {
+ return H2DatabaseType.VENDOR_NAME + "v1.2";
+ }
+
+ /**
+ * @see DatabaseType#getVersion()
+ */
+ @Override
+ public String getVersion() {
+ return "1.2";
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
index 54ccd3f..40c2886 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
@@ -59,6 +59,7 @@ import org.rhq.core.clientapi.server.content.ContentServiceResponse;
import org.rhq.core.clientapi.server.content.DeletePackagesRequest;
import org.rhq.core.clientapi.server.content.DeployPackagesRequest;
import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest;
+import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.configuration.Configuration;
@@ -1585,10 +1586,15 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
* @param contentDetails
* @return PackageBits ref populated.
*/
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private PackageBits loadPackageBits(InputStream packageBitStream, int
packageVersionId, String packageName,
String packageVersion, PackageBits existingBits, Map<String, String>
contentDetails) {
+ // If/When H2 handles blob update/streaming blobs we can get rid of this
conditional code
+ if (DatabaseTypeFactory.isH2(DatabaseTypeFactory.getDefaultDatabaseType())) {
+ return loadPackageBitsH2(packageBitStream, packageVersionId, packageName,
packageVersion, existingBits,
+ contentDetails);
+ }
+
// use existing or instantiate PackageBits instance.
PackageBits bits = (null == existingBits) ? initializePackageBits(null) :
existingBits;
@@ -1596,7 +1602,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
//associate the two if located.
- if (pv != null) {//np check.
+ if (null != pv) {
pv.setPackageBits(bits);
entityManager.flush();
}
@@ -1607,6 +1613,58 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
return bits;
}
+ private PackageBits loadPackageBitsH2(InputStream packageBitStream, int
packageVersionId, String packageName,
+ String packageVersion, PackageBits existingBits, Map<String, String>
contentDetails) {
+
+ PackageBits bits = null;
+ PackageBitsBlob blob = null;
+
+ // The blob cannot be updated, so we'll need to create a whole new row.
+ if (null != existingBits) {
+ blob = entityManager.find(PackageBitsBlob.class, existingBits.getId());
+ entityManager.remove(blob);
+ entityManager.flush();
+ }
+
+ // We have to work backwards to avoid constraint violations. PackageBits requires
a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ // just set the blob now, no streaming. The assumption is that H2 (demo) will not
be using large blobs
+ byte[] bytes = StreamUtil.slurp(packageBitStream);
+ blob.setBits(bytes);
+ entityManager.persist(blob);
+ entityManager.flush();
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do not
persist the
+ // entity, the row already exists (due to the blob persist above). Just perform
and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ entityManager.flush();
+
+ //locate related packageVersion
+ PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
+
+ //associate the two if packageVersion exists.
+ if (null != pv) {
+ pv.setPackageBits(bits);
+ entityManager.flush();
+ }
+
+ // update contentDetails in needed
+ if (null != contentDetails) {
+ contentDetails.put(UPLOAD_FILE_SIZE, String.valueOf(bytes.length));
+ try {
+ contentDetails.put(UPLOAD_SHA256, new
MessageDigestGenerator(MessageDigestGenerator.SHA_256)
+ .calcDigestString(bytes));
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to calculate SHA256 for package
bits: ", e);
+ }
+ }
+
+ return bits;
+ }
+
/**
* This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated
PackageBitsBlob.
* Note that PackageBits and PackageBitsBlob are two entities that *share* the same
db row. This is
diff --git a/pom.xml b/pom.xml
index 2a0db1c..ed621bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
<ems.version>1.2.14</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
- <h2.version>1.1.117</h2.version>
+ <h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
<richfaces.version>3.3.3.Final</richfaces.version>
<jline.version>0.9.94</jline.version>
commit 14e4a2fde58374e18db46335398bc3644ac2af95
Merge: 9b35996... cb5a73b...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 5 22:32:33 2010 -0400
Merge branch 'master' into master-jay
diff --cc pom.xml
index e766f69,2a0db1c..ed621bf
--- a/pom.xml
+++ b/pom.xml
@@@ -85,11 -85,11 +85,11 @@@
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
- <ems.version>1.2.11</ems.version>
+ <ems.version>1.2.14</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
- <h2.version>1.1.117</h2.version>
+ <h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
- <richfaces.version>3.3.3.CR1</richfaces.version>
+ <richfaces.version>3.3.3.Final</richfaces.version>
<jline.version>0.9.94</jline.version>
<sigar.version>1.6.5.132</sigar.version>
<quartz.version>1.6.5</quartz.version>
commit cb5a73bc660ad40b8fca0b4c287b14aa89797237
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Aug 5 17:55:51 2010 -0400
default to summary tab when switch resources to a resource where the current selection
is not relevant or allowed
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 798d4bc..a40f10a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -261,6 +261,10 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
}
+ if (topTabSet.getSelectedTab().getDisabled()) {
+ topTabSet.selectTab(0);
+ }
+
}
commit b31ed6d9cb521f384da1bdb1d74245345dba8b85
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Aug 5 17:54:16 2010 -0400
Chop JSF menu from pages loaded with nomenu param (as embedded in jsf
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index 2c4e779..d331d51 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -8,6 +8,7 @@
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:onc="http://jboss.org/on/component">
+<c:if test="${empty param.nomenu}">
<h:form>
@@ -688,5 +689,6 @@ v <rich:menuItem submitMode="none"
</a4j:form>
</a4j:region>
+</c:if>
</a4j:region>
commit 3b8e5db720d4ade81b52ba4522ce858c45825661
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Aug 3 12:10:47 2010 -0400
Highlight improvement for tables with background graphs
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index d565834..bc48f18 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -345,3 +345,13 @@ a:hover {
padding: 5px;
border: 1px solid darkblue;
}
+
+
+/* This sets table mouse-over highlights to have an alpha component on browsers that
support it.
+ It particularly helps with tables that have bar charts as a background component.
+ (e.g. problem metrics or call time)
+*/
+.tallCellOver, .tallCellOverDark {
+ background-color: rgb(230,230,230) !important; /* for browsers that don't like
alpha */
+ background-color: rgba(230,230,230,0.6) !important;
+}
\ No newline at end of file
commit 546416b2bb34e9d712e19bc23fc8253daed181a5
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Aug 2 15:46:29 2010 -0400
Event details view to see full log message text or other long event texts
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java
new file mode 100644
index 0000000..13ab506
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java
@@ -0,0 +1,99 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event;
+
+import com.smartgwt.client.types.TitleOrientation;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextAreaItem;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+/**
+ * @author Greg Hinkle
+ */
+public class EventDetailsView extends VLayout {
+
+
+ private ListGridRecord eventRecord;
+
+
+ public EventDetailsView(ListGridRecord eventRecord) {
+ this.eventRecord = eventRecord;
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+
+ DynamicForm form = new DynamicForm();
+ form.setWidth100();
+ form.setHeight100();
+
+ StaticTextItem id = new StaticTextItem("id","Id");
+ id.setValue(eventRecord.getAttribute("id"));
+
+ StaticTextItem severity = new
StaticTextItem("severity","Severity");
+ severity.setValue(eventRecord.getAttribute("severity"));
+
+ StaticTextItem source = new
StaticTextItem("sourceLocation","Source");
+ source.setValue(eventRecord.getAttribute("sourceLocation"));
+
+ StaticTextItem timestamp = new
StaticTextItem("timestamp","Timestamp");
+ timestamp.setValue(eventRecord.getAttribute("timestamp"));
+
+ TextAreaItem detail = new TextAreaItem("detail", "Detail");
+ detail.setTitleOrientation(TitleOrientation.TOP);
+ detail.setColSpan(2);
+ detail.setWidth("100%");
+ detail.setHeight("100%");
+ detail.setValue(eventRecord.getAttribute("detail"));
+
+
+ form.setItems(id,severity,source,timestamp,detail);
+
+
+
+ addMember(form);
+
+ }
+
+ public void displayInDialog() {
+ Window window = new Window();
+ window.setTitle("Event Details");
+ window.setWidth(800);
+ window.setHeight(800);
+ window.setIsModal(true);
+ window.setShowModalMask(true);
+ window.setCanDragResize(true);
+ window.centerInPage();
+ window.addItem(this);
+ window.setDismissOnEscape(true);
+ window.setDismissOnOutsideClick(true);
+ window.show();
+ window.focus();
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
index 492dc14..a876bfe 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
@@ -26,8 +26,11 @@ import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
/**
* @author Greg Hinkle
@@ -40,13 +43,6 @@ public class EventHistoryView extends Table {
setDataSource(new EventDatasource());
- }
-
-
-
- @Override
- protected void onDraw() {
- super.onDraw();
// getListGrid().getField("id").setWidth(60);
getListGrid().getField("severity").setWidth(120);
getListGrid().getField("severity").setCellFormatter(new CellFormatter()
{
@@ -55,10 +51,28 @@ public class EventHistoryView extends Table {
}
});
+ getListGrid().addCellDoubleClickHandler(new CellDoubleClickHandler() {
+ public void onCellDoubleClick(CellDoubleClickEvent cellDoubleClickEvent) {
+ // TODO: Implement this method.
+ showEventDetails(cellDoubleClickEvent.getRecord());
+ }
+ });
+
+ addTableAction("Details", SelectionEnablement.SINGLE, null,
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ showEventDetails(selection[0]);
+ }
+ });
+
getListGrid().getField("sourceLocation").setWidth(200);
getListGrid().getField("timestamp").setWidth(160);
}
+ public static void showEventDetails(ListGridRecord record) {
+ new EventDetailsView(record).displayInDialog();
+ }
+
public static EventHistoryView createResourceHistoryView(int resourceId) {
Criteria criteria = new Criteria();
criteria.addCriteria("resourceId",resourceId);
commit 3cecd4c47e1e9a0dcbc4c0b040bda4b7d4f01248
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Aug 2 15:45:30 2010 -0400
Fix resource tab history reselection (this broke on a change to smartgwt's tab
selection api)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 5e113ee..798d4bc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -290,7 +290,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
TwoLevelTab tab = (TwoLevelTab) t;
if (tab.getTitle().equals(tabView.getPath())) {
- topTabSet.selectTab(tabView.getPath());
+ topTabSet.selectTab(tab); //tabView.getPath());
tab.getLayout().selectTab(subtabView.getPath());
commit 15c1dfd8527df0e88588a9dbb183f9aace21f2b0
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Aug 2 15:44:47 2010 -0400
Point alerts quickview to the reports section
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index 8a6fcc4..334a2aa 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -18,17 +18,13 @@
*/
package org.rhq.enterprise.gui.coregui.client;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
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.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import com.smartgwt.client.widgets.toolbar.ToolStripSeparator;
@@ -112,7 +108,7 @@ public class Footer extends ToolStrip {
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- History.newItem("Subsystems/Alerts");
+ History.newItem("Reports/Inventory/Recent Alerts");
}
});
}
commit 43722261cdf985203f6a0fda51e122b4cf8d7f0d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 23:51:48 2010 -0400
Fix dashboard history tab reselection
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 4444d39..a82393c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -48,7 +48,6 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView;
@@ -139,7 +138,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
HLayout buttons = new HLayout(5);
buttons.addMember(editButton);
- buttons.addMember(newDashboardButton);
+ buttons.addMember(newDashboardButton);
tabSet.setTabBarControls(buttons);
@@ -149,7 +148,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
History.newItem("Dashboard/" +
tabSelectedEvent.getTab().getTitle(), false);
selectedDashboardView = (DashboardView)
tabSelectedEvent.getTab().getPane();
selectedDashboard = selectedDashboardView.getDashboard();
- selectedDashboardView.setEditMode(editMode);
+ selectedDashboardView.setEditMode(editMode);
}
});
@@ -159,7 +158,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
Tab tab = new Tab(dashboard.getName());
tab.setPane(dashboardView);
tab.setCanClose(true);
-
+
tabSet.addTab(tab);
if (dashboard.getName().equals(selectedTab)) {
@@ -193,7 +192,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
dashboard.setName("Default Dashboard");
dashboard.setColumns(2);
dashboard.setColumnWidths("32%", "68%");
- dashboard.getConfiguration().put(new
PropertySimple(Dashboard.CFG_BACKGROUND,"#F1F2F3"));
+ dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
DashboardPortlet summary = new DashboardPortlet("Inventory Summary",
InventorySummaryView.KEY, 230);
@@ -208,7 +207,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
DashboardPortlet welcome = new DashboardPortlet("Welcome To RHQ",
MessagePortlet.KEY, 180);
- welcome.getConfiguration().put(new
PropertySimple("message","<h1>Welcome to RHQ</h1>\n" +
+ welcome.getConfiguration().put(new PropertySimple("message",
"<h1>Welcome to RHQ</h1>\n" +
"<p>The RHQ project 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 " +
@@ -290,12 +289,13 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
}
-
public void renderView(ViewPath viewPath) {
if (!viewPath.isEnd()) {
selectedTab = viewPath.getCurrent().getPath();
- if (tabSet != null) {
- tabSet.selectTab(selectedTab);
+ for (Tab tab : tabSet.getTabs()) {
+ if (selectedTab.equals(tab.getTitle())) {
+ tabSet.selectTab(tab);
+ }
}
}
}
commit 9b359963fa0af88b796d092ff5dca13f6333367f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 5 15:18:07 2010 -0400
[BZ-618659] [BZ-621662] Work around the fact that H2 does not yet support
blob update. This amounts to special casing H2 in the PackageVersion
handling. Also, update H2 version from 1.1.117 to 1.2.139 to get relevant
bug fixes, move to H2's latest db format, and set ourselves up for moving
forward again when/if H2 adds blob update support.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
index 896b396..ef66a51 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java
@@ -172,6 +172,8 @@ public class DatabaseTypeFactory {
} else if (db_name.indexOf("h2") != -1) {
if (db_version.startsWith("1.1")) {
database_type_class = H2v11DatabaseType.class;
+ } else if (db_version.startsWith("1.2")) {
+ database_type_class = H2v12DatabaseType.class;
}
} else if (db_name.indexOf("sql server") != -1) {
if (db_version.startsWith("09.00") ||
db_version.startsWith("9.00")) { // SQL Server 2005
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
new file mode 100644
index 0000000..42d164b
--- /dev/null
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.core.db;
+
+/**
+ * H2 database version 1.2 which extends the abstract support for H2 database.
+ *
+ * @author Joseph Marques
+ */
+public class H2v12DatabaseType extends H2DatabaseType {
+ /**
+ * @see DatabaseType#getName()
+ */
+ @Override
+ public String getName() {
+ return H2DatabaseType.VENDOR_NAME + "v1.2";
+ }
+
+ /**
+ * @see DatabaseType#getVersion()
+ */
+ @Override
+ public String getVersion() {
+ return "1.2";
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
index 54ccd3f..40c2886 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
@@ -59,6 +59,7 @@ import org.rhq.core.clientapi.server.content.ContentServiceResponse;
import org.rhq.core.clientapi.server.content.DeletePackagesRequest;
import org.rhq.core.clientapi.server.content.DeployPackagesRequest;
import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest;
+import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.configuration.Configuration;
@@ -1585,10 +1586,15 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
* @param contentDetails
* @return PackageBits ref populated.
*/
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private PackageBits loadPackageBits(InputStream packageBitStream, int
packageVersionId, String packageName,
String packageVersion, PackageBits existingBits, Map<String, String>
contentDetails) {
+ // If/When H2 handles blob update/streaming blobs we can get rid of this
conditional code
+ if (DatabaseTypeFactory.isH2(DatabaseTypeFactory.getDefaultDatabaseType())) {
+ return loadPackageBitsH2(packageBitStream, packageVersionId, packageName,
packageVersion, existingBits,
+ contentDetails);
+ }
+
// use existing or instantiate PackageBits instance.
PackageBits bits = (null == existingBits) ? initializePackageBits(null) :
existingBits;
@@ -1596,7 +1602,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
//associate the two if located.
- if (pv != null) {//np check.
+ if (null != pv) {
pv.setPackageBits(bits);
entityManager.flush();
}
@@ -1607,6 +1613,58 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
return bits;
}
+ private PackageBits loadPackageBitsH2(InputStream packageBitStream, int
packageVersionId, String packageName,
+ String packageVersion, PackageBits existingBits, Map<String, String>
contentDetails) {
+
+ PackageBits bits = null;
+ PackageBitsBlob blob = null;
+
+ // The blob cannot be updated, so we'll need to create a whole new row.
+ if (null != existingBits) {
+ blob = entityManager.find(PackageBitsBlob.class, existingBits.getId());
+ entityManager.remove(blob);
+ entityManager.flush();
+ }
+
+ // We have to work backwards to avoid constraint violations. PackageBits requires
a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ // just set the blob now, no streaming. The assumption is that H2 (demo) will not
be using large blobs
+ byte[] bytes = StreamUtil.slurp(packageBitStream);
+ blob.setBits(bytes);
+ entityManager.persist(blob);
+ entityManager.flush();
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do not
persist the
+ // entity, the row already exists (due to the blob persist above). Just perform
and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ entityManager.flush();
+
+ //locate related packageVersion
+ PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
+
+ //associate the two if packageVersion exists.
+ if (null != pv) {
+ pv.setPackageBits(bits);
+ entityManager.flush();
+ }
+
+ // update contentDetails in needed
+ if (null != contentDetails) {
+ contentDetails.put(UPLOAD_FILE_SIZE, String.valueOf(bytes.length));
+ try {
+ contentDetails.put(UPLOAD_SHA256, new
MessageDigestGenerator(MessageDigestGenerator.SHA_256)
+ .calcDigestString(bytes));
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to calculate SHA256 for package
bits: ", e);
+ }
+ }
+
+ return bits;
+ }
+
/**
* This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated
PackageBitsBlob.
* Note that PackageBits and PackageBitsBlob are two entities that *share* the same
db row. This is
diff --git a/pom.xml b/pom.xml
index 306bbff..e766f69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
<ems.version>1.2.11</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
- <h2.version>1.1.117</h2.version>
+ <h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
<richfaces.version>3.3.3.CR1</richfaces.version>
<jline.version>0.9.94</jline.version>
commit 162744bec791b9dbcff1099cc93bee2cdabc1ebb
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 5 14:30:44 2010 -0400
if you ever call handleError(String), you will get an NPE - fixing it so that
doesn't happen
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
index 6da2f0b..9491b8f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
@@ -38,7 +38,10 @@ public class ErrorHandler {
Message errorMessage = new Message(message, (t == null) ? null : t.toString(),
Message.Severity.Error);
CoreGUI.getMessageCenter().notify(errorMessage);
- t.printStackTrace();
+ if (t != null) {
+ t.printStackTrace();
+ }
+
this.errors.add(message);
}
commit 7e02dc77ab334709f229f6a82c95a1a73eb6c20a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Aug 5 12:06:17 2010 -0400
make / redirect to /coregui/CoreGUI.html#Dashboard, rather than /Dashboard.do
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index f560de1..8d69a36 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -505,7 +505,7 @@
</session-config>
<welcome-file-list>
- <welcome-file>Dashboard.do</welcome-file>
+ <welcome-file>index.html</welcome-file>
</welcome-file-list>
<error-page>
commit 273fc42aaab1f63d2cca9022ece89a98d02cf07a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Aug 5 10:21:06 2010 -0400
ensure connections are closed after using them
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 e69e1ff..d0a7092 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
@@ -140,12 +140,21 @@ public class StartupServlet extends HttpServlet {
private void initializeServer() {
// Ensure the class is loaded and the dbType is set for our current db
+ Connection conn = null;
try {
DataSource ds = LookupUtil.getDataSource();
- Connection conn = ds.getConnection();
+ conn = ds.getConnection();
DatabaseTypeFactory.setDefaultDatabaseType(DatabaseTypeFactory.getDatabaseType(conn));
} catch (Exception e) {
log("Could not initialize server: ", e);
+ } finally {
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (Exception e) {
+ log("Failed to close temporary connection used for server
initialization: ", e);
+ }
+ }
}
// Ensure that this server is registered in the database.
commit 37c8646f95f62683b9a73947422da97386fc5f6c
Merge: 04f29c2... 6aeb3ea...
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Thu Aug 5 13:55:08 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 04f29c218de34e2b51686832366fb5be11a2415a
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Thu Aug 5 13:54:15 2010 +0200
BZ-618314 - fix of apache tests
BZ-618877 - Includes can use absolute path now.
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index d8b00bc..9f46fc9 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -95,18 +95,27 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration-tests</id>
- <activation>
- <property>
- <name>maven.test.skip</name>
- <value>!true</value>
- </property>
- </activation>
+ <!--
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+ -->
<build>
<plugins>
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 cb61c0a..3e51757 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
@@ -101,17 +101,13 @@ public class AugeasConfigurationApache extends
PluginDescriptorBasedAugeasConfig
}
private void loadIncludes(String expression, List<String> foundIncludes) {
- try {
- File file = new File(expression);
-
+ try {
List<File> files = new ArrayList<File>();
- if (!file.isAbsolute()) {
- File serverRootFile = new File(serverRootPath);
- files = Glob.match(serverRootFile, expression);
- }else
- files.add(file);
-
+ File check = new File(expression);
+ File root = new File(check.isAbsolute() ? Glob.rootPortion(expression) :
serverRootPath);
+ files.addAll(Glob.match(root, expression));
+
for (File fl : files){
if (fl.exists()) {
foundIncludes.add(fl.getAbsolutePath());
@@ -142,8 +138,7 @@ public class AugeasConfigurationApache extends
PluginDescriptorBasedAugeasConfig
}
public void loadFiles() {
- File root = new File(serverRootPath);
-
+
for (AugeasModuleConfig module : modules) {
List<String> includeGlobs = module.getIncludedGlobs();
@@ -154,10 +149,10 @@ public class AugeasConfigurationApache extends
PluginDescriptorBasedAugeasConfig
ArrayList<File> files = new ArrayList<File>();
for (String incl : includeGlobs) {
- if (incl.indexOf(File.separatorChar) == 0) {
- files.add(new File(incl));
- } else
- files.addAll(Glob.match(root, incl));
+ File check = new File(incl);
+ File root = new File(check.isAbsolute() ? Glob.rootPortion(incl) :
serverRootPath);
+
+ files.addAll(Glob.match(root, incl));
}
if (module.getExcludedGlobs() != null) {
@@ -185,15 +180,11 @@ public class AugeasConfigurationApache extends
PluginDescriptorBasedAugeasConfig
private static List<File> getIncludeFiles(String serverRoot, List<String>
foundIncludes) {
List<File> ret = new ArrayList<File>();
- File serverRootFile = new File(serverRoot);
for (String path : foundIncludes) {
- File check = new File(path);
- if (check.isAbsolute()) {
- ret.add(check);
- } else {
- for (File f : Glob.match(serverRootFile, path)) {
- ret.add(f);
- }
+ File check = new File(path);
+ File root = new File(check.isAbsolute() ? Glob.rootPortion(path) :
serverRoot);
+ for (File f :Glob.match(root, path)){
+ 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 24c2e95..e6454b7 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
@@ -70,18 +70,16 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
AugeasNode rootNode = new ApacheAugeasNode(ApacheAugeasTree.AUGEAS_DATA_PATH +
rootPath, tree);
tree.setRootNode(rootNode);
- File rootFile = new File(apacheConfig.getServerRootPath());
// we need to know which files are related to each glob
for (String inclName : module.getIncludedGlobs()) {
List<File> files = new ArrayList<File>();
- if (inclName.indexOf(File.separatorChar) == 0) {
- files.add(new File(inclName));
- } else
- files.addAll(Glob.match(rootFile, inclName));
-
+ File check = new File(inclName);
+ File root = new File(check.isAbsolute() ? Glob.rootPortion(inclName) :
apacheConfig.getServerRootPath());
+ files.addAll(Glob.match(root, inclName));
+
if (module.getExcludedGlobs() != null)
Glob.excludeAll(files, module.getExcludedGlobs());
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
index 344ab1f..88a050b 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
@@ -3,6 +3,8 @@ package org.rhq.plugins.apache;
import java.io.File;
import java.util.List;
+import net.augeas.Augeas;
+
import org.rhq.augeas.AugeasProxy;
import org.rhq.augeas.node.AugeasNode;
import org.rhq.augeas.tree.AugeasTree;
@@ -120,4 +122,13 @@ public class ApacheAugeasTest {
//test if the updated augeas tree can be mapped to configuration stored at
files in "loadconfig" temporary directory
testLoadConfig(treeUpdate, container);
}
+
+ public boolean isAugeasInstalled(){
+ try {
+ Augeas ag = new Augeas();
+ }catch(Throwable e){
+ return false;
+ }
+ return true;
+ }
}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
index 890aa10..5a6cc7e 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
@@ -18,18 +18,16 @@
*/
package org.rhq.plugins.apache;
-/*
+
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
-
import org.rhq.core.clientapi.server.discovery.InventoryReport;
import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.MeasurementData;
@@ -43,7 +41,6 @@ import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-*/
/**
* The unit tests for the JON Apache plugin.
@@ -53,7 +50,6 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet;
public class ApachePluginTest {
private static final String PLUGIN_NAME = "Apache";
- /*
@BeforeSuite
public void start() {
//System.out.println("java.class.path=" +
System.getProperty("java.class.path"));
@@ -71,6 +67,10 @@ public class ApachePluginTest {
container.getInventoryManager().executeServerScanImmediately();
container.getInventoryManager().executeServiceScanImmediately();
ApacheAugeasTest test = new ApacheAugeasTest();
+ if (!test.isAugeasInstalled()){
+ System.out.println("Augeas is not installed.");
+ return;
+ }
test.testMapping(container);
} catch (Exception e) {
e.printStackTrace();
@@ -153,5 +153,4 @@ public class ApachePluginTest {
ApachePluginTest pluginTest = new ApachePluginTest();
pluginTest.start();
}
- */
-}
\ No newline at end of file
+}
commit 6aeb3ea5ba9e3320fbb82d1b464708d69b40740b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 5 04:08:18 2010 -0400
start cleaning up, enhancing remote agent install. have to just pretty up the view,
things work, but the UI just has a poor layout. also, the install steps are failing to
display, need to fix that too. probably no more than a couple hours work left
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
index c40440e..055b5f4 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java
@@ -26,6 +26,7 @@ import java.util.List;
* @author Greg Hinkle
*/
public class AgentInstallInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
private String serverAddress;
private String agentAddress;
@@ -34,12 +35,10 @@ public class AgentInstallInfo implements Serializable {
private String owner;
private String version;
-
public List<AgentInstallStep> steps = new ArrayList<AgentInstallStep>();
public static final String SETUP_PROP =
"rhq.agent.configuration-setup-flag";
-
public static final String SERVER_ADDRESS_PROP =
"rhq.agent.server.bind-address";
public static final String SERVER_PORT_PROP =
"rhq.agent.server.bind-port";
@@ -49,8 +48,8 @@ public class AgentInstallInfo implements Serializable {
public static final int DEFAULT_SERVER_PORT = 7080;
public static final int DEFAULT_AGENT_PORT = 16163;
-
public AgentInstallInfo() {
+ this(null, null);
}
public AgentInstallInfo(String serverAddress, String agentAddress) {
@@ -88,7 +87,6 @@ public class AgentInstallInfo implements Serializable {
this.version = version;
}
-
public void addStep(AgentInstallStep step) {
steps.add(step);
}
@@ -97,9 +95,6 @@ public class AgentInstallInfo implements Serializable {
return steps;
}
-
-
-
public String getConfigurationStartString() {
StringBuilder buf = new StringBuilder();
@@ -111,10 +106,9 @@ public class AgentInstallInfo implements Serializable {
buf.append("-D").append(SETUP_PROP).append("=").append("true");
buf.append(" ");
- buf.append("-d ");
+ buf.append("--daemon ");
return buf.toString();
}
-
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java
index 91b1d8e..6d65094 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java
@@ -21,43 +21,57 @@ package org.rhq.core.domain.install.remote;
import java.io.Serializable;
/**
-* @author Greg Hinkle
-*/
+ * Encapsulates the results of a SSH command that was issued by the remote agent
installer utility.
+ *
+ * @author Greg Hinkle
+ * @author John Mazzitelli
+ */
public class AgentInstallStep implements Serializable {
- int resultCode;
- String command;
- String description;
- String result;
- long time;
+ private static final long serialVersionUID = 1L;
+
+ private String command;
+ private String description;
+ private int resultCode;
+ private String result;
+ private long duration;
public AgentInstallStep() {
}
- public AgentInstallStep(int resultCode, String command, String description, String
result, long time) {
- this.resultCode = resultCode;
+ public AgentInstallStep(String command, String description, int resultCode, String
result, long duration) {
this.command = command;
this.description = description;
+ this.resultCode = resultCode;
this.result = result;
- this.time = time;
+ this.duration = duration;
}
- public int getResultCode() {
- return resultCode;
+ public String getCommand() {
+ return command;
}
public String getDescription() {
return description;
}
- public String getCommand() {
- return command;
+ public int getResultCode() {
+ return resultCode;
}
public String getResult() {
return result;
}
- public long getTime() {
- return time;
+ public long getDuration() {
+ return duration;
}
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("AgentInstallStep
[description=").append(description).append(",
result=").append(result).append(
+ ", resultCode=").append(resultCode).append(",
duration=").append(duration).append("]");
+ return builder.toString();
+ }
+
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java
index 67857ce..b2ab566 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java
@@ -24,31 +24,32 @@ import java.io.Serializable;
* @author Greg Hinkle
*/
public class RemoteAccessInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
- private String host, user, pass;
- byte[] key;
+ private String host;
+ private String user;
+ private String password;
+ private byte[] key;
private int port = 22;
-
public RemoteAccessInfo(String host, String user, byte[] key) {
this.host = host;
this.user = user;
this.key = key;
}
- public RemoteAccessInfo(String host, String user, String pass) {
- this(host, 22, user, pass);
+ public RemoteAccessInfo(String host, String user, String password) {
+ this(host, 22, user, password);
}
- public RemoteAccessInfo(String host, int port, String user, String pass) {
+ public RemoteAccessInfo(String host, int port, String user, String password) {
this.host = host;
this.port = port;
this.user = user;
- this.pass = pass;
+ this.password = password;
}
public RemoteAccessInfo() {
-
}
public String getHost() {
@@ -75,12 +76,12 @@ public class RemoteAccessInfo implements Serializable {
this.user = user;
}
- public String getPass() {
- return pass;
+ public String getPassword() {
+ return password;
}
- public void setPass(String pass) {
- this.pass = pass;
+ public void setPassword(String password) {
+ this.password = password;
}
public byte[] getKey() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
index 76c64a2..621771f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java
@@ -27,13 +27,9 @@ import java.util.ArrayList;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ExpansionMode;
-import com.smartgwt.client.types.TitleOrientation;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.FormItemIfFunction;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.HeaderItem;
import com.smartgwt.client.widgets.form.fields.PasswordItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -48,12 +44,12 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.install.remote.AgentInstallInfo;
import org.rhq.core.domain.install.remote.AgentInstallStep;
+import org.rhq.core.domain.install.remote.RemoteAccessInfo;
import org.rhq.core.domain.measurement.MeasurementConverterClient;
import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.RemoteInstallGWTServiceAsync;
-import org.rhq.core.domain.install.remote.RemoteAccessInfo;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
@@ -74,17 +70,14 @@ public class RemoteAgentInstallView extends VLayout {
protected void onInit() {
super.onInit();
-
addMember(getConnectionForm());
agentInfoLayout = new VLayout();
agentInfoLayout.setWidth100();
addMember(agentInfoLayout);
-
}
-
DynamicForm getConnectionForm() {
form = new DynamicForm();
@@ -93,23 +86,23 @@ public class RemoteAgentInstallView extends VLayout {
HeaderItem connectionHeader = new HeaderItem();
connectionHeader.setValue("Connection Information");
- TextItem host = new TextItem("host");
+ TextItem host = new TextItem("host", "Hostname");
host.setRequired(true);
- TextItem username = new TextItem("username");
+ TextItem username = new TextItem("username", "Username");
username.setRequired(true);
- PasswordItem password = new PasswordItem("password");
-// password.setRequired(true);
+ PasswordItem password = new PasswordItem("password",
"Password");
+ // password.setRequired(true);
+ TextItem agentInstallPath = new TextItem("agentInstallPath",
"Agent Install Path");
+ agentInstallPath.setRequired(true);
ButtonItem statusCheck = new ButtonItem("updateStatus", "Update
Status");
-
final StaticTextItem agentStatus = new StaticTextItem("agentStatus",
"Agent Status");
agentStatus.setRedrawOnChange(true);
-
statusCheck.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
if (form.validate()) {
@@ -118,91 +111,93 @@ public class RemoteAgentInstallView extends VLayout {
}
});
-
ButtonItem startButton = new ButtonItem("start", "Start
Agent");
startButton.setEndRow(false);
-// startButton.setShowIfCondition(new FormItemIfFunction() {
-// public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
-// return form.getValue("agentStatus") != null &&
!"Agent Not Installed".equals(form.getValue("agentStatus"));
-// }
-// });
+ // startButton.setShowIfCondition(new FormItemIfFunction() {
+ // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ // return form.getValue("agentStatus") != null
&& !"Agent Not
Installed".equals(form.getValue("agentStatus"));
+ // }
+ // });
startButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- remoteInstallService.startAgent(getRemoteAccessInfo(), new
AsyncCallback<String>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to start
agent", caught);
- }
-
- public void onSuccess(String result) {
- CoreGUI.getMessageCenter().notify(new Message("Agent
successfully started.", Message.Severity.Info));
- agentStatusCheck();
- }
- });
+ remoteInstallService.startAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
+ new AsyncCallback<String>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to start
agent", caught);
+ }
+
+ public void onSuccess(String result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Agent successfully started.",
Message.Severity.Info));
+ agentStatusCheck();
+ }
+ });
}
});
-
ButtonItem stopButton = new ButtonItem("stop", "Stop
Agent");
stopButton.setStartRow(false);
-// stopButton.setShowIfCondition(new FormItemIfFunction() {
-// public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
-// return form.getValue("agentStatus") != null &&
!"Agent Not Installed".equals(form.getValue("agentStatus"));
-// }
-// });
+ // stopButton.setShowIfCondition(new FormItemIfFunction() {
+ // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ // return form.getValue("agentStatus") != null
&& !"Agent Not
Installed".equals(form.getValue("agentStatus"));
+ // }
+ // });
stopButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- remoteInstallService.stopAgent(getRemoteAccessInfo(), new
AsyncCallback<String>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to stop
agent", caught);
- }
-
- public void onSuccess(String result) {
- CoreGUI.getMessageCenter().notify(new Message("Agent
successfully stopped.", Message.Severity.Info));
- agentStatusCheck();
- }
- });
+ remoteInstallService.stopAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
+ new AsyncCallback<String>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to stop
agent", caught);
+ }
+
+ public void onSuccess(String result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Agent successfully stopped.",
Message.Severity.Info));
+ agentStatusCheck();
+ }
+ });
}
});
-
ButtonItem installButton = new ButtonItem("install", "Install
Agent");
installButton.setRedrawOnChange(true);
-// installButton.setShowIfCondition(new FormItemIfFunction() {
-// public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
-// return form.getValue("agentStatus") != null &&
"Agent Not Installed".equals(form.getValue("agentStatus"));
-// }
-// });
-
+ // installButton.setShowIfCondition(new FormItemIfFunction() {
+ // public boolean execute(FormItem formItem, Object o, DynamicForm
dynamicForm) {
+ // return form.getValue("agentStatus") != null
&& "Agent Not
Installed".equals(form.getValue("agentStatus"));
+ // }
+ // });
installButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- remoteInstallService.installAgent(getRemoteAccessInfo(),
"/tmp/rhqAgent", new AsyncCallback<AgentInstallInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to install
agent", caught);
- }
+ remoteInstallService.installAgent(getRemoteAccessInfo(),
getAgentInstallPath(),
+ new AsyncCallback<AgentInstallInfo>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to install
agent", caught);
+ }
- public void onSuccess(AgentInstallInfo result) {
- CoreGUI.getMessageCenter().notify(new Message("Agent
successfully installed.", Message.Severity.Info));
+ public void onSuccess(AgentInstallInfo result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Agent successfully installed.",
Message.Severity.Info));
- for (Canvas child : agentInfoLayout.getChildren()) {
- child.destroy();
+ for (Canvas child : agentInfoLayout.getChildren()) {
+ child.destroy();
+ }
+ agentInfoLayout.addMember(buildInstallInfoCanvas(result));
+ agentInfoLayout.markForRedraw();
+ agentStatusCheck();
}
- agentInfoLayout.addMember(buildInstallInfoCanvas(result));
- agentInfoLayout.markForRedraw();
- agentStatusCheck();
- }
- });
+ });
}
});
-
- form.setFields(connectionHeader, host, username, password, statusCheck,
agentStatus, new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton,
new SpacerItem());
+ form.setFields(connectionHeader, host, username, password, agentInstallPath,
statusCheck, agentStatus,
+ new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton,
new SpacerItem());
return form;
}
private void agentStatusCheck() {
- remoteInstallService.agentStatus(getRemoteAccessInfo(), new
AsyncCallback<String>() {
+ remoteInstallService.agentStatus(getRemoteAccessInfo(), getAgentInstallPath(),
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
form.setValue("agentStatus", caught.getMessage());
}
@@ -213,7 +208,6 @@ public class RemoteAgentInstallView extends VLayout {
});
}
-
private Canvas buildInstallInfoCanvas(AgentInstallInfo info) {
VLayout installInfo = new VLayout();
@@ -239,7 +233,6 @@ public class RemoteAgentInstallView extends VLayout {
installInfo.addMember(infoForm);
-
ListGrid listGrid = new ListGrid() {
@Override
protected Canvas getExpansionComponent(ListGridRecord record) {
@@ -254,18 +247,15 @@ public class RemoteAgentInstallView extends VLayout {
listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
listGrid.setDetailField("result");
-
listGrid.setAutoFitData(Autofit.VERTICAL);
ListGridField step = new ListGridField("description",
"Step");
ListGridField resultCode = new ListGridField("resultCode", "Result
Code", 90);
- ListGridField time = new ListGridField("time", "Time", 90);
-
+ ListGridField duration = new ListGridField("duration",
"Duration", 90);
- listGrid.setFields(step, resultCode, time);
+ listGrid.setFields(step, resultCode, duration);
listGrid.setData(getStepRecords(info));
-
installInfo.addMember(listGrid);
for (ListGridRecord rec : listGrid.getRecords()) {
@@ -284,20 +274,23 @@ public class RemoteAgentInstallView extends VLayout {
rec.setAttribute("description", step.getDescription());
rec.setAttribute("result", step.getResult());
rec.setAttribute("resultCode", "" +
step.getResultCode());
- rec.setAttribute("time", MeasurementConverterClient.format((double)
step.getTime(), MeasurementUnits.MILLISECONDS, true));
+ rec.setAttribute("duration",
MeasurementConverterClient.format((double) step.getDuration(),
+ MeasurementUnits.MILLISECONDS, true));
steps.add(rec);
}
return steps.toArray(new ListGridRecord[steps.size()]);
}
-
private RemoteAccessInfo getRemoteAccessInfo() {
- RemoteAccessInfo info = new RemoteAccessInfo(
- form.getValueAsString("host"),
- form.getValueAsString("username"),
- form.getValueAsString("password")
- );
+ String host = form.getValueAsString("host");
+ String username = form.getValueAsString("username");
+ String password = form.getValueAsString("password");
+ RemoteAccessInfo info = new RemoteAccessInfo(host, username, password);
return info;
}
+
+ private String getAgentInstallPath() {
+ return form.getValueAsString("agentInstallPath");
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
index d25a9d3..bd76bf9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
@@ -28,21 +28,25 @@ import org.rhq.core.domain.install.remote.AgentInstallInfo;
import org.rhq.core.domain.install.remote.RemoteAccessInfo;
/**
+ * Provides methods to remotely install, start and stop agents over SSH.
+ *
* @author Greg Hinkle
+ * @author John Mazzitelli
*/
public interface RemoteInstallGWTService extends RemoteService {
- // RemoteInstallManagerRemote
- AgentInstallInfo agentInstallCheck(RemoteAccessInfo remoteAccessInfo);
+ // --- RemoteInstallManagerRemote
+ boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String
agentInstallPath);
- AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String path);
+ AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath);
- String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String startAgent(RemoteAccessInfo remoteAccessInfo);
+ String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String stopAgent(RemoteAccessInfo remoteAccessInfo);
+ String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String agentStatus(RemoteAccessInfo remoteAccessInfo);
+ String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
index 1a6af99..321cf77 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java
@@ -33,36 +33,42 @@ import org.rhq.enterprise.server.util.LookupUtil;
* @author Greg Hinkle
*/
public class RemoteInstallGWTServiceImpl extends AbstractGWTServiceImpl implements
RemoteInstallGWTService {
+ private static final long serialVersionUID = 1L;
private RemoteInstallManagerLocal remoteInstallManager =
LookupUtil.getRemoteInstallManager();
- public AgentInstallInfo agentInstallCheck(RemoteAccessInfo remoteAccessInfo) {
- return
SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(),
remoteAccessInfo),
- "RemoteInstallService.agentInstallCheck");
+ public boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String
agentInstallPath) {
+ return
SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.agentInstallCheck");
}
- public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String path)
{
- return
SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(),
remoteAccessInfo, path),
- "RemoteInstallService.installAgent");
+ public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
+ return
SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(),
remoteAccessInfo,
+ parentPath), "RemoteInstallService.installAgent");
}
- public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
- return
SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(),
remoteAccessInfo, parentPath)),
- "RemoteInstallService.remotePathDiscover");
+ public String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
+ return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.startAgent");
+ }
+
+ public String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
+ return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.stopAgent");
}
- public String startAgent(RemoteAccessInfo remoteAccessInfo) {
- return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(),
remoteAccessInfo),
- "RemoteInstallService.startAgent");
+ public String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
{
+ return
SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(),
remoteAccessInfo,
+ agentInstallPath), "RemoteInstallService.agentStatus");
}
- public String stopAgent(RemoteAccessInfo remoteAccessInfo) {
- return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(),
remoteAccessInfo),
- "RemoteInstallService.stopAgent");
+ public String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
+ return
SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(),
remoteAccessInfo,
+ parentPath)), "RemoteInstallService.findAgentInstallPath");
}
- public String agentStatus(RemoteAccessInfo remoteAccessInfo) {
- return
SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(),
remoteAccessInfo),
- "RemoteInstallService.agentStatus");
+ public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String
parentPath) {
+ return
SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(),
remoteAccessInfo,
+ parentPath)), "RemoteInstallService.remotePathDiscover");
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java
index 4763ed5..5488e6a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java
@@ -24,57 +24,95 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Stateless;
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.install.remote.AgentInstallInfo;
import org.rhq.core.domain.install.remote.RemoteAccessInfo;
import org.rhq.enterprise.server.authz.RequiredPermission;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Permission;
/**
+ * Installs, starts and stops remote agents via SSH.
+ *
* @author Greg Hinkle
+ * @author John Mazzitelli
*/
@Stateless
public class RemoteInstallManagerBean implements RemoteInstallManagerLocal,
RemoteInstallManagerRemote {
-
@RequiredPermission(Permission.MANAGE_INVENTORY)
- public AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo
remoteAccessInfo) {
- SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo);
-
- return sshUtil.installAgent();
+ public boolean agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo,
String agentInstallPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.agentInstallCheck(agentInstallPath);
+ } finally {
+ sshUtil.disconnect();
+ }
}
@RequiredPermission(Permission.MANAGE_INVENTORY)
- public AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo
remoteAccessInfo, String path) {
- SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo);
+ public AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo
remoteAccessInfo, String parentPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.installAgent(parentPath);
+ } finally {
+ sshUtil.disconnect();
+ }
+ }
- return sshUtil.installAgent();
+ @RequiredPermission(Permission.MANAGE_INVENTORY)
+ public String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String
agentInstallPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.startAgent(agentInstallPath);
+ } finally {
+ sshUtil.disconnect();
+ }
}
@RequiredPermission(Permission.MANAGE_INVENTORY)
- public String[] remotePathDiscover(Subject subject, RemoteAccessInfo
remoteAccessInfo, String parentPath) {
- SSHInstallUtility ssh = new SSHInstallUtility(remoteAccessInfo);
- ssh.connect();
- return ssh.pathDiscovery(parentPath);
+ public String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String
agentInstallPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.stopAgent(agentInstallPath);
+ } finally {
+ sshUtil.disconnect();
+ }
+ }
+
+ public String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo, String
agentInstallPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.agentStatus(agentInstallPath);
+ } finally {
+ sshUtil.disconnect();
+ }
}
@RequiredPermission(Permission.MANAGE_INVENTORY)
- public String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo) {
- SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo);
- return sshUtil.agentStart();
+ public String findAgentInstallPath(Subject subject, RemoteAccessInfo
remoteAccessInfo, String parentPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.findAgentInstallPath(parentPath);
+ } finally {
+ sshUtil.disconnect();
+ }
}
@RequiredPermission(Permission.MANAGE_INVENTORY)
- public String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo) {
- SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo);
- return sshUtil.agentStop();
+ public String[] remotePathDiscover(Subject subject, RemoteAccessInfo
remoteAccessInfo, String parentPath) {
+ SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo);
+ try {
+ return sshUtil.pathDiscovery(parentPath);
+ } finally {
+ sshUtil.disconnect();
+ }
}
- public String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo) {
+ private SSHInstallUtility getSSHConnection(RemoteAccessInfo remoteAccessInfo) {
if (remoteAccessInfo.getHost() == null) {
- return "Enter a host";
+ throw new RuntimeException("Enter a host");
}
SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo);
- return sshUtil.agentStatus();
+ return sshUtil;
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java
index c50dd52..47329fb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java
@@ -24,27 +24,11 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Local;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.install.remote.AgentInstallInfo;
-import org.rhq.core.domain.install.remote.RemoteAccessInfo;
-
/**
+ * Provides an interface to remotely install an RHQ Agent over SSH.
+ *
* @author Greg Hinkle
*/
@Local
-public interface RemoteInstallManagerLocal {
-
-
- AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo
remoteAccessInfo);
-
- AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo,
String path);
-
- String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo,
String parentPath);
-
- String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo);
-
- String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo);
-
- String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo);
-
+public interface RemoteInstallManagerLocal extends RemoteInstallManagerRemote {
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java
index 298f823..9b85f05 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java
@@ -23,28 +23,135 @@
package org.rhq.enterprise.server.install.remote;
import javax.ejb.Remote;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.install.remote.AgentInstallInfo;
+import org.rhq.core.domain.install.remote.RemoteAccessInfo;
+import org.rhq.enterprise.server.system.ServerVersion;
/**
- * Future Remote API...
+ * Provides an interface to remotely install an RHQ Agent over SSH.
*
* @author Greg Hinkle
*/
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService(targetNamespace = ServerVersion.namespace)
@Remote
public interface RemoteInstallManagerRemote {
-
- /* To Be Updated, commented :-) and Released in next version...
+ /**
+ * Checks to see if an agent is installed in the given directory.
*
- AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo
remoteAccessInfo);
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param agentInstallPath the directory to check
+ *
+ * @return true if an agent is installed in the given install path, false if not
+ */
+ @WebMethod
+ boolean agentInstallCheck( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "agentInstallPath") String agentInstallPath);
- AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo,
String path);
+ /**
+ * Installs the agent update binary distribution file to the given parent
+ * directory. Note that the agent's install directory will be a child of
+ * the given parent directory, with that child install directory usually
+ * named "rhq-agent".
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param parentPath where the agent install directory will be
+ *
+ * @return info containing the results of the installation
+ */
+ @WebMethod
+ AgentInstallInfo installAgent( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "parentPath") String parentPath);
- String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo,
String parentPath);
+ /**
+ * Starts the agent located in the given installation directory.
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param agentInstallPath where the agent is installed
+ *
+ * @return results of the start command
+ */
+ @WebMethod
+ String startAgent( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "agentInstallPath") String agentInstallPath);
- String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo);
+ /**
+ * Stops the agent located in the given installation directory.
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param agentInstallPath where the agent is installed
+ *
+ * @return results of the stop command
+ */
+ @WebMethod
+ String stopAgent( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "agentInstallPath") String agentInstallPath);
- String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo);
+ /**
+ * Determines the running status of the agent located in the given installation
directory.
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param agentInstallPath where the agent is installed
+ *
+ * @return results of the status command
+ */
+ @WebMethod
+ String agentStatus( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "agentInstallPath") String agentInstallPath);
- String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo);
- */
+ /**
+ * Given a root parent path to check, this will scan all subdirectories
(recursively)
+ * to try to find where the agent is installed (if it is installed at all). If
parentPath
+ * is null or empty, the more common locations where agents are normally installed
will be
+ * scanned. Returns the path to the first location where an agent is probably
installed;
+ * <code>null</code> is returned if it does not look like the agent is
installed anywhere
+ * under the given parent path (or in any of the common locations, if parent path is
null).
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param parentPath the parent directory whose children files/directories are
scanned
+ *
+ * @return the probable location of an installed agent; null if no agent install was
found
+ */
+ @WebMethod
+ String findAgentInstallPath( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "parentPath") String parentPath);
+ /**
+ * Returns the given parent directory's child files/directories.
+ *
+ * @param subject the RHQ user making the request
+ * @param remoteAccessInfo the remote machine information and remote user SSH
credentials
+ * @param parentPath the parent directory whose children files/directories are
returned
+ *
+ * @return names of the parent's child files/directories
+ */
+ @WebMethod
+ String[] remotePathDiscover( //
+ @WebParam(name = "subject") Subject subject, //
+ @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo,
//
+ @WebParam(name = "parentPath") String parentPath);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
index 3f94c86..c81b478 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java
@@ -22,12 +22,11 @@
*/
package org.rhq.enterprise.server.install.remote;
-import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
+import java.util.Properties;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
@@ -41,40 +40,46 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.install.remote.AgentInstallInfo;
import org.rhq.core.domain.install.remote.AgentInstallStep;
import org.rhq.core.domain.install.remote.RemoteAccessInfo;
-import org.rhq.core.util.file.FileUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
+ * A utility object that is used to install, start and stop agents remotely over SSH.
+ *
* @author Greg Hinkle
+ * @author John Mazzitelli
*/
public class SSHInstallUtility {
- static final int DEFAULT_BUFFER_SIZE = 4096;
- static final long TIMEOUT = 10000L;
- static final long POLL_TIMEOUT = 1000L;
+ private static final String RHQ_AGENT_LATEST_VERSION_PROP =
"rhq-agent.latest.version";
+ private static final int DEFAULT_BUFFER_SIZE = 4096;
+ private static final int CONNECTION_TIMEOUT = 30000;
+ private static final long TIMEOUT = 30000L;
+ private static final long POLL_TIMEOUT = 1000L;
private Log log = LogFactory.getLog(SSHInstallUtility.class);
private RemoteAccessInfo accessInfo;
private Session session;
- private String agentDestination = "/tmp/rhqAgent"; // todo: Make
configurable
-
-
- private String agentFile = "rhq-enterprise-agent-3.0.0-SNAPSHOT.jar"; //
Corrected below
- private String agentPath =
"/projects/rhq/dev-container/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-agent/"
+ agentFile; // corrected below
-
+ private String agentFile;
+ private String agentPath;
+ private String agentVersion;
public SSHInstallUtility(RemoteAccessInfo accessInfo) {
this.accessInfo = accessInfo;
try {
File agentBinaryFile =
LookupUtil.getAgentManager().getAgentUpdateBinaryFile();
- agentPath = agentBinaryFile.getCanonicalPath();
agentFile = agentBinaryFile.getName();
+ agentPath = agentBinaryFile.getCanonicalPath();
+
+ Properties props =
LookupUtil.getAgentManager().getAgentUpdateVersionFileContent();
+ agentVersion = props.getProperty(RHQ_AGENT_LATEST_VERSION_PROP);
} catch (Exception e) {
- // Could not find agent file, leave the default
- log.warn("Failed agent binary file lookup", e);
+ agentVersion = getClass().getPackage().getImplementationVersion();
+ agentFile = "rhq-enterprise-agent-" + agentVersion +
".jar";
+ agentPath = "/tmp/rhq-agent/" + agentFile;
+ log.warn("Failed agent binary file lookup - using [" + agentPath +
"]", e);
}
if (!new File(agentPath).exists()) {
@@ -84,32 +89,27 @@ public class SSHInstallUtility {
connect();
}
-
public void connect() {
try {
JSch jsch = new JSch();
+ //if (accessInfo.getKey() != null) {
+ // jsch.addIdentity(...);
+ //}
-// if (accessInfo.getKey() != null) {
- jsch.addIdentity("/Users/ghinkle/.ssh/ghinkleawskey.pem");
-
-// }
+ session = jsch.getSession(accessInfo.getUser(), accessInfo.getHost(),
accessInfo.getPort());
- session = jsch.getSession(accessInfo.getUser(), accessInfo.getHost(), 22); //
accessInfo.getPort());
-
- if (accessInfo.getPass() != null) {
- session.setPassword(accessInfo.getPass());
+ if (accessInfo.getPassword() != null) {
+ session.setPassword(accessInfo.getPassword());
}
- java.util.Properties config = new java.util.Properties();
+ Properties config = new Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
- //session.connect();
- session.connect(30000); // making a connection with timeout.
+ session.connect(CONNECTION_TIMEOUT); // making a connection with timeout.
} catch (JSchException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
+ throw new RuntimeException("Failed SSH connection", e);
}
}
@@ -117,36 +117,145 @@ public class SSHInstallUtility {
session.disconnect();
}
+ public boolean agentInstallCheck(String agentInstallPath) {
+ String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath);
+
+ String value = executeCommand("if [ -f '" + agentWrapperScript +
"' ]; then echo \"exists\"; fi",
+ "Agent Install Check");
+ if (value == null || value.trim().length() == 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public AgentInstallInfo installAgent(String parentPath) {
+
+ AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(),
agentVersion);
+
+ executeCommand("uname -a", "Machine uname", info);
+ executeCommand("java -version", "Java Version Check", info);
+ executeCommand("mkdir -p '" + parentPath + "'",
"Create Agent Install Directory", info);
+
+ log.info("Copying agent binary update distribution file to [" +
accessInfo.getHost() + "]...");
+
+ long start = System.currentTimeMillis();
+ boolean fileSent = SSHFileSend.sendFile(session, agentPath, parentPath);
+ AgentInstallStep scpStep = new AgentInstallStep("ssh copy '" +
agentPath + "' -> '" + parentPath + "'",
+ "Remote copy the agent binary update distribution", 0, fileSent ?
"Success" : "Failed", getTimeDiff(start));
+ info.addStep(scpStep);
+
+ log.info("Agent binary update distribution file copied");
+
+ executeCommand("cd '" + parentPath + "'",
"Change to install directory", info);
+ executeCommand("java -jar '" + parentPath + "/" +
agentFile + "' '--install=" + parentPath + "'",
+ "Install Agent", info);
+
+ String serverAddress = LookupUtil.getServerManager().getServer().getAddress();
+
+ log.info("Will start new agent @ [" + accessInfo.getHost() + "]
pointing to server @ [" + serverAddress + "]");
+
+ String agentScript = parentPath + "/rhq-agent/bin/rhq-agent.sh"; //
NOTE: NOT the wrapper script
+ String properties = new AgentInstallInfo(serverAddress,
accessInfo.getHost()).getConfigurationStartString();
+
+ // Tell the script to store a pid file to make the wrapper script work
+ String envCmd1 = "RHQ_AGENT_IN_BACKGROUND='" + parentPath +
"/rhq-agent/bin/rhq-agent.pid'";
+ String envCmd2 = "export RHQ_AGENT_IN_BACKGROUND";
+
+ String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup
'" + agentScript + "' " + properties + " &";
+ executeCommand(startCommand, "Start New Agent", info);
+
+ return info;
+ }
+
+ public String startAgent(String agentInstallPath) {
+ String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath);
+
+ return executeCommand("'" + agentWrapperScript + "'
start", "Agent Start");
+ }
+
+ public String stopAgent(String agentInstallPath) {
+ String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath);
+
+ return executeCommand("'" + agentWrapperScript + "'
stop", "Agent Stop");
+ }
+
+ public String agentStatus(String agentInstallPath) {
+ String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath);
+
+ if (!agentInstallCheck(agentInstallPath)) {
+ return "Agent Not Installed";
+ }
+
+ return executeCommand("'" + agentWrapperScript + "'
status", "Agent Status");
+ }
+
+ public String findAgentInstallPath(String parentPath) {
+ if (parentPath == null || parentPath.trim().length() == 0) {
+ // user doesn't know where the agent might be - let's try to guess
+ String[] possiblePaths = new String[] { "/opt",
"/usr/local", "/usr/share", "/rhq",
+ "/home/" + accessInfo.getUser() };
+ for (String possiblePath : possiblePaths) {
+ String path = findAgentInstallPath(possiblePath);
+ if (path != null) {
+ return path;
+ }
+ }
+ return null;
+ }
+
+ if (parentPath.endsWith("rhq-agent") ||
parentPath.endsWith("rhq-agent/")) {
+ return parentPath; // assume the caller's parent path *is* the agent
install path
+ }
+
+ String full = executeCommand("find '" + parentPath + "'
-name rhq-agent -print", "Find Agent Install Path");
+ if (full == null || full.trim().length() == 0) {
+ return null;
+ }
+ String[] results = full.split("\n");
+ String path = results[0];
+ return path;
+ }
public String[] pathDiscovery(String parentPath) {
- String full = executeCommand("ls" + parentPath);
+ String full = executeCommand("ls -1 '" + parentPath +
"'", "Path Discovery");
return full.split("\n");
}
+ private String buildAgentWrapperScriptPath(String agentInstallPath) {
+ // its possible the caller is giving us the parent install directory, whereas we
+ // want the child "rhq-agent" directory. Our find method will take care
of this
+ // and return the path we want - if it doesn't, just use the path the user
gave us
+ // and let the chips fall where they may
+ String foundAgentInstall = findAgentInstallPath(agentInstallPath);
+ if (foundAgentInstall != null) {
+ agentInstallPath = foundAgentInstall;
+ }
+ String agentWrapperScript = agentInstallPath +
"/bin/rhq-agent-wrapper.sh";
+ return agentWrapperScript;
+ }
private String executeCommand(String command, String description) {
return executeCommand(command, description, new AgentInstallInfo(null, null));
}
-
private String executeCommand(String command, String description, AgentInstallInfo
info) {
- log.info("Running: " + description);
+ log.info("Running SSH command [" + description + "]");
long start = System.currentTimeMillis();
String result = null;
try {
result = executeCommand(command);
- info.addStep(new AgentInstallStep(0, command, description, result,
(System.currentTimeMillis() - start)));
+ info.addStep(new AgentInstallStep(command, description, 0, result,
getTimeDiff(start)));
} catch (ExecuteException e) {
- info.addStep(new AgentInstallStep(e.errorCode, command, e.message,
description, (System.currentTimeMillis() - start)));
+ info.addStep(new AgentInstallStep(command, description, e.errorCode,
e.getMessage(), getTimeDiff(start)));
}
- log.info("Result [" + description + "]: " + result);
+ log.info("Result of SSH command [" + description + "]: " +
result);
return result;
}
-
private String executeCommand(String command) {
ChannelExec channel = null;
- int exitStatus = 0;
+ int exitStatus = -1;
InputStream is = null;
InputStream es = null;
@@ -158,46 +267,63 @@ public class SSHInstallUtility {
is = channel.getInputStream();
es = channel.getErrStream();
- channel.connect(10000); // connect and execute command
+ channel.connect(CONNECTION_TIMEOUT); // connect and execute command
String out = read(is, channel);
String err = read(es, channel);
- // System.out.println("Output: " + out);
+ if (log.isTraceEnabled()) {
+ log.trace("SSH command output: " + out);
+ }
+
if (err.length() > 0) {
- // System.out.println("Error [" + channel.getExitStatus() +
"]: " + err);
- if (channel.getExitStatus() != 0) {
- throw new ExecuteException(channel.getExitStatus(), err);
+ exitStatus = channel.getExitStatus();
+
+ if (log.isTraceEnabled()) {
+ log.trace("SSH command error [" + exitStatus + "]:
" + err);
+ }
+
+ if (exitStatus != 0) {
+ throw new ExecuteException(exitStatus, err);
} else if (out.length() == 0) {
return err;
}
+ } else {
+ exitStatus = 0;
}
+
return out;
+ } catch (ExecuteException ee) {
+ throw ee;
} catch (Exception e) {
- e.printStackTrace();
+ throw new ExecuteException(exitStatus, e.toString());
} finally {
- try {
- is.close();
- } catch (Exception e) {
- e.printStackTrace();
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ }
}
- try {
- es.close();
- } catch (Exception e) {
- e.printStackTrace();
+
+ if (es != null) {
+ try {
+ es.close();
+ } catch (Exception e) {
+ }
}
if (channel != null) {
- channel.disconnect();
+ try {
+ channel.disconnect();
+ } catch (Exception e) {
+ log.error("Failed to disconnect", e);
+ }
}
}
- return "exit: " + exitStatus;
}
-
- public String read(InputStream is, Channel channel) throws IOException {
- // read command output
+ private String read(InputStream is, Channel channel) throws IOException {
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
ByteArrayOutputStream bos = new ByteArrayOutputStream();
final long endTime = System.currentTimeMillis() + TIMEOUT;
@@ -211,116 +337,33 @@ public class SSHInstallUtility {
}
}
if (channel.isClosed()) {
- // int exitStatus = channel.getExitStatus();
- // System.out.println("exit status: " + exitStatus);
+ if (log.isDebugEnabled()) {
+ log.debug("SSH reading exit status=" +
channel.getExitStatus());
+ }
break;
}
try {
Thread.sleep(POLL_TIMEOUT);
} catch (InterruptedException e) {
- e.printStackTrace();
}
}
return bos.toString();
}
-
- public String read2(BufferedReader reader) throws IOException {
- StringBuilder buf = new StringBuilder();
- while (true) {
- String line = reader.readLine();
- if (line == null) {
- break;
- }
- buf.append(line + "\n");
- }
- return buf.toString();
- }
-
- public String agentStop() {
- String agentWrapperScript = agentDestination +
"/rhq-agent/bin/rhq-agent-wrapper.sh ";
-
- return executeCommand(agentWrapperScript + " stop", "Agent
Stop");
- }
-
- public String agentStart() {
- String agentWrapperScript = agentDestination +
"/rhq-agent/bin/rhq-agent-wrapper.sh ";
-
- return executeCommand(agentWrapperScript + " start", "Agent
Start");
- }
-
- public String agentStatus() {
- String agentWrapperScript = agentDestination +
"/rhq-agent/bin/rhq-agent-wrapper.sh ";
-
-
- String value = executeCommand("if [ -f " + agentWrapperScript + "
]; then echo \"exists\"; fi");
- if (value == null || value.length() == 0) {
- return "Agent Not Installed";
- }
-
- return executeCommand(agentWrapperScript + " status", "Agent
Status");
+ private long getTimeDiff(long start) {
+ return System.currentTimeMillis() - start;
}
- public AgentInstallInfo installAgent() {
-
-
- AgentInstallInfo info = new AgentInstallInfo(agentDestination,
accessInfo.getUser(), "3.0.0-SNAPSHOT");
-
-
- executeCommand("uname -a", "Machine uname", info);
-
- executeCommand("java -version", "Java Version Check", info);
-
- executeCommand("mkdir -p " + agentDestination, "Create Agent
Install Directory", info);
-
-
- log.info("Copying Agent Distribution");
- long start = System.currentTimeMillis();
- boolean fileSent = SSHFileSend.sendFile(session, agentPath, agentDestination);
- info.addStep(new AgentInstallStep(0, "scp agent-installer",
"Remote copy the agent distribution", fileSent ? "Success" :
"Failed", (System.currentTimeMillis() - start)));
- log.info("Agent Distribution Copied");
-
-
- executeCommand("cd " + agentDestination, "Change to install
directory", info);
-
- executeCommand("java -jar " + agentDestination + "/" +
agentFile + " --install=" + agentDestination, "Install Agent", info);
-
-
- String serverAddress =
LookupUtil.getCloudManager().getAllCloudServers().get(0).getAddress();
-
- System.out.println("Install an agent at " + accessInfo.getHost() +
" point to the server " + serverAddress);
-
-
- AgentInstallInfo agentInfo = new AgentInstallInfo(serverAddress,
accessInfo.getHost());
-
- String agentScript = agentDestination + "/rhq-agent/bin/rhq-agent.sh
";
- String agentWrapperScript = agentDestination +
"/rhq-agent/bin/rhq-agent-wrapper.sh ";
-
-
- String properties = agentInfo.getConfigurationStartString();
-
- // Tell the script to store a pid file to make the wrapper script work
- String pidFileProp = "export RHQ_AGENT_IN_BACKGROUND=" +
agentDestination + "/rhq-agent/bin/rhq-agent.pid";
-
- String startCommand = pidFileProp + " ; nohup " + agentScript +
properties + "&";
- executeCommand(startCommand, "Agent Start With Configuration", info);
-
-
- return info;
- }
-
-
- public static class ExecuteException extends RuntimeException {
+ private static class ExecuteException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
int errorCode;
- String message;
public ExecuteException(int errorCode, String message) {
+ super(message);
this.errorCode = errorCode;
- this.message = message;
}
}
-
public static void main(String[] args) throws IOException {
String pass = null;
@@ -331,19 +374,18 @@ public class SSHInstallUtility {
SSHInstallUtility ssh = new SSHInstallUtility(info);
- System.out.println("Agent status: " + ssh.agentStatus());
-
- System.out.println("Set server address: " +
ssh.executeCommand("echo '71.162.145.95 ghinkle' >>
/etc/hosts"));
-
- ssh.agentStop();
-
- ssh.installAgent();
-
- ssh.agentStatus();
-
- ssh.agentStop();
- ssh.agentStatus();
- ssh.agentStart();
+ String parentPath = "/tmp/new-remote-agent";
+ String agentInstallPath = parentPath + "/rhq-agent";
+
+ System.out.println("Agent status: " +
ssh.agentStatus(agentInstallPath));
+ System.out.println("Agent stop: " + ssh.stopAgent(agentInstallPath));
+ System.out.println("Agent find: " +
ssh.findAgentInstallPath(parentPath));
+ System.out.println("Agent install: " + ssh.installAgent(parentPath));
+ System.out.println("Agent find: " +
ssh.findAgentInstallPath(parentPath));
+ System.out.println("Agent status: " +
ssh.agentStatus(agentInstallPath));
+ System.out.println("Agent stop: " + ssh.stopAgent(agentInstallPath));
+ System.out.println("Agent status: " +
ssh.agentStatus(agentInstallPath));
+ System.out.println("Agent start: " +
ssh.startAgent(agentInstallPath));
ssh.disconnect();
}
commit 7a2158b5c63e88c3af86f14a745adc5b61d4d9b8
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 4 17:11:09 2010 +0200
Comment out javadoc generation for now, as it breaks with some already defined
package-info.java file.
diff --git a/pom.xml b/pom.xml
index 19deabe..2a0db1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1097,6 +1097,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
+<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -1105,6 +1106,7 @@
<additionalJOption>-J-Xmx768m</additionalJOption>
</configuration>
</plugin>
+-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
commit 9d953ef12f55f76a00c0bd4a44397dfca1cb7252
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 4 16:52:30 2010 +0200
Add some more properties for maven site generation and unify some commons-codec and
commons-logging versions
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 1cdaadc..0806490 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -27,7 +27,7 @@
<jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
</properties>
-
+
<dependencies>
<!-- the notorious util jar -->
@@ -52,7 +52,7 @@
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
<scope>provided</scope> <!-- by JBossAS -->
</dependency>
-
+
<!-- required by PersistenceUtil and EJB3 Embedded -->
<dependency>
<groupId>hibernate-entitymanager</groupId>
@@ -73,8 +73,8 @@
<artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
</dependency>
-
- <!-- needed for hibernate Instrument task
+
+ <!-- needed for hibernate Instrument task
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
@@ -82,8 +82,8 @@
<scope>runtime</scope>
</dependency>
-->
-
- <!-- needed for hibernate Instrument task
+
+ <!-- needed for hibernate Instrument task
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -124,7 +124,7 @@
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
@@ -188,7 +188,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.4</version>
+ <version>${commons-codec.version}</version>
<scope>test</scope>
</dependency>
@@ -239,7 +239,7 @@
<artifactId>smartgwt</artifactId>
<version>2.0</version>
</dependency>-->
-
+
</dependencies>
<build>
@@ -315,7 +315,7 @@
</plugins>
</build>
-
+
<profiles>
<profile>
@@ -345,7 +345,7 @@
Instrumentation is useful for various property-level things
such as field-level lazy load.
Using it turned out not t be a current option since the
instrumented class carries with
it hibernate imports that we can't put in the domain jar
since it's used on the Agent and
- in Remote Java Clients. But this worked, so here ya go...
+ in Remote Java Clients. But this worked, so here ya go...
<taskdef
name="instrument"
classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
@@ -364,13 +364,13 @@
<echo>*** Copying updated files from
target${file.separator}classes${file.separator} to
${deployment.dir}${file.separator}...</echo>
<copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
<fileset dir="target/classes" />
- </copy>
+ </copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
- </execution>
+ </execution>
<execution>
<id>undeploy</id>
@@ -387,13 +387,13 @@
</goals>
</execution>
- </executions>
+ </executions>
</plugin>
</plugins>
</build>
</profile>
-
+
<profile>
<id>javadoc</id>
<activation>
@@ -411,11 +411,11 @@
<executions>
<execution>
<id>javadoc-domain-api</id>
- <phase>compile</phase>
+ <phase>compile</phase>
<goals>
<goal>javadoc</goal>
</goals>
- <configuration>
+ <configuration>
<doctitle>RHQ ${project.version} -
Domain</doctitle>
<reportOutputDirectory>${javadoc.outputDirectory}</reportOutputDirectory>
<destDir>domain</destDir>
@@ -436,7 +436,7 @@
</plugins>
</build>
</profile>
-
+
</profiles>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index dfcdfde..5adfabf 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -1,15 +1,15 @@
<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-core-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
-
+
<groupId>org.rhq</groupId>
- <artifactId>rhq-plugin-validator</artifactId>
+ <artifactId>rhq-plugin-validator</artifactId>
<packaging>maven-plugin</packaging>
<name>RHQ Plugin Validator Maven 2 Plugin</name>
@@ -20,23 +20,23 @@
<artifactId>rhq-core-domain</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-util</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-plugin-container</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
@@ -50,7 +50,7 @@
<artifactId>maven-project</artifactId>
<version>2.0.8</version>
</dependency>
-
+
</dependencies>
-
+
</project>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 465a9eb..6b1bed8 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -60,7 +60,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 940e46d..221ae3e 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -77,7 +77,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
diff --git a/modules/helpers/pluginGen/src/main/resources/pom.ftl
b/modules/helpers/pluginGen/src/main/resources/pom.ftl
index eb02eb6..6aa89e9 100644
--- a/modules/helpers/pluginGen/src/main/resources/pom.ftl
+++ b/modules/helpers/pluginGen/src/main/resources/pom.ftl
@@ -208,7 +208,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+
<version>${r"${commons-logging.version}"}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index c75e471..7fc2837 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -128,7 +128,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 44a34b9..ab18766 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -147,7 +147,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 67d24a0..9f35dbf 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -36,7 +36,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.2</version>
+ <version>${commons-codec.version}</version>
</dependency>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 89178cc..93bb45a 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -4,14 +4,14 @@
<groupId>org.rhq</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
-
+
<modelVersion>4.0.0</modelVersion>
-
+
<groupId>org.rhq</groupId>
<artifactId>rhq-snmptrapd-plugin</artifactId>
<name>RHQ SnmpTrapd Plugin</name>
<description>RHQ SnmpTrapd Plugin</description>
-
+
<scm>
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/plug...
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
@@ -20,7 +20,7 @@
<properties>
<scm.module.path>modules/plugins/snmptrapd/</scm.module.path>
</properties>
-
+
<build>
<plugins>
<plugin>
@@ -30,7 +30,7 @@
<target>1.5</target>
</configuration>
</plugin>
-
+
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
@@ -73,11 +73,11 @@
-->
</executions>
</plugin>
-
-
+
+
</plugins>
</build>
-
+
<profiles>
<profile>
<id>dev</id>
@@ -116,13 +116,13 @@
<id>deploy-jar-meta-inf</id>
<phase>package</phase>
<configuration>
- <tasks>
- <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <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 destfile="${deployment.file}"
manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
update="true">
</jar>
</tasks>
</configuration>
@@ -130,7 +130,7 @@
<goal>run</goal>
</goals>
</execution>
-
+
<execution>
<id>undeploy</id>
<phase>clean</phase>
@@ -155,7 +155,7 @@
</profiles>
-
+
<dependencies>
<dependency>
<groupId>org.rhq</groupId>
@@ -196,7 +196,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index c27ee72..a6fdf4f 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -138,7 +138,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>${commons-logging.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
diff --git a/pom.xml b/pom.xml
index 1708440..19deabe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
<packaging>pom</packaging>
<name>RHQ</name>
- <description>parent POM for all RHQ modules</description>
+ <description>RHQ is a server management and monitoring suite primarily targeted
at JBoss software.</description>
<
url>http://rhq-project.org/</url>
<inceptionYear>2008</inceptionYear>
@@ -27,7 +27,7 @@
<issueManagement>
<system>bugzilla</system>
- <
url>https://bugzilla.redhat.com/</url>
+ <
url>https://bugzilla.redhat.com/browse.cgi?product=RHQ%20Project</u...
</issueManagement>
@@ -95,6 +95,7 @@
<quartz.version>1.6.5</quartz.version>
<jna.version>3.2.5</jna.version>
<twitter4j.version>2.1.2</twitter4j.version>
+ <commons-codec.version>1.4</commons-codec.version>
<!--
defaults for datasource used by integration tests -
@@ -1085,15 +1086,134 @@
</profiles>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- </plugins>
- </reporting>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ <additionalJOption>-J-Xmx768m</additionalJOption>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <!-- more properties related to mvn site -->
+ <licenses>
+ <license>
+ <name>GPL</name>
+ </license>
+ </licenses>
+ <developers>
+ <developer>
+ <name>Charles Crouch</name>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <name>Jason Dobies</name>
+ <timezone>-5</timezone>
+ <roles>
+ <role>retired</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Filip Drabeck</name>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <name>Greg Hinkle</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Lukas Krejci</name>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <name>Joseph Marques</name>
+ <url>http://josephmarques.wordpress.com</url>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Fady Matar</name>
+ <timezone>+2</timezone>
+ <roles>
+ <role>retired</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>John 'Mazz' Mazzitelli</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Simeon Pinder</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Heiko W. Rupp</name>
+ <email>hrupp(a)redhat.com</email>
+ <url>http://pilhuhn.blogspot.com</url>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <name>John Sanda</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Jessica Sant</name>
+ <timezone>-5</timezone>
+ <roles>
+ <role>retired</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Jay Shaughnessy</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <name>Ian Springer</name>
+ <timezone>-5</timezone>
+ </developer>
+ </developers>
+ <contributors>
+ <contributor>
+ <name>Alex Kiefer</name>
+ <timezone>+1</timezone>
+ </contributor>
+ <contributor>
+ <name>Rafael Torres Coelho Soares</name>
+ <timezone>-7</timezone>
+ </contributor>
+ </contributors>
+ <mailingLists>
+ <mailingList>
+ <name>User List</name>
+
<
subscribe>https://fedorahosted.org/mailman/listinfo/rhq-users</subs...
+
<
unsubscribe>https://fedorahosted.org/mailman/listinfo/rhq-users</un...
+ <post>rhq-users(a)lists.fedorahosted.org</post>
+ <
archive>https://fedorahosted.org/pipermail/rhq-users/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Developer List</name>
+
<
subscribe>https://fedorahosted.org/mailman/listinfo/rhq-devel</subs...
+
<
unsubscribe>https://fedorahosted.org/mailman/listinfo/rhq-devel</un...
+ <post>rhq-devel(a)lists.fedorahosted.org</post>
+ <
archive>https://fedorahosted.org/pipermail/rhq-devel/</archive>
+ </mailingList>
+ </mailingLists>
</project>
commit 22de3f90d81a5ac1a3eadb69a61b40f6b1779e0f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Aug 4 15:25:36 2010 +0200
Use jaxb-impl version from parent pom
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index c1187d1..6634e78 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -87,7 +87,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
- <version>2.1.3</version>
+ <version>${jaxb-impl.version}</version>
</dependency>
</dependencies>
commit a143b2509596a7c354972c94f8e187bc57523b9a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 3 16:36:31 2010 -0400
upgrade RichFaces from 3.3.3.CR1 to 3.3.3.Final; fix a couple bugs in jdk.sh
diff --git a/etc/dev-utils/jdk.sh b/etc/dev-utils/jdk.sh
index 1e387f1..bf8193e 100755
--- a/etc/dev-utils/jdk.sh
+++ b/etc/dev-utils/jdk.sh
@@ -9,24 +9,23 @@ if [ $# -gt 1 ]; then
echo "Usage: jdk n" >&2
echo "(sets JAVA_HOME to the value of the JAVAn_HOME environment variable, if it
is defined)" >&2
echo >&2
- echo "For example, jdk 5 sets JAVA_HOME to the value of JAVA5_HOME."
>&2
- return
-fi
-
-if [ -z "${JAVA_HOME}" ]; then
- echo "ERROR: JAVA_HOME is not defined." >&2
+ echo "For example, 'jdk 6' sets JAVA_HOME to the value of
JAVA6_HOME." >&2
return
fi
export JAVA_HOME
echo current JAVA_HOME=${JAVA_HOME}
-if [ ! -d "${JAVA_HOME}" ]; then
- echo "WARNING: ${JAVA_HOME} does not exist."
-elif [ ! -f "${JAVA_HOME}/bin/java" ]; then
- echo "WARNING: ${JAVA_HOME}/bin/java does not exist."
-fi
if [ $# -eq 0 ]; then
+ if [ -z "${JAVA_HOME}" ]; then
+ echo "JAVA_HOME is not defined." >&2
+ else
+ if [ ! -d "${JAVA_HOME}" ]; then
+ echo "${JAVA_HOME} does not exist." >&2
+ elif [ ! -f "${JAVA_HOME}/bin/java" ]; then
+ echo "${JAVA_HOME}/bin/java does not exist." >&2
+ fi
+ fi
return
fi
@@ -67,7 +66,8 @@ if [ ! -f "${_NEW_JAVA_HOME}/bin/java" ]; then
return
fi
+JAVA_HOME=${_NEW_JAVA_HOME}
+echo "new JAVA_HOME=${JAVA_HOME}"
+"${JAVA_HOME}/bin/java" -version
unset _JDK_VERSION _NEW_JAVA_HOME
-JAVA_HOME=${_NEW_JAVA_HOME}
-echo "New JAVA_HOME=${JAVA_HOME}"
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index c917be9..e09921f 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -28,7 +28,7 @@
used once it's released. -->
<seam.version>2.1.0.SP1</seam.version>
<jboss-el.version>1.0_02.CR5</jboss-el.version>
- <richfaces.version>3.3.2.SR1</richfaces.version>
+ <richfaces.version>3.3.3.Final</richfaces.version>
</properties>
<dependencyManagement>
diff --git a/pom.xml b/pom.xml
index 521bc40..1708440 100644
--- a/pom.xml
+++ b/pom.xml
@@ -89,7 +89,7 @@
<postgresql.version>8.4-701.jdbc3</postgresql.version>
<h2.version>1.1.117</h2.version>
<jtds.version>1.2.2</jtds.version>
- <richfaces.version>3.3.3.CR1</richfaces.version>
+ <richfaces.version>3.3.3.Final</richfaces.version>
<jline.version>0.9.94</jline.version>
<sigar.version>1.6.5.132</sigar.version>
<quartz.version>1.6.5</quartz.version>
commit 7b884588ee0538748eb34b24cb83fa13fe5026d8
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 3 20:27:41 2010 +0200
Even more channel->repo fallout fixing
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index def88d2..44a34b9 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -11,13 +11,13 @@
<groupId>org.rhq</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
-
+
<groupId>org.rhq</groupId>
<artifactId>rhq-irc-plugin</artifactId>
<packaging>jar</packaging>
-
+
<name>RHQ IRC Server Plugin</name>
- <description>Remote monitoring of IRC repos</description>
+ <description>Remote monitoring of IRC channels</description>
<build>
<plugins>
@@ -167,12 +167,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>pircbot</groupId>
<artifactId>pircbot</artifactId>
<version>1.4.2</version>
- </dependency>
+ </dependency>
</dependencies>
</project>
diff --git
a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java
new file mode 100644
index 0000000..3475b00
--- /dev/null
+++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java
@@ -0,0 +1,134 @@
+package org.rhq.plugins.irc;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.event.Event;
+import org.rhq.core.domain.event.EventSeverity;
+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.event.EventContext;
+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.OperationContext;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
+
+
+/**
+ * @author Greg Hinkle
+ */
+public class IRCChannelComponent implements ResourceComponent<IRCServerComponent>,
MeasurementFacet, OperationFacet {
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+
+ private ResourceContext<IRCServerComponent> context;
+ private EventContext eventContext;
+ private String channel;
+
+ private AtomicLong messageCount = new AtomicLong();
+
+
+
+ /**
+ * Return availability of this resource
+ *
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
+ */
+ public AvailabilityType getAvailability() {
+ if (!context.getParentResourceComponent().isInChannel(channel)) {
+ context.getParentResourceComponent().registerChannel(this);
+ }
+
+ // TODO supply real implementation
+ 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<IRCServerComponent> context) throws
InvalidPluginConfigurationException, Exception {
+ this.context = context;
+ Configuration conf = context.getPluginConfiguration();
+ // TODO add code to start the resource / connection to it
+ channel =
conf.getSimple(IRCChannelDiscoveryComponent.CONFIG_CHANNEL).getStringValue();
+
+ eventContext = context.getEventContext();
+
+ context.getParentResourceComponent().registerChannel(this);
+ }
+
+
+ /**
+ * Tear down the rescource connection
+ *
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
+ */
+ public void stop() {
+
+ context.getParentResourceComponent().unregisterChannel(this);
+
+ }
+
+
+ /**
+ * Gather measurement data
+ *
+ * @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("users")) {
+ double count =
this.context.getParentResourceComponent().getUserCount(this.getChannel());
+ MeasurementDataNumeric res = new MeasurementDataNumeric(req, count);
+ report.addData(res);
+ } else if (req.getName().equals("messages")) {
+ report.addData( new MeasurementDataNumeric(req,
Double.valueOf(messageCount.get())));
+ }
+ }
+ }
+
+
+
+ /**
+ * Invokes the passed operation on the managed resource
+ *
+ * @param name Name of the operation
+ * @param params The method parameters
+ * @return An operation result
+ * @see org.rhq.core.pluginapi.operation.OperationFacet
+ */
+ public OperationResult invokeOperation(String name, Configuration params) throws
Exception {
+
+ OperationResult res = new OperationResult();
+ if ("sendMessage".equals(name)) {
+ String message = params.getSimple("message").getStringValue();
+ context.getParentResourceComponent().sendMessage(channel, message);
+ }
+ return res;
+ }
+
+
+ public String getChannel() {
+ return channel;
+ }
+
+ public void acceptMessage(String sender, String login, String hostname, String
message) {
+ Event event = new Event("message", sender, System.currentTimeMillis(),
EventSeverity.INFO, message);
+ this.eventContext.publishEvent(event);
+
+ this.messageCount.incrementAndGet();
+ }
+}
\ No newline at end of file
diff --git
a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java
new file mode 100644
index 0000000..e5a9a96
--- /dev/null
+++
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java
@@ -0,0 +1,53 @@
+package org.rhq.plugins.irc;
+
+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.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.List;
+
+
+/**
+ * Discovery class
+ * @author Greg Hinkle
+ */
+public class IRCChannelDiscoveryComponent implements
ResourceDiscoveryComponent<IRCServerComponent> {
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ public static final String CONFIG_CHANNEL = "channelName";
+
+ /**
+ * Run the discovery
+ */
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception {
+
+ Set<DiscoveredResourceDetails> discoveredResources = new
HashSet<DiscoveredResourceDetails>();
+
+ List<Configuration> contextPluginConfigurations =
discoveryContext.getPluginConfigurations();
+ for (Configuration config : contextPluginConfigurations) {
+
+ String channel = config.getSimple(CONFIG_CHANNEL).getStringValue();
+
+ DiscoveredResourceDetails details =
+ new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(),
+ channel,
+ "Channel " + channel,
+ null, null,
+ config,
+ null
+ );
+
+ discoveredResources.add(details);
+ }
+
+ return discoveredResources;
+
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java
deleted file mode 100644
index e39968d..0000000
--- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.rhq.plugins.irc;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.event.Event;
-import org.rhq.core.domain.event.EventSeverity;
-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.event.EventContext;
-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.OperationContext;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
-
-
-/**
- * @author Greg Hinkle
- */
-public class IRCRepoComponent implements ResourceComponent<IRCServerComponent>,
MeasurementFacet, OperationFacet {
-
- private final Log log = LogFactory.getLog(this.getClass());
-
-
- private ResourceContext<IRCServerComponent> context;
- private EventContext eventContext;
- private String repo;
-
- private AtomicLong messageCount = new AtomicLong();
-
-
-
- /**
- * Return availability of this resource
- *
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
- */
- public AvailabilityType getAvailability() {
- if (!context.getParentResourceComponent().isInRepo(repo)) {
- context.getParentResourceComponent().registerRepo(this);
- }
-
- // TODO supply real implementation
- 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<IRCServerComponent> context) throws
InvalidPluginConfigurationException, Exception {
- this.context = context;
- Configuration conf = context.getPluginConfiguration();
- // TODO add code to start the resource / connection to it
- repo = conf.getSimple(IRCRepoDiscoveryComponent.CONFIG_REPO).getStringValue();
-
- eventContext = context.getEventContext();
-
- context.getParentResourceComponent().registerRepo(this);
- }
-
-
- /**
- * Tear down the rescource connection
- *
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
- */
- public void stop() {
-
- context.getParentResourceComponent().unregisterRepo(this);
-
- }
-
-
- /**
- * Gather measurement data
- *
- * @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("users")) {
- double count =
this.context.getParentResourceComponent().getUserCount(this.getRepo());
- MeasurementDataNumeric res = new MeasurementDataNumeric(req, count);
- report.addData(res);
- } else if (req.getName().equals("messages")) {
- report.addData( new MeasurementDataNumeric(req,
Double.valueOf(messageCount.get())));
- }
- }
- }
-
-
-
- /**
- * Invokes the passed operation on the managed resource
- *
- * @param name Name of the operation
- * @param params The method parameters
- * @return An operation result
- * @see org.rhq.core.pluginapi.operation.OperationFacet
- */
- public OperationResult invokeOperation(String name, Configuration params) throws
Exception {
-
- OperationResult res = new OperationResult();
- if ("sendMessage".equals(name)) {
- String message = params.getSimple("message").getStringValue();
- context.getParentResourceComponent().sendMessage(repo, message);
- }
- return res;
- }
-
-
- public String getRepo() {
- return repo;
- }
-
- public void acceptMessage(String sender, String login, String hostname, String
message) {
- Event event = new Event("message", sender, System.currentTimeMillis(),
EventSeverity.INFO, message);
- this.eventContext.publishEvent(event);
-
- this.messageCount.incrementAndGet();
- }
-}
\ No newline at end of file
diff --git
a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java
deleted file mode 100644
index a1aab8d..0000000
---
a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.rhq.plugins.irc;
-
-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.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.List;
-
-
-/**
- * Discovery class
- * @author Greg Hinkle
- */
-public class IRCRepoDiscoveryComponent implements
ResourceDiscoveryComponent<IRCServerComponent> {
-
- private final Log log = LogFactory.getLog(this.getClass());
-
- public static final String CONFIG_REPO = "repoName";
-
- /**
- * Run the discovery
- */
- public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception {
-
- Set<DiscoveredResourceDetails> discoveredResources = new
HashSet<DiscoveredResourceDetails>();
-
- List<Configuration> contextPluginConfigurations =
discoveryContext.getPluginConfigurations();
- for (Configuration config : contextPluginConfigurations) {
-
- String repo = config.getSimple(CONFIG_REPO).getStringValue();
-
- DiscoveredResourceDetails details =
- new DiscoveredResourceDetails(
- discoveryContext.getResourceType(),
- repo,
- "Repo " + repo,
- null, null,
- config,
- null
- );
-
- discoveredResources.add(details);
- }
-
- return discoveredResources;
-
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
index 2ba1b34..5f169e8 100644
--- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
+++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
@@ -1,6 +1,5 @@
package org.rhq.plugins.irc;
-import java.util.Set;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
@@ -30,14 +29,14 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
private Bot bot;
- private Map<String, IRCRepoComponent> repos = new HashMap<String,
IRCRepoComponent>();
+ private Map<String, IRCChannelComponent> channels = new HashMap<String,
IRCChannelComponent>();
private String host;
private String port;
private String nick;
- private List<String> activeRepos;
+ private List<String> activeChannels;
- private Map<String, RepoInfo> info = new HashMap<String, RepoInfo>();
+ private Map<String, ChannelInfo> info = new HashMap<String,
ChannelInfo>();
/**
@@ -55,7 +54,7 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
log.warn("Failure to connect to IRC server " + host + "
reason: " + e.getMessage());
}
}
- activeRepos = Arrays.asList(this.bot.getChannels());
+ activeChannels = Arrays.asList(this.bot.getChannels());
return this.bot.isConnected() ? AvailabilityType.UP : AvailabilityType.DOWN;
}
@@ -81,61 +80,61 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
}
- public void registerRepo(IRCRepoComponent repoComponent) {
- this.repos.put(repoComponent.getRepo(), repoComponent);
+ public void registerChannel(IRCChannelComponent channelComponent) {
+ this.channels.put(channelComponent.getChannel(), channelComponent);
- this.bot.joinChannel(repoComponent.getRepo());
- updateRepos();
+ this.bot.joinChannel(channelComponent.getChannel());
+ updateChannels();
}
- public void unregisterRepo(IRCRepoComponent repoComponent) {
- this.bot.partChannel(repoComponent.getRepo());
- this.repos.remove(repoComponent.getRepo());
+ public void unregisterChannel(IRCChannelComponent channelComponent) {
+ this.bot.partChannel(channelComponent.getChannel());
+ this.channels.remove(channelComponent.getChannel());
}
- public boolean isInRepo(String repo) {
- return activeRepos.contains(repo);
+ public boolean isInChannel(String channel) {
+ return activeChannels.contains(channel);
}
- public void sendMessage(String repo, String message) {
- this.bot.sendMessage(repo, message);
+ public void sendMessage(String channel, String message) {
+ this.bot.sendMessage(channel, message);
}
public OperationResult invokeOperation(String name, Configuration parameters) throws
InterruptedException, Exception {
- if (name.equals("listRepos")) {
+ if (name.equals("listChannels")) {
OperationResult result = new OperationResult();
Configuration resultConfig = result.getComplexResults();
- PropertyList repoList = new PropertyList("repoList");
+ PropertyList channelList = new PropertyList("channelList");
this.bot.listChannels();
Thread.sleep(5000); // TODO is this long enough... any other way to know when
the list is done?
- for (RepoInfo repoInfo : info.values()) {
- PropertyMap repoMap = new PropertyMap("repoMap");
- repoMap.put(new PropertySimple("repo", repoInfo.repo));
- repoMap.put(new PropertySimple("userCount",
repoInfo.userCount));
- repoMap.put(new PropertySimple("topic", repoInfo.topic));
- repoList.add(repoMap);
+ for (ChannelInfo channelInfo : info.values()) {
+ PropertyMap channelMap = new PropertyMap("channelMap");
+ channelMap.put(new PropertySimple("channel",
channelInfo.channel));
+ channelMap.put(new PropertySimple("userCount",
channelInfo.userCount));
+ channelMap.put(new PropertySimple("topic",
channelInfo.topic));
+ channelList.add(channelMap);
}
- resultConfig.put(repoList);
+ resultConfig.put(channelList);
return result;
}
return null;
}
- public int getUserCount(String repo) {
- return this.bot.getUsers(repo).length;
+ public int getUserCount(String channel) {
+ return this.bot.getUsers(channel).length;
}
- public static class RepoInfo {
- String repo;
+ public static class ChannelInfo {
+ String channel;
int userCount;
String topic;
- public RepoInfo(String repo, int userCount, String topic) {
- this.repo = repo;
+ public ChannelInfo(String channel, int userCount, String topic) {
+ this.channel = channel;
this.userCount = userCount;
this.topic = topic;
}
@@ -147,19 +146,20 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
this.setName(nick);
}
- protected void onRepoInfo(String repo, int userCount, String topic) {
- info.put(repo, new RepoInfo(repo, userCount, topic));
+ @Override
+ protected void onChannelInfo(String channel, int userCount, String topic) {
+ info.put(channel, new ChannelInfo(channel, userCount, topic));
}
- public void onMessage(String repo, String sender, String login, String hostname,
String message) {
+ public void onMessage(String channel, String sender, String login, String
hostname, String message) {
- IRCRepoComponent component = IRCServerComponent.this.repos.get(repo);
+ IRCChannelComponent component =
IRCServerComponent.this.channels.get(channel);
if (component != null) {
component.acceptMessage(sender, login, hostname, message);
}
if (message.contains(getName()) &&
sender.contains("ghinkle")) {
- sendMessage(repo, "monitoring " + repos.size() + "
repos");
+ sendMessage(channel, "monitoring " + channels.size() + "
channels");
}
}
}
@@ -175,8 +175,8 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
}
- private void updateRepos() {
- activeRepos = Arrays.asList(this.bot.getChannels());
+ private void updateChannels() {
+ activeChannels = Arrays.asList(this.bot.getChannels());
}
}
\ No newline at end of file
diff --git a/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml
index 7376907..f4dcbc5 100644
--- a/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml
@@ -20,11 +20,11 @@
</plugin-configuration>
- <operation name="listRepos" description="List out all
repos">
+ <operation name="listChannels" description="List out all
channels">
<results>
- <c:list-property name="repoList">
- <c:map-property name="repoMap">
- <c:simple-property name="repo"/>
+ <c:list-property name="channelList">
+ <c:map-property name="channelMap">
+ <c:simple-property name="channel"/>
<c:simple-property name="userCount"/>
<c:simple-property name="topic"/>
</c:map-property>
@@ -33,19 +33,19 @@
</operation>
<service
- name="IRC Repo"
- discovery="IRCRepoDiscoveryComponent"
- class="IRCRepoComponent"
+ name="IRC Channel"
+ discovery="IRCChannelDiscoveryComponent"
+ class="IRCChannelComponent"
supportsManualAdd="true">
<plugin-configuration>
- <c:simple-property name="repoName"/>
+ <c:simple-property name="channelName"/>
</plugin-configuration>
- <operation name="sendMessage" description="Send a message
to the repo">
+ <operation name="sendMessage" description="Send a message
to the channel">
<parameters>
- <c:simple-property name="message" description="The
message to send to the repo" required="true"/>
+ <c:simple-property name="message" description="The
message to send to the channel" required="true"/>
</parameters>
</operation>
commit ccd97968320c1142f06ec6e0aa6d72d7a638c1e3
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Aug 3 20:05:39 2010 +0200
More channel->repo fallout fixing
diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
index e8176a1..2ba1b34 100644
--- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
+++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java
@@ -1,12 +1,10 @@
package org.rhq.plugins.irc;
-import java.util.HashSet;
import java.util.Set;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.List;
-import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -22,7 +20,6 @@ import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.jibble.pircbot.PircBot;
-import org.jibble.pircbot.IrcException;
/**
@@ -58,7 +55,7 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
log.warn("Failure to connect to IRC server " + host + "
reason: " + e.getMessage());
}
}
- activeRepos = Arrays.asList(this.bot.getRepos());
+ activeRepos = Arrays.asList(this.bot.getChannels());
return this.bot.isConnected() ? AvailabilityType.UP : AvailabilityType.DOWN;
}
@@ -87,12 +84,12 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
public void registerRepo(IRCRepoComponent repoComponent) {
this.repos.put(repoComponent.getRepo(), repoComponent);
- this.bot.joinRepo(repoComponent.getRepo());
+ this.bot.joinChannel(repoComponent.getRepo());
updateRepos();
}
public void unregisterRepo(IRCRepoComponent repoComponent) {
- this.bot.partRepo(repoComponent.getRepo());
+ this.bot.partChannel(repoComponent.getRepo());
this.repos.remove(repoComponent.getRepo());
}
@@ -111,7 +108,7 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
Configuration resultConfig = result.getComplexResults();
PropertyList repoList = new PropertyList("repoList");
- this.bot.listRepos();
+ this.bot.listChannels();
Thread.sleep(5000); // TODO is this long enough... any other way to know when
the list is done?
@@ -150,7 +147,6 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
this.setName(nick);
}
- @Override
protected void onRepoInfo(String repo, int userCount, String topic) {
info.put(repo, new RepoInfo(repo, userCount, topic));
}
@@ -180,7 +176,7 @@ public class IRCServerComponent implements ResourceComponent,
OperationFacet {
private void updateRepos() {
- activeRepos = Arrays.asList(this.bot.getRepos());
+ activeRepos = Arrays.asList(this.bot.getChannels());
}
}
\ No newline at end of file
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 4d439cf..880254c 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -164,6 +164,7 @@
<modules>
<module>byteman</module>
+ <module>irc</module>
<module>iis</module>
<module>database</module>
commit 0b56da2b0dc06bdc76552196c541ff8dd22302c5
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Aug 3 11:43:33 2010 -0400
- taking out iptables and services plugins from eclipse .classpath:
iptables plugin is not functional nor compilable.
services plugins is half-baked and needs its dependencies reworked so its buildable
via maven in a proper way
- making sure EMS is at the 1.2.13 level as well
diff --git a/.classpath b/.classpath
index 15da9c3..35714ec 100644
--- a/.classpath
+++ b/.classpath
@@ -2,9 +2,6 @@
<classpath>
<classpathentry kind="src"
path="modules/common/jboss-as/src/main/java"/>
<classpathentry kind="src"
path="modules/plugins/irc/src/main/java"/>
- <classpathentry kind="src"
path="modules/plugins/services/src/main/java"/>
- <classpathentry kind="src"
path="modules/plugins/iptables/src/main/java"/>
- <classpathentry kind="src"
path="modules/plugins/iptables/src/test/java"/>
<classpathentry kind="src"
path="modules/plugins/hadoop/src/main/java"/>
<classpathentry kind="src"
path="modules/enterprise/remoting/webservices/src/test/java"/>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/main/java"/>
@@ -205,7 +202,7 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14.jar"
sourcepath="/M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar"
sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar"
sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
commit b6b636bdd795c192b4cb5f74ce7fb4a1d2d404e1
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Aug 3 11:39:34 2010 -0400
looks like a copy-n-paste error - i don't think the services plugin REALLY wants
the twitter4j library
diff --git a/modules/plugins/services/pom.xml b/modules/plugins/services/pom.xml
index 0f84fe1..f6b8556 100644
--- a/modules/plugins/services/pom.xml
+++ b/modules/plugins/services/pom.xml
@@ -111,29 +111,6 @@
</executions>
</plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <id>copy-twitter4j-jar</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>net.homeip.yusuke</groupId>
- <artifactId>twitter4j</artifactId>
- <version>2.0.8</version>
- </artifactItem>
- </artifactItems>
-
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
commit f0e1602b9f1577774b03022bd7c6c9f191a9ea94
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 2 18:30:05 2010 -0400
changes to get build running w/ JDK7, including upgrading to EMS 1.2.14, which is
compiled w/ "-target 1.5", rather than "-target jsr14" like earlier
versions of EMS
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
index 74f59f0..9f8726a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
@@ -66,8 +66,8 @@ abstract class AbstractConditionCache {
*/
cacheElement.setActive(true); // no harm to always set active
(though, technically, STATELESS operators don't need it)
cachedConditionProducer.sendActivateAlertConditionMessage(
- cacheElement.getAlertConditionTriggerId(), timestamp,
cacheElement
- .convertValueToString(providedValue), extraParams);
+ cacheElement.getAlertConditionTriggerId(), timestamp,
+ cacheElement.convertValueToString(providedValue), extraParams);
stats.matched++;
} catch (Exception e) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java
index bc901d4..f74663a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java
@@ -32,7 +32,6 @@ import javax.jms.Session;
import org.rhq.enterprise.server.alert.engine.jms.model.ActiveAlertConditionMessage;
import org.rhq.enterprise.server.alert.engine.jms.model.InactiveAlertConditionMessage;
-import org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement;
/**
* A convenience class that will be used by the AlertConditionCacheManager to send
messages to a JMS queue for
@@ -54,7 +53,7 @@ public class CachedConditionProducerBean implements
CachedConditionProducerLocal
private Queue alertConditionQueue;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
- public <T extends AbstractCacheElement<S>, S> void
sendActivateAlertConditionMessage(int alertConditionId,
+ public <S> void sendActivateAlertConditionMessage(int alertConditionId,
long timestamp, S value, Object... extraParams) throws JMSException {
Connection connection = factory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java
index d2b4fb5..f431dd4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java
@@ -33,7 +33,7 @@ public interface CachedConditionProducerLocal {
* Send a message to the appropriate JMS destination for processing. This destination
handles creating and
* persisting entities corresponding to triggered alert conditions.
*/
- <T extends AbstractCacheElement<S>, S> void
sendActivateAlertConditionMessage(int alertConditionId, long timestamp,
+ <S> void sendActivateAlertConditionMessage(int alertConditionId, long
timestamp,
S value, Object... extraParams) throws JMSException;
void sendDeactivateAlertConditionMessage(int alertConditionId, long timestamp) throws
JMSException;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java
index c4cc491..71856f5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java
@@ -20,6 +20,10 @@ package org.rhq.enterprise.server.auth;
public class SubjectException extends RuntimeException {
+ // Default no-arg constructor required by JAXB
+ public SubjectException() {
+ }
+
public SubjectException(String message) {
super(message);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java
index 775f599..56abd94 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java
@@ -31,6 +31,10 @@ import javax.ejb.ApplicationException;
public class ConfigurationUpdateStillInProgressException extends RuntimeException {
private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB
+ public ConfigurationUpdateStillInProgressException() {
+ }
+
public ConfigurationUpdateStillInProgressException(String message) {
super(message);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java
index 7b9ae57..3ee5c58 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java
@@ -30,6 +30,7 @@ public class RepoException extends ContentException {
private RepoExceptionType type = RepoExceptionType.GENERAL;
+ // Default no-arg constructor required by JAXB
public RepoException() {
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java
index 4d502bd..cb97f40 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java
@@ -29,6 +29,10 @@ package org.rhq.enterprise.server.exception;
public class ScheduleException extends RuntimeException {
private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB
+ public ScheduleException() {
+ }
+
public ScheduleException(String message) {
super(message);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java
index 887998e..1b0f03a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java
@@ -30,6 +30,10 @@ package org.rhq.enterprise.server.exception;
public class UnscheduleException extends RuntimeException {
private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB
+ public UnscheduleException() {
+ }
+
public UnscheduleException(String message) {
super(message);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
index 6ad8885..7c31d96 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java
@@ -25,6 +25,10 @@ package org.rhq.enterprise.server.resource;
public class ResourceNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB
+ public ResourceNotFoundException() {
+ }
+
/**
* Create an exception indicating the resource with the specified id was not found.
*
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java
index 66ffa32..0d64c1e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java
@@ -21,6 +21,10 @@ package org.rhq.enterprise.server.resource.group;
public class ResourceGroupNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB
+ public ResourceGroupNotFoundException() {
+ }
+
public ResourceGroupNotFoundException(int groupId) {
super("A group with id " + groupId + " does not exist.");
}
diff --git a/pom.xml b/pom.xml
index f3c48ed..521bc40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
- <ems.version>1.2.13</ems.version>
+ <ems.version>1.2.14</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
<h2.version>1.1.117</h2.version>
<jtds.version>1.2.2</jtds.version>
@@ -708,6 +708,8 @@
<source>1.6</source>
<target>1.6</target>
<optimize>false</optimize>
+ <verbose>true</verbose>
+ <compilerArgument>-Xlint</compilerArgument>
</configuration>
</plugin>
commit 5911f8751eeea86072ab6c524a2e7bdc1f58166e
Merge: 4ae53d1... cc33d33...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 2 14:49:33 2010 -0400
Merge branch 'master' into permgen-leak
commit 4ae53d12b5b30aafe5362ad5435b0fbe548962b6
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 2 13:45:07 2010 -0400
clean up some things that we forgot to clean up at shutdown - to help GC
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
index c9c1d54..081e067 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
@@ -78,7 +78,7 @@ import org.rhq.core.pluginapi.util.FileUtils;
public class PluginContainer implements ContainerService {
private static final PluginContainer INSTANCE = new PluginContainer();
- private static final Log log = LogFactory.getLog(PluginContainer.class);
+ private final Log log = LogFactory.getLog(PluginContainer.class);
// our management interface
private PluginContainerMBeanImpl mbean;
@@ -303,7 +303,9 @@ public class PluginContainer implements ContainerService {
pluginManager.shutdown();
agentServiceListeners.clear();
+ agentServiceListeners = new
LinkedHashSet<AgentServiceLifecycleListener>();
agentServiceStreamRemoter = null;
+ agentRegistrar = null;
purgeTmpDirectoryContents();
@@ -321,6 +323,8 @@ public class PluginContainer implements ContainerService {
pluginComponentFactory = null;
pluginManager = null;
+ configuration = null;
+
started = false;
log.info("Plugin container is now shutdown.");
commit cc33d336fa0e253f16ff2669375b840b5b32fc96
Merge: cd68889... 724682f...
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 2 13:17:29 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit cd688890537687233af414fbdf785707a98f8718
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 2 13:11:39 2010 -0400
Cleaning up logic in script for resetting connection properties, adding script for
apache
I have renamed reset_conn_props.js to reset_jboss_agent_prop.js. Most of the logic in
that script has been removed. There was logic for retrieving default values from the
default template; however, I discovered through further testing that the snapshot
report
properties do not even exist in the default template when upgrading 2.2.0 -->
2.3.1.
Consequently, I need to simply hard code the properties that need to be added to the
plugin
configurations.
Adding a similar script for apache to handle properties added in the 2.4.0 release.
diff --git a/etc/cli-scripts/reset_apache_props.js
b/etc/cli-scripts/reset_apache_props.js
new file mode 100644
index 0000000..becdc50
--- /dev/null
+++ b/etc/cli-scripts/reset_apache_props.js
@@ -0,0 +1,102 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * This CLI script resets/restores apache connection properties that are not set to
their
+ * default values during plugin upgrade. This script is only intended to be run once. If
+ * run subsequent times, the script will reset these properties to their defaults,
+ * overriding whatever the current values might be.
+ */
+
+
+function iterate(iterable, callback) {
+ var iterator = iterable.iterator();
+ while (iterator.hasNext()) {
+ callback(iterator.next());
+ }
+}
+
+function filter(iterable, predicate) {
+ var matches = java.util.ArrayList();
+ iterate(iterable, function(obj) {
+ if (predicate(obj)) {
+ matches.add(obj);
+ }
+ });
+ return matches;
+}
+
+function log(msg) {
+ println("DEBUG " + msg);
+}
+
+function loadPluginConfiguration(resource) {
+ log("Loading plugin configuration for " + resource);
+ return ConfigurationManager.getPluginConfiguration(resource.id);
+}
+
+function findResourcesByTypeAndPlugin(resourceType, plugin) {
+ var criteria = ResourceCriteria();
+ criteria.addFilterResourceTypeName(resourceType);
+ criteria.addFilterPluginName(plugin);
+ criteria.fetchResourceType(true);
+ criteria.fetchPluginConfiguration(true);
+ criteria.caseSensitive = true;
+ criteria.strict = true;
+
+ var resources = ResourceManager.findResourcesByCriteria(criteria);
+
+ log("Found " + resources.size() + " " + resourceType + "
resources ");
+
+ iterate(resources, function(resource) {
+ resource.pluginConfiguration = loadPluginConfiguration(resource);
+ });
+
+ return resources;
+}
+
+function updatePluginConfigs(resources, applyDefaults) {
+ iterate(resources, function(resource) {
+ log("Preparing to update plugin configuration for " + resource)
+ applyDefaults(resource.pluginConfiguration);
+ ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
+ log("Updated plugin configuration for " + resource);
+ });
+}
+
+functionr resetApachePluginConfigProps() {
+ var resourceTypeName = 'Apache HTTP Server';
+ var pluginName = 'Apache';
+ var servers = findResourcesByTypeAndPlugin(resourceTypeName, pluginName);
+
+ updatePluginConfigs(servers, function(pluginConfig) {
+ pluginConfig.put(PropertySimple('augeasEnabled', 'no'));
+ pluginConfig.put(PropertySimple('configurationFilesInclusionPatterns',
'/etc/httpd/conf/httpd.conf'));
+ pluginConfig.put(PropertySimple('vhostCreationPolicy',
'vhost-per-file'));
+ });
+}
+
+//////////////
+// main //
+//////////////
+resetApachePluginConfigProps();
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js
deleted file mode 100644
index 274bc5c..0000000
--- a/etc/cli-scripts/reset_conn_props.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/**
- * This is a CLI script to be used for
https://bugzilla.redhat.com/show_bug.cgi?id=573034.
- * The script resets the snapshot report plugin configuration properties for JBoss
servers
- * and agents to their default values. This is a one-off script intended only to be run
- * once to assign values to required plugin properties that are unset.
- *
- * NOTE: This script can probably be refactored and generalized a bit to support
- * resetting any specified plugin configuration properties to their default values.
- * And specifying candidate properties could be done via a callback function to
- * allow for arbitrarily complex logic in determining the properties.
- */
-
-function iterate(iterable, callback) {
- var iterator = iterable.iterator();
- while (iterator.hasNext()) {
- callback(iterator.next());
- }
-}
-
-function filter(iterable, predicate) {
- var matches = java.util.ArrayList();
- iterate(iterable, function(obj) {
- if (predicate(obj)) {
- matches.add(obj);
- }
- });
- return matches;
-}
-
-function log(msg) {
- println("DEBUG " + msg);
-}
-
-function loadPluginConfiguration(resource) {
- log("Loading plugin configuration for " + resource);
- return ConfigurationManager.getPluginConfiguration(resource.id);
-}
-
-function loadPluginConfigDef(resourceTypeName, pluginName) {
- log("Loading plugin configuration definition for [resourceType=" +
resourceTypeName + ", plugin=" +
- pluginName + "]");
- var resourceType =
ResourceTypeManager.getResourceTypeByNameAndPlugin(resourceTypeName,
- pluginName);
-
- if (resourceType == null) {
- throw "Failed to find resource type '" + resourceTypeName +
"'";
- }
-
- configDef =
ConfigurationManager.getPluginConfigurationDefinitionForResourceType(resourceType.id);
-
- if (configDef == null) {
- throw "Failed to load plugin configuration for [resourceType=" +
resourceTypeName +
- ", plugin=" + pluginName + "]";
- }
-
- return configDef;
-}
-
-function findResourcesByTypeAndPlugin(resourceType, plugin) {
- var criteria = ResourceCriteria();
- criteria.addFilterResourceTypeName(resourceType);
- criteria.addFilterPluginName(plugin);
- criteria.fetchResourceType(true);
- criteria.fetchPluginConfiguration(true);
- criteria.caseSensitive = true;
- criteria.strict = true;
-
- var resources = ResourceManager.findResourcesByCriteria(criteria);
-
- log("Found " + resources.size() + " " + resourceType + "
resources ");
-
- iterate(resources, function(resource) {
- resource.pluginConfiguration = loadPluginConfiguration(resource);
- });
-
- return resources;
-}
-
-/**
- * This function takes a Configuration object and "flattens" its properties
into a list of
- * all simple (i.e., PropertySimple) objects contained in the configuration. This
includes
- * nested properties. The properties are returned as a java.util.List.
- *
- * param: configuration The Configuration object from which the property list will be
built
- *
- * return: A List object of all PropertySimple objects, including those nested in
complex
- * properties
- */
-function flattenProperties(configuration) {
- var simpleProperties = java.util.ArrayList();
-
- iterate(configuration.map.values(), function(property) {
- if (property instanceof PropertySimple) {
- simpleProperties.add(property);
- }
- else if (property instanceof PropertyList) {
- simpleProperties.addAll(flattenPropertyList(property));
- }
- });
-
- return simpleProperties;
-}
-
-function flattenPropertyList(propertyList) {
- var simpleProperties = java.util.ArrayList();
-
- iterate(propertyList.list, function(property) {
- if (property instanceof PropertySimple) {
- simpleProperty.add(property);
- }
- else if (property instanceof PropertyMap) {
- simpleProperties.addAll(flattenPropertyMap(property));
- }
- else if (property instanceof PropertyList) {
- simpleProperties.addAll(flattenPropertyList(property));
- }
- });
-
- return simpleProperties;
-}
-
-function flattenPropertyMap(propertyMap) {
- var simpleProperties = java.util.ArrayList();
-
- iterate(propertyMap.map.values(), function(property) {
- if (property instanceof PropertySimple) {
- simpleProperties.add(property);
- }
- else if (property instanceof PropertyMap) {
- simpleProperties.addAll(flattenPropertyMap(property));
- }
- else if (property instanceof PropertyList) {
- simpleProperties.addAll(flattPropertyList(property));
- }
- });
-
- return simpleProperties;
-}
-
-/**
- * Loads the specified default plugin properties for a given plugin configuration
definition.
- * The defaults are stored in and retrieved from the default template of the plugin
- * configuration.
- *
- * param: pluginConfigDef A ConfigurationDefinition object which is the plugin config
def
- * from which to retrieve the defaults
- *
- * param: defaultPropertyNames A java.util.Collection of the property names to include
- *
- * return: A java.util.Map of the default properties. Property names as strings are
mapped
- * to the PropertySimple objects.
- */
-function loadSnapshotDefaults(pluginConfigDef, defaultPropertyNames) {
- var snapshotDefaultsMap = java.util.HashMap();
- var defaults = flattenProperties(pluginConfigDef.defaultTemplate.configuration);
-
- var isSnapshotProperty = function(property) {
- return defaultPropertyNames.contains(property.name);
- }
-
- var snapshotDefaults = filter(defaults, isSnapshotProperty);
-
- iterate(snapshotDefaults, function(property) {
- snapshotDefaultsMap.put(property.name, property);
- });
-
- return snapshotDefaultsMap;
-}
-
-function getJBossSnapshotPropertyNames() {
- var set = java.util.HashSet();
- set.add('snapshotConfigEnabled');
- set.add('snapshotConfigDirectory');
- set.add('snapshotConfigRecursive');
- set.add('snapshotLogEnabled');
- set.add('snapshotLogDirectory');
- set.add('snapshotLogRecursive');
- set.add('snapshotDataEnabled');
- set.add('snapshotDataDirectory');
- set.add('snapshotDataRecursive');
- set.add('snapshotAdditionalFilesEnabled');
- set.add('snapshotAdditionalFilesDirectory');
- set.add('snapshotAdditionalFilesRecursive');
-
- return set;
-}
-
-function getAgentSnapshotPropertyNames() {
- var set = java.util.HashSet();
- set.add('snapshotConfigEnabled');
- set.add('snapshotLogEnabled');
- set.add('snapshotDataEnabled');
-
- return set;
-}
-
-/**
- * Resets the values of specified plugin configuration properties back to their default
values.
- * The configuration is modified locally, in memory and then a request is sent to
- * ConfigurationManager.
- *
- * param: resources The resources whose plugin configurations are to be updated. This is
- * expected to be a java.util.Collection.
- *
- * param: snapshotDefaults: The names of the plugin configuration properties to reset.
This
- * is expected to be a java.util.Collection.
- */
-function resetPluginConfigPropsFromTemplate(pluginConfigDef, resources, snapshotDefaults)
{
- iterate(resources, function(resource) {
- log("Preparing to reset plugin configuration properties for " + resource);
- var simpleProperties = flattenProperties(resource.pluginConfiguration);
- var snapshotProperties = filter(simpleProperties, function(property) {
- return snapshotDefaults.containsKey(property.name);
- });
-
- iterate(snapshotProperties, function(property) {
- var defaultProperty = snapshotDefaults.get(property.name);
- property.stringValue = defaultProperty.stringValue;
- log("Set property " + property.name + " to " +
property.stringValue);
- });
-
- ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
- log("Updated plugin configuration for " + resource);
- });
-}
-
-function resetPluginConfigProps(resources, applyDefaults) {
- iterate(resources, function(resource) {
- applyDefaults(resource.pluginConfiguration);
- ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
- log("Updated plugin configuration for " + resource);
- });
-}
-
-function resetJBossPluginConfigProps() {
- var jbossResourceTypeName = 'JBossAS Server';
- var jbossPluginName = 'JBossAS';
- var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName,
jbossPluginName);
- var jbossPluginConfigDef = loadPluginConfigDef(jbossResourceTypeName,
jbossPluginName);
-
- //resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef,
- // getJBossSnapshotPropertyNames()));
-
- resetPluginConfigProps(jbossServers, function(pluginConfig) {
- pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
- pluginConfig.put(PropertySimple('snapshotConfigDirectory',
'config'));
- pluginConfig.put(PropertySimple('snapshotConfigRecursive', true));
- pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
- pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log'));
- pluginConfig.put(PropertySimple('snapshotLogRecursive', false));
- pluginConfig.put(PropertySimple('snapshotDataEnabled', false));
- pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data'));
- pluginConfig.put(PropertySimple('snapshotDataRecursive', true));
-
- var propertyMap = PropertyMap('snapshotAdditionalFilesMap');
- propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true));
- propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory',
''));
- propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true));
-
- var propertyList = PropertyList('snapshotAdditionalFilesList');
- propertyList.list.add(propertyMap);
-
- pluginConfig.put(propertyList);
- });
-}
-
-function resetAgentPluginConfigProps() {
- var agentResourceTypeName = 'RHQ Agent';
- var agentPluginName = 'RHQAgent';
- var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName);
- var agentPluginConfigDef = loadPluginConfigDef(agentResourceTypeName,
agentPluginName);
-
- //resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef,
- // getAgentSnapshotPropertyNames()));
-
- resetPluginConfigProps(agents, function(pluginConfig) {
- pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
- pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
- pluginConfig.put(PropertySimple('snapshotDataEnabled', true));
- });
-}
-
-//////////////
-// main //
-//////////////
-resetJBossPluginConfigProps();
-resetAgentPluginConfigProps();
diff --git a/etc/cli-scripts/reset_jboss_agent_props.js
b/etc/cli-scripts/reset_jboss_agent_props.js
new file mode 100644
index 0000000..51fdb99
--- /dev/null
+++ b/etc/cli-scripts/reset_jboss_agent_props.js
@@ -0,0 +1,110 @@
+/**
+ * This is a CLI script to be used for
https://bugzilla.redhat.com/show_bug.cgi?id=573034.
+ * The script resets/restores the snapshot report plugin configuration properties for
JBoss servers
+ * and agents to their default values. This is a one-off script intended only to be run
+ * once to assign values to required plugin properties that are unset. Running it
subsequent times
+ * cause the current connection settings for the snapshot report properties to be
overridden and
+ * reset to their default vales
+ */
+
+function iterate(iterable, callback) {
+ var iterator = iterable.iterator();
+ while (iterator.hasNext()) {
+ callback(iterator.next());
+ }
+}
+
+function filter(iterable, predicate) {
+ var matches = java.util.ArrayList();
+ iterate(iterable, function(obj) {
+ if (predicate(obj)) {
+ matches.add(obj);
+ }
+ });
+ return matches;
+}
+
+function log(msg) {
+ println("DEBUG " + msg);
+}
+
+function loadPluginConfiguration(resource) {
+ log("Loading plugin configuration for " + resource);
+ return ConfigurationManager.getPluginConfiguration(resource.id);
+}
+
+function findResourcesByTypeAndPlugin(resourceType, plugin) {
+ var criteria = ResourceCriteria();
+ criteria.addFilterResourceTypeName(resourceType);
+ criteria.addFilterPluginName(plugin);
+ criteria.fetchResourceType(true);
+ criteria.fetchPluginConfiguration(true);
+ criteria.caseSensitive = true;
+ criteria.strict = true;
+
+ var resources = ResourceManager.findResourcesByCriteria(criteria);
+
+ log("Found " + resources.size() + " " + resourceType + "
resources ");
+
+ iterate(resources, function(resource) {
+ resource.pluginConfiguration = loadPluginConfiguration(resource);
+ });
+
+ return resources;
+}
+
+function updatePluginConfigs(resources, applyDefaults) {
+ iterate(resources, function(resource) {
+ log("Preparing to update plugin configuration for " + resource)
+ applyDefaults(resource.pluginConfiguration);
+ ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
+ log("Updated plugin configuration for " + resource);
+ });
+}
+
+function resetJBossPluginConfigProps() {
+ var jbossResourceTypeName = 'JBossAS Server';
+ var jbossPluginName = 'JBossAS';
+ var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName,
jbossPluginName);
+
+ updatePluginConfigs(jbossServers, function(pluginConfig) {
+ pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotConfigDirectory',
'config'));
+ pluginConfig.put(PropertySimple('snapshotConfigRecursive', true));
+ pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log'));
+ pluginConfig.put(PropertySimple('snapshotLogRecursive', false));
+ pluginConfig.put(PropertySimple('snapshotDataEnabled', false));
+ pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data'));
+ pluginConfig.put(PropertySimple('snapshotDataRecursive', true));
+
+ var propertyMap = PropertyMap('snapshotAdditionalFilesMap');
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true));
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory',
''));
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true));
+
+ var propertyList = PropertyList('snapshotAdditionalFilesList');
+ propertyList.list.add(propertyMap);
+
+ pluginConfig.put(propertyList);
+ });
+}
+
+function resetAgentPluginConfigProps() {
+ var agentResourceTypeName = 'RHQ Agent';
+ var agentPluginName = 'RHQAgent';
+ var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName);
+
+ updatePluginConfigs(agents, function(pluginConfig) {
+ pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotDataEnabled', true));
+ });
+}
+
+//////////////
+// main //
+//////////////
+exec -f
+resetJBossPluginConfigProps();
+resetAgentPluginConfigProps();
commit 6afb470d31be3c71c9e16544267d74a45e809da0
Merge: 774ed67... 724682f...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 2 10:44:24 2010 -0400
Merge branch 'master' into permgen-leak
commit 724682f8e03a5f804774559a97a70298dc402a43
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 2 10:43:43 2010 -0400
paranoia - we might hit sun bug
http://bugs.sun.com/view_bug.do?bug_id=6735255 so we
explicitly close the input stream prior to closing the jar file
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
index 4dc7a41..5fac37b 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
@@ -946,11 +946,12 @@ public class JBossASServerComponent implements MeasurementFacet,
OperationFacet,
private String getVhostFromWarFile(File warFile) {
JarFile jfile = null;
+ InputStream is = null;
try {
jfile = new JarFile(warFile);
JarEntry entry = jfile.getJarEntry("WEB-INF/jboss-web.xml");
if (entry != null) {
- InputStream is = jfile.getInputStream(entry);
+ is = jfile.getInputStream(entry);
SAXBuilder saxBuilder = new SAXBuilder();
Document doc = saxBuilder.build(is);
Element root = doc.getRootElement(); // <jboss-web>
@@ -968,12 +969,21 @@ public class JBossASServerComponent implements MeasurementFacet,
OperationFacet,
} catch (Exception ioe) {
log.warn("Exception when getting vhost from war file : " +
ioe.getMessage());
} finally {
- if (jfile != null)
+ if (jfile != null) {
+ if (is != null) {
+ try {
+ // see
http://bugs.sun.com/view_bug.do?bug_id=6735255 for why we
do this
+ is.close();
+ } catch (IOException e) {
+ log.info("Exception when trying to close the war file
stream: " + e.getMessage());
+ }
+ }
try {
jfile.close();
} catch (IOException e) {
log.info("Exception when trying to close the war file: " +
e.getMessage());
}
+ }
}
// We're not able to determine a vhost, so return localhost
commit b8685a6877b0fad4e7f9b305db673fd2cab3e2aa
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 2 10:33:46 2010 -0400
add explicit i18nlog dep to poms of modules that depend on it
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 8769bfc..09703ee 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -43,6 +43,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 405eaed..458c635 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -33,6 +33,11 @@
<version>1.0</version>
</dependency>
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
</dependencies>
<build>
@@ -125,4 +130,4 @@
</profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 03f3932..7187dbe 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -84,6 +84,11 @@
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
</dependency>
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
<!-- TODO: This is a fix for the Javac bug requiring annotations to be
available when compiling dependent classes. It is fixed in JDK 6 -->
<dependency>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 93931da..dcd5bed 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -64,6 +64,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-common</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 9a29f14..b3ccdca 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -76,6 +76,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-jmx</artifactId>
<version>${jboss.version}</version>
@@ -103,7 +108,6 @@
<scope>provided</scope> <!-- by JBossAS -->
</dependency>
-
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index 880cc16..f802053 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -149,6 +149,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>${el.version}</version>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 5453a41..b118a9e 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -51,6 +51,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>${jline.version}</version>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index a897a53..b0b3484 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -153,6 +153,11 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.3.1_spec</artifactId>
<!-- The Sun javamail jar isn't available from a public repo due to
licensing issues,
commit d8e467b5ab9fd98bb3196e0a5e6c19a671135dbb
Merge: 08ea91d... 0807fc7...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Aug 2 09:57:08 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 0807fc7979b0cf42c1e0e5b1a746776221533a08
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Aug 2 01:18:59 2010 -0400
add more plugins to the eclipse build path
diff --git a/.classpath b/.classpath
index ac5cafd..15da9c3 100644
--- a/.classpath
+++ b/.classpath
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src"
path="modules/common/jboss-as/src/main/java"/>
+ <classpathentry kind="src"
path="modules/plugins/irc/src/main/java"/>
+ <classpathentry kind="src"
path="modules/plugins/services/src/main/java"/>
+ <classpathentry kind="src"
path="modules/plugins/iptables/src/main/java"/>
+ <classpathentry kind="src"
path="modules/plugins/iptables/src/test/java"/>
+ <classpathentry kind="src"
path="modules/plugins/hadoop/src/main/java"/>
<classpathentry kind="src"
path="modules/enterprise/remoting/webservices/src/test/java"/>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/main/java"/>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/test/java"/>
commit 774ed6788f6d14ec7b14f169b2181fbcf20e5302
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Sat Jul 31 11:35:10 2010 -0400
BZ 615377 - use a new feature in EMS 1.2.13 that lets us clear the EMS classloader
factory cache of classloaders and jar files.
we now do this in the jmx plugin lifecycle listener.
diff --git
a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java
b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java
new file mode 100644
index 0000000..3b4984e
--- /dev/null
+++
b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java
@@ -0,0 +1,52 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.plugins.jmx;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.support.classloader.ClassLoaderFactory;
+
+import org.rhq.core.pluginapi.plugin.PluginContext;
+import org.rhq.core.pluginapi.plugin.PluginLifecycleListener;
+
+public class JMXPluginLifecycleListener implements PluginLifecycleListener {
+ private final Log log = LogFactory.getLog(JMXPluginLifecycleListener.class);
+
+ @Override
+ public void initialize(PluginContext context) throws Exception {
+ // no-op
+ }
+
+ @Override
+ public void shutdown() {
+ // so we do not cause EMS classloaders to leak perm gen, we need to clear
+ // out all caches from the EMS ClassLoaderFactory
+ try {
+ ClassLoaderFactory.clearCaches();
+ log.debug("Cleared EMS ClassLoaderFactory caches");
+ } catch (Exception e) {
+ log.error("Failed to clear EMS ClassLoaderFactory caches - perm gen may
leak", e);
+ }
+ }
+}
diff --git a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
index 258caee..2c7ca1d 100644
--- a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
@@ -4,6 +4,7 @@
displayName="Generic JMX"
package="org.rhq.plugins.jmx"
description="Supports management of JMX MBean Servers via various remoting
systems."
+ pluginLifecycleListener="JMXPluginLifecycleListener"
ampsVersion="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
diff --git a/pom.xml b/pom.xml
index 306bbff..e743278 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
- <ems.version>1.2.11</ems.version>
+ <ems.version>1.2.13</ems.version>
<postgresql.version>8.4-701.jdbc3</postgresql.version>
<h2.version>1.1.117</h2.version>
<jtds.version>1.2.2</jtds.version>
commit c1e8353c8ef155fe286658694540bf3e69619737
Merge: 433cafa... 69c6da3...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Sat Jul 31 11:15:09 2010 -0400
Merge branch 'master' into permgen-leak
commit 69c6da3af5ef3a12988836d5a11b5b09e459075c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 23 11:00:46 2010 -0400
BZ 615377 workaround sun bug
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
index d6546a2..c9c1d54 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
@@ -31,6 +31,8 @@ import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.security.auth.login.Configuration;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -114,6 +116,11 @@ public class PluginContainer implements ContainerService {
}
private PluginContainer() {
+ // for why we need to do this, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
+ try {
+ Configuration.getConfiguration();
+ } catch (Throwable t) {
+ }
}
/**
@@ -337,6 +344,13 @@ public class PluginContainer implements ContainerService {
private void cleanMemory() {
Introspector.flushCaches();
LogFactory.releaseAll();
+
+ // for why we need to do this, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
+ try {
+ Configuration.setConfiguration(null);
+ } catch (Throwable t) {
+ }
+
System.gc();
}
@@ -563,4 +577,4 @@ public class PluginContainer implements ContainerService {
public boolean isInsideAgent() {
return (this.configuration != null &&
this.configuration.isInsideAgent());
}
-}
\ No newline at end of file
+}
commit 433cafa05dc1871710813875d5c21923f716d9a5
Merge: b13693f... 483a1e8...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 30 17:44:21 2010 -0400
Merge branch 'master' into permgen-leak
commit f980213a4ce03e528c9d837f9c1e42b7a8d81ec3
Merge: 2cf77a3... 8bbecac...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 30 18:23:45 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 2cf77a315e93ca36827c35dffbd8c425d77b2e9b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 30 18:22:15 2010 +0200
Wire the autodiscovery of mysql databases. Users still need to provide credentials
manually.
diff --git
a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
index 4429e7a..f50fbc0 100644
---
a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
+++
b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java
@@ -61,6 +61,8 @@ public class MySqlDiscoveryComponent implements
ResourceDiscoveryComponent, Manu
log.info("Discovered a mysql process: " + result);
ProcessInfo procInfo = result.getProcessInfo();
+
+
servers.add(createResourceDetails(context,context.getDefaultPluginConfiguration(),procInfo));
}
return servers;
commit 8bbecacb1202740dc31740a8028cdcd8fbefc1c9
Merge: dbd7dc1... 1f72fc3...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 30 12:19:31 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts:
modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
commit 08ea91d04e4c61dfc41295262f2cac7af869d54e
Merge: c3a4115... dbd7dc1...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 30 10:38:32 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit dbd7dc1a375b47eb91075a9404f5f92e8a0f46d0
Merge: 83c59bb... ae4c7c2...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 30 12:27:48 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit ae4c7c25f5ec8987bc54c92d70fc349dc15a76ae
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 23:17:39 2010 -0400
Fix basics of inventory top view history handling (still need to decide if we like the
tree structures)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index c76ff1c..2e2617e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@ -18,11 +18,12 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
+import java.util.LinkedHashMap;
+
+import com.google.gwt.user.client.History;
import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.types.ContentsType;
import com.smartgwt.client.types.VisibilityMode;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -39,13 +40,8 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
-import org.rhq.enterprise.gui.coregui.client.admin.agent.install.RemoteAgentInstallView;
-import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView;
-import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
-import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionListView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
/**
* @author Greg Hinkle
@@ -54,8 +50,16 @@ public class InventoryView extends HLayout implements BookmarkableView
{
public static final String VIEW_PATH = "Inventory";
- private SectionStack sectionStack;
+
+ private ViewId currentSectionViewId;
+ private ViewId currentPageViewId;
+
private Canvas contentCanvas;
+ private Canvas currentContent;
+ private LinkedHashMap<String, TreeGrid> treeGrids = new
LinkedHashMap<String, TreeGrid>();
+
+
+ private SectionStack sectionStack;
@Override
protected void onInit() {
@@ -74,8 +78,28 @@ public class InventoryView extends HLayout implements BookmarkableView
{
sectionStack.setWidth(250);
sectionStack.setHeight100();
- sectionStack.addSection(buildResourcesSection());
- sectionStack.addSection(buildGroupsSection());
+ buildResourcesSection();
+ buildGroupsSection();
+
+ for (final String name : treeGrids.keySet()) {
+ TreeGrid grid = treeGrids.get(name);
+
+ grid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ if (selectionEvent.getState()) {
+ CoreGUI.goTo("Inventory/" + name + "/" +
selectionEvent.getRecord().getAttribute("name"));
+ }
+ }
+ });
+
+
+ SectionStackSection section = new SectionStackSection(name);
+ section.setExpanded(true);
+ section.addItem(grid);
+
+ sectionStack.addSection(section);
+ }
+
addMember(sectionStack);
addMember(contentCanvas);
@@ -95,16 +119,24 @@ public class InventoryView extends HLayout implements
BookmarkableView {
}
private SectionStackSection buildResourcesSection() {
- final SectionStackSection section = new
SectionStackSection("Inventory");
+ final SectionStackSection section = new
SectionStackSection("Resources");
section.setExpanded(true);
final TreeNode allResources = new TreeNode("All Resources");
final TreeNode onlyPlatforms = new TreeNode("Platforms");
+ onlyPlatforms.setIcon("types/Platform_up_16.png");
+
final TreeNode onlyServers = new TreeNode("Servers");
+ onlyServers.setIcon("types/Server_up_16.png");
+
final TreeNode onlyServices = new TreeNode("Services");
+ onlyServices.setIcon("types/Service_up_16.png");
+
final TreeNode inventory = new TreeNode("Inventory", allResources,
onlyPlatforms, onlyServers, onlyServices);
final TreeNode downServers = new TreeNode("Down Servers");
+ downServers.setIcon("types/Server_down_16.png");
+
final TreeNode savedSearches = new TreeNode("Saved Searches",
downServers);
TreeGrid treeGrid = new TreeGrid();
@@ -112,22 +144,9 @@ public class InventoryView extends HLayout implements
BookmarkableView {
Tree tree = new Tree();
tree.setRoot(new TreeNode("security", inventory, savedSearches));
treeGrid.setData(tree);
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent selectionEvent) {
- if (selectionEvent.getRecord() == allResources) {
- setContent(new ResourceSearchView());
- } else if (selectionEvent.getRecord() == onlyPlatforms) {
- setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name())));
- } else if (selectionEvent.getRecord() == onlyServers) {
- setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name())));
- } else if (selectionEvent.getRecord() == onlyServices) {
- setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVICE.name())));
- } else if (selectionEvent.getRecord() == downServers) {
- setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
AvailabilityType.DOWN.name())));
- }
- }
- });
+ treeGrid.getTree().openAll();
+ treeGrids.put("Resources", treeGrid);
section.addItem(treeGrid);
@@ -139,11 +158,11 @@ public class InventoryView extends HLayout implements
BookmarkableView {
section.setExpanded(true);
final TreeNode allGroups = new TreeNode("All Groups");
- final TreeNode onlyCompatible = new TreeNode("Compatible");
- final TreeNode onlyMixed = new TreeNode("Mixed");
+ final TreeNode onlyCompatible = new TreeNode("Compatible Groups");
+ final TreeNode onlyMixed = new TreeNode("Mixed Groups");
final TreeNode groupGroupDefinitions = new TreeNode("Group
Definitions");
final TreeNode inventory = new TreeNode("Inventory", allGroups,
onlyCompatible, onlyMixed,
- groupGroupDefinitions);
+ groupGroupDefinitions);
final TreeNode problemGroups = new TreeNode("Problem Groups");
final TreeNode savedSearches = new TreeNode("Saved Searches",
problemGroups);
@@ -153,86 +172,84 @@ public class InventoryView extends HLayout implements
BookmarkableView {
Tree tree = new Tree();
tree.setRoot(new TreeNode("clustering", inventory, savedSearches));
treeGrid.setData(tree);
- treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent selectionEvent) {
- HTMLPane pane = new HTMLPane();
- pane.setContentsType(ContentsType.PAGE);
- pane.setWidth100();
- pane.setHeight100();
-
- String url = null;
- if (selectionEvent.getRecord() == allGroups) {
- setContent(new ResourceGroupListView());
- } else if (selectionEvent.getRecord() == onlyCompatible) {
- setContent(new ResourceGroupListView(new
Criteria("category", "compatible")));
- } else if (selectionEvent.getRecord() == onlyMixed) {
- setContent(new ResourceGroupListView(new
Criteria("category", "mixed")));
- } else if (selectionEvent.getRecord() == groupGroupDefinitions) {
- setContent(new GroupDefinitionListView());
- } else if (selectionEvent.getRecord() == problemGroups) {
- setContent(new ResourceGroupListView(new
Criteria("availability", "down")));
- }
- }
- });
+ treeGrid.getTree().openAll();
+ treeGrids.put("Groups", treeGrid);
section.addItem(treeGrid);
return section;
}
public void setContent(Canvas newContent) {
- if (contentCanvas.getChildren().length > 0)
- contentCanvas.getChildren()[0].destroy();
- newContent.setWidth100();
- newContent.setHeight100();
+
+ if (contentCanvas.getChildren().length > 0) {
+ for (Canvas child : contentCanvas.getChildren()) {
+ child.destroy();
+ }
+ }
+
contentCanvas.addChild(newContent);
contentCanvas.markForRedraw();
+ this.currentContent = newContent;
}
-
private void renderContentView(ViewPath viewPath) {
- ViewId currentSectionViewId = viewPath.getCurrent();
- ViewId currentPageViewId = viewPath.getNext();
+ currentSectionViewId = viewPath.getCurrent();
+ currentPageViewId = viewPath.getNext();
String section = currentSectionViewId.getPath();
String page = currentPageViewId.getPath();
-
Canvas content = null;
- if ("Reports".equals(section)) {
-
- if ("Inventory Summary".equals(page)) {
- content = new
FullHTMLPane("/rhq/admin/report/resourceInstallReport-body.xhtml");
+ if ("Resources".equals(section)) {
+
+ if ("All Resources".equals(page)) {
+ content = new ResourceSearchView();
+ } else if ("Platforms".equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name()));
+ } else if ("Servers".equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name()));
+ } else if ("Services".equals(page)) {
+ content = new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVICE.name()));
+ } else if ("Down Servers".equals(page)) {
+
+ Criteria criteria = new
Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
AvailabilityType.DOWN.name());
+ criteria.addCriteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name());
+ content = new ResourceSearchView(criteria);
}
-
- } else if ("Security".equals(section)) {
-
- if ("Manage Users".equals(page)) {
- content = new UsersView();
- } else if ("Manage Roles".equals(page)) {
- content = new RolesView();
- } else if ("Auto Discovery Queue".equals(page)) {
- content = new ResourceAutodiscoveryView();
- } else if ("Remote Agent Install".equals(page)) {
- content = new RemoteAgentInstallView();
+ } else if ("Groups".equals(section)) {
+
+ if ("All Groups".equals(page)) {
+ content = new ResourceGroupListView();
+ } else if ("Compatible Groups".equals(page)) {
+ content = new ResourceGroupListView(new Criteria("category",
"compatible"));
+ } else if ("Mixed Groups".equals(page)) {
+ content = new ResourceGroupListView(new Criteria("category",
"mixed"));
+ } else if ("Group Definitions".equals(page)) {
+ content = new GroupDefinitionListView();
+ } else if ("Problem Groups".equals(page)) {
+ content = new ResourceGroupListView(new
Criteria("availability", "down"));
}
}
- /* for (String name : treeGrids.keySet()) {
+ for (String name : treeGrids.keySet()) {
TreeGrid treeGrid = treeGrids.get(name);
if (name.equals(section)) {
- treeGrid.setSelectedPaths(page);
+ for (TreeNode node : treeGrid.getTree().getAllNodes()) {
+ if (page.equals(node.getName())) {
+ treeGrid.selectSingleRecord(node);
+ }
+ }
} else {
treeGrid.deselectAllRecords();
}
- }*/
-
+ }
setContent(content);
@@ -245,21 +262,23 @@ public class InventoryView extends HLayout implements
BookmarkableView {
}
-
public void renderView(ViewPath viewPath) {
-/*
if (!viewPath.isCurrent(currentSectionViewId) ||
!viewPath.isNext(currentPageViewId)) {
if (viewPath.isEnd()) {
// Display default view
- setContent(defaultView());
+ History.newItem("Inventory/Resources/Platforms");
} else {
+
renderContentView(viewPath);
}
- }
-*/
+ } else {
+ if (this.currentContent instanceof BookmarkableView) {
+ ((BookmarkableView)
this.currentContent).renderView(viewPath.next().next());
+ }
+ }
}
commit a0f9e2b954909ce99fa01172199dd3acef6e219f
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 23:16:50 2010 -0400
Make sure all children are removed when updating view
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 258326d..c3bcddd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -241,8 +241,11 @@ public class ReportTopView extends HLayout implements
BookmarkableView {
public void setContent(Canvas newContent) {
- if (contentCanvas.getChildren().length > 0)
- contentCanvas.getChildren()[0].destroy();
+ if (contentCanvas.getChildren().length > 0) {
+ for (Canvas child : contentCanvas.getChildren()) {
+ child.destroy();
+ }
+ }
contentCanvas.addChild(newContent);
contentCanvas.markForRedraw();
commit 0a63a1ae2ee61d278ea9f62c7825796d3f81daa2
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 21:07:11 2010 -0400
Fix report section history tree reselection
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 4c25c61..258326d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -25,6 +25,7 @@ package org.rhq.enterprise.gui.coregui.client.report;
import java.util.LinkedHashMap;
+import com.google.gwt.http.client.URL;
import com.smartgwt.client.types.VisibilityMode;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
@@ -100,7 +101,9 @@ public class ReportTopView extends HLayout implements BookmarkableView
{
grid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- CoreGUI.goTo("Reports/" + name + "/" +
selectionEvent.getRecord().getAttribute("name"));
+ if (selectionEvent.getState()) {
+ CoreGUI.goTo("Reports/" + name + "/" +
selectionEvent.getRecord().getAttribute("name"));
+ }
}
});
@@ -255,6 +258,8 @@ public class ReportTopView extends HLayout implements BookmarkableView
{
String section = currentSectionViewId.getPath();
String page = currentPageViewId.getPath();
+ page = URL.decode(page);
+
Canvas content = null;
if ("Inventory".equals(section)) {
@@ -325,7 +330,10 @@ public class ReportTopView extends HLayout implements
BookmarkableView {
TreeGrid treeGrid = treeGrids.get(name);
if (name.equals(section)) {
-// treeGrid.setSelectedPaths(page);
+ TreeNode node = treeGrid.getTree().find(page);
+ if (node != null) {
+ treeGrid.selectSingleRecord(node);
+ }
} else {
treeGrid.deselectAllRecords();
}
@@ -352,6 +360,7 @@ public class ReportTopView extends HLayout implements BookmarkableView
{
// Display default view
setContent(defaultView());
} else {
+
renderContentView(viewPath);
}
} else {
commit 257c7680ec31b84d8a1a332cf728480f4a718c16
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 17:48:27 2010 -0400
Global operation history view for reports section
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
index de4bd1e..c353fdb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
@@ -20,14 +20,6 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operatio
import java.util.Date;
-import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
-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.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@ -36,6 +28,14 @@ import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.types.FieldType;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
+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.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
/**
* @author Greg Hinkle
*/
@@ -107,7 +107,7 @@ public class OperationHistoryDataSource extends
RPCDataSource<ResourceOperationH
record.setAttribute("operationDefinition",
from.getOperationDefinition());
record.setAttribute("operationName",
from.getOperationDefinition().getDisplayName());
record.setAttribute("errorMessage", from.getErrorMessage());
- record.setAttribute("status", from.getStatus().getDisplayName());
+ record.setAttribute("status", from.getStatus().name());
record.setAttribute("parameters", from.getParameters());
record.setAttribute("entity",from);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
index ad2d156..b537f5d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
@@ -20,8 +20,23 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operatio
import java.util.EnumSet;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.menu.IMenuButton;
+import com.smartgwt.client.widgets.menu.Menu;
+import com.smartgwt.client.widgets.menu.MenuItem;
+import com.smartgwt.client.widgets.menu.events.ClickHandler;
+import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
+
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
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;
import org.rhq.core.domain.resource.ResourceType;
@@ -34,22 +49,6 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.detail.OperationDetailsView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.widgets.events.DoubleClickEvent;
-import com.smartgwt.client.widgets.events.DoubleClickHandler;
-import com.smartgwt.client.widgets.grid.CellFormatter;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
-import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
-import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.menu.IMenuButton;
-import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuButton;
-import com.smartgwt.client.widgets.menu.MenuItem;
-import com.smartgwt.client.widgets.menu.events.ClickHandler;
-import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
-
/**
* @author Greg Hinkle
*/
@@ -91,6 +90,31 @@ public class OperationHistoryView extends VLayout {
table.getListGrid().getField("id").setWidth(40);
table.getListGrid().getField("operationName").setWidth("*");
table.getListGrid().getField("status").setWidth(100);
+ table.getListGrid().getField("status").setCellFormatter(new
CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
+ OperationRequestStatus status = OperationRequestStatus.valueOf((String)
o);
+ String icon = "";
+ switch (status) {
+ case INPROGRESS:
+ break;
+ case SUCCESS:
+ icon = "_ok";
+ break;
+ case FAILURE:
+ icon = "_failed";
+ break;
+ case CANCELED:
+ icon = "_cancel";
+ break;
+ }
+
+
+ return Canvas.imgHTML("subsystems/control/Operation" + icon +
"_16.png", 16, 16) + status.getDisplayName();
+ }
+ });
+
+
+
table.getListGrid().getField("startedTime").setWidth(120);
if (this.resource == null) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index a842474..4c25c61 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -47,9 +47,10 @@ import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
-import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
+import org.rhq.enterprise.gui.coregui.client.report.measurement.MeasurementOOBView;
import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
/**
@@ -261,9 +262,9 @@ public class ReportTopView extends HLayout implements BookmarkableView
{
if ("Tag Cloud".equals(page)) {
content = new TaggedView();
} else if ("Suspect Metrics".equals(page)) {
-// todo
+ content = new MeasurementOOBView();
} else if ("Recent Configuration Changes".equals(page)) {
- // todo
+ content = new ConfigurationHistoryView();
} else if ("Recent Operations".equals(page)) {
content = new OperationHistoryView();
} else if ("Recent Alerts".equals(page)) {
commit f60815062de16b61e874b8bac38c9c5d5a452550
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 17:47:43 2010 -0400
Global configuration history view and lookup via criteria
Configuration detail moved to a dialog
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 cbe4cc9..4010ae0 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
@@ -6,6 +6,8 @@ import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
import org.rhq.core.domain.configuration.RawConfiguration;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import
org.rhq.enterprise.server.configuration.ConfigurationUpdateStillInProgressException;
@@ -23,12 +25,16 @@ public interface ConfigurationGWTService extends RemoteService {
ConfigurationDefinition getResourceConfigurationDefinition(int resourceTypeId);
- PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(int
resourceId);
+ PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(
+ Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest,
PageControl pc);
+
ResourceConfigurationUpdate updateResourceConfiguration(int resourceId, Configuration
configuration);
PluginConfigurationUpdate updatePluginConfiguration(int resourceId, Configuration
configuration);
+ PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdatesByCriteria(ResourceConfigurationUpdateCriteria criteria);
+
RawConfiguration dummy(RawConfiguration config);
}
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 c476bee..6f721b2 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
@@ -19,6 +19,8 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
+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.gwt.ConfigurationGWTServiceAsync;
@@ -46,21 +48,21 @@ public class ConfigurationHistoryDataSource extends
RPCDataSource<ResourceConfig
public ConfigurationHistoryDataSource() {
super();
- // id, resource, subject, configuration, createdTime, duration, errorMessage,
modifiedTime, status
-
-
DataSourceIntegerField idField = new DataSourceIntegerField("id");
idField.setPrimaryKey(true);
addField(idField);
- DataSourceTextField submittedField = new
DataSourceTextField("createdTime");
+ DataSourceTextField resourceField = new DataSourceTextField("resource",
"Resource");
+ addField(resourceField);
+
+ DataSourceTextField submittedField = new
DataSourceTextField("createdTime", "Created");
submittedField.setType(FieldType.DATETIME);
addField(submittedField);
- DataSourceTextField statusField = new DataSourceTextField("status");
+ DataSourceTextField statusField = new DataSourceTextField("status",
"Status");
addField(statusField);
- DataSourceTextField subjectField = new DataSourceTextField("subject");
+ DataSourceTextField subjectField = new DataSourceTextField("subject",
"Subject");
addField(subjectField);
@@ -69,46 +71,52 @@ public class ConfigurationHistoryDataSource extends
RPCDataSource<ResourceConfig
@Override
protected void executeFetch(final DSRequest request, final DSResponse response) {
- int resourceId = (Integer)
request.getCriteria().getValues().get("resourceId");
-
- configurationService.findResourceConfigurationUpdates(resourceId, new
AsyncCallback<PageList<ResourceConfigurationUpdate>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Unable to load configuration
history",caught);
- response.setStatus(DSResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(),response);
- }
-
- public void onSuccess(PageList<ResourceConfigurationUpdate> result) {
- response.setData(buildRecords(result));
- response.setTotalRows(result.getTotalSize());
- processResponse(request.getRequestId(), response);
- }
- });
+ ResourceConfigurationUpdateCriteria criteria = new
ResourceConfigurationUpdateCriteria();
+ criteria.fetchConfiguration(true);
+ criteria.fetchResource(true);
+
+ criteria.setPageControl(getPageControl(request));
+
+ if (request.getCriteria().getValues().get("resourceId") != null) {
+
criteria.addFilterResourceIds((Integer)request.getCriteria().getValues().get("resourceId"));
+ }
+
+ configurationService.findResourceConfigurationUpdatesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceConfigurationUpdate>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Unable to load
configuration history", caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+
+ public void onSuccess(PageList<ResourceConfigurationUpdate>
result) {
+ response.setData(buildRecords(result));
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ });
}
-
-
-
@Override
public ResourceConfigurationUpdate copyValues(ListGridRecord from) {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
@Override
public ListGridRecord copyValues(ResourceConfigurationUpdate from) {
ListGridRecord record = new ListGridRecord();
record.setAttribute("id", from.getId());
- record.setAttribute("resource",from.getResource());
- record.setAttribute("subject",from.getSubjectName());
+ record.setAttribute("resource", from.getResource());
+ record.setAttribute("subject", from.getSubjectName());
record.setAttribute("configuration", from.getConfiguration());
- record.setAttribute("createdTime",new Date(from.getCreatedTime()));
+ record.setAttribute("createdTime", new Date(from.getCreatedTime()));
record.setAttribute("duration", from.getDuration());
record.setAttribute("errorMessage", from.getErrorMessage());
record.setAttribute("modifiedTime", new Date(from.getModifiedTime()));
- record.setAttribute("status",from.getStatus().name());
+ record.setAttribute("status", from.getStatus().name());
- record.setAttribute("entity",from);
+ record.setAttribute("entity", from);
return record;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java
index 6d64732..b033a40 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java
@@ -20,6 +20,7 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configur
import java.util.EnumSet;
+import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.layout.Layout;
import org.rhq.core.domain.configuration.Configuration;
@@ -61,4 +62,18 @@ public class ConfigurationHistoryDetailView extends Layout {
addMember(editor);
markForRedraw();
}
+
+ public void displayInDialog() {
+
+ Window window = new Window();
+ window.setTitle("Configuration Details");
+ window.setWidth(800);
+ window.setHeight(800);
+ window.setIsModal(true);
+ window.setShowModalMask(true);
+ window.setCanDragResize(true);
+ window.centerInPage();
+ window.addItem(this);
+ window.show();
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
index d7ca524..721fd06 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
@@ -24,15 +24,24 @@ import java.util.EnumSet;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.widgets.Canvas;
+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.grid.events.CellDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationComparisonView;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -43,20 +52,22 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
*/
public class ConfigurationHistoryView extends VLayout {
- private int resourceId;
+ private Integer resourceId;
- ConfigurationHistoryDetailView detailView;
- /**
- * Resource list filtered by a given criteria
- */
- public ConfigurationHistoryView(final int resourceId) {
- this.resourceId = resourceId;
-
+ public ConfigurationHistoryView() {
setWidth100();
setHeight100();
setAnimateMembers(true);
+
+ }
+
+
+ public ConfigurationHistoryView(final int resourceId) {
+ this();
+ this.resourceId = resourceId;
+
}
@@ -65,7 +76,9 @@ public class ConfigurationHistoryView extends VLayout {
super.onDraw();
Criteria criteria = new Criteria();
- criteria.addCriteria("resourceId", resourceId);
+ if (resourceId != null) {
+ criteria.addCriteria("resourceId", (int)resourceId);
+ }
final ConfigurationHistoryDataSource datasource = new
ConfigurationHistoryDataSource();
@@ -75,15 +88,47 @@ public class ConfigurationHistoryView extends VLayout {
table.setDataSource(datasource);
table.getListGrid().setUseAllDataSourceFields(true);
- ListGridField idField = new ListGridField("id", "ID", 60);
- ListGridField createdField = new ListGridField("createdTime",
"Timestamp", 200);
- ListGridField statusField = new ListGridField("status",
"Status", 100);
- ListGridField userField = new ListGridField("subject",
"User", 150);
- table.getListGrid().setFields(idField, createdField, statusField, userField);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE);
- table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
- table.getListGrid().setResizeFieldsInRealTime(true);
+ ListGrid grid = table.getListGrid();
+
+ grid.getField("id").setWidth(60);
+ grid.getField("createdTime").setWidth(200);
+
+ if (resourceId != null) {
+ grid.hideField("resource");
+ } else {
+ grid.getField("resource").setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
+ Resource res = (Resource) o;
+ return "<a href=\"#Resource/" + res.getId() +
"\">" + res.getName() + "</a>";
+ }
+ });
+ }
+
+ grid.getField("status").setWidth(100);
+ grid.getField("status").setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
+ ConfigurationUpdateStatus status =
ConfigurationUpdateStatus.valueOf((String) o);
+ String icon = "";
+ switch (status) {
+ case INPROGRESS:
+ break;
+ case SUCCESS:
+ icon = "_ok";
+ break;
+ case FAILURE:
+ icon = "_failed";
+ break;
+ case NOCHANGE:
+ break;
+ }
+
+ return Canvas.imgHTML("subsystems/configure/Configure" + icon +
"_16.png", 16, 16) + o;
+ }
+ });
+
+ grid.getField("subject").setWidth(150);
+
table.addTableAction("Remove", Table.SelectionEnablement.ANY,
@@ -91,6 +136,7 @@ public class ConfigurationHistoryView extends VLayout {
new TableAction() {
public void executeAction(ListGridRecord[] selection) {
// TODO: Implement this method.
+ CoreGUI.getErrorHandler().handleError("Not
implemented");
}
});
@@ -106,44 +152,48 @@ public class ConfigurationHistoryView extends VLayout {
}
});
+ table.getListGrid().addCellDoubleClickHandler(new CellDoubleClickHandler() {
+ public void onCellDoubleClick(CellDoubleClickEvent cellDoubleClickEvent) {
+ ListGridRecord record = cellDoubleClickEvent.getRecord();
+ showDetails(record);
+ }
+ });
+
+ table.addTableAction("Show Details", Table.SelectionEnablement.SINGLE,
null,
+ new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+
+ ListGridRecord record = selection[0];
+
+ showDetails(record);
+ }
+ });
- table.setShowResizeBar(true);
- table.setResizeBarTarget("next");
addMember(table);
+ }
+ public static void showDetails(ListGridRecord record) {
+ final ResourceConfigurationUpdate update = (ResourceConfigurationUpdate)
record.getAttributeAsObject("entity");
- detailView = new ConfigurationHistoryDetailView();
- detailView.setHeight("70%");
- detailView.hide();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ update.getResource().getResourceType().getId(),
+
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
- addMember(detailView);
+ public void onTypesLoaded(ResourceType type) {
+ ConfigurationDefinition definition =
type.getResourceConfigurationDefinition();
- table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent selectionEvent) {
- if (selectionEvent.getState()) {
- ListGridRecord record = (ListGridRecord) selectionEvent.getRecord();
- final ResourceConfigurationUpdate update =
(ResourceConfigurationUpdate) record.getAttributeAsObject("entity");
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- update.getResource().getResourceType().getId(),
-
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypeLoadedCallback() {
+ ConfigurationHistoryDetailView detailView = new
ConfigurationHistoryDetailView();
- public void onTypesLoaded(ResourceType type) {
+ detailView.setConfiguration(definition,
update.getConfiguration());
- ConfigurationDefinition definition =
type.getResourceConfigurationDefinition();
+ detailView.displayInDialog();
+
+ }
+ });
- detailView.setConfiguration(definition,
update.getConfiguration());
- detailView.setHeight("75%");
- showMember(detailView);
- }
- });
- } else {
- hideMember(detailView);
- }
- }
- });
}
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 83c15b7..487b167 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
@@ -6,6 +6,7 @@ import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
import org.rhq.core.domain.configuration.RawConfiguration;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
@@ -49,14 +50,12 @@ public class ConfigurationGWTServiceImpl extends
AbstractGWTServiceImpl implemen
return SerialUtility.prepare(definition, "ResourceDefinition");
}
- public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdates(int resourceId) {
- PageList<ResourceConfigurationUpdate> result;
+ public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(
+ Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest,
PageControl pc) {
- PageControl pc = PageControl.getUnlimitedInstance();
- pc.initDefaultOrderingField("cu.id", PageOrdering.DESC);
-
- // TODO GH: I'd prefer a criteria based solution here
- result =
configurationManager.findResourceConfigurationUpdates(getSessionSubject(), resourceId,
null, null, false, pc);
+ PageList<ResourceConfigurationUpdate> result =
+ configurationManager.findResourceConfigurationUpdates(
+ getSessionSubject(), resourceId, beginDate, endDate,
suppressOldest, pc);
return SerialUtility.prepare(result,
"ConfigurationService.findResourceConfigurationUpdates");
}
@@ -76,6 +75,14 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl
implemen
return SerialUtility.prepare(update,
"ConfigurationService.updatePluginConfiguration");
}
+ public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdatesByCriteria(ResourceConfigurationUpdateCriteria criteria)
{
+ PageList<ResourceConfigurationUpdate> updates =
+ configurationManager.findResourceConfigurationUpdatesByCriteria(
+ getSessionSubject(), criteria
+ );
+
+ return SerialUtility.prepare(updates,
"ConfigurationService.findResourceConfigurationUpdatesByCriteria");
+ }
public RawConfiguration dummy(RawConfiguration config) {
System.out.println(config.getPath());
commit eb013e6250a5f4ba88bebefb41582c5b62e52615
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 17:46:28 2010 -0400
Measurement oob history view for reports
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index d4a4731..cd99ad7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -33,6 +33,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
+import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -55,4 +56,10 @@ public interface MeasurementDataGWTService extends RemoteService {
public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
+
+ PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String
metricNameFilter,
+ String resourceNameFilter, String parentNameFilter, PageControl pc);
+
+ PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId,
int n);
+
}
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
new file mode 100644
index 0000000..0df9e99
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java
@@ -0,0 +1,154 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.report.measurement;
+
+import java.util.Collection;
+import java.util.List;
+
+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.fields.DataSourceLinkField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.measurement.MeasurementConverterClient;
+import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
+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.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class MeasurementOOBDataSource extends
RPCDataSource<MeasurementOOBComposite> {
+
+ private int maximumFactor = 0;
+
+ public MeasurementOOBDataSource() {
+
+
+ DataSourceTextField metricField = new
DataSourceTextField("scheduleName","Metric");
+ addField(metricField);
+
+ DataSourceTextField resourceField = new
DataSourceTextField("resourceName", "Resource");
+ addField(resourceField);
+
+ DataSourceTextField parentField = new DataSourceTextField("parentName",
"Parent");
+ addField(parentField);
+
+ DataSourceTextField bandField = new
DataSourceTextField("formattedBaseband", "Band");
+ addField(bandField);
+
+ DataSourceTextField outlierField = new
DataSourceTextField("formattedOutlier", "Outlier");
+ addField(outlierField);
+
+ DataSourceTextField factorField = new DataSourceTextField("factor",
"Out of range factor (%)");
+ addField(factorField);
+
+ }
+
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+
+ PageControl pc = getPageControl(request);
+
+ GWTServiceLookup.getMeasurementDataService().getSchedulesWithOOBs(
+ null, null, null, pc,
+ new AsyncCallback<PageList<MeasurementOOBComposite>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
measurement OOB information",caught);
+ }
+
+ public void onSuccess(PageList<MeasurementOOBComposite> result)
{
+ response.setData(buildRecords(result));
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ }
+ );
+
+ }
+
+ @Override
+ public MeasurementOOBComposite copyValues(ListGridRecord from) {
+ throw new UnsupportedOperationException("OOBs Read only");
+ }
+
+
+ @Override
+ public ListGridRecord[] buildRecords(Collection<MeasurementOOBComposite> list)
{
+ for (MeasurementOOBComposite oob : list) {
+ if (oob.getFactor() > maximumFactor)
+ maximumFactor = oob.getFactor();
+ }
+
+ return super.buildRecords(list);
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementOOBComposite from) {
+ applyFormatting(from);
+
+ ListGridRecord record = new ListGridRecord();
+
+ 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());
+ record.setAttribute("formattedOutlier", from.getFormattedOutlier());
+ record.setAttribute("blMin", from.getBlMin());
+ record.setAttribute("blMax", from.getBlMax());
+ record.setAttribute("parentId", from.getParentId());
+ record.setAttribute("parentName", from.getParentName());
+
+ int factorRankingWidth = (int) (((double)from.getFactor())/ (double)maximumFactor
* 100d);
+
+ record.setBackgroundComponent(
+ new HTMLFlow(
+ "<div style=\"width: " + factorRankingWidth +
"%; height: 100%; background-color:
#A5B391;\"> </div>"));
+
+ return record;
+
+ }
+
+
+ private void applyFormatting(MeasurementOOBComposite oob) {
+ oob.setFormattedOutlier(MeasurementConverterClient.format(oob.getOutlier(),
oob.getUnits(), true));
+ formatBaseband(oob);
+ }
+
+ private void formatBaseband(MeasurementOOBComposite oob) {
+ String min = MeasurementConverterClient.format(oob.getBlMin(), oob.getUnits(),
true);
+ String max = MeasurementConverterClient.format(oob.getBlMax(), oob.getUnits(),
true);
+ oob.setFormattedBaseband(min + ", " + max);
+ }
+}
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
new file mode 100644
index 0000000..0b16677
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java
@@ -0,0 +1,61 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.report.measurement;
+
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+
+/**
+ * @author Greg Hinkle
+ */
+public class MeasurementOOBView extends Table {
+
+
+ public MeasurementOOBView() {
+ super("Suspect Metrics");
+
+
+ setDataSource(new MeasurementOOBDataSource());
+
+ getListGrid().setAlternateRecordStyles(false);
+
+
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+
+ getListGrid().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>";
+ }
+ });
+
+
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index 5749dc4..2514bd6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@ -30,13 +30,16 @@ import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
+import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -49,6 +52,7 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
private MeasurementDataManagerLocal dataManager =
LookupUtil.getMeasurementDataManager();
private CallTimeDataManagerLocal callTimeDataManager =
LookupUtil.getCallTimeDataManager();
+ private MeasurementOOBManagerLocal measurementOOBManager =
LookupUtil.getOOBManager();
private MeasurementScheduleManagerLocal scheduleManager =
LookupUtil.getMeasurementScheduleManager();
private MeasurementDefinitionManagerLocal definitionManager =
LookupUtil.getMeasurementDefinitionManager();
@@ -84,4 +88,25 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
return
SerialUtility.prepare(scheduleManager.findSchedulesByCriteria(getSessionSubject(),
criteria),
"MeasurementDataService.findMeasurementSchedulesByCriteria");
}
+
+
+ public PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String
metricNameFilter, String resourceNameFilter, String parentNameFilter, PageControl pc) {
+ return SerialUtility.prepare(
+ measurementOOBManager.getSchedulesWithOOBs(
+ getSessionSubject(),
+ metricNameFilter,
+ resourceNameFilter,
+ parentNameFilter,
+ pc),
+ "MeasurementDataService.getSchedulesWithOOBs");
+ }
+
+ public PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int
resourceId, int n) {
+ return SerialUtility.prepare(
+ measurementOOBManager.getHighestNOOBsForResource(
+ getSessionSubject(),
+ resourceId,
+ n),
+ "MeasurementDataService.getHighestNOOBsForResource");
+ }
}
commit cb605f26aa5ca97754f5518c82fdee35c7265ae5
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 17:45:19 2010 -0400
gwt serialization compatibility
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 f32c07b..d7cdcef 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
@@ -50,6 +50,9 @@ public class MeasurementOOBComposite implements Serializable {
private String formattedOutlier;
private String formattedBaseband;
+ 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) {
commit 9368e87552fb67fb7076295c8cd12ce7aa4d1e30
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 29 17:45:06 2010 -0400
Criteria query support for looking up ResourceConfigurationUpdate's
Security fix for null resource history lookup
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
new file mode 100644
index 0000000..af4f3b9
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java
@@ -0,0 +1,162 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.criteria;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
+import org.rhq.core.domain.util.PageOrdering;
+
+/**
+ * @author Greg Hinkle
+ */
+@XmlRootElement
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@SuppressWarnings("unused")
+public class ResourceConfigurationUpdateCriteria extends Criteria {
+ private static final long serialVersionUID = 1L;
+
+ public static final String SORT_FIELD_CTIME = "ctime";
+ public static final String SORT_FIELD_RESOURCE_NAME = "name";
+ public static final String SORT_FIELD_STATUS = "status";
+ public static final String SORT_FIELD_RESOURCE_ID = "resourceId";
+
+ private Integer filterId;
+ private Long filterStartTime; // requires overrides
+ private Long filterEndTime; // requires overrides
+ private ConfigurationUpdateStatus filterStatus;
+ private String filterResourceTypeId; // requires overrides
+ private String filterResourceTypeName; // requires overrides
+ private List<Integer> filterResourceIds; // requires overrides
+ private List<Integer> filterResourceGroupIds; // requires overrides
+
+ private boolean fetchResource;
+ private boolean fetchGroupConfigurationUpdate;
+ private boolean fetchConfiguration;
+
+ private PageOrdering sortCtime;
+ private PageOrdering sortName; // requires sort override
+ private PageOrdering sortPriority; // requires sort override
+ private PageOrdering sortResourceId; // requires sort override
+
+ public ResourceConfigurationUpdateCriteria() {
+
+ filterOverrides.put("startTime", "ctime >= ?");
+ filterOverrides.put("endTime", "ctime <= ?");
+ filterOverrides.put("resourceTypeId", "resource.resourceType.id =
?");
+ filterOverrides.put("resourceTypeName",
"resource.resourceType.name like ?");
+ filterOverrides.put("resourceIds", "resource.id IN ( ? )");
+ filterOverrides.put("resourceGroupIds", "resource.id IN " //
+ + "( SELECT res.id " //
+ + " FROM ResourceGroup rg " //
+ + " JOIN rg.explicitResources res " //
+ + " WHERE rg.id = ? )");
+
+ sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.name");
+ sortOverrides.put(SORT_FIELD_STATUS, "status");
+ sortOverrides.put(SORT_FIELD_RESOURCE_ID, "resource.id");
+ }
+
+ @Override
+ public Class getPersistentClass() {
+ return ResourceConfigurationUpdate.class;
+ }
+
+ // filters
+
+ public void addFilterId(Integer filterId) {
+ this.filterId = filterId;
+ }
+
+ public void addFilterStartTime(Long filterStartTime) {
+ this.filterStartTime = filterStartTime;
+ }
+
+ public void addFilterEndTime(Long filterEndTime) {
+ this.filterEndTime = filterEndTime;
+ }
+
+ public void addFilterStatus(ConfigurationUpdateStatus status) {
+ this.filterStatus = status;
+ }
+
+ public void addFilterResourceTypeId(String filterResourceTypeId) {
+ this.filterResourceTypeId = filterResourceTypeId;
+ }
+
+ public void addFilterResourceTypeName(String filterResourceTypeName) {
+ this.filterResourceTypeName = filterResourceTypeName;
+ }
+
+ public void addFilterResourceIds(Integer... filterResourceIds) {
+ this.filterResourceIds = Arrays.asList(filterResourceIds);
+ }
+
+ public void addFilterResourceGroupIds(Integer... filterResourceGroupIds) {
+ this.filterResourceGroupIds = Arrays.asList(filterResourceGroupIds);
+ }
+
+
+ // Fetches
+
+ public void fetchResource(boolean fetchResource) {
+ this.fetchResource = fetchResource;
+ }
+
+ public void fetchGroupConfigurationUpdate(boolean fetchGroupConfigurationUpdate) {
+ this.fetchGroupConfigurationUpdate = fetchGroupConfigurationUpdate;
+ }
+
+ public void fetchConfiguration(boolean configuration) {
+ this.fetchConfiguration = configuration;
+ }
+
+
+ // Sorts
+
+ public void addSortCtime(PageOrdering sortCtime) {
+ addSortField(SORT_FIELD_CTIME);
+ this.sortCtime = sortCtime;
+ }
+
+ public void addSortResourceName(PageOrdering sortName) {
+ addSortField(SORT_FIELD_RESOURCE_NAME);
+ this.sortName = sortName;
+ }
+
+ public void addSortPriority(PageOrdering sortPriority) {
+ addSortField(SORT_FIELD_STATUS);
+ this.sortPriority = sortPriority;
+ }
+
+ public void addSortResourceId(PageOrdering sortResourceId) {
+ addSortField(SORT_FIELD_RESOURCE_ID);
+ this.sortResourceId = sortResourceId;
+ }
+}
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 5f7203a..64c7d3b 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
@@ -67,6 +67,7 @@ import
org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
import org.rhq.core.domain.content.PackageType;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.Agent;
import org.rhq.core.domain.resource.Resource;
@@ -105,6 +106,8 @@ import
org.rhq.enterprise.server.resource.group.ResourceGroupNotFoundException;
import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException;
import org.rhq.enterprise.server.scheduler.SchedulerLocal;
import org.rhq.enterprise.server.system.ServerVersion;
+import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
+import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.enterprise.server.util.QuartzUtil;
/**
@@ -853,7 +856,10 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdates(Subject subject, Integer resourceId,
Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resourceId)) {
+ if (resourceId == null &&
!authorizationManager.isInventoryManager(subject)) {
+ throw new PermissionException("User[" + subject.getName() + "]
Must be an inventory manager to query " +
+ "without a resource id.");
+ } else if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resourceId)) {
throw new PermissionException("User[" + subject.getName()
+ "] does not have permission to view configuration history for
resource[id=" + resourceId + "]");
}
@@ -2025,4 +2031,23 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
return out;
}
+
+
+ @SuppressWarnings("unchecked")
+ public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdatesByCriteria(
+ Subject subject, ResourceConfigurationUpdateCriteria criteria) {
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ if (!authorizationManager.isInventoryManager(subject)) {
+ generator.setAuthorizationResourceFragment(
+ CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
"resource", subject.getId());
+ }
+
+ CriteriaQueryRunner<ResourceConfigurationUpdate> queryRunner =
+ new CriteriaQueryRunner(criteria, generator, entityManager);
+
+ PageList<ResourceConfigurationUpdate> updates = queryRunner.execute();
+
+
+ return updates;
+ }
}
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 4242153..a82241d 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
@@ -39,6 +39,7 @@ import
org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate;
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
@@ -497,4 +498,8 @@ public interface ConfigurationManagerLocal {
boolean fromStructured) throws ResourceNotFoundException,
TranslationNotSupportedException;
Configuration mergeConfiguration(Configuration config);
+
+
+ PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdatesByCriteria(
+ Subject subject, ResourceConfigurationUpdateCriteria criteria);
}
\ No newline at end of file
commit c3a411545c18e5efa8b5889416398d8bb8a1b5ae
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Jul 29 15:58:07 2010 -0400
move i18nlog dep from deps section to depMgmt section
diff --git a/pom.xml b/pom.xml
index 306bbff..6bc9e4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -278,6 +278,12 @@
</dependency>
<dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ <version>${i18nlog.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
@@ -420,12 +426,6 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>i18nlog</groupId>
- <artifactId>i18nlog</artifactId>
- <version>${i18nlog.version}</version>
- </dependency>
-
<!-- for the JAXB annotations -->
<dependency>
<groupId>javax.xml.bind</groupId>
commit 83c59bb8502776784ab83a360130d7b3b961ecd0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jul 29 21:52:24 2010 +0200
Cater for Oracle returning -2 and just add 1 item instead
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
index 770ae6e..65bf0e3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
@@ -330,7 +330,7 @@ public class CallTimeDataManagerBean implements
CallTimeDataManagerLocal, CallTi
+ results[i] + "] for batch command [" + i + "] is
less than 0 or greater than 1.");
}
- insertedRowCount += results[i];
+ insertedRowCount += results[i]==-2 ? 1 : results[i] ; // If Oracle
returns -2, just count 1 row
}
log.debug("Inserted new call-time data key rows for " +
((insertedRowCount >= 0) ? insertedRowCount : "?")
@@ -406,7 +406,7 @@ public class CallTimeDataManagerBean implements
CallTimeDataManagerLocal, CallTi
+ results[i] + "] for batch command [" + i + "]
does not equal 1.");
}
- insertedRowCount += results[i];
+ insertedRowCount += results[i]==-2 ? 1 : results[i] ; // If Oracle
returns -2, just count 1 row;
}
notifyAlertConditionCacheManager("insertCallTimeDataValues",
callTimeDataSet
commit 483a1e8352f7fc0d8ade726a8b045488c4190826
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 29 09:10:56 2010 -0400
[BZ 619135] For manual add ensure that component start does not prevent
necessary server sync.
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 0c86f8f..720d1ab 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -283,7 +283,7 @@ public class InventoryManager extends AgentService implements
ContainerService,
return results;
} catch (TimeoutException te) {
log.warn("Discovery for Resources of [" + context.getResourceType()
+ "] has been running for more than "
- + timeout + " milliseconds. This may be a plugin bug.",
te);
+ + timeout + " milliseconds. This may be a plugin bug.", te);
return null;
} catch (BlacklistedException be) {
// Discovery did not run, because the ResourceType was blacklisted during a
prior discovery scan.
@@ -316,8 +316,8 @@ public class InventoryManager extends AgentService implements
ContainerService,
return result;
} catch (TimeoutException te) {
log.warn("Manual add of Resource of type [" +
context.getResourceType() + "] with plugin configuration ["
- + pluginConfig.toString(true) + "] has been running for more
than "
- + timeout + " milliseconds. This may be a plugin bug.",
te);
+ + pluginConfig.toString(true) + "] has been running for more than
" + timeout
+ + " milliseconds. This may be a plugin bug.", te);
return null;
} catch (BlacklistedException be) {
log.debug(ThrowableUtil.getAllMessages(be));
@@ -601,6 +601,8 @@ public class InventoryManager extends AgentService implements
ContainerService,
MergeResourceResponse mergeResourceResponse;
Resource resource = null;
boolean resourceAlreadyExisted = false;
+ Throwable startError = null;
+
try {
ResourceContainer parentResourceContainer =
getResourceContainer(parentResourceId);
ResourceComponent parentResourceComponent =
parentResourceContainer.getResourceComponent();
@@ -692,7 +694,14 @@ public class InventoryManager extends AgentService implements
ContainerService,
if (log.isDebugEnabled()) {
log.debug("Activating resource [" + resource +
"]...");
}
- activateResource(resource, resourceContainer, newPluginConfig);
+ // if it fails to start keep going, we already have the resource in inventory
and
+ // need to coordinate with the server. The new resource will be unavailable
but at least
+ // it will be accessible and editable by the user. Report the start exception
at the end.
+ try {
+ activateResource(resource, resourceContainer, newPluginConfig);
+ } catch (Throwable t) {
+ startError = t;
+ }
// NOTE: We don't mess with inventory status - that's the
server's responsibility.
@@ -708,6 +717,12 @@ public class InventoryManager extends AgentService implements
ContainerService,
newResources.add(resource);
postProcessNewlyCommittedResources(newResources);
performServiceScan(resource.getId());
+
+ if (null != startError) {
+ throw new PluginContainerException("The resource [" + resource
+ + "] has been added but could not be started. Verify the
supplied configuration values: ",
+ startError);
+ }
}
// Catch any other RuntimeExceptions or Errors, so the server doesn't have to
worry about deserializing or
commit 4e7a5da9176eb3198f2b3497e966352818642a80
Merge: a2addce... 148c25c...
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Jul 28 16:54:04 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit a2addcee76d260a82fff7faf848773a5932bd803
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Jul 28 16:50:02 2010 -0400
[BZ 573034] Updating script to not retrieve defaults from default template
The script originally fetched the default values for connection properties from the
default
template and used the values from the default template to apply default values to
connection
properties of resources. This is a nice solution because it is generic and applicable
across resource types; however, since 2.3.1 does not have the code changes in the
plugin
upgrade code, the new properties do not exist in the default template in 2.3.1.
Consequently, the values are essentially hard-coded on a per resource type basis.
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js
index bb2ac46..274bc5c 100644
--- a/etc/cli-scripts/reset_conn_props.js
+++ b/etc/cli-scripts/reset_conn_props.js
@@ -31,8 +31,13 @@ function log(msg) {
println("DEBUG " + msg);
}
+function loadPluginConfiguration(resource) {
+ log("Loading plugin configuration for " + resource);
+ return ConfigurationManager.getPluginConfiguration(resource.id);
+}
+
function loadPluginConfigDef(resourceTypeName, pluginName) {
- log("Loading plugin configuration for [resourceType=" + resourceTypeName +
", plugin=" +
+ log("Loading plugin configuration definition for [resourceType=" +
resourceTypeName + ", plugin=" +
pluginName + "]");
var resourceType =
ResourceTypeManager.getResourceTypeByNameAndPlugin(resourceTypeName,
pluginName);
@@ -64,6 +69,10 @@ function findResourcesByTypeAndPlugin(resourceType, plugin) {
log("Found " + resources.size() + " " + resourceType + "
resources ");
+ iterate(resources, function(resource) {
+ resource.pluginConfiguration = loadPluginConfiguration(resource);
+ });
+
return resources;
}
@@ -171,7 +180,6 @@ function getJBossSnapshotPropertyNames() {
set.add('snapshotDataRecursive');
set.add('snapshotAdditionalFilesEnabled');
set.add('snapshotAdditionalFilesDirectory');
- set.add('snapshotAdditionalFilesRegex');
set.add('snapshotAdditionalFilesRecursive');
return set;
@@ -197,7 +205,7 @@ function getAgentSnapshotPropertyNames() {
* param: snapshotDefaults: The names of the plugin configuration properties to reset.
This
* is expected to be a java.util.Collection.
*/
-function resetPluginConfigProps(resources, snapshotDefaults) {
+function resetPluginConfigPropsFromTemplate(pluginConfigDef, resources, snapshotDefaults)
{
iterate(resources, function(resource) {
log("Preparing to reset plugin configuration properties for " + resource);
var simpleProperties = flattenProperties(resource.pluginConfiguration);
@@ -208,6 +216,7 @@ function resetPluginConfigProps(resources, snapshotDefaults) {
iterate(snapshotProperties, function(property) {
var defaultProperty = snapshotDefaults.get(property.name);
property.stringValue = defaultProperty.stringValue;
+ log("Set property " + property.name + " to " +
property.stringValue);
});
ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
@@ -215,14 +224,44 @@ function resetPluginConfigProps(resources, snapshotDefaults) {
});
}
+function resetPluginConfigProps(resources, applyDefaults) {
+ iterate(resources, function(resource) {
+ applyDefaults(resource.pluginConfiguration);
+ ConfigurationManager.updatePluginConfiguration(resource.id,
resource.pluginConfiguration);
+ log("Updated plugin configuration for " + resource);
+ });
+}
+
function resetJBossPluginConfigProps() {
var jbossResourceTypeName = 'JBossAS Server';
var jbossPluginName = 'JBossAS';
var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName,
jbossPluginName);
var jbossPluginConfigDef = loadPluginConfigDef(jbossResourceTypeName,
jbossPluginName);
- resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef,
- getJBossSnapshotPropertyNames()));
+ //resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef,
+ // getJBossSnapshotPropertyNames()));
+
+ resetPluginConfigProps(jbossServers, function(pluginConfig) {
+ pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotConfigDirectory',
'config'));
+ pluginConfig.put(PropertySimple('snapshotConfigRecursive', true));
+ pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log'));
+ pluginConfig.put(PropertySimple('snapshotLogRecursive', false));
+ pluginConfig.put(PropertySimple('snapshotDataEnabled', false));
+ pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data'));
+ pluginConfig.put(PropertySimple('snapshotDataRecursive', true));
+
+ var propertyMap = PropertyMap('snapshotAdditionalFilesMap');
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true));
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory',
''));
+ propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true));
+
+ var propertyList = PropertyList('snapshotAdditionalFilesList');
+ propertyList.list.add(propertyMap);
+
+ pluginConfig.put(propertyList);
+ });
}
function resetAgentPluginConfigProps() {
@@ -231,8 +270,14 @@ function resetAgentPluginConfigProps() {
var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName);
var agentPluginConfigDef = loadPluginConfigDef(agentResourceTypeName,
agentPluginName);
- resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef,
- getAgentSnapshotPropertyNames()));
+ //resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef,
+ // getAgentSnapshotPropertyNames()));
+
+ resetPluginConfigProps(agents, function(pluginConfig) {
+ pluginConfig.put(PropertySimple('snapshotConfigEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotLogEnabled', true));
+ pluginConfig.put(PropertySimple('snapshotDataEnabled', true));
+ });
}
//////////////
commit 1f72fc36df296aee0f093c012276a520edcc40f6
Author: hudson auto <wnstb(a)yahoo.com>
Date: Wed Jul 28 15:12:01 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 97ef93b..eda9133 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 3b26a39..bc7965b 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 688d5e4..2cf950b 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 2ddc4af..ee81a94 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index a27161b..d177f9e 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 4589d42..a51f92b 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d7559da..7ff6a10 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index dc75145..e0ced84 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b535306..0911918 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index f72bc2f..d47d4c8 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 967b21a..e1ce7ef 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index fbab223..2e58102 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 996cd8f..7739177 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 8a95e51..eeb7e81 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index b0c399b..7aad64c 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 37bcda5..bc41dc5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 3fc1344..d9f1c1c 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 127b06f..8942239 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 9f09ff1..8b9da9c 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 95b62cd..611eb9d 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index c1c297f..798a8ca 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index 6be8d8d..df05645 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index 709bfe3..acbe21f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 8d33ef0..1beadca 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index bf6a9a4..0c529ba 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index d9f0c15..a794cd6 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index 9bdfc91..aa880be 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 77a5685..3b0dbb8 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index dff57e7..05187c7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 6008df1..e86ef41 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 68d51c0..910b617 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 444256d..2ea73ee 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index f09e063..2c98817 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index b4d2146..3fd11e8 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index c063211..bf15866 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index ddff575..79fdc38 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index ea1eb7b..dd5bc18 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 363ac0a..c0973f3 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index b4751ba..a62fee8 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index b0a0c3b..3193539 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 6d35aed..e69bfbc 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index cbd7334..ca33bb7 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 6398092..af75153 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index ebac52c..09839b8 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 30efb5a..73f405e 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 8464662..4c44f10 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 40ab2a2..0033d1b 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 0c5fb51..61965f2 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 3f1e165..7451668 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 25917cc..0ac61d3 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 40c066f..5a78451 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 9832288..2b16f4a 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 26e985a..e4ab9b2 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 14e52de..a6cba32 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index e160aa6..9c7cc74 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index 344a215..ebdd3da 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index bb1abdd..06c8981 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index 2458369..aa278b8 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 4ac7f43..0cc2084 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 21ccc78..14738d0 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index 366d1aa..d056f74 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index d992e29..28dc9b1 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index c5e5ae2..a0721a9 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index ffac476..5d327ee 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c475e5e..c37598e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 5fa4596..cc160c9 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 88db42f..700a6af 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 51580cd..915106a 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index a140f5d..d920440 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 9119492..d5aaad5 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 714ad7a..30889f7 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index e01b311..b79645d 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index aef1858..f7cf265 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 4f87dfe..acb08ef 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 157119f..7dd0fde 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index eed10bc..65fa7b8 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 9a9c2f0..853c020 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index befe74c..a0ade77 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index ac9b3f6..b9ed2b3 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index 61f4e11..b3846fa 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 684e8e3..443e524 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index a9874cc..ac9885a 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 5a02364..d0c9053 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 3d937e7..06ae2ae 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index e915511..1acdb0f 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index f65ad5a..39c75da 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index aadd8bf..97b83b0 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32c52d..85d6105 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 639838b..283ab6a 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index beb98f2..5a4466c 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index fdb0991..a190dcd 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8fb6fee..8f4e675 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 9411143..0d41574 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 0ec4d51..7719b14 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index f5106f0..2d9d715 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index b637f0d..3579496 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 55c3b49..41df1b8 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 9de8802..205d5b0 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 9ee6ac3..e299efa 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index 93e847c..b3d5e87 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index a6af192..bc96ae3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5b243a9..2235687 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 5e2dc43..7ff85bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 8fb6059a9db07d40b827ae6358dbfcebcc7fdac9
Author: hudson auto <wnstb(a)yahoo.com>
Date: Wed Jul 28 15:10:27 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index eda9133..97ef93b 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index bc7965b..3b26a39 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 2cf950b..688d5e4 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index ee81a94..2ddc4af 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index d177f9e..a27161b 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index a51f92b..4589d42 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 7ff6a10..d7559da 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..dc75145 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 0911918..b535306 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d47d4c8..f72bc2f 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e1ce7ef..967b21a 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 2e58102..fbab223 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 7739177..996cd8f 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index eeb7e81..8a95e51 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7aad64c..b0c399b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index bc41dc5..37bcda5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index d9f1c1c..3fc1344 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 8942239..127b06f 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 8b9da9c..9f09ff1 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 611eb9d..95b62cd 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 798a8ca..c1c297f 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index df05645..6be8d8d 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index acbe21f..709bfe3 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 1beadca..8d33ef0 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 0c529ba..bf6a9a4 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index a794cd6..d9f0c15 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index aa880be..9bdfc91 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3b0dbb8..77a5685 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 05187c7..dff57e7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index e86ef41..6008df1 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 910b617..68d51c0 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 2ea73ee..444256d 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 2c98817..f09e063 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 3fd11e8..b4d2146 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index bf15866..c063211 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 79fdc38..ddff575 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index dd5bc18..ea1eb7b 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c0973f3..363ac0a 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index a62fee8..b4751ba 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3193539..b0a0c3b 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index e69bfbc..6d35aed 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index ca33bb7..cbd7334 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index af75153..6398092 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 09839b8..ebac52c 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 73f405e..30efb5a 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 4c44f10..8464662 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 0033d1b..40ab2a2 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 61965f2..0c5fb51 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 7451668..3f1e165 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 0ac61d3..25917cc 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 5a78451..40c066f 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 2b16f4a..9832288 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index e4ab9b2..26e985a 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index a6cba32..14e52de 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9c7cc74..e160aa6 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index ebdd3da..344a215 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 06c8981..bb1abdd 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index aa278b8..2458369 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 0cc2084..4ac7f43 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 14738d0..21ccc78 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index d056f74..366d1aa 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 28dc9b1..d992e29 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index a0721a9..c5e5ae2 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 5d327ee..ffac476 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c37598e..c475e5e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index cc160c9..5fa4596 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 700a6af..88db42f 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 915106a..51580cd 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index d920440..a140f5d 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d5aaad5..9119492 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 30889f7..714ad7a 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index b79645d..e01b311 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f7cf265..aef1858 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index acb08ef..4f87dfe 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 7dd0fde..157119f 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 65fa7b8..eed10bc 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 853c020..9a9c2f0 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a0ade77..befe74c 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b9ed2b3..ac9b3f6 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index b3846fa..61f4e11 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 443e524..684e8e3 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ac9885a..a9874cc 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d0c9053..5a02364 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 06ae2ae..3d937e7 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 1acdb0f..e915511 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 39c75da..f65ad5a 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 97b83b0..aadd8bf 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 85d6105..f32c52d 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 283ab6a..639838b 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 5a4466c..beb98f2 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index a190dcd..fdb0991 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8f4e675..8fb6fee 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 0d41574..9411143 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 7719b14..0ec4d51 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 2d9d715..f5106f0 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3579496..b637f0d 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 41df1b8..55c3b49 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 205d5b0..9de8802 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index e299efa..9ee6ac3 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index b3d5e87..93e847c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index bc96ae3..a6af192 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 2235687..5b243a9 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 7ff85bb..5e2dc43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 148c25cc279be5f96923c149fc0530512afdb9a0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jul 28 14:24:20 2010 -0400
bz 619138 - add "inventory --sync" command
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index 7e621e8..eadb493 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -1922,7 +1922,7 @@ public interface AgentI18NResourceKeys {
@I18NMessage("inventory")
String INVENTORY = "PromptCommand.inventory";
- @I18NMessage("inventory [--xml] [--export=<file>]
[--norecurse]\\n\\\n"
+ @I18NMessage("inventory [--sync] [--xml] [--export=<file>]
[--norecurse]\\n\\\n"
+ "\\ [--id=<#>] | --types |
<inventory-binary-file>]")
String INVENTORY_SYNTAX = "PromptCommand.inventory.syntax";
@@ -1931,6 +1931,9 @@ public interface AgentI18NResourceKeys {
@I18NMessage("This will allow you to view the resources currently in
inventory.\\n\\\n"
+ "The valid command line arguments are:\\n\\\n"
+ + "\\ -s, --sync : Purges the agent's inventory and re-syncs it with the
server.\\n\\\n"
+ + "\\ This forces the agent's plugin container to
restart.\\n\\\n"
+ + "\\ All other options are ignored if this is
specified.\\n\\\n"
+ "\\ -e, --export=file : Writes the inventory information to the given
file.\\n\\\n"
+ "\\ If this is not specified, the output will go to
the\\n\\\n"
+ "\\ console window.\\n\\\n"
@@ -1980,6 +1983,15 @@ public interface AgentI18NResourceKeys {
+ "two are mutually exclusive")
String INVENTORY_ID_AND_DUMP_TYPES_SPECIFIED =
"PromptCommand.inventory.id-and-dump-types-specified";
+ @I18NMessage("Cannot sync inventory - not currently able to talk to the RHQ
Server.")
+ String INVENTORY_ERROR_NOT_SENDING =
"PromptCommand.inventory.error-not-sending";
+
+ @I18NMessage("Purged the persisted inventory found at [{0}], sync will occur
when plugin container restarts")
+ String INVENTORY_DATA_FILE_DELETED =
"PromptCommand.inventory.data-file-deleted";
+
+ @I18NMessage("Failed to purge the inventory data file [{0}], sync may
fail.")
+ String INVENTORY_DATA_FILE_DELETION_FAILURE =
"PromptCommand.inventory.data-file-deletion-failure";
+
@I18NMessage("avail")
String AVAILABILITY = "PromptCommand.availability";
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java
index cb48f38..661a84a 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java
@@ -20,11 +20,14 @@ package org.rhq.enterprise.agent.promptcmd;
import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Set;
+
import mazz.i18n.Msg;
+
import org.rhq.core.clientapi.agent.PluginContainerException;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pc.PluginContainer;
@@ -34,6 +37,7 @@ import org.rhq.core.pc.util.InventoryPrinter;
import org.rhq.enterprise.agent.AgentMain;
import org.rhq.enterprise.agent.i18n.AgentI18NFactory;
import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys;
+import org.rhq.enterprise.communications.command.client.ClientCommandSender;
/**
* Provides a view into the inventory.
@@ -92,12 +96,15 @@ public class InventoryPromptCommand implements AgentPromptCommand {
boolean dumpTypesOnly = false;
Integer id = null;
boolean noRecurse = false;
+ boolean sync = false;
- String sopts = "-e:i:ntx";
- LongOpt[] lopts = { new LongOpt("export", LongOpt.REQUIRED_ARGUMENT,
null, 'e'),
- new LongOpt("id", LongOpt.REQUIRED_ARGUMENT, null, 'i'),
- new LongOpt("norecurse", LongOpt.NO_ARGUMENT, null, 'n'),
- new LongOpt("types", LongOpt.NO_ARGUMENT, null, 't'), new
LongOpt("xml", LongOpt.NO_ARGUMENT, null, 'x') };
+ String sopts = "-se:i:ntx";
+ LongOpt[] lopts = { new LongOpt("export", LongOpt.REQUIRED_ARGUMENT,
null, 'e'), //
+ new LongOpt("id", LongOpt.REQUIRED_ARGUMENT, null, 'i'),
//
+ new LongOpt("norecurse", LongOpt.NO_ARGUMENT, null, 'n'),
//
+ new LongOpt("sync", LongOpt.NO_ARGUMENT, null, 's'), //
+ new LongOpt("types", LongOpt.NO_ARGUMENT, null, 't'), //
+ new LongOpt("xml", LongOpt.NO_ARGUMENT, null, 'x') };
Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
int code;
@@ -116,6 +123,11 @@ public class InventoryPromptCommand implements AgentPromptCommand {
break;
}
+ case 's': {
+ sync = true;
+ break;
+ }
+
case 'e': {
exportFile = getopt.getOptarg();
break;
@@ -156,6 +168,13 @@ public class InventoryPromptCommand implements AgentPromptCommand {
return;
}
+ // if being asked to sync, we shutdown the PC, delete inventory.dat and restart
PC.
+ // all other options are ignored
+ if (sync) {
+ syncInventory(agent, out);
+ return;
+ }
+
if ((inventoryBinaryFile != null) && dumpTypesOnly) {
out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DUMP_TYPES_AND_BINARY_FILE_SPECIFIED));
out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL,
getSyntax()));
@@ -228,4 +247,40 @@ public class InventoryPromptCommand implements AgentPromptCommand {
return;
}
+
+ private void syncInventory(AgentMain agent, PrintWriter out) {
+ // if the PC is already started, we need to shut it down and restart it after we
get the new plugins
+ boolean recyclePC = agent.isPluginContainerStarted();
+
+ // make sure our agent is currently in communications with the server
+ ClientCommandSender clientCommandSender = agent.getClientCommandSender();
+ if (clientCommandSender == null || !clientCommandSender.isSending()) {
+ out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_ERROR_NOT_SENDING));
+ return;
+ }
+
+ // use the PC prompt command to stop the PC - needed because the PC cannot
hot-deploy plugins
+ if (recyclePC) {
+ executePCCommand(agent, "stop");
+ }
+
+ File dataDir =
agent.getConfiguration().getPluginContainerConfiguration().getDataDirectory();
+ File inventoryDataFile = new File(dataDir, "inventory.dat");
+ inventoryDataFile.delete();
+ if (!inventoryDataFile.exists()) {
+ out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DATA_FILE_DELETED,
inventoryDataFile));
+ } else {
+
out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DATA_FILE_DELETION_FAILURE,
inventoryDataFile));
+ }
+
+ if (recyclePC) {
+ executePCCommand(agent, "start");
+ }
+ }
+
+ private void executePCCommand(AgentMain agent, String startOrStop) {
+ PluginContainerPromptCommand command = new PluginContainerPromptCommand();
+ command.execute(agent, new String[] { command.getPromptCommandString(),
startOrStop });
+ }
+
}
\ No newline at end of file
commit 551ec3b94fd778e1756d827b2aa2ae1530433c44
Merge: ac089af... 94090ca...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 28 13:58:42 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit ac089af2c4b4471876e4b84b9d45169cf7cb9cce
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 28 13:56:56 2010 -0400
Revert "fix so that when the Server moves a Resource to a new parent as a result
of that Resource's type's parent type changing, that Resource also gets moved to
the new parent in the plugin container's local inventory the next time the PC
InventoryManager performs an inventory sync (fix for second half of
https://bugzilla.redhat.com/show_bug.cgi?id=618879)"
This reverts commit e60acb24efe12dc9aac8e0b5f708c551c17a6768.
This fix is attached to
https://bugzilla.redhat.com/show_bug.cgi?id=618879 as a patch,
which we'll most likely apply after JON 2.4 has been released.
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 6e9a503..0c86f8f 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -237,7 +237,6 @@ public class InventoryManager extends AgentService implements
ContainerService,
inventoryThreadPoolExecutor.scheduleWithFixedDelay(serviceScanExecutor,
configuration
.getServiceDiscoveryInitialDelay(),
configuration.getServiceDiscoveryPeriod(), TimeUnit.SECONDS);
}
-
} finally {
inventoryLock.writeLock().unlock();
}
@@ -2258,41 +2257,22 @@ public class InventoryManager extends AgentService implements
ContainerService,
if (log.isDebugEnabled()) {
log.debug("Merging [" + resource + "] into local
inventory...");
}
- Resource passedResource = resource; // Keep a reference to the passed Resource
for debugging purposes.
-
- ResourceContainer existingResourceContainer = getResourceContainer(resource);
- if (existingResourceContainer == null) {
- existingResourceContainer = getResourceContainer(resource.getId());
- }
- Resource existingResourceViaContainer = (existingResourceContainer != null) ?
- existingResourceContainer.getResource() : null;
- Resource existingParent = (existingResourceViaContainer != null) ?
- existingResourceViaContainer.getParentResource() : null;
-
- Resource newParent;
+ Resource passedResource = resource; // always keep a reference to the passed
resource
+ Resource parentResource;
if (resource.getParentResource() != null) {
ResourceContainer parentResourceContainer =
getResourceContainer(resource.getParentResource());
if (parentResourceContainer == null) {
parentResourceContainer =
getResourceContainer(resource.getParentResource().getId());
}
- if (parentResourceContainer != null) {
- newParent = parentResourceContainer.getResource();
- } else {
- newParent = null; // TODO right thing to do? Or directly return?
- }
+ if (parentResourceContainer != null)
+ parentResource = parentResourceContainer.getResource();
+ else
+ parentResource = null; // TODO right thing to do? Or directly return?
} else {
- newParent = null;
+ parentResource = null;
}
-
- if (newParent != null && existingParent != null &&
- !matches(newParent, existingParent)) {
- // The Server must have moved the Resource to a new parent - remove it from
its old parent in our
- // local inventory. We'll add
- existingParent.removeChildResource(existingResourceViaContainer);
- }
-
- Resource existingResourceViaParent = findMatchingChildResource(resource,
newParent);
- if (newParent == null && existingResourceViaParent == null) {
+ Resource existingResource = findMatchingChildResource(resource, parentResource);
+ if (parentResource == null && existingResource == null) {
// This should never happen, but add a check so we'll know if it ever
does.
log.error("Existing platform [" + this.platform + "] has
different Resource type and/or Resource key than "
+ "platform in Server inventory: " + resource);
@@ -2301,31 +2281,31 @@ public class InventoryManager extends AgentService implements
ContainerService,
boolean pluginConfigUpdated = false;
this.inventoryLock.writeLock().lock();
try {
- if (existingResourceViaParent != null) {
+ if (existingResource != null) {
// First grab the existing Resource's container, so we can reuse it.
- resourceContainer =
this.resourceContainers.remove(existingResourceViaParent.getUuid());
+ resourceContainer =
this.resourceContainers.remove(existingResource.getUuid());
if (resourceContainer != null) {
this.resourceContainers.put(resource.getUuid(), resourceContainer);
}
- if (newParent != null) {
+ if (parentResource != null) {
// It's critical to remove the existing Resource from the
parent's child Set if the UUID has
// changed (i.e. altering the hashCode of an item in a Set == BAD),
so just always remove it.
- newParent.removeChildResource(existingResourceViaParent);
+ parentResource.removeChildResource(existingResource);
}
// Now merge the new Resource into the existing Resource...
- pluginConfigUpdated = mergeResource(resource,
existingResourceViaParent);
- resource = existingResourceViaParent;
+ pluginConfigUpdated = mergeResource(resource, existingResource);
+ resource = existingResource;
}
- if (newParent != null) {
- newParent.addChildResource(resource);
+ if (parentResource != null) {
+ parentResource.addChildResource(resource);
} else {
this.platform = resource;
}
// Replace the stripped-down ResourceType that came from the Server with the
full ResourceType - it's
// critical to do this before refreshing the state (i.e. calling start on the
ResourceComponent)
- // and critical to do this before initializing the container (since it's
needed for the classloader creation).
+ // and critical to do this before initializing the container (since its
needed for the classloader creation).
ResourceType fullResourceType =
this.pluginManager.getMetadataManager().getType(resource.getResourceType());
if (fullResourceType == null) {
log.error("Unable to merge Resource " + resource + " - its
type is unknown - perhaps the ["
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index 3d1ddd7..185562a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -622,21 +622,14 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// parent to that type.
if (validParentTypes.contains(resourceParentType)) {
- log.debug("Moving " + existingResource + " from old parent
" + existingResource.getParentResource()
- + " to new parent " + resource.getParentResource() +
"...");
if (existingResource.getParentResource() != null) {
existingResource.getParentResource().removeChildResource(existingResource);
}
if (resource.getParentResource() != null) {
parentResource = getExistingResource(resource.getParentResource());
parentResource.addChildResource(existingResource);
-
}
existingResource.setParentResource(resource.getParentResource());
-
- // IMPORTANT: Update the Resource's mtime, so the Agent will know to
update the Resource's parent during
- // its inventory sync.
- existingResource.setMtime(System.currentTimeMillis());
} else {
log.debug("Existing Resource " + existingResource + " has
invalid parent type ("
+ existingResourceParentType + ") and so does plugin-reported
Resource " + resource + " ("
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index a0b01ac..64e9afd 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -843,16 +843,10 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
if (newParent != null) {
- log.debug("Moving " + resource + " from old parent "
+ resource.getParentResource() + " to new parent "
- + newParent + "...");
if (resource.getParentResource() != null) {
resource.getParentResource().removeChildResource(resource);
}
newParent.addChildResource(resource);
-
- // IMPORTANT: Update the Resource's mtime, so the Agent will know to
update the Resource's parent during
- // its inventory sync.
- resource.setMtime(System.currentTimeMillis());
} else {
log.debug("We were unable to move " + resource + " from
invalid parent " + resource.getParentResource()
+ " to a new valid parent with one of the following types:
" + newParentTypes);
commit 87316df996bb23032a68861f47639f90b5dda532
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 28 13:54:35 2010 -0400
a few cosmetic + javadoc changes
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
index 04e1fb3..b1e39f8 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
@@ -99,11 +99,12 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
*
* <p>This will return <code>null</code> if there is no committed
inventory and thus no availability reports should
* be sent. This will rarely happen - only if this is a brand new agent whose
inventory hasn't been committed yet or
- * if the platform and all its children have been deleted (in which case the agent
should be uninstalled or the user
+ * if the platform and all its children have been deleted (in which case the agent
should be uninstalled, or the user
* will want to re-import the platform). In either case, it will be in rare, corner
cases that this will ever return
* null, and the condition that caused the null should eventually go away.</p>
*
- * @return the report containing all the availabilities that need to be sent to the
Server
+ * @return the report containing all the availabilities that need to be sent to the
Server, or <code>null</code> if
+ * there is no committed inventory and thus no availability reports should be
sent
*
* @throws Exception if failed to create and prepare the report
*/
@@ -153,16 +154,16 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
}
private void checkInventory(Resource resource, AvailabilityReport availabilityReport,
boolean reportChangesOnly,
- boolean checkChildren, boolean parentIsDown) {
+ boolean checkChildren, boolean parentIsDown) {
// Only report avail for committed Resources - that's all the Server cares
about.
- if (resource.getInventoryStatus() != InventoryStatus.COMMITTED) {
+ if (resource.getId() == 0 || resource.getInventoryStatus() !=
InventoryStatus.COMMITTED) {
return;
}
ResourceContainer resourceContainer =
this.inventoryManager.getResourceContainer(resource);
// Only report avail for synchronized Resources, otherwise chances are the Server
will know nothing of the
// Resource.
- if (resourceContainer == null ||
- resourceContainer.getSynchronizationState() !=
ResourceContainer.SynchronizationState.SYNCHRONIZED) {
+ if (resourceContainer == null
+ || resourceContainer.getSynchronizationState() !=
ResourceContainer.SynchronizationState.SYNCHRONIZED) {
return;
}
AvailabilityFacet resourceComponent;
@@ -177,17 +178,17 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
return;
}
- AvailabilityType current = null;
-
- // Find out what the avail was the last time we checked it.
- Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource);
+ // If this is a changed-only report, find out what the avail was the last time we
checked it.
+ Availability previous = (reportChangesOnly) ?
this.inventoryManager.getAvailabilityIfKnown(resource) : null;
+ AvailabilityType current;
if (parentIsDown) {
// If the resource's parent is down, the rules are that the resource and
all of the parent's other
// descendants, must also be down, so there's no need to even ask the
resource component for its
// current availability - its current avail is DOWN and that's that.
current = AvailabilityType.DOWN;
} else {
+ current = null;
try {
// if the component is started, ask what its current availability is as
of right now;
// if it's not started, then assume it's down, and the next time
we check,
commit e60acb24efe12dc9aac8e0b5f708c551c17a6768
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 28 13:11:02 2010 -0400
fix so that when the Server moves a Resource to a new parent as a result of that
Resource's type's parent type changing, that Resource also gets moved to the new
parent in the plugin container's local inventory the next time the PC InventoryManager
performs an inventory sync (fix for second half of
https://bugzilla.redhat.com/show_bug.cgi?id=618879)
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
index 0c86f8f..6e9a503 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
@@ -237,6 +237,7 @@ public class InventoryManager extends AgentService implements
ContainerService,
inventoryThreadPoolExecutor.scheduleWithFixedDelay(serviceScanExecutor,
configuration
.getServiceDiscoveryInitialDelay(),
configuration.getServiceDiscoveryPeriod(), TimeUnit.SECONDS);
}
+
} finally {
inventoryLock.writeLock().unlock();
}
@@ -2257,22 +2258,41 @@ public class InventoryManager extends AgentService implements
ContainerService,
if (log.isDebugEnabled()) {
log.debug("Merging [" + resource + "] into local
inventory...");
}
- Resource passedResource = resource; // always keep a reference to the passed
resource
- Resource parentResource;
+ Resource passedResource = resource; // Keep a reference to the passed Resource
for debugging purposes.
+
+ ResourceContainer existingResourceContainer = getResourceContainer(resource);
+ if (existingResourceContainer == null) {
+ existingResourceContainer = getResourceContainer(resource.getId());
+ }
+ Resource existingResourceViaContainer = (existingResourceContainer != null) ?
+ existingResourceContainer.getResource() : null;
+ Resource existingParent = (existingResourceViaContainer != null) ?
+ existingResourceViaContainer.getParentResource() : null;
+
+ Resource newParent;
if (resource.getParentResource() != null) {
ResourceContainer parentResourceContainer =
getResourceContainer(resource.getParentResource());
if (parentResourceContainer == null) {
parentResourceContainer =
getResourceContainer(resource.getParentResource().getId());
}
- if (parentResourceContainer != null)
- parentResource = parentResourceContainer.getResource();
- else
- parentResource = null; // TODO right thing to do? Or directly return?
+ if (parentResourceContainer != null) {
+ newParent = parentResourceContainer.getResource();
+ } else {
+ newParent = null; // TODO right thing to do? Or directly return?
+ }
} else {
- parentResource = null;
+ newParent = null;
}
- Resource existingResource = findMatchingChildResource(resource, parentResource);
- if (parentResource == null && existingResource == null) {
+
+ if (newParent != null && existingParent != null &&
+ !matches(newParent, existingParent)) {
+ // The Server must have moved the Resource to a new parent - remove it from
its old parent in our
+ // local inventory. We'll add
+ existingParent.removeChildResource(existingResourceViaContainer);
+ }
+
+ Resource existingResourceViaParent = findMatchingChildResource(resource,
newParent);
+ if (newParent == null && existingResourceViaParent == null) {
// This should never happen, but add a check so we'll know if it ever
does.
log.error("Existing platform [" + this.platform + "] has
different Resource type and/or Resource key than "
+ "platform in Server inventory: " + resource);
@@ -2281,31 +2301,31 @@ public class InventoryManager extends AgentService implements
ContainerService,
boolean pluginConfigUpdated = false;
this.inventoryLock.writeLock().lock();
try {
- if (existingResource != null) {
+ if (existingResourceViaParent != null) {
// First grab the existing Resource's container, so we can reuse it.
- resourceContainer =
this.resourceContainers.remove(existingResource.getUuid());
+ resourceContainer =
this.resourceContainers.remove(existingResourceViaParent.getUuid());
if (resourceContainer != null) {
this.resourceContainers.put(resource.getUuid(), resourceContainer);
}
- if (parentResource != null) {
+ if (newParent != null) {
// It's critical to remove the existing Resource from the
parent's child Set if the UUID has
// changed (i.e. altering the hashCode of an item in a Set == BAD),
so just always remove it.
- parentResource.removeChildResource(existingResource);
+ newParent.removeChildResource(existingResourceViaParent);
}
// Now merge the new Resource into the existing Resource...
- pluginConfigUpdated = mergeResource(resource, existingResource);
- resource = existingResource;
+ pluginConfigUpdated = mergeResource(resource,
existingResourceViaParent);
+ resource = existingResourceViaParent;
}
- if (parentResource != null) {
- parentResource.addChildResource(resource);
+ if (newParent != null) {
+ newParent.addChildResource(resource);
} else {
this.platform = resource;
}
// Replace the stripped-down ResourceType that came from the Server with the
full ResourceType - it's
// critical to do this before refreshing the state (i.e. calling start on the
ResourceComponent)
- // and critical to do this before initializing the container (since its
needed for the classloader creation).
+ // and critical to do this before initializing the container (since it's
needed for the classloader creation).
ResourceType fullResourceType =
this.pluginManager.getMetadataManager().getType(resource.getResourceType());
if (fullResourceType == null) {
log.error("Unable to merge Resource " + resource + " - its
type is unknown - perhaps the ["
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index 185562a..3d1ddd7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -622,14 +622,21 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// parent to that type.
if (validParentTypes.contains(resourceParentType)) {
+ log.debug("Moving " + existingResource + " from old parent
" + existingResource.getParentResource()
+ + " to new parent " + resource.getParentResource() +
"...");
if (existingResource.getParentResource() != null) {
existingResource.getParentResource().removeChildResource(existingResource);
}
if (resource.getParentResource() != null) {
parentResource = getExistingResource(resource.getParentResource());
parentResource.addChildResource(existingResource);
+
}
existingResource.setParentResource(resource.getParentResource());
+
+ // IMPORTANT: Update the Resource's mtime, so the Agent will know to
update the Resource's parent during
+ // its inventory sync.
+ existingResource.setMtime(System.currentTimeMillis());
} else {
log.debug("Existing Resource " + existingResource + " has
invalid parent type ("
+ existingResourceParentType + ") and so does plugin-reported
Resource " + resource + " ("
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index 64e9afd..a0b01ac 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -843,10 +843,16 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
if (newParent != null) {
+ log.debug("Moving " + resource + " from old parent "
+ resource.getParentResource() + " to new parent "
+ + newParent + "...");
if (resource.getParentResource() != null) {
resource.getParentResource().removeChildResource(resource);
}
newParent.addChildResource(resource);
+
+ // IMPORTANT: Update the Resource's mtime, so the Agent will know to
update the Resource's parent during
+ // its inventory sync.
+ resource.setMtime(System.currentTimeMillis());
} else {
log.debug("We were unable to move " + resource + " from
invalid parent " + resource.getParentResource()
+ " to a new valid parent with one of the following types:
" + newParentTypes);
commit 4f675366f3743d33b8da8b9c73389550d515f162
Merge: c0c02b6... 50a5832...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jul 28 17:30:44 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 94090ca72aee2da30fd60dafc11603e8acaa2794
Author: hudson auto <wnstb(a)yahoo.com>
Date: Tue Jul 27 23:54:37 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 97ef93b..eda9133 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 3b26a39..bc7965b 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 688d5e4..2cf950b 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 2ddc4af..ee81a94 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index a27161b..d177f9e 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 4589d42..a51f92b 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d7559da..7ff6a10 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index dc75145..e0ced84 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b535306..0911918 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index f72bc2f..d47d4c8 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 967b21a..e1ce7ef 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index fbab223..2e58102 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 996cd8f..7739177 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 8a95e51..eeb7e81 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index b0c399b..7aad64c 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 37bcda5..bc41dc5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 3fc1344..d9f1c1c 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 127b06f..8942239 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 9f09ff1..8b9da9c 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 95b62cd..611eb9d 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index c1c297f..798a8ca 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index 6be8d8d..df05645 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index 709bfe3..acbe21f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 8d33ef0..1beadca 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index bf6a9a4..0c529ba 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index d9f0c15..a794cd6 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index 9bdfc91..aa880be 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 77a5685..3b0dbb8 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index dff57e7..05187c7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 6008df1..e86ef41 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 68d51c0..910b617 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 444256d..2ea73ee 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index f09e063..2c98817 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index b4d2146..3fd11e8 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index c063211..bf15866 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index ddff575..79fdc38 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index ea1eb7b..dd5bc18 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 363ac0a..c0973f3 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index b4751ba..a62fee8 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index b0a0c3b..3193539 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 6d35aed..e69bfbc 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index cbd7334..ca33bb7 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 6398092..af75153 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index ebac52c..09839b8 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 30efb5a..73f405e 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 8464662..4c44f10 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 40ab2a2..0033d1b 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 0c5fb51..61965f2 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 3f1e165..7451668 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 25917cc..0ac61d3 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 40c066f..5a78451 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 9832288..2b16f4a 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 26e985a..e4ab9b2 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 14e52de..a6cba32 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index e160aa6..9c7cc74 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index 344a215..ebdd3da 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index bb1abdd..06c8981 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index 2458369..aa278b8 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 4ac7f43..0cc2084 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 21ccc78..14738d0 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index 366d1aa..d056f74 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index d992e29..28dc9b1 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index c5e5ae2..a0721a9 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index ffac476..5d327ee 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c475e5e..c37598e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 5fa4596..cc160c9 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 88db42f..700a6af 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 51580cd..915106a 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index a140f5d..d920440 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 9119492..d5aaad5 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 714ad7a..30889f7 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index e01b311..b79645d 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index aef1858..f7cf265 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 4f87dfe..acb08ef 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 157119f..7dd0fde 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index eed10bc..65fa7b8 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 9a9c2f0..853c020 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index befe74c..a0ade77 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index ac9b3f6..b9ed2b3 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index 61f4e11..b3846fa 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 684e8e3..443e524 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index a9874cc..ac9885a 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 5a02364..d0c9053 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 3d937e7..06ae2ae 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index e915511..1acdb0f 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index f65ad5a..39c75da 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index aadd8bf..97b83b0 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32c52d..85d6105 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 639838b..283ab6a 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index beb98f2..5a4466c 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index fdb0991..a190dcd 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8fb6fee..8f4e675 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 9411143..0d41574 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 0ec4d51..7719b14 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index f5106f0..2d9d715 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index b637f0d..3579496 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 55c3b49..41df1b8 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 9de8802..205d5b0 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 9ee6ac3..e299efa 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index 93e847c..b3d5e87 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index a6af192..bc96ae3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5b243a9..2235687 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 5e2dc43..7ff85bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit be9f9d2e64dcc8538188e8381abb706aa4daab9d
Author: hudson auto <wnstb(a)yahoo.com>
Date: Tue Jul 27 23:53:24 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index eda9133..97ef93b 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index bc7965b..3b26a39 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 2cf950b..688d5e4 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index ee81a94..2ddc4af 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index d177f9e..a27161b 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index a51f92b..4589d42 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 7ff6a10..d7559da 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..dc75145 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 0911918..b535306 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d47d4c8..f72bc2f 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e1ce7ef..967b21a 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 2e58102..fbab223 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 7739177..996cd8f 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index eeb7e81..8a95e51 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7aad64c..b0c399b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index bc41dc5..37bcda5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index d9f1c1c..3fc1344 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 8942239..127b06f 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 8b9da9c..9f09ff1 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 611eb9d..95b62cd 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 798a8ca..c1c297f 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index df05645..6be8d8d 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index acbe21f..709bfe3 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 1beadca..8d33ef0 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 0c529ba..bf6a9a4 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index a794cd6..d9f0c15 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index aa880be..9bdfc91 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3b0dbb8..77a5685 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 05187c7..dff57e7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index e86ef41..6008df1 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 910b617..68d51c0 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 2ea73ee..444256d 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 2c98817..f09e063 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 3fd11e8..b4d2146 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index bf15866..c063211 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 79fdc38..ddff575 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index dd5bc18..ea1eb7b 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c0973f3..363ac0a 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index a62fee8..b4751ba 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3193539..b0a0c3b 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index e69bfbc..6d35aed 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index ca33bb7..cbd7334 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index af75153..6398092 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 09839b8..ebac52c 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 73f405e..30efb5a 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 4c44f10..8464662 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 0033d1b..40ab2a2 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 61965f2..0c5fb51 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 7451668..3f1e165 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 0ac61d3..25917cc 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 5a78451..40c066f 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 2b16f4a..9832288 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index e4ab9b2..26e985a 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index a6cba32..14e52de 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9c7cc74..e160aa6 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index ebdd3da..344a215 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 06c8981..bb1abdd 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index aa278b8..2458369 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 0cc2084..4ac7f43 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 14738d0..21ccc78 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index d056f74..366d1aa 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 28dc9b1..d992e29 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index a0721a9..c5e5ae2 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 5d327ee..ffac476 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c37598e..c475e5e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index cc160c9..5fa4596 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 700a6af..88db42f 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 915106a..51580cd 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index d920440..a140f5d 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d5aaad5..9119492 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 30889f7..714ad7a 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index b79645d..e01b311 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f7cf265..aef1858 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index acb08ef..4f87dfe 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 7dd0fde..157119f 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 65fa7b8..eed10bc 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 853c020..9a9c2f0 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a0ade77..befe74c 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b9ed2b3..ac9b3f6 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index b3846fa..61f4e11 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 443e524..684e8e3 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ac9885a..a9874cc 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d0c9053..5a02364 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 06ae2ae..3d937e7 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 1acdb0f..e915511 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 39c75da..f65ad5a 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 97b83b0..aadd8bf 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 85d6105..f32c52d 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 283ab6a..639838b 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 5a4466c..beb98f2 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index a190dcd..fdb0991 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8f4e675..8fb6fee 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 0d41574..9411143 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 7719b14..0ec4d51 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 2d9d715..f5106f0 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3579496..b637f0d 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 41df1b8..55c3b49 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 205d5b0..9de8802 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index e299efa..9ee6ac3 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index b3d5e87..93e847c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index bc96ae3..a6af192 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 2235687..5b243a9 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 7ff85bb..5e2dc43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 5cb61cd55e617104661544da182e47d197fdf401
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 27 23:07:57 2010 -0400
fix so unsynced (invStatus!=COMMITED || id==0) Resources are not included in avail
reports sent by the PC (fixes half of
https://bugzilla.redhat.com/show_bug.cgi?id=618879)
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
index d916bbc..04e1fb3 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -48,7 +48,8 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet;
* Runs a periodic scan for resource availability.
*
* @author Greg Hinkle
- * @author John Mazzitelli
+ * @author John Mazzitelli
+ * @author Ian Springer
*/
public class AvailabilityExecutor implements Runnable, Callable<AvailabilityReport>
{
// the get-availability-timeout will rarely, if ever, want to be overridden. It will
default to be 5 seconds
@@ -94,15 +95,15 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
}
/**
- * Returns the availability report that should be sent to the server.
+ * Returns the availability report that should be sent to the Server.
*
* <p>This will return <code>null</code> if there is no committed
inventory and thus no availability reports should
* be sent. This will rarely happen - only if this is a brand new agent whose
inventory hasn't been committed yet or
* if the platform and all its children have been deleted (in which case the agent
should be uninstalled or the user
* will want to re-import the platform). In either case, it will be in rare, corner
cases that this will ever return
- * null and the condition that caused the null should eventually go away.</p>
+ * null, and the condition that caused the null should eventually go away.</p>
*
- * @return the report containing all the availabilities that need to be sent to the
server
+ * @return the report containing all the availabilities that need to be sent to the
Server
*
* @throws Exception if failed to create and prepare the report
*/
@@ -122,13 +123,13 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
long start = System.currentTimeMillis();
checkInventory(inventoryManager.getPlatform(), availabilityReport,
- availabilityReport.isChangesOnlyReport(), true);
+ availabilityReport.isChangesOnlyReport(), true, false);
// In enterprise mode, the server will need at least one resource so it can
derive what agent
// is sending this report. If the report is empty (meaning, nothing has
changed since the last
// availability check), let's add the platform record to the report
- if (availabilityReport.getResourceAvailability().size() == 0) {
- checkInventory(inventoryManager.getPlatform(), availabilityReport, false,
false);
+ if (availabilityReport.getResourceAvailability().isEmpty()) {
+ checkInventory(inventoryManager.getPlatform(), availabilityReport, false,
false, false);
}
// if we have non-platform resources in the report, the agent has had
@@ -152,103 +153,91 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
}
private void checkInventory(Resource resource, AvailabilityReport availabilityReport,
boolean reportChangesOnly,
- boolean checkChildren) {
+ boolean checkChildren, boolean parentIsDown) {
+ // Only report avail for committed Resources - that's all the Server cares
about.
+ if (resource.getInventoryStatus() != InventoryStatus.COMMITTED) {
+ return;
+ }
ResourceContainer resourceContainer =
this.inventoryManager.getResourceContainer(resource);
- AvailabilityFacet resourceComponent = null;
- if (resourceContainer != null && resource.getInventoryStatus() ==
InventoryStatus.COMMITTED) {
- try {
- resourceComponent =
resourceContainer.createResourceComponentProxy(AvailabilityFacet.class,
- FacetLockType.NONE, GET_AVAILABILITY_TIMEOUT, true, false);
- } catch (PluginContainerException e) {
- if (log.isDebugEnabled()) {
- log.debug("Could not create resource component proxy for "
+ resource + " due to " + e);
- }
+ // Only report avail for synchronized Resources, otherwise chances are the Server
will know nothing of the
+ // Resource.
+ if (resourceContainer == null ||
+ resourceContainer.getSynchronizationState() !=
ResourceContainer.SynchronizationState.SYNCHRONIZED) {
+ return;
+ }
+ AvailabilityFacet resourceComponent;
+ try {
+ resourceComponent =
resourceContainer.createResourceComponentProxy(AvailabilityFacet.class,
+ FacetLockType.NONE, GET_AVAILABILITY_TIMEOUT, true, false);
+ } catch (PluginContainerException e) {
+ // TODO (ips): Why aren't we logging this as an error?
+ if (log.isDebugEnabled()) {
+ log.debug("Could not create resource component proxy for " +
resource + ".", e);
}
+ return;
}
- if (resourceComponent != null) {
- AvailabilityType current = null;
-
- // Only report availability for committed resources; don't bother with
new, ignored or deleted resources.
- if (resource.getInventoryStatus() == InventoryStatus.COMMITTED) {
+ AvailabilityType current = null;
- // this is what we think the availability is, based on a previous check
- Availability previous =
this.inventoryManager.getAvailabilityIfKnown(resource);
+ // Find out what the avail was the last time we checked it.
+ Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource);
- try {
- // if the component is started, ask what its current availability is
as of right now
- // if its not started, then assume its down, our next time checking
we'll see if its
- // started and check for real then - otherwise, keep assuming its
down (this is for
- // the case when a plugin component can't start for whatever
reason or is just slow
- // to start)
+ if (parentIsDown) {
+ // If the resource's parent is down, the rules are that the resource and
all of the parent's other
+ // descendants, must also be down, so there's no need to even ask the
resource component for its
+ // current availability - its current avail is DOWN and that's that.
+ current = AvailabilityType.DOWN;
+ } else {
+ try {
+ // if the component is started, ask what its current availability is as
of right now;
+ // if it's not started, then assume it's down, and the next time
we check,
+ // we'll see if it's started and check for real then - otherwise,
keep assuming it's
+ // down (this is for the case when a plugin component can't start for
whatever reason
+ // or is just slow to start)
+ if (resourceContainer.getResourceComponentState() ==
ResourceComponentState.STARTED) {
+ current = resourceComponent.getAvailability();
+ } else {
+ this.inventoryManager.activateResource(resource, resourceContainer,
false);
if (resourceContainer.getResourceComponentState() ==
ResourceComponentState.STARTED) {
current = resourceComponent.getAvailability();
- } else {
- this.inventoryManager.activateResource(resource,
resourceContainer, false);
- if (resourceContainer.getResourceComponentState() ==
ResourceComponentState.STARTED) {
- current = resourceComponent.getAvailability();
- }
}
- } catch (Throwable t) {
- ResourceError resourceError = new ResourceError(resource,
ResourceErrorType.AVAILABILITY_CHECK, t,
- System.currentTimeMillis());
- this.inventoryManager.sendResourceErrorToServer(resourceError);
- // TODO GH: Put errors in report, rather than sending them to the
Server separately.
- if (log.isDebugEnabled()) {
- if (t instanceof TimeoutException)
- // no need to log the stack trace for timeouts...
- log.debug("Failed to collect availability on resource
" + resource + " (call timed out)");
- else
- log.debug("Failed to collect availability on resource
" + resource, t);
- }
- }
-
- if (current == null) {
- current = AvailabilityType.DOWN;
}
-
- if (resourceContainer.getSynchronizationState() ==
ResourceContainer.SynchronizationState.SYNCHRONIZED) {
- Availability availability =
this.inventoryManager.updateAvailability(resource, current);
-
- // only add the availability to the report if it changed from its
previous state
- // if this is the first time we've been executed,
reportChangesOnly will be false
- // and we will send a full report as our very first report
- if ((previous == null) || (previous.getAvailabilityType() != current)
|| !reportChangesOnly) {
- availabilityReport.addAvailability(availability);
+ } catch (Throwable t) {
+ ResourceError resourceError = new ResourceError(resource,
ResourceErrorType.AVAILABILITY_CHECK, t,
+ System.currentTimeMillis());
+ this.inventoryManager.sendResourceErrorToServer(resourceError);
+ // TODO GH: Put errors in report, rather than sending them to the Server
separately.
+ if (log.isDebugEnabled()) {
+ if (t instanceof TimeoutException) {
+ // no need to log the stack trace for timeouts...
+ log.debug("Failed to collect availability on " +
resource + " (call timed out)");
+ } else {
+ log.debug("Failed to collect availability on " +
resource, t);
}
}
}
-
- if (checkChildren) {
- // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions.
- Set<Resource> children = new
HashSet<Resource>(resource.getChildResources());
- if (current == AvailabilityType.UP) {
- for (Resource child : children)
- checkInventory(child, availabilityReport, reportChangesOnly,
true);
- } else {
- for (Resource child : children)
- markDown(child, availabilityReport, reportChangesOnly);
- }
+ if (current == null) {
+ current = AvailabilityType.DOWN;
}
}
- return;
- }
-
- /**
- * Marks the specified Resource and all its descendants as DOWN for the report.
- */
- private void markDown(Resource resource, AvailabilityReport availabilityReport,
boolean changesOnly) {
- Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource);
- if (!changesOnly || previous == null || previous.getAvailabilityType() !=
AvailabilityType.DOWN) {
- Availability availability =
this.inventoryManager.updateAvailability(resource, AvailabilityType.DOWN);
+ // Only add the availability to the report if it changed from its previous
state.
+ // If this is the first time we've been executed, reportChangesOnly will be
false,
+ // and we will send a full report as our very first report.
+ if ((previous == null) || (previous.getAvailabilityType() != current) ||
!reportChangesOnly) {
+ Availability availability =
this.inventoryManager.updateAvailability(resource, current);
availabilityReport.addAvailability(availability);
}
- // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions.
- Set<Resource> children = new HashSet(resource.getChildResources());
- for (Resource child : children) {
- markDown(child, availabilityReport, changesOnly);
+
+ if (checkChildren) {
+ // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions.
+ Set<Resource> children = new
HashSet<Resource>(resource.getChildResources());
+ for (Resource child : children) {
+ checkInventory(child, availabilityReport, reportChangesOnly, true,
current == AvailabilityType.DOWN);
+ }
}
+
+ return;
}
/**
@@ -267,4 +256,4 @@ public class AvailabilityExecutor implements Runnable,
Callable<AvailabilityRepo
void sendChangedOnlyReportNextTime() {
this.sendChangedOnlyReport.set(true);
}
-}
\ No newline at end of file
+}
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
index 3d27295..ab8d30e 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
@@ -299,7 +299,7 @@ public class ResourceContainer implements Serializable {
* @param daemonThread whether or not the thread used for the invocation should be
a daemon thread
* @param onlyIfStarted if <code>true</code>, and the component is not
started, an exception is thrown
*
- * @return a proxy that wraps the given component and exposes the given facet
interface
+ * @return a proxy that wraps the given component and exposes the given facet
interface; will never be null
*
* @throws PluginContainerException if the component does not exist or does not
implement the interface
*/
commit 50a583202459274a2f846b85402047506d6f6d84
Merge: ebe40d2... 35851a1...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 27 21:48:55 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit ebe40d281993c044317e9004bf1019e485b2611c
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 27 21:46:56 2010 -0400
[BZ 573034] Updating script so that it works with JON 2.3.1 as well as 2.4.0
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js
index 95997f2..bb2ac46 100644
--- a/etc/cli-scripts/reset_conn_props.js
+++ b/etc/cli-scripts/reset_conn_props.js
@@ -55,7 +55,9 @@ function findResourcesByTypeAndPlugin(resourceType, plugin) {
var criteria = ResourceCriteria();
criteria.addFilterResourceTypeName(resourceType);
criteria.addFilterPluginName(plugin);
+ criteria.fetchResourceType(true);
criteria.fetchPluginConfiguration(true);
+ criteria.caseSensitive = true;
criteria.strict = true;
var resources = ResourceManager.findResourcesByCriteria(criteria);
commit 35851a130156c4cf4bc27dbeda54bb94bc5db450
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 27 21:10:46 2010 -0400
use more reasonable gwt:compile memory defaults, parameterize localWorkers
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index 82cddb6..ce9dfca 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -27,7 +27,8 @@
<!-- If this is too much memory to allocate to your gwt:debug process then
override this property in
in your settings.xml -->
- <gwt-plugin.extraJvmArgs>-Xms1024M -Xmx1024M -XX:PermSize=256M
-XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
+ <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M</gwt-plugin.extraJvmArgs>
+ <gwt-plugin.localWorkers>2</gwt-plugin.localWorkers>
</properties>
@@ -235,7 +236,7 @@
<logLevel>INFO</logLevel>
<runTarget>http://localhost:7080/coregui/CoreGUI.html</runTarget>
<extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
- <localWorkers>2</localWorkers>
+ <localWorkers>${gwt-plugin.localWorkers}</localWorkers>
<draftCompile>true</draftCompile>
<buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
<hostedWebapp>target/hostedwar</hostedWebapp>
commit ea96f7924e7f43768ec7a267e3535f2322d9bfc8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 27 21:06:58 2010 -0400
fix compile error
* add method recently exposed in RoleManagerRemote to fix compile error
for WebservicesManagerBean missing interface method implementation
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index 1fd9720..c188ffe 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -162,7 +162,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
@Stateless
@WebService(endpointInterface =
"org.rhq.enterprise.server.webservices.WebservicesRemote", targetNamespace =
ServerVersion.namespace)
-@XmlSeeAlso( { PropertyDefinition.class, PropertyDefinitionSimple.class,
PropertyDefinitionList.class,
+@XmlSeeAlso({ PropertyDefinition.class, PropertyDefinitionSimple.class,
PropertyDefinitionList.class,
PropertyDefinitionMap.class })
public class WebservicesManagerBean implements WebservicesRemote {
@@ -903,6 +903,10 @@ public class WebservicesManagerBean implements WebservicesRemote {
roleManager.addSubjectsToRole(subject, roleId, subjectIds);
}
+ public void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds) {
+ roleManager.setAssignedSubjectRoles(subject, subjectId, roleIds);
+ }
+
public PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria
criteria) {
checkParametersPassedIn(subject, criteria);
return roleManager.findRolesByCriteria(subject, criteria);
commit cefdf1fd4ad51e29b46587a1cf1fe4dde203852a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 27 21:08:41 2010 -0400
support printing alert condition details for all types of alert definitions
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java
index 08551fa..727577e 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java
@@ -92,7 +92,17 @@ public final class AlertDefUtil {
// first format the LHS of the operator
if (category == AlertConditionCategory.CONTROL) {
try {
- Integer resourceTypeId =
cond.getAlertDefinition().getResource().getResourceType().getId();
+ AlertDefinitionManagerLocal alertDefinitionManager =
LookupUtil.getAlertDefinitionManager();
+ Integer alertDefinitionId = cond.getAlertDefinition().getId();
+ Integer resourceTypeId = null;
+ if (alertDefinitionManager.isTemplate(alertDefinitionId)) {
+ resourceTypeId =
cond.getAlertDefinition().getResourceType().getId();
+ } else if
(alertDefinitionManager.isGroupAlertDefinition(alertDefinitionId)) {
+ resourceTypeId =
cond.getAlertDefinition().getResourceGroup().getResourceType().getId();
+ } else {
+ resourceTypeId =
cond.getAlertDefinition().getResource().getResourceType().getId();
+ }
+
String operationName = cond.getName();
OperationManagerLocal operationManager =
LookupUtil.getOperationManager();
@@ -110,7 +120,7 @@ public final class AlertDefUtil {
textValue.append(cond.getMeasurementDefinition().getDisplayName());
textValue.append(" (");
textValue.append(cond.getOption());
- if (cond.getName()!=null && !cond.getName().equals("")) {
+ if (cond.getName() != null && !cond.getName().equals(""))
{
textValue.append("; pattern=[");
textValue.append(cond.getName());
textValue.append("]");
commit 38ed2d28ea96e45434c772c15ed6addd0d947c1a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 20:20:51 2010 -0400
Fix inventory views for updated ResourceDatasource criterias
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index 8852dfc..c76ff1c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@ -32,7 +32,9 @@ import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;
+import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
@@ -115,13 +117,13 @@ public class InventoryView extends HLayout implements
BookmarkableView {
if (selectionEvent.getRecord() == allResources) {
setContent(new ResourceSearchView());
} else if (selectionEvent.getRecord() == onlyPlatforms) {
- setContent(new ResourceSearchView(new Criteria("category",
"platform")));
+ setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name())));
} else if (selectionEvent.getRecord() == onlyServers) {
- setContent(new ResourceSearchView(new Criteria("category",
"server")));
+ setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVER.name())));
} else if (selectionEvent.getRecord() == onlyServices) {
- setContent(new ResourceSearchView(new Criteria("category",
"service")));
+ setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.SERVICE.name())));
} else if (selectionEvent.getRecord() == downServers) {
- setContent(new ResourceSearchView(new
Criteria("availability", "down")));
+ setContent(new ResourceSearchView(new
Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(),
AvailabilityType.DOWN.name())));
}
}
commit 8f98335a235c3a8f819d1a3d3a4d72d9ade052a3
Merge: 56081bb... 1fa4fa8...
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Tue Jul 27 23:34:05 2010 +0200
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 56081bbf57ddb82a7796ac33f5db80a4ed014d20
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Tue Jul 27 23:30:01 2010 +0200
BZ-618230 - absolute path in apache configuration file, breaks discovery.
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 e54b642..f33f8fd 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
@@ -42,17 +42,9 @@ public class ApacheParserImpl implements ApacheParser{
}
private List<File> getIncludeFiles(String foundInclude) {
- List<File> ret = new ArrayList<File>();
- File serverRootFile = new File(serverRootPath);
- File check = new File(foundInclude);
- if (check.isAbsolute()) {
- ret.add(check);
- } else {
- for (File f : Glob.match(serverRootFile, foundInclude)) {
- ret.add(f);
- }
- }
-
- return ret;
+ File check = new File(foundInclude);
+ File root = new File(check.isAbsolute() ? Glob.rootPortion(foundInclude) :
serverRootPath);
+
+ return Glob.match(root, foundInclude);
}
}
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 94aea0a..fddf06e 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
@@ -28,6 +28,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* A helper class for easy work with glob patterns.
@@ -36,6 +38,8 @@ import java.util.List;
*/
public class Glob {
+ private static final Log log = LogFactory.getLog(Glob.class);
+
private Glob() {
}
@@ -169,12 +173,17 @@ public class Glob {
}
}
- private static String rootPortion(String path) {
- for (File root : File.listRoots()) {
- if (path.startsWith(root.getPath())) {
- return root.getPath();
+ public static String rootPortion(String path) {
+ File[] roots = File.listRoots();
+ if (roots != null) {
+ for (File root : roots) {
+ if (path.startsWith(root.getPath())) {
+ return root.getPath();
+ }
}
- }
+ } else {
+ log.warn("Could not determine file system roots. This is
strange.");
+ }
return "";
}
commit 054ce11b07031a30a00afb04316b4ee5065b6b43
Merge: 6e303ec... 4c30f50...
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 17:08:30 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index a8bd44a,396aa0e..a902bc5
---
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
@@@ -279,11 -255,8 +255,10 @@@ public class ResourceGroupDetailView ex
}
}
-
public void renderView(ViewPath viewPath) {
- // TODO: Implement this method.
+
+ Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
+
if (viewPath.isEnd()) {
// default
commit 6e303ec5c6fa7916b9e83d88f6a7c9e3f6c0b8d0
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 16:57:24 2010 -0400
Missing cloud png, report top view cleanup
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 8024902..a842474 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -89,8 +89,8 @@ public class ReportTopView extends HLayout implements BookmarkableView
{
treeGrids.put("Inventory", buildInventorySection());
- treeGrids.put("Configuration", buildSystemConfigurationSection());
- treeGrids.put("Cluster", buildManagementClusterSection());
+// treeGrids.put("Configuration", buildSystemConfigurationSection());
+// treeGrids.put("Cluster", buildManagementClusterSection());
treeGrids.put("Reports", buildReportsSection());
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png
new file mode 100644
index 0000000..a147dde
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png differ
commit 1fa4fa83c8c3a805a04ca35c2c9586e4675bd903
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 27 15:28:50 2010 -0400
BZ-616656: BZ-601189: fix searching and pagination on IE6
For IE6, revert back to a standard h:inputText element instead of the new
SearchBar (thus, IE6 will not support search suggestions or saved searches).
This eliminates the javascript error bubbling up from the SmartGWT library,
which prevents further interaction on the page from succeeding (clicking the go
button as well as pagination).
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
index 67b654f..7a5a8d5 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java
@@ -27,6 +27,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.servlet.http.HttpServletRequest;
+
import com.sun.facelets.tag.AbstractTagLibrary;
import org.rhq.core.clientapi.util.units.DateFormatter;
@@ -443,4 +445,10 @@ public class FunctionTagLibrary extends AbstractTagLibrary {
AlertSender sender =
alertSenderPluginManager.getAlertSenderForNotification(alertNotification);
return sender.previewConfiguration();
}
+
+ public static boolean isIE6() {
+ HttpServletRequest request = FacesContextUtility.getRequest();
+ String userAgent = request.getHeader("User-Agent").toLowerCase();
+ return (userAgent.indexOf("msie") != -1 &&
userAgent.indexOf("6.0") != -1);
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 3683968..52245bf 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -41,6 +41,8 @@
<p/>
<h:panelGrid columns="3">
<h:outputText value="Search: " />
+
+ <c:if test="#{!onf:isIE6()}">
<ui:include src="/rhq/common/searchInterface.xhtml">
<ui:param name="searchButtonId"
value="browseGroupsForm:searchButtonJSF" />
<ui:param name="searchSubsystem" value="GROUP"
/>
@@ -48,7 +50,6 @@
<ui:param name="defaultSavedSearchPatternId"
value="#{param.searchId}" />
<ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
-
<a4j:commandButton id="searchButtonJSF" value="GO"
reRender="browseGroupsDataTable,
browseGroupsDataTableScroller, inventoryBrowserErrorPanel"
status="commonStatus"
@@ -60,6 +61,22 @@
onclick="applySearchFilter(getElementCrossBrowser('patternField').value);">
<s:defaultAction/>
</a4j:commandButton>
+ </c:if>
+
+ <c:if test="#{onf:isIE6()}">
+ <h:inputText style="width: 800px; min-width: 800px;"
value="#{BrowseGroupsUIBean.search}"/>
+ <a4j:commandButton id="searchButtonJSF" value="GO"
+ reRender="browseGroupsDataTable,
browseGroupsDataTableScroller, inventoryBrowserErrorPanel"
+ status="commonStatus"
+
actionListener="#{BrowseGroupsUIBean.clearDataModel}"
+ styleClass="buttonmed"
+ similarityGroupingId="searchRequest"
+ requestDelay="50"
+ ignoreDupResponses="true">
+ <s:defaultAction/>
+ </a4j:commandButton>
+ </c:if>
+
</h:panelGrid>
<p/>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index c7f43c7..dacc5cb 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -41,6 +41,8 @@
<p/>
<h:panelGrid columns="3">
<h:outputText value="Search: " />
+
+ <c:if test="#{!onf:isIE6()}">
<ui:include src="/rhq/common/searchInterface.xhtml">
<ui:param name="searchButtonId"
value="browseResourcesForm:searchButtonJSF" />
<ui:param name="searchSubsystem"
value="RESOURCE" />
@@ -48,7 +50,6 @@
<ui:param name="defaultSavedSearchPatternId"
value="#{param.searchId}" />
<ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
-
<a4j:commandButton id="searchButtonJSF" value="GO"
reRender="browseResourcesDataTable,
browseResourcesDataTableScroller, inventoryBrowserErrorPanel"
status="commonStatus"
@@ -60,6 +61,22 @@
onclick="applySearchFilter(getElementCrossBrowser('patternField').value);">
<s:defaultAction/>
</a4j:commandButton>
+ </c:if>
+
+ <c:if test="#{onf:isIE6()}">
+ <h:inputText style="width: 800px; min-width: 800px;"
value="#{BrowseResourcesUIBean.search}"/>
+ <a4j:commandButton id="searchButtonJSF" value="GO"
+ reRender="browseResourcesDataTable,
browseResourcesDataTableScroller, inventoryBrowserErrorPanel"
+ status="commonStatus"
+
actionListener="#{BrowseResourcesUIBean.clearDataModel}"
+ styleClass="buttonmed"
+ similarityGroupingId="searchRequest"
+ requestDelay="50"
+ ignoreDupResponses="true">
+ <s:defaultAction/>
+ </a4j:commandButton>
+ </c:if>
+
</h:panelGrid>
<p/>
commit fb02185b1a48ad560a5dfd9c20ca1415a6d64e62
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 13:13:48 2010 -0400
Add missing tagcloud icon
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png
new file mode 100644
index 0000000..e64577c
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png differ
commit 2ef1d6aba1a5ebd549293d0d74f7edea84c862f6
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 13:12:57 2010 -0400
Some performance tests on the resource tree (Attempts to precache the entire tree)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java
new file mode 100644
index 0000000..939c519
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java
@@ -0,0 +1,360 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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.DataSource;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceImageField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.types.DSDataFormat;
+import com.smartgwt.client.types.DSProtocol;
+import com.smartgwt.client.widgets.tree.TreeNode;
+
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceSubCategory;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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;
+
+/**
+ * @author Greg Hinkle
+ */
+public class NewResourceTreeDataSource extends DataSource {
+
+ int rootId;
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+ public NewResourceTreeDataSource() {
+ setClientOnly(false);
+ setDataProtocol(DSProtocol.CLIENTCUSTOM);
+ setDataFormat(DSDataFormat.CUSTOM);
+
+
+ this.rootId = rootId;
+
+ DataSourceField idDataField = new DataSourceTextField("id",
"ID");
+ idDataField.setPrimaryKey(true);
+
+ DataSourceTextField nameDataField = new DataSourceTextField("name",
"Name");
+ nameDataField.setCanEdit(false);
+
+ DataSourceTextField descriptionDataField = new
DataSourceTextField("description", "Description");
+ descriptionDataField.setCanEdit(false);
+
+ DataSourceImageField availabilityDataField = new
DataSourceImageField("currentAvailability", "Availability");
+ descriptionDataField.setCanEdit(false);
+
+ DataSourceTextField parentIdField = new DataSourceTextField("parentId",
"Parent ID");
+ parentIdField.setForeignKey("id");
+ // parentIdField.setRootValue(rootId);
+
+ // DataSourceTextField parentKeyField = new
DataSourceTextField("parentKey", "Parent KEY");
+ // parentKeyField.setForeignKey("id");
+ // parentKeyField.setRootValue(rootId);
+
+ // nameDataField.setType(FieldType.);
+
+ setDropExtraFields(false);
+
+ setFields(idDataField, nameDataField, descriptionDataField,
availabilityDataField);
+ }
+
+ @Override
+ protected Object transformRequest(DSRequest request) {
+ String requestId = request.getRequestId();
+ DSResponse response = new DSResponse();
+ response.setAttribute("clientContext",
request.getAttributeAsObject("clientContext"));
+ // Asume success
+ response.setStatus(0);
+ switch (request.getOperationType()) {
+ case ADD:
+ //executeAdd(request, response);
+ break;
+ case FETCH:
+ executeFetch(requestId, request, response);
+ break;
+ case REMOVE:
+ //executeRemove(lstRec);
+ break;
+ case UPDATE:
+ //executeAdd(lstRec, false);
+ break;
+
+ default:
+ break;
+ }
+
+ return request.getData();
+ }
+
+
+ public void executeFetch(final String requestId, final DSRequest request, final
DSResponse response) {
+ final long start = System.currentTimeMillis();
+
+ String p = request.getCriteria().getAttribute("parentId");
+
+ ResourceCriteria criteria = new ResourceCriteria();
+
+ if (p == null) {
+ System.out.println("DataSourceTree: Loading initial data");
+
+ criteria.addFilterId(rootId);
+
+ } else {
+ System.out.println("DataSourceTree: Loading " + p);
+
+ criteria.addFilterParentResourceId(Integer.parseInt(p));
+ }
+
+ // The server is already eager fetch resource type
+ // * criteria.fetchResourceType(true);
+
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load resource data
for tree", caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(requestId, response);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ processIncomingData(result, response, requestId);
+ }
+ });
+ }
+
+ private void processIncomingData(List<Resource> result, final DSResponse
response, final String requestId) {
+
+ ResourceTypeRepository.Cache.getInstance().loadResourceTypes(result,
+ EnumSet.of(ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory),
+ new ResourceTypeRepository.ResourceTypeLoadedCallback() {
+ public void onResourceTypeLoaded(List<Resource> result) {
+// response.setData(build(result));
+ processResponse(requestId, response);
+
+ }
+ });
+ }
+
+ /**
+ * Construct a set of TreeNodes from a list of resources
+ *
+ * @param resources
+ * @return
+ */
+ public static TreeNode build(int rootId, Map<Integer, Resource> resources) {
+ Resource root = resources.get(rootId);
+
+ TreeNode rootNode = new ResourceTreeNode(root);
+
+ buildTree(rootNode, root, resources);
+
+ ResourceTreeNode[] records = new ResourceTreeNode[resources.size()];
+ for (int x = 0; x < resources.size(); x++) {
+ Resource res = resources.get(x);
+ ResourceTreeNode record = new ResourceTreeNode(res);
+ records[x] = record;
+ }
+
+ return rootNode;
+// return introduceTypeFolders(records);
+ }
+
+ private static void buildTree(TreeNode parent, Resource parentResource,
Map<Integer, Resource> resources) {
+
+ HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType,
TypeTreeNode>();
+
+
+ ArrayList<ResourceTreeNode> childNodes = new
ArrayList<ResourceTreeNode>();
+
+ for (Resource res : resources.values()) {
+ if (res.getParentResource() != null &&
res.getParentResource().getId() == parentResource.getId()) {
+
+// parent.setChildren();
+
+ ResourceTreeNode child = new ResourceTreeNode(res);
+
+ childNodes.add(child);
+
+ buildTree(child, res, resources);
+
+ }
+ }
+
+ parent.setChildren(childNodes.toArray(new TreeNode[childNodes.size()]));
+
+ }
+
+
+
+
+ private static TreeNode[] introduceTypeFolders(ResourceTreeNode[] nodes) {
+ ArrayList<TreeNode> built = new ArrayList<TreeNode>();
+ HashMap<ResourceSubCategory, CategoryTreeNode> categories = new
HashMap<ResourceSubCategory, CategoryTreeNode>();
+ HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType,
TypeTreeNode>();
+
+
+ for (ResourceTreeNode node : nodes) {
+ built.add(node);
+
+ if (!types.containsKey(node.getResourceType())
+ && node.getResourceType().getCategory() !=
ResourceCategory.PLATFORM) {
+
+ String parentResourceId =
String.valueOf(node.getResource().getParentResource().getId());
+
+ CategoryTreeNode categoryNode = null;
+
+ if (node.getResourceType().getSubCategory() != null) {
+ ResourceSubCategory category =
node.getResourceType().getSubCategory();
+ if (category.getName() != null) {
+ categoryNode = categories.get(category);
+
+ if (categoryNode == null) {
+ categoryNode = new CategoryTreeNode(parentResourceId,
category);
+
+ categories.put(category, categoryNode);
+ built.add(categoryNode);
+ }
+ }
+ }
+
+ String parentId = null;
+ if (categoryNode != null) {
+ parentId = categoryNode.getAttribute("id");
+ } else {
+ parentId = parentResourceId;
+ }
+
+ TypeTreeNode typeNode = new TypeTreeNode(parentId, parentResourceId,
node.getResourceType().getName());
+ built.add(typeNode);
+ types.put(node.getResourceType(), typeNode);
+ }
+ }
+
+ return built.toArray(new TreeNode[built.size()]);
+
+ }
+
+ private static boolean sameTypes(ResourceTreeNode[] nodes) {
+ ResourceType first = nodes[0].getResourceType();
+ for (ResourceTreeNode node : nodes) {
+ if (!first.equals(node)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static class CategoryTreeNode extends TreeNode {
+ public CategoryTreeNode(String parentId, ResourceSubCategory category) {
+ setID(parentId + "__" + category.getName());
+ setParentID(parentId);
+ setName(category.getDisplayName());
+
+ setAttribute("id", parentId + "__" +
category.getName());
+ setAttribute("parentId", parentId);
+ setAttribute("name", category.getDisplayName());
+ }
+ }
+
+
+ public static class TypeTreeNode extends TreeNode {
+
+ private TypeTreeNode(String parentId, String parentResourceId, String type) {
+ setID(parentId + "_" + type);
+ setParentID(parentId);
+
+ setAttribute("id", parentResourceId + "_" + type);
+ setAttribute("parentId", parentId);
+ // setAttribute("parentKey", parentId);
+ setAttribute("name", type);
+ }
+
+ }
+
+ public static class ResourceTreeNode extends TreeNode {
+
+ private Resource resource;
+
+ private ResourceTreeNode(Resource resource) {
+ this.resource = resource;
+
+ String id = String.valueOf(resource.getId());
+ String parentId = resource.getParentResource() == null ? null
+ : (resource.getParentResource().getId() + "_" +
resource.getResourceType().getName());
+
+ // System.out.println(id + " / " + parentId);
+
+ setID(id);
+ setParentID(parentId);
+
+
+ setAttribute("id", id);
+ setAttribute("parentId", parentId);
+
+ // setAttribute("parentKey",
resource.getParentResource() == null ? 0 : (resource.getParentResource().getId() +
resource.getResourceType().getName()));
+
+ setAttribute("name", resource.getName());
+// setAttribute("description", resource.getDescription());
+ setAttribute(
+ "currentAvailability",
+ resource.getCurrentAvailability().getAvailabilityType() ==
AvailabilityType.UP ? "/images/icons/availability_green_16.png"
+ : "/images/icons/availability_red_16.png");
+
+ setIsFolder((resource.getResourceType().getChildResourceTypes() != null
&& !resource.getResourceType()
+ .getChildResourceTypes().isEmpty()));
+ }
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ public void setResource(Resource resource) {
+ this.resource = resource;
+ }
+
+ public ResourceType getResourceType() {
+ return resource.getResourceType();
+ }
+
+ public String getParentId() {
+ return getAttribute("parentId");
+ }
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java
new file mode 100644
index 0000000..3c72ba7
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java
@@ -0,0 +1,514 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
+import com.smartgwt.client.widgets.grid.events.SelectionEvent;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.menu.Menu;
+import com.smartgwt.client.widgets.menu.MenuItem;
+import com.smartgwt.client.widgets.menu.MenuItemSeparator;
+import com.smartgwt.client.widgets.menu.events.ClickHandler;
+import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
+import com.smartgwt.client.widgets.tree.Tree;
+import com.smartgwt.client.widgets.tree.TreeGrid;
+import com.smartgwt.client.widgets.tree.TreeNode;
+import com.smartgwt.client.widgets.tree.events.DataArrivedEvent;
+import com.smartgwt.client.widgets.tree.events.DataArrivedHandler;
+import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent;
+import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.criteria.ResourceTypeCriteria;
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
+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.Breadcrumb;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
+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.gwt.ResourceTypeGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.create.OperationCreateWizard;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.ResourceFactoryCreateWizard;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+
+/**
+ * @author Greg Hinkle
+ */
+public class NewResourceTreeView extends VLayout {
+ private Resource selectedResource;
+ private Resource rootResource;
+
+ private TreeGrid treeGrid;
+ private Menu contextMenu;
+
+ private ViewId currentViewId;
+
+ private ArrayList<ResourceSelectListener> selectListeners = new
ArrayList<ResourceSelectListener>();
+
+ private boolean initialSelect = false;
+
+ public NewResourceTreeView() {
+ super();
+
+ setWidth("250");
+ setHeight100();
+
+ setShowResizeBar(true);
+ }
+
+ public void onInit() {
+
+ }
+
+ private void buildTree() {
+
+ treeGrid = new CustomResourceTreeGrid();
+
+ treeGrid.setOpenerImage("resources/dir.png");
+ treeGrid.setOpenerIconSize(16);
+
+// treeGrid.setAutoFetchData(true);
+ treeGrid.setAnimateFolders(false);
+ treeGrid.setSelectionType(SelectionStyle.SINGLE);
+ treeGrid.setShowRollOver(false);
+ treeGrid.setSortField("name");
+ treeGrid.setShowHeader(false);
+
+ treeGrid.setLeaveScrollbarGap(false);
+
+
+ contextMenu = new Menu();
+ MenuItem item = new MenuItem("Expand node");
+
+
+ treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ if (!selectionEvent.isRightButtonDown() &&
selectionEvent.getState()) {
+ if (treeGrid.getSelectedRecord() instanceof
ResourceTreeDatasource.ResourceTreeNode) {
+ ResourceTreeDatasource.ResourceTreeNode node =
(ResourceTreeDatasource.ResourceTreeNode) treeGrid.getSelectedRecord();
+ System.out.println("Resource selected in tree: " +
node.getResource());
+
+ String newToken = "Resource/" +
node.getResource().getId();
+ String currentToken = History.getToken();
+ if (!currentToken.startsWith(newToken)) {
+
+ String ending =
currentToken.replaceFirst("^[^\\/]*\\/[^\\/]*", "");
+
+ History.newItem("Resource/" +
node.getResource().getId() + ending);
+
+ }
+ }
+
+ }
+ }
+ });
+
+
+ // This constructs the context menu for the resource at the time of the click.
+ setContextMenu(contextMenu);
+
+
+ treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() {
+ public void onNodeContextClick(final NodeContextClickEvent event) {
+ event.getNode();
+ event.cancel();
+
+ if (event.getNode() instanceof ResourceTreeDatasource.TypeTreeNode) {
+ showContextMenu((ResourceTreeDatasource.TypeTreeNode)
event.getNode());
+ } else if (event.getNode() instanceof
ResourceTreeDatasource.ResourceTreeNode) {
+ showContextMenu((ResourceTreeDatasource.ResourceTreeNode)
event.getNode());
+ }
+ }
+ });
+ }
+
+
+ private void showContextMenu(ResourceTreeDatasource.TypeTreeNode node) {
+
+ contextMenu.setItems(new MenuItem(node.getName()));
+ contextMenu.showContextMenu();
+
+ }
+
+ private void showContextMenu(final ResourceTreeDatasource.ResourceTreeNode node) {
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ node.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory,
+
ResourceTypeRepository.MetadataType.pluginConfigurationDefinition,
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ buildResourceContextMenu(node.getResource(), type);
+ contextMenu.showContextMenu();
+ }
+ });
+ }
+
+
+ private void buildResourceContextMenu(final Resource resource, final ResourceType
resourceType) {
+ contextMenu.setItems(new MenuItem(resource.getName()));
+
+ contextMenu.addItem(new MenuItem("Type: " + resourceType.getName()));
+
+
+ MenuItem editPluginConfiguration = new MenuItem("Plugin
Configuration");
+ editPluginConfiguration.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ int resourceId = resource.getId();
+ int resourceTypeId = resourceType.getId();
+
+ Window configEditor = new Window();
+ configEditor.setTitle("Edit " + resource.getName() + "
plugin configuration");
+ configEditor.setWidth(800);
+ configEditor.setHeight(800);
+ configEditor.setIsModal(true);
+ configEditor.setShowModalMask(true);
+ configEditor.setCanDragResize(true);
+ configEditor.centerInPage();
+ configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId,
ConfigurationEditor.ConfigType.plugin));
+ configEditor.show();
+
+ }
+ });
+
editPluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() !=
null);
+ contextMenu.addItem(editPluginConfiguration);
+
+
+ MenuItem editResourceConfiguration = new MenuItem("Resource
Configuration");
+ editResourceConfiguration.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ int resourceId = resource.getId();
+ int resourceTypeId = resourceType.getId();
+
+ final Window configEditor = new Window();
+ configEditor.setTitle("Edit " + resource.getName() + "
resource configuration");
+ configEditor.setWidth(800);
+ configEditor.setHeight(800);
+ configEditor.setIsModal(true);
+ configEditor.setShowModalMask(true);
+ configEditor.setCanDragResize(true);
+ configEditor.setShowResizer(true);
+ configEditor.centerInPage();
+ configEditor.addCloseClickHandler(new CloseClickHandler() {
+ public void onCloseClick(CloseClientEvent closeClientEvent) {
+ configEditor.destroy();
+ }
+ });
+ configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId,
ConfigurationEditor.ConfigType.resource));
+ configEditor.show();
+
+ }
+ });
+
editResourceConfiguration.setEnabled(resourceType.getResourceConfigurationDefinition() !=
null);
+ contextMenu.addItem(editResourceConfiguration);
+
+ contextMenu.addItem(new MenuItemSeparator());
+
+
+ // Operations Menu
+ MenuItem operations = new MenuItem("Operations");
+ 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) {
+ new OperationCreateWizard(selectedResource,
operationDefinition).startOperationWizard();
+ }
+ });
+ opSubMenu.addItem(operationItem);
+ // todo action
+ }
+ operations.setEnabled(!resourceType.getOperationDefinitions().isEmpty());
+ operations.setSubmenu(opSubMenu);
+ contextMenu.addItem(operations);
+
+
+ contextMenu.addItem(buildMetricsMenu(resourceType));
+
+
+ // Create Menu
+ MenuItem createChildMenu = new MenuItem("Create Child");
+ Menu createChildSubMenu = new Menu();
+ for (final ResourceType childType : resourceType.getChildResourceTypes()) {
+ if (childType.isCreatable()) {
+ MenuItem createItem = new MenuItem(childType.getName());
+ createChildSubMenu.addItem(createItem);
+ createItem.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ ResourceFactoryCreateWizard.showCreateWizard(resource,
childType);
+ }
+ });
+
+ }
+ }
+ createChildMenu.setSubmenu(createChildSubMenu);
+ createChildMenu.setEnabled(createChildSubMenu.getItems().length > 0);
+ contextMenu.addItem(createChildMenu);
+
+
+ // Manually Add Menu
+ MenuItem importChildMenu = new MenuItem("Import");
+ Menu importChildSubMenu = new Menu();
+ for (ResourceType childType : resourceType.getChildResourceTypes()) {
+ if (childType.isSupportsManualAdd()) {
+ importChildSubMenu.addItem(new MenuItem(childType.getName()));
+ //todo action
+ }
+ }
+ if (resourceType.getCategory() == ResourceCategory.PLATFORM) {
+ loadManuallyAddServersToPlatforms(importChildSubMenu);
+ }
+ importChildMenu.setSubmenu(importChildSubMenu);
+ importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0);
+ contextMenu.addItem(importChildMenu);
+ }
+
+
+ private void loadManuallyAddServersToPlatforms(final Menu manuallyAddMenu) {
+ ResourceTypeGWTServiceAsync rts = GWTServiceLookup.getResourceTypeGWTService();
+
+ ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+ criteria.addFilterSupportsManualAdd(true);
+ criteria.fetchParentResourceTypes(true);
+ rts.findResourceTypesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
platform manual add children", caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+ for (ResourceType type : result) {
+ if (type.getParentResourceTypes() == null ||
type.getParentResourceTypes().isEmpty()) {
+ MenuItem item = new MenuItem(type.getName());
+ manuallyAddMenu.addItem(item);
+ }
+ }
+ }
+ });
+ }
+
+
+ private MenuItem buildMetricsMenu(final ResourceType type) {
+ MenuItem measurements = new MenuItem("Measurements");
+ final Menu measurementsSubMenu = new Menu();
+
+
+ GWTServiceLookup.getDashboardService().findDashboardsForSubject(new
AsyncCallback<List<Dashboard>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load user
dashboards", caught);
+ }
+
+ public void onSuccess(List<Dashboard> result) {
+
+ for (final MeasurementDefinition def : type.getMetricDefinitions()) {
+
+ MenuItem defItem = new MenuItem(def.getDisplayName());
+ measurementsSubMenu.addItem(defItem);
+ Menu defSubItem = new Menu();
+ defItem.setSubmenu(defSubItem);
+
+
+ for (final Dashboard d : result) {
+ MenuItem addToDBItem = new MenuItem("Add chart to Dashboard:
" + d.getName());
+ defSubItem.addItem(addToDBItem);
+
+ addToDBItem.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent menuItemClickEvent) {
+
+ DashboardPortlet p = new
DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250);
+ p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId()));
+ p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId()));
+
+ d.addPortlet(p, 0, 0);
+
+ GWTServiceLookup.getDashboardService().storeDashboard(d,
new AsyncCallback<Dashboard>() {
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server",
caught);
+ }
+
+ public void onSuccess(Dashboard result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Saved dashboard " + result.getName() + " to server",
Message.Severity.Info));
+ }
+ });
+
+ }
+ });
+
+ }
+
+
+ }
+
+ }
+ });
+ measurements.setSubmenu(measurementsSubMenu);
+ return measurements;
+ }
+
+ Resource getResource(int resourceId) {
+ if (this.treeGrid != null && this.treeGrid.getTree() != null) {
+ ResourceTreeDatasource.ResourceTreeNode treeNode =
+ (ResourceTreeDatasource.ResourceTreeNode)
this.treeGrid.getTree().findById(String.valueOf(resourceId));
+ if (treeNode != null) {
+ return treeNode.getResource();
+ }
+ }
+ return null;
+ }
+
+ private void setRootResource(Resource rootResource) {
+ this.rootResource = rootResource;
+ }
+
+ public void setSelectedResource(final Resource selectedResource, final ViewId viewId)
{
+ this.selectedResource = selectedResource;
+
+ TreeNode node = null;
+ if (treeGrid != null && treeGrid.getTree() != null
+ && (node =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) {
+
+ // This is the case where the tree was previously loaded and we get fired to
look at a different
+ // node in the same tree and just have to switch the selection
+
+ TreeNode[] parents = treeGrid.getTree().getParents(node);
+ treeGrid.getTree().openFolders(parents);
+ treeGrid.getTree().openFolder(node);
+
+ treeGrid.deselectAllRecords();
+ treeGrid.selectRecord(node);
+
+
+ // Update breadcrumbs
+ viewId.getBreadcrumbs().clear();
+ for (int i = parents.length - 1; i >= 0; i--) {
+ TreeNode n = parents[i];
+ adjustBreadcrumb(n, viewId);
+ }
+ adjustBreadcrumb(node, viewId);
+
+ CoreGUI.refreshBreadCrumbTrail();
+
+ } else {
+
+ // Data not yet loaded or a node in a different tree
+
+ final ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+
+ resourceService.getPlatformForResource(selectedResource.getId(), new
AsyncCallback<Resource>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("adasdf", caught);
+ }
+
+ public void onSuccess(Resource result) {
+ rootResource = result;
+
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterRootResourceId(rootResource.getId());
+ criteria.setPageControl(PageControl.getUnlimitedInstance());
+
+ resourceService.findResourcesByCriteria(criteria,
+ new AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError("lkasldf", caught);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+
+ loadTree(rootResource.getId(), result);
+ }
+ });
+ }
+ });
+
+ }
+ }
+
+ private void loadTree(int rootId, PageList<Resource> result) {
+ if (this.treeGrid != null) {
+ this.treeGrid.destroy();
+ }
+ this.buildTree();
+
+ HashMap<Integer,Resource> data = new HashMap<Integer, Resource>();
+ for (Resource res : result) {
+ data.put(res.getId(),res);
+ }
+
+ Tree tree = new Tree();
+
+ tree.setRoot(NewResourceTreeDataSource.build(rootId, data));
+ treeGrid.setData(tree);
+ addMember(this.treeGrid);
+ }
+
+
+ private void adjustBreadcrumb(TreeNode node, ViewId viewId) {
+ if (node instanceof ResourceTreeDatasource.ResourceTreeNode) {
+
+ Resource nr = ((ResourceTreeDatasource.ResourceTreeNode)
node).getResource();
+ String display = node.getName() + " <span
class=\"subtitle\">" + nr.getResourceType().getName() +
"</span>";
+ String icon = "types/" +
nr.getResourceType().getCategory().getDisplayName() + "_up_16.png";
+
+
+ viewId.getBreadcrumbs().add(new
Breadcrumb(node.getAttribute("id"),
+ display, icon, true));
+
+ } else {
+
+// if (node.getName() != null) {
+// viewId.getBreadcrumbs().add(new
Breadcrumb(node.getAttribute("id"), node.getName(), null, true));
+// }
+ }
+ }
+
+
+ public void addResourceSelectListener(ResourceSelectListener listener) {
+ this.selectListeners.add(listener);
+ }
+
+ public void renderView(ViewPath viewPath) {
+ currentViewId = viewPath.getCurrent();
+ }
+}
\ No newline at end of file
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 701c176..02570b6 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
@@ -50,6 +50,8 @@ import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.events.ShowContextMenuEvent;
+import com.smartgwt.client.widgets.events.ShowContextMenuHandler;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -121,7 +123,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
- if (selectionEvent.getState()) {
+ if (!selectionEvent.isRightButtonDown() &&
selectionEvent.getState()) {
if (treeGrid.getSelectedRecord() instanceof
ResourceTreeDatasource.ResourceTreeNode) {
ResourceTreeDatasource.ResourceTreeNode node =
(ResourceTreeDatasource.ResourceTreeNode) treeGrid.getSelectedRecord();
System.out.println("Resource selected in tree: " +
node.getResource());
@@ -144,9 +146,13 @@ public class ResourceTreeView extends VLayout {
// This constructs the context menu for the resource at the time of the click.
setContextMenu(contextMenu);
+
+
+
treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() {
public void onNodeContextClick(final NodeContextClickEvent event) {
event.getNode();
+ event.cancel();
if (event.getNode() instanceof ResourceTreeDatasource.TypeTreeNode) {
showContextMenu((ResourceTreeDatasource.TypeTreeNode)
event.getNode());
@@ -406,6 +412,9 @@ public class ResourceTreeView extends VLayout {
if (treeGrid != null && treeGrid.getTree() != null
&& (node =
treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) {
+ // This is the case where the tree was previously loaded and we get fired to
look at a different
+ // node in the same tree and just have to switch the selection
+
TreeNode[] parents = treeGrid.getTree().getParents(node);
treeGrid.getTree().openFolders(parents);
treeGrid.getTree().openFolder(node);
commit 3bf778a65f84daf3e39514cd87ad269558c1257e
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 13:12:19 2010 -0400
Slim down the selectors in height
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
index 28830da..f2c02f5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java
@@ -4,18 +4,23 @@
* 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.
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
*
* 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.
+ * GNU General Public License and the GNU Lesser 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.
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
package org.rhq.enterprise.gui.coregui.client.components.form;
import java.util.ArrayList;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
index 8b13207..8fc14b0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -102,7 +102,7 @@ public abstract class AbstractSelector<T> extends VLayout {
// LEFT SIDE
availableGrid = new ListGrid();
- availableGrid.setHeight(350);
+ availableGrid.setHeight(300);
availableGrid.setCanDragRecordsOut(true);
availableGrid.setDragTrackerMode(DragTrackerMode.ICON);
availableGrid.setTrackerImage(new
ImgProperties("types/Service_up_16.png", 16, 16));
@@ -157,7 +157,7 @@ public abstract class AbstractSelector<T> extends VLayout {
// RIGHT SIDE
assignedGrid = new ListGrid();
- assignedGrid.setHeight(350);
+ assignedGrid.setHeight(300);
assignedGrid.setCanReorderRecords(true);
assignedGrid.setCanDragRecordsOut(true);
commit 7048f423e2f90def4e4abb13d559940ad0bb796f
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 13:03:15 2010 -0400
Ability to use <enter> twice on the login form to use autofill values
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index c28d77e..d534aca 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -26,7 +26,6 @@ import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
-import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Alignment;
@@ -102,7 +101,7 @@ public class LoginView extends Canvas {
TextItem user = new TextItem("user", "User");
user.setRequired(true);
user.setAttribute("autoComplete", "native");
- PasswordItem password = new PasswordItem("password",
"Password");
+ final PasswordItem password = new PasswordItem("password",
"Password");
password.setRequired(true);
password.setAttribute("autoComplete", "native");
@@ -110,6 +109,13 @@ public class LoginView extends Canvas {
loginButton.setAlign(Alignment.CENTER);
loginButton.setColSpan(2);
+ user.addKeyPressHandler(new KeyPressHandler() {
+ public void onKeyPress(KeyPressEvent event) {
+ if ((event.getCharacterValue() != null) &&
(event.getCharacterValue() == KeyCodes.KEY_ENTER)) {
+ password.focusInItem(); // Work around the form not getting
auto-fill values until the field is focused
+ }
+ }
+ });
password.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if ((event.getCharacterValue() != null) &&
(event.getCharacterValue() == KeyCodes.KEY_ENTER)) {
commit cdf8afe540f894b61147721f67def6e90a2a004a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:59:46 2010 -0400
Improve bundle tree reloading so that it doesn't always close the entire tree
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index cce46a3..5ea41cf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@ -93,8 +93,14 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
public void renderView(ViewPath viewPath) {
+ if (viewPath.isRefresh()) {
+ bundleTreeView.refresh();
+ }
+
+
bundleTreeView.selectPath(viewPath);
+
if (viewPath.isEnd()) {
if (currentNextPath == null && bundlesListView != null) {
// refresh
@@ -117,6 +123,5 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
bundleView.renderView(viewPath.next());
}
}
- bundleTreeView.refresh();//refresh the tree in all cases.
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java
index 3dabe7e..000af5f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java
@@ -46,9 +46,7 @@ public class BundleTreeView extends TreeGrid {
setWidth100();
setHeight100();
-
- setWidth100();
- setHeight100();
+ setLeaveScrollbarGap(false);
// setShowRoot(true);
setAutoFetchData(true);
setAnimateFolders(false);
commit c650a717ee4a21354d83e34f73f03705b5f72fbf
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:59:14 2010 -0400
Fix selector repackaging
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
index 271ca59..771e51d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
@@ -25,8 +25,8 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.bundle.Bundle;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleSelector;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector;
public class SelectBundleStep extends AbstractWizardStep {
commit da32f65506ed18dcdf4d5865b840750d5a18b615
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Jul 27 18:49:43 2010 +0200
BZ 618741 - add the configuration name to the name of the JBoss AS (4 and 5) server
resources.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index 8ef756d..5068f2d 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -316,6 +316,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION;
File deployDir = new File(absoluteConfigPath, "deploy");
+
File rhqInstallerWar = new File(deployDir, "rhq-installer.war");
File rhqInstallerWarUndeployed = new File(deployDir,
"rhq-installer.war.rej");
boolean isRhqServer = rhqInstallerWar.exists() ||
rhqInstallerWarUndeployed.exists();
@@ -324,13 +325,13 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
// We know this is an RHQ Server. Let's add an event source for its
server log file, but disable it by default.
configureEventSourceForServerLogFile(pluginConfig);
}
- String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), isRhqServer);
+ String name = formatServerName(bindAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(),
isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, installInfo.getVersion(),
description, pluginConfig, processInfo);
}
- public String formatServerName(String bindingAddress, String jnpPort, String
hostname, boolean isRhq) {
+ public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName, boolean isRhq) {
if (isRhq) {
return hostname + " RHQ Server";
@@ -355,7 +356,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
hostnameToUse += ":" + jnpPort;
}
- return hostnameToUse;
+ return hostnameToUse + " " + configurationName;
}
}
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java
index 05483e4..78a3330 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java
@@ -325,7 +325,7 @@ public class JBossASDiscoveryComponent implements
ResourceDiscoveryComponent, Ma
}
}
}
- String name = formatServerName(bindingAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), isInServer);
+ String name = formatServerName(bindingAddress, namingPort,
discoveryContext.getSystemInformation().getHostname(), configName, isInServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key,
name, installInfo.getVersion(),
description, pluginConfiguration, processInfo);
@@ -404,7 +404,7 @@ public class JBossASDiscoveryComponent implements
ResourceDiscoveryComponent, Ma
setPluginConfigurationDefaults(pluginConfiguration);
String resourceName = formatServerName(bindAddress, jnpPort,
- context.getSystemInformation().getHostname(),
isRhqServer(configDir));
+ context.getSystemInformation().getHostname(), configName,
isRhqServer(configDir));
DiscoveredResourceDetails resource = new
DiscoveredResourceDetails(context.getResourceType(), configDir
.getAbsolutePath(), resourceName, version,
"JBoss AS server that the RHQ Plugin Container is running
within", pluginConfiguration, null);
@@ -420,7 +420,7 @@ public class JBossASDiscoveryComponent implements
ResourceDiscoveryComponent, Ma
return null;
}
- public String formatServerName(String bindingAddress, String jnpPort, String
hostname, boolean isRhq) {
+ public String formatServerName(String bindingAddress, String jnpPort, String
hostname, String configurationName, boolean isRhq) {
if (isRhq) {
return hostname + " RHQ Server";
@@ -444,7 +444,7 @@ public class JBossASDiscoveryComponent implements
ResourceDiscoveryComponent, Ma
hostnameToUse += ":" + jnpPort;
}
- return hostnameToUse;
+ return hostnameToUse + " " + configurationName;
}
}
commit b59013caf09787898c3a5efb863f0dfcf852f8d4
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:42:18 2010 -0400
Better admin tree L&F
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index c2ebe9b..6eead0b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -121,6 +121,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
private TreeGrid buildSecuritySection() {
final TreeGrid securityTreeGrid = new TreeGrid();
+ securityTreeGrid.setLeaveScrollbarGap(false);
securityTreeGrid.setShowHeader(false);
Tree tree = new Tree();
@@ -151,6 +152,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
private TreeGrid buildManagementClusterSection() {
final TreeGrid mgmtClusterTreeGrid = new TreeGrid();
+ mgmtClusterTreeGrid.setLeaveScrollbarGap(false);
mgmtClusterTreeGrid.setShowHeader(false);
Tree tree = new Tree();
@@ -174,6 +176,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
private TreeGrid buildSystemConfigurationSection() {
final TreeGrid systemConfigTreeGrid = new TreeGrid();
+ systemConfigTreeGrid.setLeaveScrollbarGap(false);
systemConfigTreeGrid.setShowHeader(false);
Tree tree = new Tree();
@@ -195,6 +198,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
private TreeGrid buildReportsSection() {
final TreeGrid reportsTreeGrid = new TreeGrid();
+ reportsTreeGrid.setLeaveScrollbarGap(false);
reportsTreeGrid.setShowHeader(false);
Tree tree = new Tree();
commit 64354925b00bfedb4fbbba1626c942b88e0eaf4c
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:41:47 2010 -0400
Support for tracking refreshes explicitely in the viewpath
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
index 0a1253b..e0b7991 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
@@ -29,6 +29,8 @@ public class ViewPath {
private int index = 0;
+ private boolean refresh = false;
+
public ViewPath() {
}
@@ -84,4 +86,12 @@ public class ViewPath {
public int viewsLeft() {
return viewPath.size() - index - 1;
}
+
+ public boolean isRefresh() {
+ return refresh;
+ }
+
+ public void setRefresh(boolean refresh) {
+ this.refresh = refresh;
+ }
}
commit d18f68e412fb929443b7edc23deeab2473281119
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:41:27 2010 -0400
Reports top level category
tag cloud display, recent alerts, recent operations
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 8fb1f0b..7cd621b 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
@@ -53,6 +53,7 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGro
import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView;
import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
+import org.rhq.enterprise.gui.coregui.client.report.ReportTopView;
import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
@@ -248,6 +249,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
public static void refresh() {
currentViewPath = new ViewPath(currentPath);
+ currentViewPath.setRefresh(true);
coreGUI.rootCanvas.renderView(currentViewPath);
}
@@ -275,6 +277,8 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
canvas = new TaggedView();
} else if (breadcrumbName.equals("Subsystems")) {
canvas = new AlertsView();
+ } else if (breadcrumbName.equals("Reports")) {
+ canvas = new ReportTopView();
} else {
canvas = null;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
new file mode 100644
index 0000000..8024902
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -0,0 +1,370 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.report;
+
+import java.util.LinkedHashMap;
+
+import com.smartgwt.client.types.VisibilityMode;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+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.SectionStack;
+import com.smartgwt.client.widgets.layout.SectionStackSection;
+import com.smartgwt.client.widgets.tree.Tree;
+import com.smartgwt.client.widgets.tree.TreeGrid;
+import com.smartgwt.client.widgets.tree.TreeNode;
+
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.admin.agent.install.RemoteAgentInstallView;
+import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView;
+import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
+import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
+import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
+import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ReportTopView extends HLayout implements BookmarkableView {
+
+ public static final String VIEW_PATH = "Reports";
+
+
+ private ViewId currentSectionViewId;
+ private ViewId currentPageViewId;
+
+
+ private SectionStack sectionStack;
+
+ private Canvas contentCanvas;
+ private Canvas currentContent;
+ private LinkedHashMap<String, TreeGrid> treeGrids = new
LinkedHashMap<String, TreeGrid>();
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ setWidth100();
+ setHeight100();
+
+ contentCanvas = new Canvas();
+ contentCanvas.setWidth("*");
+ contentCanvas.setHeight100();
+
+ sectionStack = new SectionStack();
+ sectionStack.setShowResizeBar(true);
+ sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
+ sectionStack.setWidth(250);
+ sectionStack.setHeight100();
+
+
+ treeGrids.put("Inventory", buildInventorySection());
+ treeGrids.put("Configuration", buildSystemConfigurationSection());
+ treeGrids.put("Cluster", buildManagementClusterSection());
+ treeGrids.put("Reports", buildReportsSection());
+
+
+ for (final String name : treeGrids.keySet()) {
+ TreeGrid grid = treeGrids.get(name);
+
+ grid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ CoreGUI.goTo("Reports/" + name + "/" +
selectionEvent.getRecord().getAttribute("name"));
+ }
+ });
+
+
+ SectionStackSection section = new SectionStackSection(name);
+ section.setExpanded(true);
+ section.addItem(grid);
+
+ sectionStack.addSection(section);
+ }
+
+
+ addMember(sectionStack);
+ addMember(contentCanvas);
+
+ }
+
+
+ private HTMLFlow defaultView() {
+ String contents = "<h1>Reports</h1>\n" +
+ "This section provides access to global reports.";
+ HTMLFlow flow = new HTMLFlow(contents);
+ flow.setPadding(20);
+ return flow;
+ }
+
+
+ private TreeGrid buildInventorySection() {
+
+ final TreeGrid inventoryTreeGrid = new TreeGrid();
+ inventoryTreeGrid.setLeaveScrollbarGap(false);
+ inventoryTreeGrid.setShowHeader(false);
+
+ Tree tree = new Tree();
+ final TreeNode tagCloud = new TreeNode("Tag Cloud");
+ tagCloud.setIcon("global/Cloud_16.png");
+
+ final TreeNode suspectMetrics = new TreeNode("Suspect Metrics");
+ suspectMetrics.setIcon("subsystems/monitor/Monitor_failed_16.png");
+
+ final TreeNode recentConfigurationChanges = new TreeNode("Recent
Configuration Changes");
+
recentConfigurationChanges.setIcon("subsystems/configure/Configure_16.png");
+
+ final TreeNode recentOperations = new TreeNode("Recent Operations");
+ recentOperations.setIcon("subsystems/control/Operation_16.png");
+
+ final TreeNode recentAlerts = new TreeNode("Recent Alerts");
+ recentAlerts.setIcon("subsystems/alert/Alert_LOW_16.png");
+
+ final TreeNode alertDefinitions = new TreeNode("Alert Definitions");
+ alertDefinitions.setIcon("subsystems/alert/Alerts_16.png");
+
+ final TreeNode platforms = new TreeNode("Platforms");
+ platforms.setIcon("types/Platform_up_16.png");
+
+
+ tree.setRoot(new TreeNode("inventory",
+ tagCloud,
+ suspectMetrics,
+ recentConfigurationChanges,
+ recentOperations,
+ recentAlerts,
+ alertDefinitions,
+ platforms));
+
+ inventoryTreeGrid.setData(tree);
+
+ return inventoryTreeGrid;
+ }
+
+
+ private TreeGrid buildManagementClusterSection() {
+
+ final TreeGrid mgmtClusterTreeGrid = new TreeGrid();
+ mgmtClusterTreeGrid.setLeaveScrollbarGap(false);
+ mgmtClusterTreeGrid.setShowHeader(false);
+
+ Tree tree = new Tree();
+ final TreeNode manageServersNode = new TreeNode("Servers");
+ final TreeNode manageAgentsNode = new TreeNode("Agents");
+ final TreeNode manageAffinityGroupsNode = new TreeNode("Affinity
Groups");
+ final TreeNode managePartitionEventsNode = new TreeNode("Partition
Events");
+
+ tree.setRoot(new TreeNode("clustering",
+ manageServersNode,
+ manageAgentsNode,
+ manageAffinityGroupsNode,
+ managePartitionEventsNode));
+
+ mgmtClusterTreeGrid.setData(tree);
+
+ return mgmtClusterTreeGrid;
+ }
+
+
+ private TreeGrid buildSystemConfigurationSection() {
+
+ final TreeGrid systemConfigTreeGrid = new TreeGrid();
+ systemConfigTreeGrid.setLeaveScrollbarGap(false);
+ systemConfigTreeGrid.setShowHeader(false);
+
+ Tree tree = new Tree();
+ final TreeNode manageSettings = new TreeNode("System Settings");
+ final TreeNode manageTemplates = new TreeNode("Templates");
+ final TreeNode manageDownloads = new TreeNode("Downloads");
+ final TreeNode manageLicense = new TreeNode("License");
+ final TreeNode managePlugins = new TreeNode("Plugins");
+
+ tree.setRoot(new TreeNode("System Configuration",
+ manageSettings, manageTemplates, manageDownloads, manageLicense,
managePlugins));
+
+ systemConfigTreeGrid.setData(tree);
+
+ return systemConfigTreeGrid;
+ }
+
+
+ private TreeGrid buildReportsSection() {
+
+ final TreeGrid reportsTreeGrid = new TreeGrid();
+ reportsTreeGrid.setLeaveScrollbarGap(false);
+ reportsTreeGrid.setShowHeader(false);
+
+ Tree tree = new Tree();
+ final TreeNode inventorySummaryNode = new TreeNode("Inventory
Summary");
+
+ TreeNode reportsNode = new TreeNode("Reports", inventorySummaryNode);
+ tree.setRoot(reportsNode);
+
+ reportsTreeGrid.setData(tree);
+
+ return reportsTreeGrid;
+ }
+
+
+ public void setContent(Canvas newContent) {
+
+ if (contentCanvas.getChildren().length > 0)
+ contentCanvas.getChildren()[0].destroy();
+
+ contentCanvas.addChild(newContent);
+ contentCanvas.markForRedraw();
+ this.currentContent = newContent;
+ }
+
+
+ private void renderContentView(ViewPath viewPath) {
+
+ currentSectionViewId = viewPath.getCurrent();
+ currentPageViewId = viewPath.getNext();
+
+ String section = currentSectionViewId.getPath();
+ String page = currentPageViewId.getPath();
+
+
+ Canvas content = null;
+ if ("Inventory".equals(section)) {
+
+ if ("Tag Cloud".equals(page)) {
+ content = new TaggedView();
+ } else if ("Suspect Metrics".equals(page)) {
+// todo
+ } else if ("Recent Configuration Changes".equals(page)) {
+ // todo
+ } else if ("Recent Operations".equals(page)) {
+ content = new OperationHistoryView();
+ } else if ("Recent Alerts".equals(page)) {
+ content = new AlertsView();
+ } else if ("Alert Definitions".equals(page)) {
+ //todo
+ } else if ("Platforms".equals(page)) {
+ content = new PlatformPortletView();
+ }
+
+
+ } else if ("Security".equals(section)) {
+
+ if ("Manage Users".equals(page)) {
+ content = new UsersView();
+ } else if ("Manage Roles".equals(page)) {
+ content = new RolesView();
+ } else if ("Auto Discovery Queue".equals(page)) {
+ content = new ResourceAutodiscoveryView();
+ } else if ("Remote Agent Install".equals(page)) {
+ content = new RemoteAgentInstallView();
+ }
+ } else if ("Configuration".equals(section)) {
+
+ String url = null;
+ if ("System Settings".equals(page)) {
+ url = "/admin/config/Config.do?mode=edit";
+ } else if ("Templates".equals(page)) {
+ url =
"/admin/config/EditDefaults.do?mode=monitor&viewMode=all";
+ } else if ("Downloads".equals(page)) {
+ url = "/rhq/admin/downloads-body.xhtml";
+ } else if ("License".equals(page)) {
+ url = "/admin/license/LicenseAdmin.do?mode=view";
+ } else if ("Plugins".equals(page)) {
+ url = "/rhq/admin/plugin/plugin-list.xhtml";
+ }
+ url = addQueryStringParam(url, "nomenu=true");
+ content = new FullHTMLPane(url);
+
+
+ } else if ("Cluster".equals(section)) {
+ String url = null;
+ if ("Servers".equals(page)) {
+ url = "/rhq/ha/listServers.xhtml";
+ } else if ("Agents".equals(page)) {
+ url = "/rhq/ha/listAgents.xhtml";
+ } else if ("Affinity Groups".equals(page)) {
+ url = "/rhq/ha/listAffinityGroups.xhtml";
+ } else if ("Partition Events".equals(page)) {
+ url = "/rhq/ha/listPartitionEvents.xhtml";
+ }
+ url = addQueryStringParam(url, "nomenu=true");
+ content = new FullHTMLPane(url);
+ }
+
+
+ for (String name : treeGrids.keySet()) {
+
+ TreeGrid treeGrid = treeGrids.get(name);
+ if (name.equals(section)) {
+// treeGrid.setSelectedPaths(page);
+ } else {
+ treeGrid.deselectAllRecords();
+ }
+ }
+
+
+
+ setContent(content);
+
+
+ if (content instanceof BookmarkableView) {
+ ((BookmarkableView) content).renderView(viewPath.next().next());
+ }
+
+
+ }
+
+
+ public void renderView(ViewPath viewPath) {
+
+ if (!viewPath.isCurrent(currentSectionViewId) ||
!viewPath.isNext(currentPageViewId)) {
+
+ if (viewPath.isEnd()) {
+ // Display default view
+ setContent(defaultView());
+ } else {
+ renderContentView(viewPath);
+ }
+ } else {
+ if (this.currentContent instanceof BookmarkableView) {
+ ((BookmarkableView)
this.currentContent).renderView(viewPath.next().next());
+ }
+
+ }
+
+
+ }
+
+ private static String addQueryStringParam(String url, String param) {
+ char separatorChar = (url.indexOf('?') == -1) ? '?' :
'&';
+ return url + separatorChar + param;
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
index 9e183fb..0a78e50 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
@@ -109,7 +109,7 @@ public class TagCloudView extends VLayout {
int font = (int) ((((double) tag.getTotal()) / (double) max) * (maxFont -
minFont)) + minFont;
- buf.append("<a href=\"#Tag/" + tag.getTag().toString() +
"\" style=\"font-size: " + font + "pt; margin:
8px;\"");
+ buf.append("<a href=\"#Reports/Inventory/Tag Cloud/" +
tag.getTag().toString() + "\" style=\"font-size: " + font + "pt;
margin: 8px;\"");
buf.append(" title=\"Tag used " + tag.getTotal() + "
times\"");
commit 1b99ddfec45e3d718937f839fd998ddc118a5d2a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 12:40:23 2010 -0400
Role create/edit with working group and subject assignments
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java
index 123e47d..74b9c34 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java
@@ -54,11 +54,6 @@ public class PermissionEditorView extends CanvasItem {
setCanvas(new SimpleCollapsiblePanel("Permissions", buildForm()));
}
- @Override
- public Canvas getCanvas() {
- System.out.println("ANythinglksjgalksdjfalskdjfalkdjflaksjdfl?");
- return super.getCanvas(); // TODO: Implement this method.
- }
public Canvas buildForm() {
System.out.println("Building permissions canvas");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
index 523c822..cca86be 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java
@@ -18,14 +18,15 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.roles;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSCallback;
@@ -34,8 +35,10 @@ import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.DSOperationType;
import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.types.TitleOrientation;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
@@ -67,19 +70,20 @@ public class RoleEditView extends VLayout {
private HeaderLabel editLabel;
private DynamicForm form;
private PermissionEditorView permissionEditorItem;
- private CanvasItem selectorItem;
+
+ private CanvasItem groupSelectorItem;
private ResourceGroupSelector groupSelector;
+ private CanvasItem subjectSelectorItem;
+ private RoleSubjectSelector subjectSelector;
+
+ private Window editorWindow;
+
+
public RoleEditView() {
super();
setPadding(10);
setOverflow(Overflow.AUTO);
- }
-
- @Override
- protected void onInit() {
- super.onInit();
-
addMember(message);
@@ -91,6 +95,8 @@ public class RoleEditView extends VLayout {
private Canvas buildRoleForm() {
this.editCanvas = new VLayout();
+ this.editCanvas.setWidth100();
+ this.editCanvas.setHeight100();
editLabel = new HeaderLabel("Create User");
// TODO create header css style and set
@@ -98,6 +104,8 @@ public class RoleEditView extends VLayout {
editCanvas.addMember(editLabel);
form = new DynamicForm();
+ form.setWidth100();
+
form.setDataSource(RolesDataSource.getInstance());
TextItem idItem = new TextItem("id", "Id");
@@ -108,10 +116,17 @@ public class RoleEditView extends VLayout {
permissionEditorItem.setShowTitle(false);
permissionEditorItem.setColSpan(2);
- selectorItem = new CanvasItem("groupSelectionCanvas");
+ groupSelectorItem = new CanvasItem("groupSelectionCanvas",
"Assigned Resource Groups");
+ groupSelectorItem.setCanvas(new Label("loading...")); //new
RoleResourceGroupSelector(null));
+ groupSelectorItem.setTitleOrientation(TitleOrientation.TOP);
+ groupSelectorItem.setColSpan(2);
+
+
+ subjectSelectorItem = new CanvasItem("subjectSelectionCanvas",
"Assigned Subjects");
+ subjectSelectorItem.setCanvas(new Label("loading...")); //new
RoleSubjectSelector(null));
+ subjectSelectorItem.setTitleOrientation(TitleOrientation.TOP);
+ subjectSelectorItem.setColSpan(2);
- selectorItem.setShowTitle(false);
- selectorItem.setColSpan(2);
SubmitItem saveButton = new SubmitItem("save", "Save");
@@ -134,7 +149,8 @@ public class RoleEditView extends VLayout {
idItem,
nameItem,
permissionEditorItem,
- selectorItem,
+ groupSelectorItem,
+ subjectSelectorItem,
saveButton, new ResetItem("reset", "Reset"));
editCanvas.addMember(form);
@@ -153,19 +169,23 @@ public class RoleEditView extends VLayout {
permissionEditorItem.setPermissions((Set<Permission>)
record.getAttributeAsObject("permissions"));
groupSelector = new
RoleResourceGroupSelector((Collection<ResourceGroup>)
record.getAttributeAsObject("resourceGroups"));
- selectorItem.setCanvas(groupSelector);
+ groupSelectorItem.setCanvas(groupSelector);
+
+
+ subjectSelector = new RoleSubjectSelector((Collection<Subject>)
record.getAttributeAsObject("subjects"));
+ subjectSelectorItem.setCanvas(subjectSelector);
} catch (Throwable t) {
t.printStackTrace();
}
- markForRedraw();
+// markForRedraw();
}
public void editNone() {
message.show();
editCanvas.hide();
- markForRedraw();
+// markForRedraw();
}
public void editNew() {
@@ -174,6 +194,19 @@ public class RoleEditView extends VLayout {
form.setSaveOperationType(DSOperationType.ADD);
editLabel.setContents("Create Role");
+
+
+ editorWindow = new Window();
+ editorWindow.setTitle("Create Role");
+ editorWindow.setWidth(800);
+ editorWindow.setHeight(800);
+ editorWindow.setIsModal(true);
+ editorWindow.setShowModalMask(true);
+ editorWindow.setCanDragResize(true);
+ editorWindow.centerInPage();
+ editorWindow.addItem(this);
+ editorWindow.show();
+
}
@@ -190,7 +223,7 @@ public class RoleEditView extends VLayout {
}
int roleId;
- if (roleBeingEdited != null) {
+ if (roleBeingEdited != null && roleBeingEdited.getId() != null)
{
roleId = roleBeingEdited.getId();
} else {
// new role
@@ -202,13 +235,37 @@ public class RoleEditView extends VLayout {
roleId, groupIds,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
update role's assigned groups",caught);
+ CoreGUI.getErrorHandler().handleError("Failed to
update role's assigned groups", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Updated assigned groups", Message.Severity.Info));
+ }
+ });
+
+ HashSet<Integer> selectedSubjects =
subjectSelector.getSelection();
+ int[] subjectIds = new int[selectedSubjects.size()];
+ i = 0;
+ for (Integer id : selectedSubjects) {
+ subjectIds[i++] = id;
+ }
+
+
+ GWTServiceLookup.getRoleService().setAssignedSubjects(
+ roleId, subjectIds,
+ new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
update role's assigned subjects", caught);
}
public void onSuccess(Void result) {
- // TODO: Implement this method.
+ CoreGUI.getMessageCenter().notify(new
Message("Updated role assigned subjects", Message.Severity.Info));
}
});
+
+ if (editorWindow != null) {
+ editorWindow.destroy();
+ }
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
new file mode 100644
index 0000000..4b8e940
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
@@ -0,0 +1,83 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.admin.roles;
+
+import java.util.Collection;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.gui.coregui.client.admin.users.UsersDataSource;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class RoleSubjectSelector extends AbstractSelector<Subject> {
+
+
+
+ public RoleSubjectSelector(Collection<Subject> subjects) {
+ super();
+ if (subjects != null) {
+ ListGridRecord[] data = (new UsersDataSource()).buildRecords(subjects);
+ setAssigned(data);
+ }
+ }
+
+
+
+ @Override
+ protected DynamicForm getAvailableFilterForm() {
+ return null; // TODO: Implement this method.
+ }
+
+ @Override
+ protected RPCDataSource<Subject> getDataSource() {
+ return new SelectedSubjectsDataSource();
+ }
+
+ @Override
+ protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
+ return null; // TODO: Implement this method.
+ }
+
+
+ public class SelectedSubjectsDataSource extends UsersDataSource {
+
+ @Override
+ public ListGridRecord[] buildRecords(Collection<Subject> subjects) {
+ ListGridRecord[] records = super.buildRecords(subjects);
+ for (ListGridRecord record : records) {
+ if (selection.contains(record.getAttributeAsInt("id"))) {
+ record.setEnabled(false);
+ }
+ }
+ return records;
+ }
+ }
+
+}
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 644b02d..5ddbde2 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
@@ -63,8 +63,7 @@ public class RolesDataSource extends RPCDataSource<Role> {
return INSTANCE;
}
- private RolesDataSource() {
- super("Roles");
+ public RolesDataSource() {
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID");
idDataField.setPrimaryKey(true);
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 dc36ee6..7c0f175 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
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.roles;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -33,7 +35,8 @@ import com.smartgwt.client.widgets.layout.VLayout;
/**
* @author Greg Hinkle
*/
-public class RolesView extends VLayout {
+public class RolesView extends VLayout implements BookmarkableView {
+
@Override
@@ -104,17 +107,12 @@ public class RolesView extends VLayout {
RoleEditView editView = new RoleEditView();
- final Window roleEditor = new Window();
- roleEditor.setTitle("Create Role");
- roleEditor.setWidth(800);
- roleEditor.setHeight(800);
- roleEditor.setIsModal(true);
- roleEditor.setShowModalMask(true);
- roleEditor.setCanDragResize(true);
- roleEditor.centerInPage();
- roleEditor.addItem(editView);
- roleEditor.show();
-
editView.editNew();
}
+
+ public void renderView(ViewPath viewPath) {
+
+ System.out.println("Display role list");
+
+ }
}
\ No newline at end of file
commit 6990d0ed3763c09166b0771429a96cfa9a204010
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 11:50:07 2010 -0400
Exposing subject roles assignments
fixed bugs in set role groups assignments and set role subject assignments
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
index 768b8f4..932ceb8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
@@ -41,4 +41,6 @@ public interface RoleGWTService extends RemoteService {
void setAssignedResourceGroups(int roleId, int[] resourceGroupIds);
void setAssignedSubjects(int roleId, int[] subjectIds);
+
+ void setAssignedSubjectRoles(int subjectId, int[] roleIds);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java
index 1414025..87d9132 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.criteria.RoleCriteria;
import org.rhq.core.domain.util.PageList;
@@ -60,4 +61,9 @@ public class RoleGWTServiceImpl extends AbstractGWTServiceImpl
implements RoleGW
public void setAssignedSubjects(int roleId, int[] subjectIds) {
roleManager.setAssignedSubjects(getSessionSubject(), roleId, subjectIds);
}
+
+
+ public void setAssignedSubjectRoles(int subjectId, int[] roleIds) {
+ roleManager.setAssignedSubjectRoles(getSessionSubject(), subjectId, roleIds);
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
index 30feae3..c53d399 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
@@ -76,7 +76,7 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
private AlertNotificationManagerLocal alertNotificationManager;
/**
- * @see
org.rhq.enterprise.server.authz.RoleManagerLocal#findRolesBySubject(Subject,PageControl)
+ * @see org.rhq.enterprise.server.authz.RoleManagerLocal#findRolesBySubject(int
subjectId,PageControl pageControl)
*/
@SuppressWarnings("unchecked")
// the first param, subject, is not the subject making the request, its the subject
whose roles are to be returned.
@@ -262,6 +262,41 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
return;
}
+
+ @RequiredPermission(Permission.MANAGE_SECURITY)
+ public void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds) {
+
+ Subject subjectToModify = subjectManager.getSubjectById(subjectId); // attach it
+ List<Integer> currentRoles = new ArrayList<Integer>();
+ for (Role role : subjectToModify.getRoles()) {
+ currentRoles.add(role.getId());
+ }
+
+ List<Integer> newRoles = ArrayUtils.wrapInList(roleIds); // members needing
addition
+ newRoles.removeAll(currentRoles);
+ if (newRoles.size() > 0) {
+ int[] newRoleIds = new int[newRoles.size()];
+ int i = 0;
+ for (Integer id : newRoles) {
+ newRoleIds[i++] = id;
+ }
+ addRolesToSubject(subject, subjectId, newRoleIds);
+ }
+
+ List<Integer> extraMembers = new ArrayList<Integer>(currentRoles); //
members needing removal
+ extraMembers.removeAll(ArrayUtils.wrapInList(roleIds));
+ if (extraMembers.size() > 0) {
+ int[] extraMemberIds = new int[extraMembers.size()];
+ int i = 0;
+ for (Integer id : extraMembers) {
+ extraMemberIds[i++] = id;
+ }
+ removeRolesFromSubject(subject, subjectId, extraMemberIds);
+ }
+ }
+
+
+
/**
* @see org.rhq.enterprise.server.authz.RoleManagerLocal#getRoleById(Integer)
*/
@@ -306,7 +341,7 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
}
/**
- * @see
org.rhq.enterprise.server.authz.RoleManagerRemote#findSubjectsByRole(Subject,Integer,PageControl)
+ * @see org.rhq.enterprise.server.authz.RoleManagerLocal#findSubjectsByRole(Integer
roleId,PageControl pageControl)
*/
public PageList<Subject> findSubjectsByRole(Subject subject, Integer roleId,
PageControl pc) {
return findSubjectsByRole(roleId, pc);
@@ -464,13 +499,24 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
List<Integer> newMembers = ArrayUtils.wrapInList(groupIds); // members
needing addition
newMembers.removeAll(currentMembers);
if (newMembers.size() > 0) {
- addResourceGroupsToRole(subject, roleId, groupIds);
+ int[] newMemberInts = new int[newMembers.size()];
+ int i = 0;
+ for (Integer id : newMembers) {
+ newMemberInts[i++] = id;
+ }
+ addResourceGroupsToRole(subject, roleId, newMemberInts);
}
List<Integer> extraMembers = new ArrayList<Integer>(currentMembers);
// members needing removal
extraMembers.removeAll(ArrayUtils.wrapInList(groupIds));
if (extraMembers.size() > 0) {
- removeResourceGroupsFromRole(subject, roleId, groupIds);
+ int[] removeMemberInts = new int[extraMembers.size()];
+ int i = 0;
+ for (Integer id : extraMembers) {
+ removeMemberInts[i++] = id;
+ }
+
+ removeResourceGroupsFromRole(subject, roleId, removeMemberInts);
}
}
@@ -520,13 +566,23 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
List<Integer> newMembers = ArrayUtils.wrapInList(subjectIds); // members
needing addition
newMembers.removeAll(currentMembers);
if (newMembers.size() > 0) {
- addSubjectsToRole(subject, roleId, subjectIds);
+ int[] newMemberIds = new int[newMembers.size()];
+ int i = 0;
+ for (Integer id : newMembers) {
+ newMemberIds[i++] = id;
+ }
+ addSubjectsToRole(subject, roleId, newMemberIds);
}
List<Integer> extraMembers = new ArrayList<Integer>(currentMembers);
// members needing removal
extraMembers.removeAll(ArrayUtils.wrapInList(subjectIds));
if (extraMembers.size() > 0) {
- removeSubjectsFromRole(subject, roleId, subjectIds);
+ int[] removeMemberIds = new int[extraMembers.size()];
+ int i = 0;
+ for (Integer id : extraMembers) {
+ removeMemberIds[i++] = id;
+ }
+ removeSubjectsFromRole(subject, roleId, removeMemberIds);
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java
index 3b6e6e2..496d607 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java
@@ -184,6 +184,9 @@ public interface RoleManagerLocal {
*/
void removeRolesFromSubject(Subject subject, int subjectId, int[] roleIds);
+ void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds);
+
+
void addSubjectsToRole(Subject subject, int roleId, int[] subjectIds);
void removeSubjectsFromRole(Subject subject, int roleId, int[] subjectIds);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java
index e0008cc..4755b36 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java
@@ -166,6 +166,15 @@ public interface RoleManagerRemote {
@WebParam(name = "subjectIds") int[] subjectIds);
/**
+ * Sets the set of roles assigned to a subject. Requires SECURITY_ADMIN
+ * @param subject
+ * @param subjectId
+ * @param roleIds
+ */
+ @WebMethod
+ void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds);
+
+ /**
* Adds the given resource groups to the given role.
*
* @param subject The logged in user's subject.
commit c84efa61e275be2e79b37a994bef5d4b9ef35afe
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 11:48:10 2010 -0400
User create/edit with working role assignments
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
new file mode 100644
index 0000000..e554fef
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
@@ -0,0 +1,86 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.admin.users;
+
+import java.util.Collection;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.authz.Role;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesDataSource;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class SubjectRoleSelector extends AbstractSelector<Role> {
+
+
+ public SubjectRoleSelector(Collection<Role> roles) {
+ super();
+ if (roles != null) {
+ ListGridRecord[] data = (new RolesDataSource()).buildRecords(roles);
+ setAssigned(data);
+ }
+ }
+
+
+
+ @Override
+ protected DynamicForm getAvailableFilterForm() {
+ return null; // TODO: Implement this method.
+ }
+
+ @Override
+ protected RPCDataSource<Role> getDataSource() {
+ return new SelectedRolesDataSource();
+
+ }
+
+ @Override
+ protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
+ return null; // TODO: Implement this method.
+ }
+
+
+ public class SelectedRolesDataSource extends RolesDataSource {
+
+ @Override
+ public ListGridRecord[] buildRecords(Collection<Role> roles) {
+ ListGridRecord[] records = super.buildRecords(roles);
+ for (ListGridRecord record : records) {
+ if (selection.contains(record.getAttributeAsInt("id"))) {
+ record.setEnabled(false);
+ }
+ }
+ return records;
+ }
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java
index 72fc465..38f0e7a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java
@@ -56,7 +56,7 @@ public class SubjectRolesEditorItem extends CanvasItem {
super(name, title);
setShowTitle(false);
setColSpan(2);
- setWidth("90%");
+// setWidth("90%");
setCanvas(new SimpleCollapsiblePanel("Assigned Roles", buildForm()));
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
index edfddbd..334315b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java
@@ -20,13 +20,25 @@ package org.rhq.enterprise.gui.coregui.client.admin.users;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Role;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+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.types.Alignment;
import com.smartgwt.client.types.DSOperationType;
+import com.smartgwt.client.types.TitleOrientation;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.ResetItem;
import com.smartgwt.client.widgets.form.fields.SectionItem;
import com.smartgwt.client.widgets.form.fields.SubmitItem;
@@ -34,8 +46,10 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
+import java.util.HashSet;
import java.util.Set;
/**
@@ -46,28 +60,33 @@ public class UserEditView extends VLayout {
private Label message = new Label("Select a user to edit...");
- private SubjectRolesEditorItem subjectRolesEditorItem ;
+// private SubjectRolesEditorItem subjectRolesEditorItem ;
private VLayout editCanvas;
private HeaderLabel editLabel;
private DynamicForm form;
+ CanvasItem roleSelectionItem;
+
private UsersDataSource dataSource;
private Subject subject;
- @Override
- protected void onInit() {
- super.onInit();
+ private Window editorWindow;
+ private SubjectRoleSelector roleSelector;
+
+ public UserEditView() {
+ dataSource = UsersDataSource.getInstance();
+
setWidth100();
setHeight100();
buildSubjectEditor();
- form.hide();
+ editCanvas.hide();
addMember(message);
- addMember(form);
+ addMember(editCanvas);
}
@@ -75,6 +94,9 @@ public class UserEditView extends VLayout {
form = new DynamicForm();
form.setWidth100();
+ form.setHiliteRequiredFields(true);
+ form.setRequiredTitleSuffix("* :");
+
SectionItem userEditSection = new SectionItem("userEditSection",
"Edit User");
@@ -97,43 +119,109 @@ public class UserEditView extends VLayout {
// form.setField//s(userEditSection);
- dataSource = UsersDataSource.getInstance();
form.setUseAllDataSourceFields(true);
form.setDataSource(dataSource);
- subjectRolesEditorItem = new
SubjectRolesEditorItem("rolesEditor","Assigned Roles");
- TextItem departmentItem = new TextItem("department");
+ this.roleSelectionItem = new CanvasItem("selectRoles", "Select
Roles");
+ this.roleSelectionItem.setTitleOrientation(TitleOrientation.TOP);
+ this.roleSelectionItem.setColSpan(2);
+// roleSelectionItem.setCanvas(new SubjectRoleSelector(null));
- SubmitItem saveButton = new SubmitItem("save", "Save");
+ TextItem departmentItem = new TextItem("department");
+ departmentItem.setRequired(false);
+
+
+ IButton saveButton = new IButton("Save");
+ saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent)
{
+ if (form.validate()) {
+ save();
+ if (editorWindow != null) {
+ editorWindow.destroy();
+ CoreGUI.refresh();
+ }
+ }
+ }
+ });
- saveButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- form.saveData();
- System.out.println("Save is done");
+ IButton resetButton = new IButton("Reset");
+ resetButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent)
{
+ form.reset();
}
});
+ IButton cancelButton = new IButton("Cancel");
+ cancelButton.addClickHandler(new
com.smartgwt.client.widgets.events.ClickHandler() {
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent)
{
+ if (editorWindow != null) {
+ editorWindow.destroy();
+ } else {
+ form.reset();
+ }
+ }
+ });
+
+ HLayout buttonLayout = new HLayout(10);
+ buttonLayout.setAlign(Alignment.CENTER);
+ buttonLayout.addMember(saveButton);
+ buttonLayout.addMember(resetButton);
+ buttonLayout.addMember(cancelButton);
+
+
- ResetItem resetButton = new ResetItem("reset", "Reset");
+ form.setItems(departmentItem, roleSelectionItem);
- form.setItems(departmentItem, subjectRolesEditorItem, saveButton, resetButton);
- return form;
+ editCanvas = new VLayout();
+ editCanvas.addMember(form);
+ editCanvas.addMember(buttonLayout);
+
+ return editCanvas;
}
+ private void save() {
+ final HashSet<Integer> roles = roleSelector.getSelection();
+ form.saveData(new DSCallback() {
+ public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
+
+ int subjectId = Integer.parseInt(new
ListGridRecord(dsRequest.getData()).getAttribute("id"));
+
+ int[] roleIds = new int[roles.size()];
+ int i = 0;
+ for (Integer id : roles) {
+ roleIds[i++] = id;
+ }
+
+ GWTServiceLookup.getRoleService().setAssignedSubjectRoles(subjectId,
roleIds,
+ new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to set
subject role assignments.",caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Succesfully saved new user roles.", Message.Severity.Info));
+ }
+ });
+
+ }
+ });
+ }
+
public void editRecord(Record record) {
-
form.getDataSource().getField("username").setCanEdit(record.getAttribute("id")
== null);
+// form.getDataSource().getField("username").setCanEdit(true );
- subjectRolesEditorItem.setSubject((Subject)
record.getAttributeAsObject("entity"));
- subjectRolesEditorItem.setRoles((Set<Role>)
record.getAttributeAsObject("roles"));
+
+ roleSelector = new SubjectRoleSelector((Set<Role>)
record.getAttributeAsObject("roles"));
+ roleSelectionItem.setCanvas(roleSelector);
try {
form.editRecord(record);
@@ -141,7 +229,7 @@ public class UserEditView extends VLayout {
t.printStackTrace();
}
message.hide();
- form.show();
+ editCanvas.show();
form.setSaveOperationType(DSOperationType.UPDATE);
markForRedraw();
@@ -149,17 +237,36 @@ public class UserEditView extends VLayout {
public void editNone() {
message.show();
- form.hide();
+ editCanvas.hide();
markForRedraw();
}
- public void editNew() {
- form.getDataSource().getField("username").setCanEdit(true);
+ private void editNewInternal() {
subject = new Subject();
ListGridRecord r = dataSource.copyValues(subject);
editRecord(r);
+// form.getDataSource().getField("username").setCanEdit(false);
form.setSaveOperationType(DSOperationType.ADD);
+ editorWindow = new Window();
+ editorWindow.setTitle("Create User");
+ editorWindow.setWidth(800);
+ editorWindow.setHeight(800);
+ editorWindow.setIsModal(true);
+ editorWindow.setShowModalMask(true);
+ editorWindow.setCanDragResize(true);
+ editorWindow.centerInPage();
+ editorWindow.addItem(this);
+ editorWindow.show();
+
+ }
+
+ public static void editNew() {
+ UserEditView editView = new UserEditView();
+ editView.editNewInternal();
+
+
+
}
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 b76788b..578d2b6 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
@@ -70,14 +70,13 @@ public class UsersDataSource extends RPCDataSource<Subject> {
}
- private UsersDataSource() {
- super("Users");
-
+ public UsersDataSource() {
+
DataSourceField idDataField = new DataSourceIntegerField("id",
"ID");
idDataField.setPrimaryKey(true);
idDataField.setCanEdit(false);
- DataSourceTextField usernameField = new DataSourceTextField("username",
"User Name", 100, true);
+ DataSourceTextField usernameField = new DataSourceTextField("name",
"User Name", 100, true);
DataSourceTextField firstName = new DataSourceTextField("firstName",
"First Name", 100, true);
@@ -101,11 +100,11 @@ public class UsersDataSource extends RPCDataSource<Subject> {
passwordVerify.setValidators(passwordsEqualValidator);
- DataSourceTextField email = new DataSourceTextField("email",
"Email Address", 100, true);
+ DataSourceTextField emailAddress = new
DataSourceTextField("emailAddress", "Email Address", 100, true);
- DataSourceTextField phone = new DataSourceTextField("phoneNumber",
"Phone");
+ DataSourceTextField phone = new DataSourceTextField("phoneNumber",
"Phone", 15, false);
- DataSourceTextField department = new DataSourceTextField("department",
"Department");
+ DataSourceTextField department = new DataSourceTextField("department",
"Department", 100, false);
DataSourceField roles = new DataSourceField();
roles.setForeignKey("Roles.id");
@@ -113,7 +112,7 @@ public class UsersDataSource extends RPCDataSource<Subject> {
roles.setMultiple(true);
- setFields(idDataField, usernameField, firstName, lastName, password,
passwordVerify, phone, email, department);
+ setFields(idDataField, usernameField, firstName, lastName, password,
passwordVerify, phone, emailAddress, department);
}
@@ -122,6 +121,7 @@ public class UsersDataSource extends RPCDataSource<Subject> {
SubjectCriteria criteria = new SubjectCriteria();
criteria.setPageControl(getPageControl(request));
+ criteria.fetchRoles(true);
subjectService.findSubjectsByCriteria(criteria, new
AsyncCallback<PageList<Subject>>() {
public void onFailure(Throwable caught) {
@@ -158,7 +158,7 @@ public class UsersDataSource extends RPCDataSource<Subject> {
public void onFailure(Throwable caught) {
// TODO better exceptions so we can set the right validation errors
Map<String, String> errors = new HashMap<String, String>();
- errors.put("username", "A user with this name already
exists.");
+ errors.put("name", "A user with this name already
exists.");
response.setErrors(errors);
// CoreGUI.getErrorHandler().handleError("Failed to create
role",caught);
response.setStatus(RPCResponse.STATUS_VALIDATION_ERROR);
@@ -243,13 +243,13 @@ public class UsersDataSource extends RPCDataSource<Subject> {
public Subject copyValues(ListGridRecord from) {
Subject to = new Subject();
to.setId(from.getAttributeAsInt("id"));
- to.setName(from.getAttributeAsString("username"));
+ to.setName(from.getAttributeAsString("name"));
to.setFirstName(from.getAttributeAsString("firstName"));
to.setLastName(from.getAttributeAsString("lastName"));
to.setFactive(from.getAttributeAsBoolean("factive"));
to.setDepartment(from.getAttributeAsString("department"));
to.setPhoneNumber(from.getAttributeAsString("phoneNumber"));
- to.setEmailAddress(from.getAttributeAsString("email"));
+ to.setEmailAddress(from.getAttributeAsString("emailAddress"));
to.setRoles((Set<Role>) from.getAttributeAsObject("roles"));
return to;
@@ -258,13 +258,13 @@ public class UsersDataSource extends RPCDataSource<Subject> {
public ListGridRecord copyValues(Subject from) {
ListGridRecord to = new ListGridRecord();
to.setAttribute("id", from.getId());
- to.setAttribute("username", from.getName());
+ to.setAttribute("name", from.getName());
to.setAttribute("firstName", from.getFirstName());
to.setAttribute("lastName", from.getLastName());
to.setAttribute("factive", from.getFactive());
to.setAttribute("department", from.getDepartment());
to.setAttribute("phoneNumber", from.getPhoneNumber());
- to.setAttribute("email", from.getEmailAddress());
+ to.setAttribute("emailAddress", from.getEmailAddress());
to.setAttribute("roles", from.getRoles());
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 a574eb2..bc070bf 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
@@ -59,9 +59,9 @@ public class UsersView extends VLayout {
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
- ListGridField nameField = new ListGridField("username",
"Name", 100);
+ ListGridField nameField = new ListGridField("name", "User
Name", 100);
- ListGridField emailField = new ListGridField("email", "Email
Address");
+ ListGridField emailField = new ListGridField("emailAddress",
"Email Address");
table.getListGrid().setFields(idField, nameField, emailField);
@@ -110,19 +110,7 @@ public class UsersView extends VLayout {
public void createUser() {
- UserEditView editView = new UserEditView();
- final Window roleEditor = new Window();
- roleEditor.setTitle("Create User");
- roleEditor.setWidth(800);
- roleEditor.setHeight(800);
- roleEditor.setIsModal(true);
- roleEditor.setShowModalMask(true);
- roleEditor.setCanDragResize(true);
- roleEditor.centerInPage();
- roleEditor.addItem(editView);
- roleEditor.show();
-
- editView.editNew();
+ UserEditView.editNew();
}
}
commit df86722f3ea043ae0169601b8a4c4a31113d004f
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 11:17:07 2010 -0400
Moved the abstract selector to the components package as its a generic utility
component
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
index e1b94f0..aaca7be 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
@@ -35,9 +35,9 @@ import org.rhq.core.domain.bundle.Bundle;
import org.rhq.core.domain.bundle.BundleType;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesDataSource;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
/**
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
new file mode 100644
index 0000000..8b13207
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -0,0 +1,286 @@
+/*
+ * 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.components.selector;
+
+import java.util.HashSet;
+
+import com.google.gwt.user.client.Timer;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.types.DragDataAction;
+import com.smartgwt.client.types.DragTrackerMode;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.widgets.ImgProperties;
+import com.smartgwt.client.widgets.TransferImgButton;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.DoubleClickEvent;
+import com.smartgwt.client.widgets.events.DoubleClickHandler;
+import com.smartgwt.client.widgets.events.KeyPressEvent;
+import com.smartgwt.client.widgets.events.KeyPressHandler;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
+import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
+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.grid.events.RecordDropEvent;
+import com.smartgwt.client.widgets.grid.events.RecordDropHandler;
+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.VLayout;
+import com.smartgwt.client.widgets.layout.VStack;
+
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public abstract class AbstractSelector<T> extends VLayout {
+
+ protected HashSet<Integer> selection = new HashSet<Integer>();
+
+ protected ListGridRecord[] initialSelection;
+
+ protected ListGrid availableGrid;
+ protected ListGrid assignedGrid;
+
+ protected TransferImgButton addButton;
+ protected TransferImgButton removeButton;
+ protected TransferImgButton addAllButton;
+ protected TransferImgButton removeAllButton;
+
+ protected Criteria latestCriteria;
+
+ public AbstractSelector() {
+ }
+
+ public void setAssigned(ListGridRecord[] assignedRecords) {
+ initialSelection = assignedRecords;
+ }
+
+ public HashSet<Integer> getSelection() {
+ return selection;
+ }
+
+ protected abstract DynamicForm getAvailableFilterForm();
+
+ protected abstract RPCDataSource<T> getDataSource();
+
+ protected abstract Criteria getLatestCriteria(DynamicForm availableFilterForm);
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ final DynamicForm availableFilterForm = getAvailableFilterForm();
+
+ if (availableFilterForm != null) {
+ addMember(availableFilterForm);
+ }
+
+ HLayout hlayout = new HLayout();
+ hlayout.setAlign(VerticalAlignment.BOTTOM);
+
+ // LEFT SIDE
+ availableGrid = new ListGrid();
+ availableGrid.setHeight(350);
+ availableGrid.setCanDragRecordsOut(true);
+ availableGrid.setDragTrackerMode(DragTrackerMode.ICON);
+ availableGrid.setTrackerImage(new
ImgProperties("types/Service_up_16.png", 16, 16));
+ availableGrid.setDragDataAction(DragDataAction.COPY);
+ availableGrid.setDataSource(getDataSource());
+ availableGrid.setFetchDelay(700);
+
+ availableGrid.setAutoFetchData(true);
+ availableGrid.setFields(new ListGridField("icon", 50), new
ListGridField("name"));
+
+ hlayout.addMember(availableGrid);
+
+ if (availableFilterForm != null) {
+ availableFilterForm.addItemChangedHandler(new ItemChangedHandler() {
+ public void onItemChanged(ItemChangedEvent itemChangedEvent) {
+ latestCriteria = getLatestCriteria(availableFilterForm);
+
+ Timer t = new Timer() {
+ @Override
+ public void run() {
+ if (latestCriteria != null) {
+ Criteria c = latestCriteria;
+ latestCriteria = null;
+ availableGrid.fetchData(c);
+ }
+ }
+ };
+ t.schedule(500);
+ }
+ });
+ }
+ // CENTER BUTTONS
+ VStack moveButtonStack = new VStack(6);
+ moveButtonStack.setAlign(VerticalAlignment.CENTER);
+ moveButtonStack.setWidth(40);
+
+ addButton = new TransferImgButton(TransferImgButton.RIGHT);
+ addButton.setDisabled(true);
+ removeButton = new TransferImgButton(TransferImgButton.LEFT);
+ removeButton.setDisabled(true);
+ addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL);
+ removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL);
+ removeAllButton.setDisabled(true);
+
+ moveButtonStack.addMember(addButton);
+ moveButtonStack.addMember(removeButton);
+ moveButtonStack.addMember(addAllButton);
+ moveButtonStack.addMember(removeAllButton);
+
+ hlayout.addMember(moveButtonStack);
+
+ // RIGHT SIDE
+
+ assignedGrid = new ListGrid();
+ assignedGrid.setHeight(350);
+ assignedGrid.setCanReorderRecords(true);
+ assignedGrid.setCanDragRecordsOut(true);
+
+ assignedGrid.setCanAcceptDroppedRecords(true);
+ ListGridField iconField = new ListGridField("icon", 50);
+ iconField.setType(ListGridFieldType.ICON);
+ assignedGrid.setFields(iconField, new ListGridField("name"));
+
+ hlayout.addMember(assignedGrid);
+
+ addButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ assignedGrid.transferSelectedData(availableGrid);
+ select(assignedGrid.getSelection());
+ updateButtons();
+ }
+ });
+ removeButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ deselect(assignedGrid.getSelection());
+ assignedGrid.removeSelectedData();
+ updateButtons();
+ }
+ });
+ addAllButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ availableGrid.selectAllRecords();
+ assignedGrid.transferSelectedData(availableGrid);
+ select(availableGrid.getSelection());
+ updateButtons();
+ }
+ });
+ removeAllButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ assignedGrid.selectAllRecords();
+ deselect(assignedGrid.getSelection());
+ assignedGrid.removeSelectedData();
+ updateButtons();
+ }
+ });
+
+ availableGrid.addDoubleClickHandler(new DoubleClickHandler() {
+ public void onDoubleClick(DoubleClickEvent event) {
+ assignedGrid.transferSelectedData(availableGrid);
+ select(assignedGrid.getSelection());
+ updateButtons();
+ }
+ });
+
+ assignedGrid.addDoubleClickHandler(new DoubleClickHandler() {
+ public void onDoubleClick(DoubleClickEvent event) {
+ deselect(assignedGrid.getSelection());
+ assignedGrid.removeSelectedData();
+ updateButtons();
+ }
+ });
+
+ availableGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ updateButtons();
+ }
+ });
+
+ assignedGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent selectionEvent) {
+ updateButtons();
+ }
+ });
+
+ assignedGrid.addKeyPressHandler(new KeyPressHandler() {
+ public void onKeyPress(KeyPressEvent event) {
+ if ("Delete".equals(event.getKeyName())) {
+ deselect(assignedGrid.getSelection());
+ assignedGrid.removeSelectedData();
+ }
+ }
+ });
+
+ assignedGrid.addRecordDropHandler(new RecordDropHandler() {
+ public void onRecordDrop(RecordDropEvent recordDropEvent) {
+ select(recordDropEvent.getDropRecords());
+ }
+ });
+
+ if (initialSelection != null) {
+ assignedGrid.setData(initialSelection);
+ for (ListGridRecord record : initialSelection) {
+ selection.add(record.getAttributeAsInt("id"));
+ }
+ }
+
+ addMember(hlayout);
+
+ }
+
+ protected void updateButtons() {
+ addButton.setDisabled(!availableGrid.anySelected() ||
availableGrid.getTotalRows() == 0);
+ removeButton.setDisabled(!assignedGrid.anySelected() ||
assignedGrid.getTotalRows() == 0);
+ addAllButton.setDisabled(availableGrid.getTotalRows() == 0);
+ removeAllButton.setDisabled(assignedGrid.getTotalRows() == 0);
+ }
+
+ protected void select(ListGridRecord[] records) {
+ availableGrid.deselectAllRecords();
+ for (ListGridRecord record : records) {
+ record.setEnabled(false);
+ selection.add(record.getAttributeAsInt("id"));
+ }
+ }
+
+ protected void deselect(ListGridRecord[] records) {
+ HashSet<Integer> toRemove = new HashSet<Integer>();
+ for (ListGridRecord record : records) {
+ toRemove.add(record.getAttributeAsInt("id"));
+ }
+ selection.removeAll(toRemove);
+
+ for (Integer id : toRemove) {
+ Record r = availableGrid.getDataAsRecordList().find("id", id);
+ if (r != null) {
+ ((ListGridRecord) r).setEnabled(true);
+ }
+ }
+ availableGrid.markForRedraw();
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java
deleted file mode 100644
index d51fe2a..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java
+++ /dev/null
@@ -1,283 +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.selection;
-
-import java.util.HashSet;
-
-import com.google.gwt.user.client.Timer;
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.Record;
-import com.smartgwt.client.types.DragDataAction;
-import com.smartgwt.client.types.DragTrackerMode;
-import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.widgets.ImgProperties;
-import com.smartgwt.client.widgets.TransferImgButton;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.DoubleClickEvent;
-import com.smartgwt.client.widgets.events.DoubleClickHandler;
-import com.smartgwt.client.widgets.events.KeyPressEvent;
-import com.smartgwt.client.widgets.events.KeyPressHandler;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
-import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
-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.grid.events.RecordDropEvent;
-import com.smartgwt.client.widgets.grid.events.RecordDropHandler;
-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.VLayout;
-import com.smartgwt.client.widgets.layout.VStack;
-
-import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-
-/**
- * @author Greg Hinkle
- */
-public abstract class AbstractSelector<T> extends VLayout {
-
- protected HashSet<Integer> selection = new HashSet<Integer>();
-
- protected ListGridRecord[] initialSelection;
-
- protected ListGrid availableGrid;
- protected ListGrid assignedGrid;
-
- protected TransferImgButton addButton;
- protected TransferImgButton removeButton;
- protected TransferImgButton addAllButton;
- protected TransferImgButton removeAllButton;
-
- protected Criteria latestCriteria;
-
- public AbstractSelector() {
- }
-
- public void setAssigned(ListGridRecord[] assignedRecords) {
- initialSelection = assignedRecords;
- }
-
- public HashSet<Integer> getSelection() {
- return selection;
- }
-
- protected abstract DynamicForm getAvailableFilterForm();
-
- protected abstract RPCDataSource<T> getDataSource();
-
- protected abstract Criteria getLatestCriteria(DynamicForm availableFilterForm);
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- final DynamicForm availableFilterForm = getAvailableFilterForm();
-
- addMember(availableFilterForm);
-
- HLayout hlayout = new HLayout();
- hlayout.setAlign(VerticalAlignment.BOTTOM);
-
- // LEFT SIDE
- availableGrid = new ListGrid();
- availableGrid.setHeight(350);
- availableGrid.setCanDragRecordsOut(true);
- availableGrid.setDragTrackerMode(DragTrackerMode.ICON);
- availableGrid.setTrackerImage(new
ImgProperties("types/Service_up_16.png", 16, 16));
- availableGrid.setDragDataAction(DragDataAction.COPY);
- availableGrid.setDataSource(getDataSource());
- availableGrid.setFetchDelay(700);
-
- availableGrid.setAutoFetchData(true);
- availableGrid.setFields(new ListGridField("icon", 50), new
ListGridField("name"));
-
- hlayout.addMember(availableGrid);
-
- availableFilterForm.addItemChangedHandler(new ItemChangedHandler() {
- public void onItemChanged(ItemChangedEvent itemChangedEvent) {
- latestCriteria = getLatestCriteria(availableFilterForm);
-
- Timer t = new Timer() {
- @Override
- public void run() {
- if (latestCriteria != null) {
- Criteria c = latestCriteria;
- latestCriteria = null;
- availableGrid.fetchData(c);
- }
- }
- };
- t.schedule(500);
- }
- });
-
- // CENTER BUTTONS
- VStack moveButtonStack = new VStack(6);
- moveButtonStack.setAlign(VerticalAlignment.CENTER);
- moveButtonStack.setWidth(40);
-
- addButton = new TransferImgButton(TransferImgButton.RIGHT);
- addButton.setDisabled(true);
- removeButton = new TransferImgButton(TransferImgButton.LEFT);
- removeButton.setDisabled(true);
- addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL);
- removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL);
- removeAllButton.setDisabled(true);
-
- moveButtonStack.addMember(addButton);
- moveButtonStack.addMember(removeButton);
- moveButtonStack.addMember(addAllButton);
- moveButtonStack.addMember(removeAllButton);
-
- hlayout.addMember(moveButtonStack);
-
- // RIGHT SIDE
-
- assignedGrid = new ListGrid();
- assignedGrid.setHeight(350);
- assignedGrid.setCanReorderRecords(true);
- assignedGrid.setCanDragRecordsOut(true);
-
- assignedGrid.setCanAcceptDroppedRecords(true);
- ListGridField iconField = new ListGridField("icon", 50);
- iconField.setType(ListGridFieldType.ICON);
- assignedGrid.setFields(iconField, new ListGridField("name"));
-
- hlayout.addMember(assignedGrid);
-
- addButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- assignedGrid.transferSelectedData(availableGrid);
- select(assignedGrid.getSelection());
- updateButtons();
- }
- });
- removeButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- deselect(assignedGrid.getSelection());
- assignedGrid.removeSelectedData();
- updateButtons();
- }
- });
- addAllButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- availableGrid.selectAllRecords();
- assignedGrid.transferSelectedData(availableGrid);
- select(availableGrid.getSelection());
- updateButtons();
- }
- });
- removeAllButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- assignedGrid.selectAllRecords();
- deselect(assignedGrid.getSelection());
- assignedGrid.removeSelectedData();
- updateButtons();
- }
- });
-
- availableGrid.addDoubleClickHandler(new DoubleClickHandler() {
- public void onDoubleClick(DoubleClickEvent event) {
- assignedGrid.transferSelectedData(availableGrid);
- select(assignedGrid.getSelection());
- updateButtons();
- }
- });
-
- assignedGrid.addDoubleClickHandler(new DoubleClickHandler() {
- public void onDoubleClick(DoubleClickEvent event) {
- deselect(assignedGrid.getSelection());
- assignedGrid.removeSelectedData();
- updateButtons();
- }
- });
-
- availableGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent selectionEvent) {
- updateButtons();
- }
- });
-
- assignedGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent selectionEvent) {
- updateButtons();
- }
- });
-
- assignedGrid.addKeyPressHandler(new KeyPressHandler() {
- public void onKeyPress(KeyPressEvent event) {
- if ("Delete".equals(event.getKeyName())) {
- deselect(assignedGrid.getSelection());
- assignedGrid.removeSelectedData();
- }
- }
- });
-
- assignedGrid.addRecordDropHandler(new RecordDropHandler() {
- public void onRecordDrop(RecordDropEvent recordDropEvent) {
- select(recordDropEvent.getDropRecords());
- }
- });
-
- if (initialSelection != null) {
- assignedGrid.setData(initialSelection);
- for (ListGridRecord record : initialSelection) {
- selection.add(record.getAttributeAsInt("id"));
- }
- }
-
- addMember(hlayout);
-
- }
-
- protected void updateButtons() {
- addButton.setDisabled(!availableGrid.anySelected() ||
availableGrid.getTotalRows() == 0);
- removeButton.setDisabled(!assignedGrid.anySelected() ||
assignedGrid.getTotalRows() == 0);
- addAllButton.setDisabled(availableGrid.getTotalRows() == 0);
- removeAllButton.setDisabled(assignedGrid.getTotalRows() == 0);
- }
-
- protected void select(ListGridRecord[] records) {
- availableGrid.deselectAllRecords();
- for (ListGridRecord record : records) {
- record.setEnabled(false);
- selection.add(record.getAttributeAsInt("id"));
- }
- }
-
- protected void deselect(ListGridRecord[] records) {
- HashSet<Integer> toRemove = new HashSet<Integer>();
- for (ListGridRecord record : records) {
- toRemove.add(record.getAttributeAsInt("id"));
- }
- selection.removeAll(toRemove);
-
- for (Integer id : toRemove) {
- Record r = availableGrid.getDataAsRecordList().find("id", id);
- if (r != null) {
- ((ListGridRecord) r).setEnabled(true);
- }
- }
- availableGrid.markForRedraw();
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
index 5c3c007..7731067 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
@@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index a692a2f..1274e14 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
commit 84d3db34645fd839d4d47e2cf4d84b40164d0fdb
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 11:14:54 2010 -0400
Fix platform view for ResourceDatasoruce changes
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
index eb14394..ea30685 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
@@ -53,6 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
/**
* @author Greg Hinkle
@@ -70,13 +71,21 @@ public class PlatformPortletView extends ListGrid implements Portlet
{
public PlatformPortletView() {
+ setWidth100();
+ setHeight100();
+
+ prefetch();
+
+
setShowRecordComponents(true);
setShowRecordComponentsByCell(true);
+ setUseAllDataSourceFields(true);
+ setAutoFitData(Autofit.HORIZONTAL);
+
setDataSource(new PlatformMetricDataSource(this));
- setInitialCriteria(new Criteria("category",
ResourceCategory.PLATFORM.name()));
+ setInitialCriteria(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name()));
- prefetch();
}
@@ -104,9 +113,7 @@ public class PlatformPortletView extends ListGrid implements Portlet
{
private void buildUI() {
- setAutoFetchData(true);
- setUseAllDataSourceFields(true);
- setAutoFitData(Autofit.HORIZONTAL);
+
ListGridField nameField = new ListGridField("name", "Name",
250);
nameField.setCellFormatter(new CellFormatter() {
@@ -126,6 +133,7 @@ public class PlatformPortletView extends ListGrid implements Portlet
{
hideField("currentAvailability");
+ this.fetchData(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(),
ResourceCategory.PLATFORM.name()));
}
commit 4c30f50c40e619a5b8c4a08ff2d5d87b1877029d
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 27 10:49:41 2010 -0400
Fixing typo
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js
index 4993638..95997f2 100644
--- a/etc/cli-scripts/reset_conn_props.js
+++ b/etc/cli-scripts/reset_conn_props.js
@@ -52,7 +52,7 @@ function loadPluginConfigDef(resourceTypeName, pluginName) {
}
function findResourcesByTypeAndPlugin(resourceType, plugin) {
- var critiera = ResourceCriteria();
+ var criteria = ResourceCriteria();
criteria.addFilterResourceTypeName(resourceType);
criteria.addFilterPluginName(plugin);
criteria.fetchPluginConfiguration(true);
commit d02ea18eddc4dcee9f98d22bf9361a0d6cc46ee1
Merge: 91f0e1a... d7f4757...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 27 10:48:23 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 01dcd82e397ad2019489b69d883a89ec1c7341d9
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Tue Jul 27 10:43:18 2010 -0400
Global recent operations view
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
index b6f6702..de4bd1e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java
@@ -54,6 +54,9 @@ public class OperationHistoryDataSource extends
RPCDataSource<ResourceOperationH
DataSourceTextField nameField = new
DataSourceTextField("operationName");
addField(nameField);
+ DataSourceTextField resourceField = new
DataSourceTextField("resource");
+ addField(resourceField);
+
DataSourceTextField statusField = new DataSourceTextField("status");
addField(statusField);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
index a54d0ac..ad2d156 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java
@@ -38,6 +38,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.events.DoubleClickEvent;
import com.smartgwt.client.widgets.events.DoubleClickHandler;
+import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
@@ -66,6 +67,8 @@ public class OperationHistoryView extends VLayout {
}
public OperationHistoryView() {
+ setWidth100();
+ setHeight100();
}
public OperationHistoryView(Resource resource) {
@@ -90,12 +93,24 @@ public class OperationHistoryView extends VLayout {
table.getListGrid().getField("status").setWidth(100);
table.getListGrid().getField("startedTime").setWidth(120);
+ if (this.resource == null) {
+ table.getListGrid().getField("resource").setWidth(300);
+ table.getListGrid().getField("resource").setCellFormatter(new
CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int
i1) {
+ Resource res = (Resource) o;
+ return "<a href=\"#Resource/" + res.getId() +
"\">" + res.getName() + "</a>";
+ }
+ });
+ } else {
+ table.getListGrid().hideField("resource");
+ }
table.getListGrid().addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
public void onRecordDoubleClick(RecordDoubleClickEvent
recordDoubleClickEvent) {
ResourceOperationHistory history = (ResourceOperationHistory)
recordDoubleClickEvent.getRecord().getAttributeAsObject("entity");
- showDetails(history); }
+ showDetails(history);
+ }
});
@@ -108,27 +123,29 @@ public class OperationHistoryView extends VLayout {
});
- final Menu operationMenu = new Menu();
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.operations),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- for (final OperationDefinition od :
type.getOperationDefinitions()) {
- MenuItem menuItem = new MenuItem(od.getDisplayName());
- operationMenu.addItem(menuItem);
- menuItem.addClickHandler(new ClickHandler() {
- public void onClick(MenuItemClickEvent event) {
- new OperationCreateWizard(resource,
od).startOperationWizard();
- }
- });
+ if (resource != null) {
+ final Menu operationMenu = new Menu();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.operations),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ for (final OperationDefinition od :
type.getOperationDefinitions()) {
+ MenuItem menuItem = new MenuItem(od.getDisplayName());
+ operationMenu.addItem(menuItem);
+ menuItem.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent event) {
+ new OperationCreateWizard(resource,
od).startOperationWizard();
+ }
+ });
+ }
}
- }
- });
+ });
- IMenuButton operationsButton = new IMenuButton("Run Operation",
operationMenu);
- operationsButton.setShowMenuBelow(false);
- table.addExtraWidget(operationsButton);
+ IMenuButton operationsButton = new IMenuButton("Run Operation",
operationMenu);
+ operationsButton.setShowMenuBelow(false);
+ table.addExtraWidget(operationsButton);
+ }
addMember(table);
commit c0c02b6a66332cd2c5d0605830ec2e69b59afc61
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 27 14:21:37 2010 +0200
This query is no longer needed
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index bae5e26..8f4e45f 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -709,20 +709,6 @@ import org.rhq.core.domain.util.Summary;
+ " r.parentResource = NULL, " // takes resources out of the
hierarchy, so we don't have to change ResourceSyncInfo logic
+ " r.resourceKey = 'deleted' " //
+ " WHERE r.id IN (:resourceIds ) "), //
- @NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION, query =
"" //
- + "UPDATE Resource r " //
- + " SET r.inventoryStatus = :status, " //
- + " r.agent = NULL, " //
- + " r.parentResource = NULL, " // takes resources out of the
hierarchy, so we don't have to change ResourceSyncInfo logic
- + " r.resourceKey = 'deleted' " //
- + " WHERE r.id = :resourceId " //
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource p1
WHERE p1.id = :resourceId) "
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN
rr.parentResource.parentResource p2 WHERE p2.id = :resourceId) "
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN
rr.parentResource.parentResource.parentResource p3 WHERE p3.id = :resourceId) "
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN
rr.parentResource.parentResource.parentResource.parentResource p4 WHERE p4.id =
:resourceId) "
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN
rr.parentResource.parentResource.parentResource.parentResource.parentResource p5 WHERE
p5.id = :resourceId) "
- + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN
rr.parentResource.parentResource.parentResource.parentResource.parentResource.parentResource
p6 WHERE p6.id = :resourceId) "
- + " "), //
@NamedQuery(name = Resource.QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION, query =
"" //
+ "SELECT r.id FROM Resource AS r WHERE r.agent IS NULL"),
@@ -866,7 +852,6 @@ public class Resource implements Comparable<Resource>,
Serializable {
public static final String QUERY_FIND_DESCENDENTS_BY_TYPE_AND_NAME =
"Resource.findDescendentsByTypeAndName";
public static final String QUERY_FIND_DESCENDENTS =
"Resource.findDescendents";
public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK =
"Resource.markResourcesForAsyncDeletionQuick";
- public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION =
"Resource.markResourcesForAsyncDeletion";
public static final String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION =
"Resource.findResourcesMarkedForAsyncDeletion";
public static final String QUERY_RESOURCE_REPORT =
"Resource.findResourceReport";
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java
b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java
index b1328e9..a60fa33 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java
@@ -22,7 +22,9 @@
*/
package org.rhq.core.domain.test;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -149,8 +151,10 @@ public class QueriesTest extends AbstractEJB3Test {
tx.begin();
EntityManager entityManager = getEntityManager();
- Query q =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
- q.setParameter("resourceId", 1);
+ Query q =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK);
+ List<Integer> ids = new ArrayList<Integer>();
+ ids.add(1);
+ q.setParameter("resourceIds", ids);
q.setParameter("status", InventoryStatus.UNINVENTORIED);
q.executeUpdate();
}
commit d7f47571f3e41951eb97fd07c5890c59a938d88a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jul 26 15:42:16 2010 -0400
check for -1 returned by getSize
diff --git
a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
index e4bc366..07fcad5 100644
---
a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
+++
b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
@@ -174,7 +174,8 @@ public class AntBundleServerPluginComponent implements
ServerPluginComponent, Bu
public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception {
if (this.recipeName.equalsIgnoreCase(entry.getName())) {
// this should be safe downcast, recipes are not that big
- ByteArrayOutputStream out = new ByteArrayOutputStream((int)
entry.getSize());
+ int contentSize = (int) entry.getSize();
+ ByteArrayOutputStream out = new ByteArrayOutputStream((contentSize >
0) ? contentSize : 32768);
StreamUtil.copy(stream, out, false);
this.recipe = new String(out.toByteArray());
out = null; // no need for this anymore, help out GC
commit d1677f06b7640443632869da21cfdb30b1f7e68a
Author: hudson auto <wnstb(a)yahoo.com>
Date: Mon Jul 26 14:20:36 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 97ef93b..eda9133 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 3b26a39..bc7965b 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 688d5e4..2cf950b 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 2ddc4af..ee81a94 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index a27161b..d177f9e 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 4589d42..a51f92b 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d7559da..7ff6a10 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index dc75145..e0ced84 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b535306..0911918 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index f72bc2f..d47d4c8 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 967b21a..e1ce7ef 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index fbab223..2e58102 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 996cd8f..7739177 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 8a95e51..eeb7e81 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index b0c399b..7aad64c 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 37bcda5..bc41dc5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 3fc1344..d9f1c1c 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 127b06f..8942239 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 9f09ff1..8b9da9c 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 95b62cd..611eb9d 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index c1c297f..798a8ca 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index 6be8d8d..df05645 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index 709bfe3..acbe21f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 8d33ef0..1beadca 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index bf6a9a4..0c529ba 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index d9f0c15..a794cd6 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index 9bdfc91..aa880be 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 77a5685..3b0dbb8 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index dff57e7..05187c7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 6008df1..e86ef41 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 68d51c0..910b617 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 444256d..2ea73ee 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index f09e063..2c98817 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index b4d2146..3fd11e8 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index c063211..bf15866 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index ddff575..79fdc38 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index ea1eb7b..dd5bc18 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 363ac0a..c0973f3 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index b4751ba..a62fee8 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index b0a0c3b..3193539 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 6d35aed..e69bfbc 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index cbd7334..ca33bb7 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 6398092..af75153 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index ebac52c..09839b8 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 30efb5a..73f405e 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 8464662..4c44f10 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 40ab2a2..0033d1b 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 0c5fb51..61965f2 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 3f1e165..7451668 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 25917cc..0ac61d3 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 40c066f..5a78451 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 9832288..2b16f4a 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 26e985a..e4ab9b2 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 14e52de..a6cba32 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index e160aa6..9c7cc74 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index 344a215..ebdd3da 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index bb1abdd..06c8981 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index 2458369..aa278b8 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 4ac7f43..0cc2084 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 21ccc78..14738d0 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index 366d1aa..d056f74 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index d992e29..28dc9b1 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index c5e5ae2..a0721a9 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index ffac476..5d327ee 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c475e5e..c37598e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 5fa4596..cc160c9 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 88db42f..700a6af 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 51580cd..915106a 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index a140f5d..d920440 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 9119492..d5aaad5 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 714ad7a..30889f7 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index e01b311..b79645d 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index aef1858..f7cf265 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 4f87dfe..acb08ef 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 157119f..7dd0fde 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index eed10bc..65fa7b8 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 9a9c2f0..853c020 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index befe74c..a0ade77 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index ac9b3f6..b9ed2b3 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index 61f4e11..b3846fa 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 684e8e3..443e524 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index a9874cc..ac9885a 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 5a02364..d0c9053 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 3d937e7..06ae2ae 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index e915511..1acdb0f 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index f65ad5a..39c75da 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index aadd8bf..97b83b0 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32c52d..85d6105 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 639838b..283ab6a 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index beb98f2..5a4466c 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index fdb0991..a190dcd 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8fb6fee..8f4e675 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 9411143..0d41574 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 0ec4d51..7719b14 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index f5106f0..2d9d715 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index b637f0d..3579496 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 55c3b49..41df1b8 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 9de8802..205d5b0 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 9ee6ac3..e299efa 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index 93e847c..b3d5e87 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index a6af192..bc96ae3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5b243a9..2235687 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 5e2dc43..7ff85bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0.GA</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 2f8ffb1fae72d6006470834f0aaf69028c37cdb7
Author: hudson auto <wnstb(a)yahoo.com>
Date: Mon Jul 26 14:19:11 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index eda9133..97ef93b 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index bc7965b..3b26a39 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 2cf950b..688d5e4 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index ee81a94..2ddc4af 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index d177f9e..a27161b 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index a51f92b..4589d42 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 7ff6a10..d7559da 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..dc75145 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 0911918..b535306 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d47d4c8..f72bc2f 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e1ce7ef..967b21a 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 2e58102..fbab223 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 7739177..996cd8f 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index eeb7e81..8a95e51 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7aad64c..b0c399b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index bc41dc5..37bcda5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index d9f1c1c..3fc1344 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 8942239..127b06f 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 8b9da9c..9f09ff1 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 611eb9d..95b62cd 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 798a8ca..c1c297f 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index df05645..6be8d8d 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index acbe21f..709bfe3 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 1beadca..8d33ef0 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 0c529ba..bf6a9a4 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index a794cd6..d9f0c15 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index aa880be..9bdfc91 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3b0dbb8..77a5685 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 05187c7..dff57e7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index e86ef41..6008df1 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 910b617..68d51c0 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 2ea73ee..444256d 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 2c98817..f09e063 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 3fd11e8..b4d2146 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index bf15866..c063211 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 79fdc38..ddff575 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index dd5bc18..ea1eb7b 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c0973f3..363ac0a 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index a62fee8..b4751ba 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3193539..b0a0c3b 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index e69bfbc..6d35aed 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index ca33bb7..cbd7334 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index af75153..6398092 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 09839b8..ebac52c 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 73f405e..30efb5a 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 4c44f10..8464662 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 0033d1b..40ab2a2 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 61965f2..0c5fb51 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 7451668..3f1e165 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 0ac61d3..25917cc 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 5a78451..40c066f 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 2b16f4a..9832288 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index e4ab9b2..26e985a 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index a6cba32..14e52de 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9c7cc74..e160aa6 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index ebdd3da..344a215 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 06c8981..bb1abdd 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index aa278b8..2458369 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 0cc2084..4ac7f43 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 14738d0..21ccc78 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index d056f74..366d1aa 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 28dc9b1..d992e29 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index a0721a9..c5e5ae2 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 5d327ee..ffac476 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c37598e..c475e5e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index cc160c9..5fa4596 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 700a6af..88db42f 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 915106a..51580cd 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index d920440..a140f5d 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d5aaad5..9119492 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 30889f7..714ad7a 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index b79645d..e01b311 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f7cf265..aef1858 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index acb08ef..4f87dfe 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 7dd0fde..157119f 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 65fa7b8..eed10bc 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 853c020..9a9c2f0 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a0ade77..befe74c 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b9ed2b3..ac9b3f6 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index b3846fa..61f4e11 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 443e524..684e8e3 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ac9885a..a9874cc 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d0c9053..5a02364 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 06ae2ae..3d937e7 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 1acdb0f..e915511 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 39c75da..f65ad5a 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 97b83b0..aadd8bf 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 85d6105..f32c52d 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 283ab6a..639838b 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 5a4466c..beb98f2 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index a190dcd..fdb0991 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8f4e675..8fb6fee 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 0d41574..9411143 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 7719b14..0ec4d51 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 2d9d715..f5106f0 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3579496..b637f0d 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 41df1b8..55c3b49 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 205d5b0..9de8802 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index e299efa..9ee6ac3 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index b3d5e87..93e847c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index bc96ae3..a6af192 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 2235687..5b243a9 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 7ff85bb..5e2dc43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.GA</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit fe26d6a1480246d9e9d42b38f3076e1c9cd45c5d
Merge: fe24a0b... d3ecc7e...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 26 13:25:25 2010 -0400
Merge branch 'master' into master-jay
commit fe24a0b7e6dc3573a90c58e7f6047757ad3160dc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 26 10:57:21 2010 -0400
add some minor protection against concurrent repo sync by disabling button
while one gui initiated sync is running.
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 7f30b4d..a636bae 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
@@ -193,7 +193,7 @@
<h:commandButton rendered="${mode ne 'edit'}"
value="EDIT"
action="#{RepoDetailsUIBean.edit}" alt="Edit"
styleClass="buttonmed" id="editButton" />
- <h:commandButton rendered="${mode ne 'edit'}"
+ <h:commandButton rendered="${mode ne 'edit' and not
RepoDetailsUIBean.currentlySyncing}"
value="SYNCHRONIZE" action="#{RepoDetailsUIBean.sync}"
alt="Synchronize" styleClass="buttonmed"
id="syncButton" />
<h:commandButton rendered="#{RepoDetailsUIBean.currentlySyncing}"
commit 5efcc6d725c133800b7535a1346e54971adf5f7f
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Jul 26 13:05:24 2010 -0400
disable tests, and publishing of Maven artifacts for enterprise builds
diff --git a/release.sh b/release.sh
index 9cb9e06..fd595a2 100644
--- a/release.sh
+++ b/release.sh
@@ -177,9 +177,11 @@ fi
PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors
-Penterprise,dist,release"
-if [ "$MODE" = "test" ]; then
- MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
-fi
+# TODO: We may eventually want to reenable tests for production releases.
+#if [ "$MODE" = "test" ]; then
+# MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
+#fi
+MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
if [ "$RELEASE_TYPE" = "enterprise" ]; then
MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
fi
@@ -193,7 +195,8 @@ if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6"
fi
-if [ "$MODE" = "production" ]; then
+# TODO: We may eventually want to reenable publishing of enterprise artifacts.
+if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE"
= "community" ]; then
MAVEN_RELEASE_PERFORM_GOAL="deploy"
else
MAVEN_RELEASE_PERFORM_GOAL="install"
commit 52476886663a8d99b94e1b9e15246fe6ea173c22
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jul 26 12:28:14 2010 -0400
Fix debug error message due to unsupported clipping model on breadcrumb pane
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
index 29377cd..17e9237 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
@@ -41,7 +41,7 @@ public class BreadcrumbTrailPane extends ToolStrip {
setWidth100();
setMembersMargin(15);
- setOverflow(Overflow.CLIP_V);
+ setOverflow(Overflow.HIDDEN);
}
commit fb105f6293db80686f723048c9931b1c90889c58
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 26 12:23:34 2010 -0400
Commentedt out test class until
https://bugzilla.redhat.com/show_bug.cgi?id=618314 gets resolved.
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
index f3ce761..890aa10 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
@@ -18,6 +18,7 @@
*/
package org.rhq.plugins.apache;
+/*
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
@@ -42,6 +43,7 @@ import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+*/
/**
* The unit tests for the JON Apache plugin.
@@ -51,6 +53,7 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet;
public class ApachePluginTest {
private static final String PLUGIN_NAME = "Apache";
+ /*
@BeforeSuite
public void start() {
//System.out.println("java.class.path=" +
System.getProperty("java.class.path"));
@@ -150,4 +153,5 @@ public class ApachePluginTest {
ApachePluginTest pluginTest = new ApachePluginTest();
pluginTest.start();
}
+ */
}
\ No newline at end of file
commit e38b19c067b0d880f48d257bdea7c6522e089295
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jul 26 12:22:03 2010 -0400
Fix bug with overlaying one top pane on another
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 7dfd9df..8fb1f0b 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
@@ -49,6 +49,7 @@ import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupTopView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView;
import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
@@ -262,6 +263,8 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
canvas = new InventoryView();
} else if (breadcrumbName.equals("Resource")) {
canvas = new ResourceView();
+ } else if (breadcrumbName.equals("ResourceGroup")) {
+ canvas = new ResourceGroupTopView();
} else if (breadcrumbName.equals("Dashboard")) {
canvas = new DashboardsView();
} else if (breadcrumbName.equals("Bundles")) {
@@ -308,9 +311,9 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
public static void setContent(Canvas newContent) {
Canvas contentCanvas = Canvas.getById(CONTENT_CANVAS_ID);
- if (contentCanvas.getChildren().length > 0)
- contentCanvas.getChildren()[0].destroy();
-
+ for (Canvas child : contentCanvas.getChildren()) {
+ child.destroy();
+ }
if (newContent != null) {
content = newContent;
contentCanvas.addChild(newContent);
commit 5e8b7a6ae42e61fe9fe2a617baf473c857a188ef
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jul 26 12:21:41 2010 -0400
Initial resource group tree view work
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 4e9f17a..a8bd44a 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
@@ -281,7 +281,9 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
public void renderView(ViewPath viewPath) {
- // TODO: Implement this method.
+
+ Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
+
if (viewPath.isEnd()) {
// default
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
index 37c492c..3aade28 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -22,15 +22,19 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
-import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView;
/**
* @author Greg Hinkle
@@ -39,10 +43,10 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
private Canvas contentCanvas;
- private Resource currentResource;
+ private ResourceGroup currentGroup;
//private Resource resourcePlatform;
-// private ResourceTreeView treeView;
+ private ResourceGroupTreeView treeView;
private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
@@ -60,15 +64,15 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
setHeight100();
-// treeView = new ResourceTreeView();
-// addMember(treeView);
+ treeView = new ResourceGroupTreeView();
+ addMember(treeView);
contentCanvas = new Canvas();
addMember(contentCanvas);
// created above
-// detailView = new ResourceDetailView();
+ detailView = new ResourceGroupDetailView();
// treeView.addResourceSelectListener(detailView);
@@ -128,13 +132,19 @@ public class ResourceGroupTopView extends HLayout implements
BookmarkableView {
viewPath.getViewPath().add(new ViewId("Overview"));
}
- Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
+ Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentResource == null || currentResource.getId() != resourceId) {
+
+
+
+ if (currentGroup == null || currentGroup.getId() != groupId) {
// setSelectedResource(resourceId, viewPath);
-// this.treeView.renderView(viewPath);
+ this.treeView.setSelectedGroup(groupId);
+
+
+
viewPath.next();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
new file mode 100644
index 0000000..ef5406d
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java
@@ -0,0 +1,130 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tree.Tree;
+import com.smartgwt.client.widgets.tree.TreeGrid;
+import com.smartgwt.client.widgets.tree.TreeNode;
+
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ResourceGroupTreeView extends VLayout {
+
+
+ private int groupId;
+
+ private TreeGrid treeGrid;
+
+ public ResourceGroupTreeView() {
+ setWidth(250);
+ setHeight100();
+ }
+
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+
+ this.treeGrid = new TreeGrid();
+ this.treeGrid.setWidth100();
+ this.treeGrid.setHeight100();
+ treeGrid.setShowRoot(true);
+
+ addMember(this.treeGrid);
+
+
+ }
+
+ public void setSelectedGroup(int groupId) {
+ this.groupId = groupId;
+ GWTServiceLookup.getClusterService().getClusterTree(groupId,
+ new AsyncCallback<ClusterFlyweight>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
tree", caught);
+ }
+
+ public void onSuccess(ClusterFlyweight result) {
+ loadTree(result);
+ }
+ });
+
+
+ }
+
+
+
+
+ private void loadTree(ClusterFlyweight root) {
+
+
+ TreeNode rootNode = new TreeNode(root.getName());
+
+ loadTree(rootNode, root);
+
+ Tree tree = new Tree();
+ tree.setRoot(rootNode);
+
+ treeGrid.setData(tree);
+ markForRedraw();
+
+ }
+
+ public void loadTree(TreeNode parent, ClusterFlyweight parentNode) {
+ if (!parentNode.getChildren().isEmpty()) {
+
+ ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
+
+ HashMap<Integer,TreeNode> typeNodes = new HashMap<Integer,
TreeNode>();
+
+
+ for (ClusterFlyweight child : parentNode.getChildren()) {
+
+
+
+
+
+ TreeNode node = new TreeNode(child.getName());
+ childNodes.add(node);
+
+ if (child.getChildren().isEmpty()) {
+ node.setIsFolder(false);
+ } else {
+ node.setIsFolder(true);
+ loadTree(node, child);
+ }
+ }
+ parent.setChildren(childNodes.toArray(new TreeNode[childNodes.size()]));
+ }
+ }
+}
commit 929c3cd23ad8e2f1bfb8340483b2365af987b038
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 26 11:07:24 2010 -0400
Fix compile error in ws test code due to removal of getConfiguration
remote.
diff --git
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
index 7c80417..0ee5348 100644
---
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
+++
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
@@ -77,15 +77,6 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
// TODO: verify configuration details
- // Test get configuration
- Configuration configRetrieved = WEBSERVICE_REMOTE.getConfiguration(
- // JaxbConfiguration configRetrieved =
- // WEBSERVICE_REMOTE.getConfiguration(
- subject, configuration.getId());
- assertNotNull("Configuration was not located.", configRetrieved);
- assertEquals("Configuration information was not correct.",
configuration.getVersion(), configRetrieved
- .getVersion());
-
boolean isUpdating =
WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.getId());
assertFalse("Config should not be in process of modification.",
isUpdating);
@@ -95,7 +86,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
// JaxbConfiguration pluginConfig =
// WEBSERVICE_REMOTE.getPluginConfiguration(
subject, resource.getId());
- assertNotNull("Configuration was not located.", configRetrieved);
+ assertNotNull("Configuration was not located.", pluginConfig);
assertNotNull("The property definition map should not be null.",
pluginConfig.getProperties());
// pluginConfig.getPropertyListOrPropertySimpleOrPropertyMap());
}
commit 0bfff55f068fae0d325b66ce0fc6cd1566542dc8
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jul 26 13:09:20 2010 +0200
BZ 617718 - follow the OID -> oid change in the last commit as property names are
case specific.
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
index ef3af1d..082e706 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
@@ -32,7 +32,7 @@ public class SnmpInfo {
public static SnmpInfo load(Configuration configuration) {
String host = configuration.getSimpleValue("host", null); // required
String port = configuration.getSimpleValue("port", "162");
- String oid = configuration.getSimpleValue("OID", null); // required
+ String oid = configuration.getSimpleValue("oid", null); // required
return new SnmpInfo(host, port, oid);
}
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
index 2a52279..4389779 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
@@ -467,7 +467,7 @@ public class SnmpTrapSender implements PDUFactory {
return "SNMP is not enabled.";
}
- String baseOid = alertParameters.getSimpleValue("OID",null);
+ String baseOid = alertParameters.getSimpleValue("oid",null);
// TODO add a request id and a timestamp
commit d3ecc7eacb94dc4d97ee6ff96d3193c1d4f0d2b4
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Sun Jul 25 21:57:04 2010 +0200
BZ 617577 - avoid doing the expensive recursive query again. Also the call to getTree
is not needed.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index 52420f4..bae5e26 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -283,7 +283,7 @@ import org.rhq.core.domain.util.Summary;
+ " JOIN res.currentAvailability a " //
+ " JOIN res.resourceType rt LEFT JOIN rt.subCategory " //
+ " WHERE res.parentResource = :parent " //
- + " AND rt.id IN ( :resourceTypeIds ) " //
+ + " AND rt.id IN ( :resourceTypeIds ) " //
+ " AND res.inventoryStatus = :inventoryStatus GROUP BY
res.parentResource, rt"),
@NamedQuery(name = Resource.QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS,
query = "" //
+ "SELECT res " //
@@ -451,7 +451,7 @@ import org.rhq.core.domain.util.Summary;
+ " WHERE rg.id = :groupId " //
+ " AND res.inventoryStatus = 'COMMITTED' "),
@NamedQuery(name = Resource.QUERY_GET_AVAILABLE_RESOURCES_FOR_REPO, query =
"" //
- + " SELECT res " //
+ + " SELECT res " //
+ " FROM Resource AS res " //
+ " WHERE res.id NOT IN " //
+ " ( SELECT rc.resource.id " //
@@ -702,6 +702,13 @@ import org.rhq.core.domain.util.Summary;
+ " OR r.id IN (SELECT rr.id FROM Resource rr WHERE
rr.parentResource.parentResource.parentResource.parentResource.parentResource.id =
:resourceId) "
+ " OR r.id IN (SELECT rr.id FROM Resource rr WHERE
rr.parentResource.parentResource.parentResource.parentResource.parentResource.parentResource.id
= :resourceId) "
+ " "),
+ @NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK, query =
"" //
+ + "UPDATE Resource r " //
+ + " SET r.inventoryStatus = :status, " //
+ + " r.agent = NULL, " //
+ + " r.parentResource = NULL, " // takes resources out of the
hierarchy, so we don't have to change ResourceSyncInfo logic
+ + " r.resourceKey = 'deleted' " //
+ + " WHERE r.id IN (:resourceIds ) "), //
@NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION, query =
"" //
+ "UPDATE Resource r " //
+ " SET r.inventoryStatus = :status, " //
@@ -858,6 +865,7 @@ public class Resource implements Comparable<Resource>,
Serializable {
public static final String QUERY_FIND_DESCENDENTS_BY_TYPE_AND_NAME =
"Resource.findDescendentsByTypeAndName";
public static final String QUERY_FIND_DESCENDENTS =
"Resource.findDescendents";
+ public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK =
"Resource.markResourcesForAsyncDeletionQuick";
public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION =
"Resource.markResourcesForAsyncDeletion";
public static final String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION =
"Resource.findResourcesMarkedForAsyncDeletion";
@@ -969,7 +977,7 @@ public class Resource implements Comparable<Resource>,
Serializable {
@ManyToMany(mappedBy = "implicitResources", fetch = FetchType.LAZY)
private Set<ResourceGroup> implicitGroups = new
HashSet<ResourceGroup>();
- // bulk delete
+ // bulk delete
@ManyToMany(mappedBy = "explicitResources", fetch = FetchType.LAZY)
private Set<ResourceGroup> explicitGroups = new
HashSet<ResourceGroup>();
@@ -1209,16 +1217,16 @@ public class Resource implements Comparable<Resource>,
Serializable {
/**
* This method should be called whenever we want the agent to recognize that
something about this resource has
* changed on the server-side that requires synchronization to take place.
- *
+ *
* We don't want to modify the mtime every time this resource is updated/merged;
this field has special meaning
* to the agent-side representation of this resource in the plugin container; if the
server-side mtime is later
* than the agent-side, the agent thinks this resource has been modified in some way
and will start a workflow that
* causes synchronization to happen; however, the agent only cares about specific
types of updates to the resource:
- *
+ *
* - plugin configuration changes
* - measurement schedule updates
* - basic fields modified such as name, description, inventory status, etc
- *
+ *
* For a list of changes that the agent cares about, see
InventoryManager.mergeResource(Resource, Resource)
*/
@@ -1715,7 +1723,7 @@ public class Resource implements Comparable<Resource>,
Serializable {
}
public void writeExternalAgent(ObjectOutput out) throws IOException {
- // Note that a Resource may have been constructed with id only. Check for
uninitialized fields.
+ // Note that a Resource may have been constructed with id only. Check for
uninitialized fields.
out.writeInt(id);
out.writeUTF(uuid);
out.writeUTF((null == resourceKey) ? "" : resourceKey);
@@ -1785,7 +1793,7 @@ public class Resource implements Comparable<Resource>,
Serializable {
// It is assumed that the object is clean of Hibernate proxies (i.e.
HibernateDetachUtility has been run if necessary)
public void writeExternalRemote(ObjectOutput out) throws IOException {
- // Note that a Resource may have been constructed with id only. Check for
uninitialized fields.
+ // Note that a Resource may have been constructed with id only. Check for
uninitialized fields.
out.writeInt(id);
out.writeUTF(uuid);
out.writeUTF(resourceKey);
@@ -1805,10 +1813,10 @@ public class Resource implements Comparable<Resource>,
Serializable {
out.writeObject(resourceConfiguration);
out.writeObject(pluginConfiguration);
out.writeObject(agent);
- // not supplied by remote: alertDefinitions
+ // not supplied by remote: alertDefinitions
// not supplied by remote: resourceConfigurationUpdates
// not supplied by remote: pluginConfigurationUpdates
- // making a copy reduces chances of ConcurrentModificationException in a thread
iterating the original
+ // making a copy reduces chances of ConcurrentModificationException in a thread
iterating the original
out.writeObject((null == implicitGroups) ? null : new
LinkedHashSet<ResourceGroup>(implicitGroups));
// making a copy reduces chances of ConcurrentModificationException in a thread
iterating the original
out.writeObject((null == explicitGroups) ? null : new
LinkedHashSet<ResourceGroup>(explicitGroups));
@@ -1823,7 +1831,7 @@ public class Resource implements Comparable<Resource>,
Serializable {
out.writeObject(availability);
out.writeObject(currentAvailability);
out.writeObject(resourceErrors);
- // not supplied by remote: eventSources
+ // not supplied by remote: eventSources
out.writeObject(productVersion);
}
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 3687b5e..3dfc87f 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
@@ -229,7 +229,8 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
@SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public List<Integer> uninventoryResource(Subject user, int resourceId) {
- Resource resource = resourceManager.getResourceTree(resourceId, true);
+// Resource resource = resourceManager.getResourceTree(resourceId, true);
+ Resource resource = entityManager.find(Resource.class,resourceId);
if (resource == null) {
log.info("Delete resource not possible, as resource with id [" +
resourceId + "] was not found");
return Collections.emptyList(); // Resource not found. TODO give a nice
message to the user
@@ -293,10 +294,28 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
i = j;
}
- Query markDeletedQuery =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
- markDeletedQuery.setParameter("resourceId", resourceId);
- markDeletedQuery.setParameter("status",
InventoryStatus.UNINVENTORIED);
- int resourcesDeleted = markDeletedQuery.executeUpdate();
+ // QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION is an expensive recursive query
+ // But luckily we have already (through such a recursive query above) determined
the doomed resources
+// Query markDeletedQuery =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
+// markDeletedQuery.setParameter("resourceId", resourceId);
+// markDeletedQuery.setParameter("status",
InventoryStatus.UNINVENTORIED);
+// int resourcesDeleted = markDeletedQuery.executeUpdate();
+
+ i = 0;
+ int resourcesDeleted = 0;
+ while (i < toBeDeletedResourceIds.size()) {
+ int j = i + 1000;
+ if (j > toBeDeletedResourceIds.size())
+ j = toBeDeletedResourceIds.size();
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
+
+
+ Query markDeletedQuery =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK);
+ markDeletedQuery.setParameter("resourceIds", idsToDelete);
+ markDeletedQuery.setParameter("status",
InventoryStatus.UNINVENTORIED);
+ resourcesDeleted+= markDeletedQuery.executeUpdate();
+ i = j;
+ }
if (resourcesDeleted != toBeDeletedResourceIds.size()) {
log.error("Tried to uninventory " + toBeDeletedResourceIds.size()
commit 6e03907d4f26b130f37426e50cdd4df0d111d344
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Sun Jul 25 14:29:57 2010 +0200
BZ 604034 - use a newer version of jaxb impl to avoid issues with maven repos.
diff --git a/pom.xml b/pom.xml
index ab4b267..306bbff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
<properties>
<!-- explictly specify a default encoding to avoid relying on the LANG env var
being set correctly -->
- <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
+ <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<rhq.groupId>org.rhq</rhq.groupId>
<rhq.product.name>RHQ</rhq.product.name>
@@ -52,7 +52,7 @@
<product.salesEmail>sales(a)rhq-project.org</product.salesEmail>
<product.supportEmail>info(a)rhq-project.org</product.supportEmail>
<product.version>${project.version}</product.version>
-
<
product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</pr...
+
<
product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</pr...
<doUpdate>false</doUpdate>
@@ -81,7 +81,7 @@
<hibernate-entitymanager.version>3.2.1.GA</hibernate-entitymanager.version>
<i18nlog.version>1.0.10</i18nlog.version>
<jaxb-api.version>2.1</jaxb-api.version>
- <jaxb-impl.version>2.1.6</jaxb-impl.version>
+ <jaxb-impl.version>2.1.9</jaxb-impl.version>
<jsf-api.version>1.2_14</jsf-api.version>
<jsf-impl.version>1.2_14</jsf-impl.version>
<ojdbc5.version>11.2.0.1.0</ojdbc5.version>
commit a1ab2bc79180820bfa05ec8284a03830c5c7f0e0
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Sun Jul 25 14:28:49 2010 +0200
Start rewriting to handle blocks of questions.
diff --git
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
index 649cbf5..6e72405 100644
---
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
+++
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
@@ -21,8 +21,11 @@ package org.rhq.helpers.bundleGen;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Locale;
import java.lang.reflect.Method;
+import java.util.Map;
import java.util.ResourceBundle;
import javax.xml.parsers.DocumentBuilder;
@@ -78,100 +81,126 @@ public class XmlQuestionsReader {
Document doc = builder.parse(input);
Element root = doc.getDocumentElement(); // <questions>
- NodeList questionNodes = root.getChildNodes();// "question"
+ NodeList questionNodes = root.getChildNodes();// "question|block"
for (int i = 0; i < questionNodes.getLength(); i++ ) {
Node node = questionNodes.item(i);
if (node instanceof Element) {
- Element question = (Element)node;
- String prop = question.getAttribute("prop");
- String type = question.getAttribute("type");
- if (type.equals(""))
- type="string";
- String aIf = question.getAttribute("if"); // TODO implement
-
- if (!isValidType(type)) {
- System.err.println("Type " + type + " is invalid in
" + question );
- return;
+ String nodeName = node.getNodeName();
+ if (nodeName.equals("question")) {
+ Element question = (Element)node;
+ String res = handleQuestion(reader,question,lang);
+ String prop = question.getAttribute("prop");
+ String type = question.getAttribute("type");
+ fillObject(props,prop,type,res);
}
- Element text = getElementForLang(question,"text",lang);
- NodeList prefillNodes =
question.getElementsByTagName("prefill");
- String prefill = null;
- if (prefillNodes.getLength()>0) {
- prefill = prefillNodes.item(0).getTextContent();
- }
- Element helpNode = getElementForLang(question,"help",lang);
- String help = null;
- if (helpNode!=null) {
- help = helpNode.getTextContent();
- }
-
- boolean isBool = false;
- System.out.print(text.getTextContent());
- if ("bool".equals(type)) {
- isBool = true;
- System.out.print(resourceBundle.getString("yes.no"));
- }
- if (prefill!=null) {
- System.out.print("[" + prefill + "]");
- }
-
- String answer;
- boolean helpRequested = false;
- do {
- helpRequested = false;
- System.out.print(": ");
- answer = reader.readLine();
- if (answer.startsWith("?")) {
- helpRequested = true;
- if (help!=null) {
- System.out.println(help);
- }
- else
-
System.out.println(resourceBundle.getString("no.help.available"));
- }
-
- } while (helpRequested);
-
- String setterName = "set" + caps(prop);
- Method setter;
- if (isBool)
- setter = Props.class.getMethod(setterName, Boolean.TYPE);
- else
- setter = Props.class.getMethod(setterName, String.class);
-
- if (isBool) {
- String yesString = resourceBundle.getString("yes.key");
- if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString)) {
- setter.invoke(props, true);
- }
- }
- else if ("string".equals(type)) {
- // If only return pressed and we have a prefill, use this.
- if (prefill!= null && answer.length()==0) {
- setter.invoke(props,prefill);
- }
- else {
- if (!answer.startsWith("\n") &&
!answer.startsWith("\r") && !(answer.length() == 0))
- setter.invoke(props,answer);
- }
- }
- else {
+ else if (nodeName.equals("block")) {
+// Map res = handleBlock(reader,node,props,lang);
// TODO
}
}
+ }
+ }
+ catch (Exception e ) {
+ e.printStackTrace();
+ }
+ }
+ private void handleBlock(BufferedReader reader, Node node, Props props, String lang)
throws Exception
+ {
+ Element block = (Element)node;
+ String repeat = block.getAttribute("repeat");
+ if (repeat==null || repeat.isEmpty())
+ repeat="one";
+ int repeatCount = 0;
- }
+// for () {
+// // first ask the standalone question and decide from there
+// Element question = (Element)
block.getElementsByTagName("question").item(0);
+//
+//
+// // Now loop over the questions
+// NodeList questions = block.getElementsByTagName("question");
+// for (int i = 1; i < questions.getLength(); i++) {
+// Node qnode = questions.item(i);
+// // handleQuestion(reader,qnode,props,lang); TODO
+// }
+// }
+ }
+
+ /**
+ * Handle <question> elements
+ * @param reader
+ * @param question
+ * @param lang
+ * @throws Exception
+ */
+ private String handleQuestion(BufferedReader reader, Element question,String lang)
throws Exception
+ {
+ String type = question.getAttribute("type");
+ if (type.equals(""))
+ type="string";
+
+ if (!isValidType(type)) {
+ System.err.println("Type " + type + " is invalid in " +
question );
+ return null;
+ }
+ Element text = getElementForLang(question,"text",lang);
+ NodeList prefillNodes = question.getElementsByTagName("prefill");
+ String prefill = null;
+ if (prefillNodes.getLength()>0) {
+ prefill = prefillNodes.item(0).getTextContent();
}
- catch (Exception e) {
- throw e;
+ Element helpNode = getElementForLang(question,"help",lang);
+ String help = null;
+ if (helpNode!=null) {
+ help = helpNode.getTextContent();
}
+ System.out.print(text.getTextContent());
+ if ("bool".equals(type)) {
+ System.out.print(resourceBundle.getString("yes.no"));
+ }
+ if (prefill!=null) {
+ System.out.print("[" + prefill + "]");
+ }
+
+ String answer;
+ boolean helpRequested = false;
+ do {
+ helpRequested = false;
+ System.out.print(": ");
+ answer = reader.readLine();
+ if (answer.startsWith("?")) {
+ helpRequested = true;
+ if (help!=null) {
+ System.out.println(help);
+ }
+ else
+
System.out.println(resourceBundle.getString("no.help.available"));
+ }
+
+ } while (helpRequested);
+
+ if (type.equals("bool")) {
+ String yesString = resourceBundle.getString("yes.key");
+ if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString))
+ return Boolean.TRUE.toString();
+ else
+ return Boolean.FALSE.toString();
+ }
+ else {
+ if (prefill!= null && answer.length()==0) {
+ return prefill;
+ }
+ else
+ return answer;
+ }
}
+
/**
* Search for an element <i>tagWanted</i> within parent. If multiple
* elements are present, use the one with the matching <i>lang</i>.
@@ -201,6 +230,26 @@ public class XmlQuestionsReader {
}
return noLang;
}
+
+
+ private void fillObject(Object target, String prop, String type, String res) throws
Exception {
+
+ String setterName = "set" + caps(prop);
+ Method setter;
+ Class clazz = target.getClass();
+ Method[] methods = clazz.getDeclaredMethods();
+
+ if ("bool".equals(type)) {
+ setter = clazz.getMethod(setterName, Boolean.TYPE);
+ setter.invoke(target, Boolean.valueOf(res));
+ }
+ else {
+ setter = clazz.getMethod(setterName, String.class);
+ setter.invoke(target,res);
+ }
+ }
+
+
/**
* Returns true if the passed type is a valid data type of the properties (not for a
single
* property).
@@ -209,7 +258,7 @@ public class XmlQuestionsReader {
*/
private boolean isValidType(String type) {
- if ("bool".equals(type) || "string".equals(type) ||
"resourceCategory".equals(type))
+ if ("bool".equals(type) || "string".equals(type))
return true;
return false;
diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd
b/modules/helpers/bundleGen/src/main/resources/questions.dtd
index ed3981a..13fe665 100644
--- a/modules/helpers/bundleGen/src/main/resources/questions.dtd
+++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd
@@ -1,6 +1,6 @@
<!-- root of all evil -->
-<!ELEMENT questions (question+)>
+<!ELEMENT questions (question|block)+>
<!-- one single question -->
<!ELEMENT question (text+, options?, prefill?, help*)>
@@ -8,11 +8,18 @@
<!ATTLIST question
prop CDATA #REQUIRED
type (bool|string) #IMPLIED
- if (true|false) #IMPLIED
strip (start|end|outer|all) #IMPLIED
+<!-- a block of questions asked together -->
+<!-- First a question is displayed to introduce the block -->
+<!-- And to check if the remainder should be asked at all -->
+<!-- Then questions are asked -->
+<!ELEMENT block (question,question+)>
+<!ATTLIST block
+ repeat (one|multi) #IMPLIED
+>
<!-- The text to ask -->
<!ELEMENT text (#PCDATA)>
commit c3b143eec4f67612e868a947f370f1dd7bfc7dee
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Jul 24 21:25:03 2010 -0400
[BZ 617718] Changing property name to lower case since plugin is accessing wrong
property name
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
index 6308f86..32ec521 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -73,7 +73,7 @@
<alert-configuration>
<c:simple-property name="host" type="string"
required="true" description="Trap target host"/>
<c:simple-property name="port" type="integer"
required="false" default="162" description="Trap target
port"/>
- <c:simple-property name="OID" type="string"
required="true" description="OID of the trap sent"/>
+ <c:simple-property name="oid" type="string"
required="true" description="OID of the trap sent"/>
</alert-configuration>
</alert-plugin>
commit 853e45e0e7d4723e8eab3eef3cb478c9a5d8ff82
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 23 18:24:35 2010 -0400
BZ-617773: only show resource-level alert definitions in the subsystem view
* resource disambiguator doesn't support mixed results
** it can only disambiguate a list of resource-specific items
* thus, change subsystem view to suppress alert templates / group alert definitions
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index 770c211..23ecc44 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -135,7 +135,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
+ " SELECT new
org.rhq.core.domain.alert.composite.AlertDefinitionComposite" //
+ " ( ad, parent.id, parent.name ) " //
+ " FROM AlertDefinition ad " //
- + "LEFT JOIN ad.resource res " //
+ + " JOIN ad.resource res " //
+ "LEFT JOIN res.parentResource parent " //
/*
* as much as i want to (for efficiency of the query [namely roundtrips to the
db]) i can't use fetching here
@@ -156,7 +156,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
+ " SELECT new
org.rhq.core.domain.alert.composite.AlertDefinitionComposite" //
+ " ( ad, parent.id, parent.name ) " //
+ " FROM AlertDefinition ad " //
- + "LEFT JOIN ad.resource res " //
+ + " JOIN ad.resource res " //
+ "LEFT JOIN res.parentResource parent " //
/*
* as much as i want to (for efficiency of the query [namely roundtrips to the
db]) i can't use fetching here
commit 1f9e0e91b5ca6c5be60bf12197e17ec95aac6160
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 23 14:01:52 2010 -0400
LDAP module needs to be REQUISITE
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
index 76977e6..caec439 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
@@ -142,7 +142,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
try {
validateLdapOptions(configOptions);
ace = new AppConfigurationEntry(LdapLoginModule.class.getName(),
- AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT,
configOptions);
+ AppConfigurationEntry.LoginModuleControlFlag.REQUISITE,
configOptions);
this.log.info("Enabling RHQ LDAP JAAS Provider");
configEntries.add(ace);
} catch (NamingException e) {
commit 0949f2865546081d2c49d503a28f6a0cc2976987
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 23 13:34:38 2010 -0400
BZ 595482 - add new JDBC login module to prohibit LDAP look if there is already an RHQ
principal defined in the database
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
index 2c98b0a..76977e6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
@@ -37,8 +37,8 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.core.jaas.JDBCLoginModule;
+import org.rhq.enterprise.server.core.jaas.JDBCPrincipalCheckLoginModule;
import org.rhq.enterprise.server.core.jaas.LdapLoginModule;
-import org.rhq.enterprise.server.core.jaas.TempSessionLoginModule;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
@@ -113,6 +113,8 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
this.log.info("Enabling RHQ JDBC JAAS Provider");
configEntries.add(ace);
+ /*
+ * NOT USED ANYMORE
// to support the need for authenticating temporary session passwords, add a
login module that can do that
// we set an empty set of config options, but if we need to, we can store the
config items
// in the RHQ_config_props table, which would allow the GUI to modify them
(just in case we want to add that capability)
@@ -122,10 +124,20 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, new
HashMap<String, String>());
this.log.info("Enabled the temporary session login module");
configEntries.add(ace);
+ *
+ */
String provider = conf.getProperty(RHQConstants.JAASProvider);
if ((provider != null) &&
provider.equals(RHQConstants.LDAPJAASProvider)) {
+ // this is a "gatekeeper" that only allows us to go to LDAP if
there is no principal in the DB
+ configOptions = getJdbcOptions(conf);
+ ace = new
AppConfigurationEntry(JDBCPrincipalCheckLoginModule.class.getName(),
+ AppConfigurationEntry.LoginModuleControlFlag.REQUISITE,
configOptions);
+ this.log.info("Enabling RHQ JDBC-2 JAAS Provider");
+ configEntries.add(ace);
+
+ // this is the LDAP module that checks the LDAP for auth
configOptions = getLdapOptions(conf);
try {
validateLdapOptions(configOptions);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
new file mode 100644
index 0000000..f56747a
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
@@ -0,0 +1,150 @@
+/*
+ * 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.server.core.jaas;
+
+import java.security.acl.Group;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.FailedLoginException;
+import javax.security.auth.login.LoginException;
+import javax.sql.DataSource;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.jboss.security.SimpleGroup;
+import org.jboss.security.Util;
+import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
+
+import org.rhq.enterprise.server.RHQConstants;
+
+/**
+ * A JDBC login module that passes only if there is no principal in the database.
+ */
+
+public class JDBCPrincipalCheckLoginModule extends UsernamePasswordLoginModule {
+ private Log log = LogFactory.getLog(JDBCPrincipalCheckLoginModule.class);
+ private String dsJndiName;
+ private String principalsQuery = "SELECT password FROM RHQ_PRINCIPAL WHERE
principal=?";
+
+ @Override
+ public void initialize(Subject subj, CallbackHandler handler, Map shared_state, Map
opts) {
+ super.initialize(subj, handler, shared_state, opts);
+
+ dsJndiName = (String) opts.get("dsJndiName");
+ if (dsJndiName == null) {
+ dsJndiName = RHQConstants.DATASOURCE_JNDI_NAME;
+ }
+
+ Object tmpQuery = opts.get("principalsQuery");
+
+ if (tmpQuery != null) {
+ principalsQuery = tmpQuery.toString();
+ }
+
+ log.debug("dsJndiName=" + dsJndiName);
+ log.debug("prinipalsQuery=" + principalsQuery);
+ }
+
+ private Properties getProperties() {
+ Properties props = new Properties();
+
+ props.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
+ props.put("java.naming.provider.url",
"jnp://localhost:1099");
+ props.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
+
+ return props;
+ }
+
+ /**
+ * @see org.jboss.security.auth.spi.UsernamePasswordLoginModule#getUsersPassword()
+ */
+ @Override
+ protected String getUsersPassword() throws LoginException {
+ String username = getUsername();
+ String password = getUsernameAndPassword()[1]; // what did the user enter?
+ Connection conn = null;
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+
+ try {
+ Properties props = getProperties();
+ InitialContext ctx = new InitialContext(props);
+ DataSource ds = (DataSource) ctx.lookup(dsJndiName);
+ conn = ds.getConnection();
+
+ ps = conn.prepareStatement(principalsQuery);
+ ps.setString(1, username);
+ rs = ps.executeQuery();
+ if (rs.next() == true) {
+ throw new FailedLoginException("username found in principals - do
not continue");
+ }
+
+ password = Util.createPasswordHash("MD5", "base64", null,
null, password); // return back the string entered by the user as a hash
+ } catch (NamingException ex) {
+ throw new LoginException(ex.toString(true));
+ } catch (SQLException ex) {
+ throw new LoginException(ex.toString());
+ } finally {
+ if (rs != null) {
+ try {
+ rs.close();
+ } catch (Exception e) {
+ }
+ }
+
+ if (ps != null) {
+ try {
+ ps.close();
+ } catch (Exception e) {
+ }
+ }
+
+ if (conn != null) {
+ try {
+ conn.close();
+ } catch (Exception ex) {
+ }
+ }
+ }
+
+ return password;
+ }
+
+ /**
+ * @see org.jboss.security.auth.spi.AbstractServerLoginModule#getRoleSets()
+ */
+ @Override
+ protected Group[] getRoleSets() throws LoginException {
+ SimpleGroup roles = new SimpleGroup("Roles");
+
+ //roles.addMember( new SimplePrincipal( "some user" ) );
+ Group[] roleSets = { roles };
+ return roleSets;
+ }
+}
\ No newline at end of file
commit 5a91a74f90333a1efbc8ec69b8b86bab7ae4a919
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:53:13 2010 -0400
Admin view tree icons
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 20ebafc..c2ebe9b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -125,9 +125,17 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
Tree tree = new Tree();
final TreeNode manageUsersNode = new TreeNode("Manage Users");
+ manageUsersNode.setIcon("global/User_16.png");
+
final TreeNode manageRolesNode = new TreeNode("Manage Roles");
+ manageRolesNode.setIcon("global/Role_16.png");
+
final TreeNode discoveryQueue = new TreeNode("Auto Discovery Queue");
+ discoveryQueue.setIcon("global/Recent_16.png");
+
final TreeNode remoteAgentInstall = new TreeNode("Remote Agent
Install");
+ remoteAgentInstall.setIcon("global/Agent_16.png");
+
tree.setRoot(new TreeNode("security",
manageUsersNode,
manageRolesNode,
@@ -277,7 +285,7 @@ public class AdministrationView extends HLayout implements
BookmarkableView {
TreeGrid treeGrid = treeGrids.get(name);
if (name.equals(section)) {
- treeGrid.setSelectedPaths(page);
+// treeGrid.setSelectedPaths(page);
} else {
treeGrid.deselectAllRecords();
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png
new file mode 100644
index 0000000..225bde6
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png
new file mode 100644
index 0000000..61e1d68
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png
new file mode 100644
index 0000000..e5e3bae
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png
new file mode 100644
index 0000000..c8daa89
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png
new file mode 100644
index 0000000..7e15427
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png
new file mode 100644
index 0000000..4a31006
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png
new file mode 100644
index 0000000..9b75027
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png
new file mode 100644
index 0000000..39ddbd8
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png
new file mode 100644
index 0000000..e10a3b9
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png
new file mode 100644
index 0000000..4f2e1b1
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png
new file mode 100644
index 0000000..9d6916f
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png
new file mode 100644
index 0000000..5dfcada
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png
new file mode 100644
index 0000000..c86cd80
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png
new file mode 100644
index 0000000..a147dde
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png differ
commit 6f028fdaca0e2c698f4fcc013d1e6acba5c817f0
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:52:11 2010 -0400
Expose "cluster" service features which will be the center of all future
group, autogroup and recursive group views
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
new file mode 100644
index 0000000..a156804
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
@@ -0,0 +1,99 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.resource.group.composite;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.rhq.core.domain.resource.group.ClusterKey;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ClusterFlyweight implements Serializable {
+
+ private int groupId;
+
+ private ClusterKeyFlyweight clusterKey;
+
+ private String name;
+
+ private List<ClusterFlyweight> children;
+
+ private int members;
+
+ public ClusterFlyweight() {
+ }
+
+ public ClusterFlyweight(int groupId) {
+ this.groupId = groupId;
+ }
+
+ public ClusterFlyweight(ClusterKeyFlyweight clusterKey) {
+ this.clusterKey = clusterKey;
+ }
+
+ public void addResource(String s) {
+ if (name == null) {
+ name = s;
+ } else if (!name.equals(s)) {
+ name = "?";
+ }
+ }
+
+ public int getMembers() {
+ return members;
+ }
+
+ public void setMembers(int members) {
+ this.members = members;
+ }
+
+ public void setChildren(List<ClusterFlyweight> clusterKeyFlyweights) {
+ this.children = clusterKeyFlyweights;
+ }
+
+ public int getGroupId() {
+ return groupId;
+ }
+
+ public ClusterKeyFlyweight getClusterKey() {
+ return clusterKey;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public List<ClusterFlyweight> getChildren() {
+ return children;
+ }
+
+
+
+
+
+
+
+
+}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java
new file mode 100644
index 0000000..6d3d488
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java
@@ -0,0 +1,62 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.resource.group.composite;
+
+import java.io.Serializable;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ClusterKeyFlyweight implements Serializable {
+
+ private int resourceTypeId;
+ private String resourceKey;
+
+ public ClusterKeyFlyweight() {
+ }
+
+ public ClusterKeyFlyweight(int resourceTypeId, String resourceKey) {
+ this.resourceTypeId = resourceTypeId;
+ this.resourceKey = resourceKey;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ClusterKeyFlyweight node = (ClusterKeyFlyweight) o;
+
+ if (resourceTypeId != node.resourceTypeId) return false;
+ if (resourceKey != null ? !resourceKey.equals(node.resourceKey) :
node.resourceKey != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = resourceTypeId;
+ result = 31 * result + (resourceKey != null ? resourceKey.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java
new file mode 100644
index 0000000..c052c58
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java
@@ -0,0 +1,79 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.server.resource.cluster;
+
+import java.util.List;
+
+import javax.ejb.Remote;
+
+import org.jetbrains.annotations.Nullable;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+
+/**
+ * @author Greg Hinkle
+ */
+@Remote
+public interface ClusterManagerRemote {
+
+ /**
+ * Given a cluster key create a backing group.
+ * @param clusterKey
+ * @param addResources If true, the new group will be assigned the current resources
defined by the clusterKey.
+ * Otherwise no resources will be assigned to the new group.
+ * @throws IllegalArgumentException if a backing group exists for this clusterKey
+ */
+ ResourceGroup createAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey,
boolean addResources);
+
+ /**
+ * Return the backing group for the supplied cluster key. Resource membership will
represent the resources
+ * last set for the group and may not reflect current membership. See {@link
#getAutoClusterResources(String)}
+ * @param clusterKey
+ * @return The backing group, or null if the key does not have a backing group.
+ */
+ @Nullable
+ ResourceGroup getAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey);
+
+ /**
+ * Given a cluster key get the auto cluster resource membership. The membership is
always determined
+ * at call time, regardless of whether a backing group exists. To get the backing
group, if it exists,
+ * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}.
+ */
+ List<Resource> getAutoClusterResources(Subject subject, ClusterKey
clusterKey);
+
+
+ /**
+ * Load a fully populated tree view of the "cluster nodes" for a cluster
group. These are
+ * summary nodes and do not contain the actual resources in the group.
+ *
+ * @param subject
+ * @param groupId
+ * @return
+ */
+ ClusterFlyweight getClusterTree(Subject subject, int groupId);
+
+}
commit 35ec18e4ddeae903986bf56c453a90907f7a6f6d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:50:32 2010 -0400
A new build profile that will build just domain,server and coregui (useful for core
api development)
diff --git a/modules/pom.xml b/modules/pom.xml
index e363555..ef98301 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -72,6 +72,22 @@
</profile>
<profile>
+ <id>model</id>
+ <activation>
+ <property>
+ <name>model</name>
+ </property>
+ </activation>
+ <modules>
+ <module>core/domain</module>
+ <module>enterprise/server/jar</module>
+ <module>enterprise/gui/coregui</module>
+ </modules>
+ </profile>
+
+
+
+ <profile>
<id>plugins</id>
<activation>
<property>
commit 6b757721e31722740c602563b39ea3e54e5cbefe
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:49:28 2010 -0400
Expose "cluster" service features which will be the center of all future
group, autogroup and recursive group views
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index a3db099..f26acb7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -71,5 +71,6 @@
<servlet path="/ContentGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
<servlet path="/DashboardGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/>
<servlet path="/EventGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/>
+ <servlet path="/ClusterGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.ClusterGWTServiceImpl"/>
</module>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
new file mode 100644
index 0000000..20d32d5
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
@@ -0,0 +1,68 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.gwt;
+
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+
+/**
+ * @author Greg Hinkle
+ */
+public interface ClusterGWTService extends RemoteService {
+
+
+ /**
+ * Given a cluster key create a backing group.
+ * @param clusterKey
+ * @param addResources If true, the new group will be assigned the current resources
defined by the clusterKey.
+ * Otherwise no resources will be assigned to the new group.
+ * @throws IllegalArgumentException if a backing group exists for this clusterKey
+ */
+ ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean
addResources);
+
+ /**
+ * Return the backing group for the supplied cluster key. Resource membership will
represent the resources
+ * last set for the group and may not reflect current membership. See {@link
#getAutoClusterResources(String)}
+ * @param clusterKey
+ * @return The backing group, or null if the key does not have a backing group.
+ */
+ ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey);
+
+ /**
+ * Given a cluster key get the auto cluster resource membership. The membership is
always determined
+ * at call time, regardless of whether a backing group exists. To get the backing
group, if it exists,
+ * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}.
+ */
+ List<Resource> getAutoClusterResources(ClusterKey clusterKey);
+
+
+ ClusterFlyweight getClusterTree(int groupId);
+
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index b0cc8d9..9965430 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -120,6 +120,10 @@ public class GWTServiceLookup {
return secure(EventGWTServiceAsync.Util.getInstance());
}
+ public static ClusterGWTServiceAsync getClusterService() {
+ return secure(ClusterGWTServiceAsync.Util.getInstance());
+ }
+
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java
new file mode 100644
index 0000000..f3f8323
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java
@@ -0,0 +1,69 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.server.gwt;
+
+import java.util.List;
+
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+import org.rhq.enterprise.gui.coregui.client.gwt.ClusterGWTService;
+import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
+import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ClusterGWTServiceImpl extends AbstractGWTServiceImpl implements
ClusterGWTService {
+
+
+ private ClusterManagerLocal clusterManager = LookupUtil.getClusterManager();
+
+
+ public ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean
addResources) {
+ return SerialUtility.prepare(
+ clusterManager.createAutoClusterBackingGroup(getSessionSubject(),
clusterKey, addResources),
+ "ClusterGWTServiceImpl.createAutoClusterBackingGroup");
+ }
+
+ public ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey) {
+ return SerialUtility.prepare(
+ clusterManager.getAutoClusterBackingGroup(getSessionSubject(),
clusterKey),
+ "ClusterGWTServiceImpl.getAutoClusterBackingGroup");
+ }
+
+ public List<Resource> getAutoClusterResources(ClusterKey clusterKey) {
+ return SerialUtility.prepare(
+ clusterManager.getAutoClusterResources(getSessionSubject(), clusterKey),
+ "ClusterGWTServiceImpl.getAutoClusterResources");
+ }
+
+ public ClusterFlyweight getClusterTree(int groupId) {
+ return SerialUtility.prepare(
+ clusterManager.getClusterTree(getSessionSubject(), groupId),
+ "ClusterGWTServiceImpl.getClusterTree");
+
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index b89ece9..a86b217 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -104,6 +104,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
EventGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
ClusterGWTService</servlet-name>
+
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ClusterGWTServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -206,4 +210,8 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
EventGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/EventGWTService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
ClusterGWTService</servlet-name>
+
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ClusterGWTService</url-pattern>
+ </servlet-mapping>
</web-app>
commit c1352afdaef3eb9011c3365c51949ea14e1dc8a1
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:48:21 2010 -0400
Switch back to future UXD design for top menubar
Move user login info to footer
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index 65fc203..8a6fcc4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -60,7 +60,14 @@ public class Footer extends ToolStrip {
protected void onDraw() {
super.onDraw();
- addMember(new Label("Welcome to RHQ"));
+
+ Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
+ loggedInAs.setWrap(false);
+ loggedInAs.setMargin(5);
+ loggedInAs.setValign(VerticalAlignment.CENTER);
+
+
+ addMember(loggedInAs);
addMember(new ToolStripSeparator());
recentMessage = new MessageCenterView();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java
new file mode 100644
index 0000000..c98c16d
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java
@@ -0,0 +1,247 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.menu;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.Window;
+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.VLayout;
+import com.smartgwt.client.widgets.menu.Menu;
+import com.smartgwt.client.widgets.menu.MenuBar;
+import com.smartgwt.client.widgets.menu.MenuItem;
+import com.smartgwt.client.widgets.menu.MenuItemSeparator;
+import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
+
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
+
+/**
+ * @author Greg Hinkle
+ */
+public class DropDownMenuBarView extends VLayout {
+
+ private AboutModalWindow aboutModalWindow;
+
+ public DropDownMenuBarView() {
+ super(5);
+ setHeight(50);
+ setWidth100();
+
+
+ }
+
+
+ protected void onDraw3() {
+ super.onDraw();
+
+ this.aboutModalWindow = new AboutModalWindow();
+
+ HLayout topBar = new HLayout();
+ topBar.setHeight(28);
+ topBar.setStyleName("topMenuBar");
+// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0
#DDDDDD
+// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png");
+// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X);
+
+
+ Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
+ logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
+ DropDownMenuBarView.this.aboutModalWindow.show();
+ }
+ });
+
+
+ topBar.addMember(logo);
+
+
+ // Create a menu bar
+ final MenuBar menu = new MenuBar();
+ menu.setHeight(28);
+
+
+
+ Menu subsystemsMenu = new Menu();
+
+ subsystemsMenu.setTitle("Subsystems");
+ subsystemsMenu.addItem(new EMenuItem("Configuration Changes",
LinkManager.getSubsystemConfigurationLink(),
"subsystems/configure/Configure_16.png"));//, new
LinkCommand("#config"));
+ subsystemsMenu.addItem(new EMenuItem("Suspect Metrics",
LinkManager.getSubsystemSuspectMetricsLink(),
"subsystems/monitor/Monitor_failed_16.png"));//, new
LinkCommand("#config"));
+ subsystemsMenu.addItem(new EMenuItem("Operations",
LinkManager.getSubsystemOperationHistoryLink(),
"subsystems/control/Operation_16.png"));//, new
LinkCommand("#config"));
+ subsystemsMenu.addItem(new EMenuItem("Alerts",
LinkManager.getSubsystemAlertHistoryLink(),
"subsystems/alert/Alert_HIGH_16.png"));//, new
LinkCommand("#config"));
+ subsystemsMenu.addItem(new EMenuItem("Alert Definitions",
LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//,
new LinkCommand("#config"));
+
+
+ final Menu overviewMenu = new Menu();
+ overviewMenu.setTitle("Overview");
+ overviewMenu.setStyleName("SimpleMenuBarButton");
+ overviewMenu.setBorder("none");
+ com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new
com.smartgwt.client.widgets.menu.MenuItem("Subsystems");
+ subsystemsSubMenuItem.setSubmenu(subsystemsMenu);
+ overviewMenu.addItem(subsystemsSubMenuItem);
+ overviewMenu.addItem(new EMenuItem("AutoDiscovery
Queue",LinkManager.getAutodiscoveryQueueLink()));//,new
LinkCommand("#cofng"));
+ overviewMenu.addItem(new
EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new
LinkCommand("#cofng"));
+
+
+ Menu resourcesMenu = new Menu();
+ resourcesMenu.setTitle("Resources");
+ resourcesMenu.setStyleName("SimpleMenuBarButton");
+ resourcesMenu.setBorder("none");
+ resourcesMenu.setStyleName("menuBarMenuButton");
+ resourcesMenu.addItem(new EMenuItem("All Resources",
LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf"));
+ resourcesMenu.addItem(new EMenuItem("Platforms",
LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new
LinkCommand("#fsdf"));
+ resourcesMenu.addItem(new EMenuItem("Servers",
LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new
LinkCommand("#fsdf"));
+ resourcesMenu.addItem(new EMenuItem("Services",
LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new
LinkCommand("#fsdf"));
+ resourcesMenu.addItem(new MenuItemSeparator());
+
+ final FavoritesMenu favoritesMenu = new FavoritesMenu();
+ resourcesMenu.addItem(favoritesMenu);
+ menu.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ System.out.println("over here");
+ favoritesMenu.refresh();
+ }
+ });
+
+ Menu groupsMenu = new Menu();
+ groupsMenu.setStyleName("menuBarMenuButton");
+ groupsMenu.setTitle("Groups");
+ groupsMenu.addItem(new EMenuItem("All Groups",
LinkManager.getHubAllGroupsLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new EMenuItem("Compatible Groups",
LinkManager.getHubCompatibleGroupsLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new EMenuItem("Mixed Groups",
LinkManager.getHubMixedGroupsLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new EMenuItem("Group Definitions",
LinkManager.getHubGroupDefinitionsLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new MenuItemSeparator());
+ groupsMenu.addItem(new EMenuItem("New Group",
LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new EMenuItem("New Group Definition",
LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf"));
+ groupsMenu.addItem(new MenuItemSeparator());
+// groupsMenu.addItem(new MenuItem("Favorites")); //, new
LinkCommand("#sf"));
+
+
+ Menu securityMenu = new Menu();
+ securityMenu.setTitle("Security");
+ securityMenu.addItem(new
EMenuItem("Users",LinkManager.getAdminUsersLink()));
+ securityMenu.addItem(new
EMenuItem("Roles",LinkManager.getAdminRolesLink()));
+ MenuItem securitySubMenuItem = new MenuItem("Security");
+ securitySubMenuItem.setSubmenu(securityMenu);
+
+
+ Menu sysConfigMenu = new Menu();
+ sysConfigMenu.setTitle("System Configuration");
+ sysConfigMenu.addItem(new
EMenuItem("Settings",LinkManager.getAdminSysConfigLink()));
+ sysConfigMenu.addItem(new
EMenuItem("Plugins",LinkManager.getAdminPluginsLink()));
+ sysConfigMenu.addItem(new
EMenuItem("Templates",LinkManager.getAdminTemplatesLink()));
+ MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration");
+ sysConfigSubMenuItem.setSubmenu(sysConfigMenu);
+
+
+ Menu contentMenu = new Menu();
+ contentMenu.setTitle("Content");
+ contentMenu.addItem(new EMenuItem("Bundles","#Bundles"));
+ contentMenu.addItem(new EMenuItem("Content
Providers",LinkManager.getAdminContentProvidersLink()));
+ contentMenu.addItem(new EMenuItem("Content
Repositories",LinkManager.getAdminContentReposLink()));
+ MenuItem contentSubMenuItem = new MenuItem("Content");
+ contentSubMenuItem.setSubmenu(contentMenu);
+
+
+ Menu haMenu = new Menu();
+ haMenu.setTitle("High Availability");
+ haMenu.addItem(new
EMenuItem("Servers",LinkManager.getHAServersLink()));
+ haMenu.addItem(new EMenuItem("Agents",LinkManager.getHAAgentsLink()));
+ haMenu.addItem(new EMenuItem("Affinity
Groups",LinkManager.getHAAffinityGroupsLink()));
+ haMenu.addItem(new EMenuItem("Partition
Events",LinkManager.getHAEventsLink()));
+ MenuItem haSubMentItem = new MenuItem("High Availability");
+ haSubMentItem.setSubmenu(haMenu);
+
+
+ Menu reportsMenu = new Menu();
+ reportsMenu.setTitle("Reports");
+ reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report",
LinkManager.getReportsInventoryLink()));
+ MenuItem reportsSubMenuItem = new MenuItem("Reports");
+ reportsSubMenuItem.setSubmenu(reportsMenu);
+
+
+ Menu adminMenu = new Menu();
+ adminMenu.setTitle("Administration");
+ adminMenu.addItem(securitySubMenuItem);
+ adminMenu.addItem(sysConfigSubMenuItem);
+ adminMenu.addItem(contentSubMenuItem);
+ adminMenu.addItem(haSubMentItem);
+ adminMenu.addItem(reportsSubMenuItem);
+ adminMenu.addItem(new EMenuItem("Downloads",
LinkManager.getAdminDownloadsLink()));
+ adminMenu.addItem(new EMenuItem("License",
LinkManager.getAdminLicenseLink()));
+
+
+
+
+
+ Menu helpMenu = new Menu();
+ helpMenu.setStyleName("menuBarMenuButton");
+ helpMenu.setTitle("Help");
+ helpMenu.addItem(new EMenuItem("Online Documentation",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
+ helpMenu.addItem(new EMenuItem("Open a support case",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
+// helpMenu.addItem(new MenuItem("About")); //, new
LinkCommand("#sdfs"));
+
+ menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu);
+
+
+ topBar.addMember(menu);
+
+
+ addMember(topBar);
+ addMember(new SearchBarPane());
+
+ }
+
+
+ public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem {
+
+ String link;
+
+ public EMenuItem(String title, String link) {
+ super(title);
+ this.link = link;
+ init();
+ }
+
+ public EMenuItem(String title, String link, String icon) {
+ super(title, icon);
+ this.link = link;
+ init();
+ }
+
+ private void init() {
+ addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
+ public void onClick(MenuItemClickEvent menuItemClickEvent) {
+ if (link.startsWith("#")) {
+ History.newItem(link.substring(1));
+ } else {
+ Window.Location.assign(link);
+ }
+ }
+ });
+ }
+ }
+
+}
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 55a7d47..9d354f4 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
@@ -57,196 +57,16 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard", "Demo",
"Inventory", "Bundles", "Administration"};
+ public static final String[] SECTIONS = {"Dashboard",
"Inventory", "Reports", "Bundles",
"Administration"};
private String selected = "Dashboard";
private HTMLFlow linksPane;
- public MenuBarView() {
- super(5);
- setHeight(50);
- setWidth100();
-
-
- }
-
protected void onDraw() {
super.onDraw();
- this.aboutModalWindow = new AboutModalWindow();
-
- HLayout topBar = new HLayout();
- topBar.setHeight(28);
- topBar.setStyleName("topMenuBar");
-// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0
#DDDDDD
-// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png");
-// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X);
-
-
- Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
- logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
- MenuBarView.this.aboutModalWindow.show();
- }
- });
-
-
- topBar.addMember(logo);
-
-
- // Create a menu bar
- final MenuBar menu = new MenuBar();
- menu.setHeight(28);
-
-
-
- Menu subsystemsMenu = new Menu();
-
- subsystemsMenu.setTitle("Subsystems");
- subsystemsMenu.addItem(new EMenuItem("Configuration Changes",
LinkManager.getSubsystemConfigurationLink(),
"subsystems/configure/Configure_16.png"));//, new
LinkCommand("#config"));
- subsystemsMenu.addItem(new EMenuItem("Suspect Metrics",
LinkManager.getSubsystemSuspectMetricsLink(),
"subsystems/monitor/Monitor_failed_16.png"));//, new
LinkCommand("#config"));
- subsystemsMenu.addItem(new EMenuItem("Operations",
LinkManager.getSubsystemOperationHistoryLink(),
"subsystems/control/Operation_16.png"));//, new
LinkCommand("#config"));
- subsystemsMenu.addItem(new EMenuItem("Alerts",
LinkManager.getSubsystemAlertHistoryLink(),
"subsystems/alert/Alert_HIGH_16.png"));//, new
LinkCommand("#config"));
- subsystemsMenu.addItem(new EMenuItem("Alert Definitions",
LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//,
new LinkCommand("#config"));
-
-
- final Menu overviewMenu = new Menu();
- overviewMenu.setTitle("Overview");
- overviewMenu.setStyleName("SimpleMenuBarButton");
- overviewMenu.setBorder("none");
- com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new
com.smartgwt.client.widgets.menu.MenuItem("Subsystems");
- subsystemsSubMenuItem.setSubmenu(subsystemsMenu);
- overviewMenu.addItem(subsystemsSubMenuItem);
- overviewMenu.addItem(new EMenuItem("AutoDiscovery
Queue",LinkManager.getAutodiscoveryQueueLink()));//,new
LinkCommand("#cofng"));
- overviewMenu.addItem(new
EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new
LinkCommand("#cofng"));
-
-
- Menu resourcesMenu = new Menu();
- resourcesMenu.setTitle("Resources");
- resourcesMenu.setStyleName("SimpleMenuBarButton");
- resourcesMenu.setBorder("none");
- resourcesMenu.setStyleName("menuBarMenuButton");
- resourcesMenu.addItem(new EMenuItem("All Resources",
LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf"));
- resourcesMenu.addItem(new EMenuItem("Platforms",
LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new
LinkCommand("#fsdf"));
- resourcesMenu.addItem(new EMenuItem("Servers",
LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new
LinkCommand("#fsdf"));
- resourcesMenu.addItem(new EMenuItem("Services",
LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new
LinkCommand("#fsdf"));
- resourcesMenu.addItem(new MenuItemSeparator());
-
- final FavoritesMenu favoritesMenu = new FavoritesMenu();
- resourcesMenu.addItem(favoritesMenu);
- menu.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- System.out.println("over here");
- favoritesMenu.refresh();
- }
- });
-
- Menu groupsMenu = new Menu();
- groupsMenu.setStyleName("menuBarMenuButton");
- groupsMenu.setTitle("Groups");
- groupsMenu.addItem(new EMenuItem("All Groups",
LinkManager.getHubAllGroupsLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new EMenuItem("Compatible Groups",
LinkManager.getHubCompatibleGroupsLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new EMenuItem("Mixed Groups",
LinkManager.getHubMixedGroupsLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new EMenuItem("Group Definitions",
LinkManager.getHubGroupDefinitionsLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new MenuItemSeparator());
- groupsMenu.addItem(new EMenuItem("New Group",
LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new EMenuItem("New Group Definition",
LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf"));
- groupsMenu.addItem(new MenuItemSeparator());
-// groupsMenu.addItem(new MenuItem("Favorites")); //, new
LinkCommand("#sf"));
-
-
- Menu securityMenu = new Menu();
- securityMenu.setTitle("Security");
- securityMenu.addItem(new
EMenuItem("Users",LinkManager.getAdminUsersLink()));
- securityMenu.addItem(new
EMenuItem("Roles",LinkManager.getAdminRolesLink()));
- MenuItem securitySubMenuItem = new MenuItem("Security");
- securitySubMenuItem.setSubmenu(securityMenu);
-
-
- Menu sysConfigMenu = new Menu();
- sysConfigMenu.setTitle("System Configuration");
- sysConfigMenu.addItem(new
EMenuItem("Settings",LinkManager.getAdminSysConfigLink()));
- sysConfigMenu.addItem(new
EMenuItem("Plugins",LinkManager.getAdminPluginsLink()));
- sysConfigMenu.addItem(new
EMenuItem("Templates",LinkManager.getAdminTemplatesLink()));
- MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration");
- sysConfigSubMenuItem.setSubmenu(sysConfigMenu);
-
-
- Menu contentMenu = new Menu();
- contentMenu.setTitle("Content");
- contentMenu.addItem(new EMenuItem("Bundles","#Bundles"));
- contentMenu.addItem(new EMenuItem("Content
Providers",LinkManager.getAdminContentProvidersLink()));
- contentMenu.addItem(new EMenuItem("Content
Repositories",LinkManager.getAdminContentReposLink()));
- MenuItem contentSubMenuItem = new MenuItem("Content");
- contentSubMenuItem.setSubmenu(contentMenu);
-
-
- Menu haMenu = new Menu();
- haMenu.setTitle("High Availability");
- haMenu.addItem(new
EMenuItem("Servers",LinkManager.getHAServersLink()));
- haMenu.addItem(new EMenuItem("Agents",LinkManager.getHAAgentsLink()));
- haMenu.addItem(new EMenuItem("Affinity
Groups",LinkManager.getHAAffinityGroupsLink()));
- haMenu.addItem(new EMenuItem("Partition
Events",LinkManager.getHAEventsLink()));
- MenuItem haSubMentItem = new MenuItem("High Availability");
- haSubMentItem.setSubmenu(haMenu);
-
-
- Menu reportsMenu = new Menu();
- reportsMenu.setTitle("Reports");
- reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report",
LinkManager.getReportsInventoryLink()));
- MenuItem reportsSubMenuItem = new MenuItem("Reports");
- reportsSubMenuItem.setSubmenu(reportsMenu);
-
-
- Menu adminMenu = new Menu();
- adminMenu.setTitle("Administration");
- adminMenu.addItem(securitySubMenuItem);
- adminMenu.addItem(sysConfigSubMenuItem);
- adminMenu.addItem(contentSubMenuItem);
- adminMenu.addItem(haSubMentItem);
- adminMenu.addItem(reportsSubMenuItem);
- adminMenu.addItem(new EMenuItem("Downloads",
LinkManager.getAdminDownloadsLink()));
- adminMenu.addItem(new EMenuItem("License",
LinkManager.getAdminLicenseLink()));
-
-
-
-
-
- Menu helpMenu = new Menu();
- helpMenu.setStyleName("menuBarMenuButton");
- helpMenu.setTitle("Help");
- helpMenu.addItem(new EMenuItem("Online Documentation",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
- helpMenu.addItem(new EMenuItem("Open a support case",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
-// helpMenu.addItem(new MenuItem("About")); //, new
LinkCommand("#sdfs"));
-
- menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu);
-
-
- topBar.addMember(menu);
-
-
- addMember(topBar);
- addMember(new SearchBarPane());
-
- }
-
- protected void onDraw2() {
- super.onDraw();
-
- HTMLFlow menu = new HTMLFlow();
- menu.setContentsType(ContentsType.PAGE);
- menu.setContentsURL("/rhq/common/menu/menu.xhtml");
- addMember(menu);
- }
-
-
- // @Override
-
- protected void onDraw3() {
- super.onDraw();
-
History.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent<String>
stringValueChangeEvent) {
String first =
stringValueChangeEvent.getValue().split("/")[0];
@@ -285,15 +105,15 @@ public class MenuBarView extends VLayout {
topStrip.addMember(new LayoutSpacer());
HLayout helpLayout = new HLayout();
- Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
- loggedInAs.setWrap(false);
- loggedInAs.setValign(VerticalAlignment.CENTER);
- helpLayout.addMember(loggedInAs);
- helpLayout.addMember(new Hyperlink("Help", "Help"));
- helpLayout.addMember(new Hyperlink("Preferences",
"Preferences"));
- helpLayout.addMember(new Hyperlink("Log Out", "LogOut"));
- helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
- topStrip.addMember(helpLayout);
+// Label loggedInAs = new Label("Logged in as " +
CoreGUI.getSessionSubject().getName());
+// loggedInAs.setWrap(false);
+// loggedInAs.setValign(VerticalAlignment.CENTER);
+// helpLayout.addMember(loggedInAs);
+ topStrip.addMember(new Hyperlink("Help", "Help"));
+ topStrip.addMember(new Hyperlink("Preferences",
"Preferences"));
+ topStrip.addMember(new Hyperlink("Log Out", "LogOut"));
+// helpLayout.setLayoutAlign(VerticalAlignment.CENTER);
+// topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm();
links.setNumCols(SECTIONS.length * 2);
@@ -355,33 +175,4 @@ public class MenuBarView extends VLayout {
}
- public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem {
-
- String link;
-
- public EMenuItem(String title, String link) {
- super(title);
- this.link = link;
- init();
- }
-
- public EMenuItem(String title, String link, String icon) {
- super(title, icon);
- this.link = link;
- init();
- }
-
- private void init() {
- addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
- public void onClick(MenuItemClickEvent menuItemClickEvent) {
- if (link.startsWith("#")) {
- History.newItem(link.substring(1));
- } else {
- Window.Location.assign(link);
- }
- }
- });
- }
- }
-
}
commit e624bee83c605b20d8411d0b44a8d885460b6262
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:47:12 2010 -0400
Let login form support native browser autocomplete so user/passwords can be saved
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 64d89ca..c28d77e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -98,14 +98,13 @@ public class LoginView extends Canvas {
HeaderItem header = new HeaderItem();
header.setValue("RHQ Login");
-
+
TextItem user = new TextItem("user", "User");
user.setRequired(true);
- user.setAttribute("canAutocomplete", true);
- user.setAttribute("autoComplete", true);
+ user.setAttribute("autoComplete", "native");
PasswordItem password = new PasswordItem("password",
"Password");
password.setRequired(true);
- password.setAttribute("autocomplete", true);
+ password.setAttribute("autoComplete", "native");
loginButton = new SubmitItem("login", "Login");
loginButton.setAlign(Alignment.CENTER);
commit 94d13c9f83d65c1a9ff8a35a53f5c9e6727e0aa2
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:46:27 2010 -0400
Moved ClusterKey to the domain module as it will now be part of the public API
Expose ClusterFlyweight Tree api
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java
index 39e6f4a..10611fa 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java
@@ -18,7 +18,12 @@
*/
package org.rhq.enterprise.server.resource.cluster;
+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 javax.ejb.EJB;
import javax.ejb.Stateless;
@@ -33,7 +38,10 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
+import org.rhq.core.domain.resource.group.composite.ClusterKeyFlyweight;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
@@ -48,7 +56,7 @@ import
org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException;
*
*/
@Stateless
-public class ClusterManagerBean implements ClusterManagerLocal {
+public class ClusterManagerBean implements ClusterManagerLocal, ClusterManagerRemote {
private final Log log = LogFactory.getLog(ClusterManagerBean.class);
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
@@ -168,6 +176,75 @@ public class ClusterManagerBean implements ClusterManagerLocal {
return rs;
}
+ public ClusterFlyweight getClusterTree(Subject subject, int groupId) {
+ Query query = entityManager.createQuery(
+ "SELECT r.id, r.resourceType.id, r.parentResource.id, r.resourceKey,
r.name, " +
+ "(SELECT count(r2) FROM Resource r2 join r2.explicitGroups
g2 WHERE g2.id = :groupId and r2.id = r.id) " +
+ "FROM Resource r join r.implicitGroups g " +
+ "WHERE g.id = :groupId");
+
+ query.setParameter("groupId", groupId);
+ List<Object[]> rs = query.getResultList();
+
+ Map<Integer, List<Object[]>> dataMap = new HashMap<Integer,
List<Object[]>>();
+ Set<Integer> explicitResources = new HashSet<Integer>();
+
+ for (Object[] d : rs) {
+
+ Integer parentId = (Integer) d[2];
+ List<Object[]> childList = dataMap.get(parentId);
+ if (childList == null) {
+ childList = new ArrayList<Object[]>();
+ dataMap.put(parentId, childList);
+ }
+ childList.add(d);
+ if ((Long) d[5] > 0) {
+ explicitResources.add((Integer) d[0]);
+ }
+ }
+
+
+ ClusterFlyweight key = new ClusterFlyweight(groupId);
+
+ buildTree(groupId, key, explicitResources, dataMap);
+
+ return key;
+ }
+
+ private void buildTree(int groupId, ClusterFlyweight parent, Set<Integer>
parentIds, Map<Integer,List<Object[]>> data) {
+
+ for (Integer parentId : parentIds) {
+
+ Map<ClusterKeyFlyweight, ClusterFlyweight> children = new
HashMap<ClusterKeyFlyweight, ClusterFlyweight>();
+ Map<ClusterKeyFlyweight, Set<Integer>> members = new
HashMap<ClusterKeyFlyweight, Set<Integer>>();
+
+ if (data.get(parentId) != null) {
+ for (Object[] child : data.get(parentId)) {
+ ClusterKeyFlyweight n = new ClusterKeyFlyweight((Integer)child[1],
(String)child[3]);
+ ClusterFlyweight flyweight = children.get(n);
+ Set<Integer> memberList = members.get(n);
+ if (flyweight == null) {
+ flyweight = new ClusterFlyweight(n);
+ children.put(n, flyweight);
+ memberList = new HashSet<Integer>();
+ members.put(n, memberList);
+ }
+ flyweight.addResource((String)child[4]);
+ memberList.add((Integer) child[0]);
+ }
+ }
+
+ parent.setChildren(new
ArrayList<ClusterFlyweight>(children.values()));
+
+
+ for (ClusterFlyweight child : children.values()) {
+ buildTree(groupId, child, members.get(child.getClusterKey()), data);
+ }
+ }
+ }
+
+
+
private String getClusterKeyQuery(ClusterKey clusterKey) {
if (null == clusterKey)
return null;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java
index ce11d33..b13b380 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java
@@ -26,37 +26,15 @@ import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
/*
* @author Jay Shaughnessy
*/
@Local
-public interface ClusterManagerLocal {
+public interface ClusterManagerLocal extends ClusterManagerRemote {
- /**
- * Given a cluster key create a backing group.
- * @param clusterKey
- * @param addResources If true, the new group will be assigned the current resources
defined by the clusterKey.
- * Otherwise no resources will be assigned to the new group.
- * @throws IllegalArgumentException if a backing group exists for this clusterKey
- */
- ResourceGroup createAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey,
boolean addResources);
-
- /**
- * Return the backing group for the supplied cluster key. Resource membership will
represent the resources
- * last set for the group and may not reflect current membership. See {@link
#getAutoClusterResources(String)}
- * @param clusterKey
- * @return The backing group, or null if the key does not have a backing group.
- */
- @Nullable
- ResourceGroup getAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey);
-
- /**
- * Given a cluster key get the auto cluster resource membership. The membership is
always determined
- * at call time, regardless of whether a backing group exists. To get the backing
group, if it exists,
- * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}.
- */
- List<Resource> getAutoClusterResources(Subject subject, ClusterKey
clusterKey);
}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java
index ec5177d..3729a60 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java
@@ -30,6 +30,7 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
commit e01dce1066bd008701e7f4cf36db95d5517b0471
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:45:36 2010 -0400
Moved ClusterKey to the domain module as it will now be part of the public API
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java
new file mode 100644
index 0000000..e6d5369
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java
@@ -0,0 +1,237 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.core.domain.resource.group;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A ClusterKey represents an AutoCluster of resources in a Cluster Hierarchy. Given the
key it is
+ * possible to determine specific membership of the AutoCluster at any time. It
represents the Cluster
+ * Root (a Compatible Group) and the hierarchy of resource cluster nodes. Each level of
the hierarchy
+ * represents a resource cluster node defined by a Plugin|ResourceType|ResourceKey
tuple.<br/>
+ * <br/>
+ * The ClusterKey has the following form:
+ * <pre>
+ * Expressed iteratively:
+ *
+ * CompatibleGroupId::ResourceTypeId1:ResourceKey1::ResourceTypeId2:ResourceKey2:: ...
::ResourceTypeIdN:ResourceKeyN
+ *
+ * Expressed Recursively:
+ *
+ * Depth-1 AutoCluster CompatibleGroupId::ResourceTypeId1:ResourceKey1
+ * Depth-N AutoCluster <ParentClusterKey>::ResourceTypeIdN:ResourceKeyN
+ * </pre>
+ * @author jay shaughnessy
+ *
+ */
+public class ClusterKey implements Serializable {
+ static final String DELIM = ":";
+ static final String DELIM_NODE = "::";
+
+ // Id of the compatible resource group containing the root set of clustered
resources.
+ private int clusterGroupId = 0;
+ private List<ClusterKey.Node> hierarchy;
+ private String key = null;
+ private String namedKey = null;
+
+
+ public ClusterKey() {
+ }
+
+ /** Construct ClusterKey with to-be-defined Hierarcrhy */
+ public ClusterKey(int clusterResourceGroupId) {
+ this.clusterGroupId = clusterResourceGroupId;
+ this.hierarchy = new ArrayList<ClusterKey.Node>();
+ }
+
+ /** Construct ClusterKey for a top level AutoCluster */
+ public ClusterKey(int clusterResourceGroupId, int resourceTypeId, String resourceKey)
{
+ this.clusterGroupId = clusterResourceGroupId;
+ this.hierarchy = new ArrayList<ClusterKey.Node>();
+ this.hierarchy.add(new ClusterKey.Node(resourceTypeId, resourceKey));
+ }
+
+ /** Construct a new ClusterKey for a child AutoCluster of the provided parentKey*/
+ public ClusterKey(ClusterKey parentKey, int childResourceTypeId, String
childResourceKey) {
+ List<ClusterKey.Node> rootClusterNodes = parentKey.getHierarchy();
+
+ this.clusterGroupId = parentKey.getClusterGroupId();
+ this.hierarchy = new ArrayList<ClusterKey.Node>(rootClusterNodes);
//.size() + 1);
+// Collections.copy(this.hierarchy, rootClusterNodes);
+ this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey));
+ }
+
+
+
+ public int getClusterGroupId() {
+ return clusterGroupId;
+ }
+
+ public List<ClusterKey.Node> getHierarchy() {
+ return hierarchy;
+ }
+
+ /**
+ * Increase depth of hierarchy with new child node.
+ * @param childResourceTypeId
+ * @param childResourceKey
+ * @return The updated hierarchy
+ */
+ public List<ClusterKey.Node> addChildToHierarchy(int childResourceTypeId,
String childResourceKey) {
+
+ this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey));
+
+ return hierarchy;
+ }
+
+ /**
+ * @return the depth of the AutoCluster hierarchy. Just another way of getting the
hierarchy size.
+ */
+ public int getDepth() {
+ return hierarchy.size();
+ }
+
+ /**
+ * @param newDepth > 0, keep only the hierarchy up to an including the specified
depth.
+ */
+ public void setDepth(int newDepth) {
+ while ((newDepth > 0) && (this.hierarchy.size() > newDepth)) {
+ this.hierarchy.remove(this.hierarchy.size() - 1);
+ }
+ }
+
+ public String getKey() {
+ if (null == key) {
+ StringBuilder b = new StringBuilder();
+ b.append(clusterGroupId);
+
+ for (ClusterKey.Node node : hierarchy) {
+ b.append(DELIM_NODE);
+ b.append(node.toString());
+ }
+ key = b.toString();
+ }
+
+ return key;
+ }
+
+ /**
+ * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM
+ */
+ @Override
+ public String toString() {
+ return getKey();
+ }
+
+
+ public static ClusterKey valueOf(String clusterKey) {
+ ClusterKey result = null;
+
+ try {
+ String[] nodes = clusterKey.split(DELIM_NODE);
+ int groupId = Integer.valueOf(nodes[0]);
+
+ result = new ClusterKey(groupId);
+
+ for (int i = 1; i < nodes.length; ++i) {
+ String[] nodeInfo = nodes[i].split(DELIM);
+
+ if ((nodeInfo.length != 2) || "".equals(nodeInfo[0].trim()) ||
"".equals(nodeInfo[1].trim())) {
+ throw new IllegalArgumentException("Invalid cluster key node:
" + nodeInfo);
+ }
+
+ result.addChildToHierarchy(Integer.valueOf(nodeInfo[0]), nodeInfo[1]);
+ }
+ } catch (Exception e) {
+ result = null;
+ }
+
+ return result;
+ }
+
+ /**
+ * @param clusterKey
+ * @return The ResourceType id of the resource group this clusterKey defines.
+ */
+ public static int getResourceType(ClusterKey clusterKey) {
+ List<ClusterKey.Node> nodes = clusterKey.getHierarchy();
+
+ return nodes.get(nodes.size() - 1).getResourceTypeId();
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof ClusterKey)) return false;
+
+ ClusterKey that = (ClusterKey) o;
+
+ if (!getKey().equals(that.getKey())) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return getKey().hashCode();
+ }
+
+ /**
+ * Immutable class representing a node in an AutoCluster hierarchy. The node
describes a
+ * Set of like resources (same type and same resource key). By itself the node lacks
any context
+ * and so typically this class is for use within a ClusterKey, which qualifies the
node with
+ * the root group and constraining node ancestry.. */
+ public static class Node implements Serializable {
+ int resourceTypeId;
+ String resourceKey;
+
+ public Node(int resourceTypeId, String resourceKey) {
+ super();
+ this.resourceTypeId = resourceTypeId;
+ this.resourceKey = encode(resourceKey);
+ }
+
+ public int getResourceTypeId() {
+ return resourceTypeId;
+ }
+
+ public String getResourceKey() {
+ return decode(resourceKey);
+ }
+
+ /**
+ * format: resourceTypeId:resourceKey (actual delimiter is ClusterKey.DELIM)
+ */
+ @Override
+ public String toString() {
+ return resourceTypeId + DELIM + resourceKey;
+ }
+
+ private String encode(String info) {
+ return info.replace(":","%3a");
+ }
+ private String decode(String code) {
+ return code.replace("%3a", ":");
+ }
+ }
+}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
index e3da8ca..34fb0a6 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java
@@ -31,6 +31,7 @@ import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.enterprise.gui.navigation.contextmenu.MenuItemDescriptor;
@@ -40,7 +41,6 @@ import
org.rhq.enterprise.gui.navigation.contextmenu.TreeContextMenuBase;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
-import org.rhq.enterprise.server.resource.cluster.ClusterKey;
import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java
index 66ef285..ef8f7d0 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java
@@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight;
import org.rhq.core.domain.resource.flyweight.ResourceFlyweight;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
@@ -38,7 +39,6 @@ import
org.rhq.enterprise.gui.navigation.resource.ResourceTreeModelUIBean;
import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.resource.cluster.ClusterKey;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.util.HibernatePerformanceMonitor;
import org.rhq.enterprise.server.util.LookupUtil;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java
index 3a1e482..8f1003a 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java
@@ -20,9 +20,9 @@ package org.rhq.enterprise.gui.navigation.group;
import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight;
import org.rhq.core.domain.resource.flyweight.ResourceFlyweight;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.util.sort.HumaneStringComparator;
-import org.rhq.enterprise.server.resource.cluster.ClusterKey;
import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java
index a803b9c..273e7a2 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java
@@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.navigation.group;
import java.io.IOException;
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
import javax.faces.application.FacesMessage;
@@ -35,12 +34,10 @@ import org.richfaces.model.TreeRowKey;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight;
-import org.rhq.core.domain.resource.group.composite.AutoGroupComposite;
+import org.rhq.core.domain.resource.group.ClusterKey;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.gui.util.FacesContextUtility;
-import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
-import org.rhq.enterprise.server.resource.cluster.ClusterKey;
import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java
deleted file mode 100644
index c2511be..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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.server.resource.cluster;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.group.ResourceGroup;
-
-/**
- * A ClusterKey represents an AutoCluster of resources in a Cluster Hierarchy. Given the
key it is
- * possible to determine specific membership of the AutoCluster at any time. It
represents the Cluster
- * Root (a Compatible Group) and the hierarchy of resource cluster nodes. Each level of
the hierarchy
- * represents a resource cluster node defined by a Plugin|ResourceType|ResourceKey
tuple.<br/>
- * <br/>
- * The ClusterKey has the following form:
- * <pre>
- * Expressed iteratively:
- *
- * CompatibleGroupId::ResourceTypeId1:ResourceKey1::ResourceTypeId2:ResourceKey2:: ...
::ResourceTypeIdN:ResourceKeyN
- *
- * Expressed Recursively:
- *
- * Depth-1 AutoCluster CompatibleGroupId::ResourceTypeId1:ResourceKey1
- * Depth-N AutoCluster <ParentClusterKey>::ResourceTypeIdN:ResourceKeyN
- * </pre>
- * @author jay shaughnessy
- *
- */
-public class ClusterKey {
- static final String DELIM = ":";
- static final String DELIM_NODE = "::";
-
- // Id of the compatible resource group containing the root set of clustered
resources.
- private int clusterGroupId = 0;
- private List<ClusterKey.Node> hierarchy;
- private String key = null;
- private String namedKey = null;
-
- /** Construct ClusterKey with to-be-defined Hierarcrhy */
- public ClusterKey(int clusterResourceGroupId) {
- this.clusterGroupId = clusterResourceGroupId;
- this.hierarchy = new ArrayList<ClusterKey.Node>();
- }
-
- /** Construct ClusterKey for a top level AutoCluster */
- public ClusterKey(int clusterResourceGroupId, int resourceTypeId, String resourceKey)
{
- this.clusterGroupId = clusterResourceGroupId;
- this.hierarchy = new ArrayList<ClusterKey.Node>();
- this.hierarchy.add(new ClusterKey.Node(resourceTypeId, resourceKey));
- }
-
- /** Construct a new ClusterKey for a child AutoCluster of the provided parentKey*/
- public ClusterKey(ClusterKey parentKey, int childResourceTypeId, String
childResourceKey) {
- List<ClusterKey.Node> rootClusterNodes = parentKey.getHierarchy();
-
- this.clusterGroupId = parentKey.getClusterGroupId();
- this.hierarchy = new ArrayList<ClusterKey.Node>(rootClusterNodes);
//.size() + 1);
-// Collections.copy(this.hierarchy, rootClusterNodes);
- this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey));
- }
-
-
-
- public int getClusterGroupId() {
- return clusterGroupId;
- }
-
- public List<ClusterKey.Node> getHierarchy() {
- return hierarchy;
- }
-
- /**
- * Increase depth of hierarchy with new child node.
- * @param childResourceTypeId
- * @param childResourceKey
- * @return The updated hierarchy
- */
- public List<ClusterKey.Node> addChildToHierarchy(int childResourceTypeId,
String childResourceKey) {
-
- this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey));
-
- return hierarchy;
- }
-
- /**
- * @return the depth of the AutoCluster hierarchy. Just another way of getting the
hierarchy size.
- */
- public int getDepth() {
- return hierarchy.size();
- }
-
- /**
- * @param newDepth > 0, keep only the hierarchy up to an including the specified
depth.
- */
- public void setDepth(int newDepth) {
- while ((newDepth > 0) && (this.hierarchy.size() > newDepth)) {
- this.hierarchy.remove(this.hierarchy.size() - 1);
- }
- }
-
- public String getKey() {
- if (null == key) {
- StringBuilder b = new StringBuilder();
- b.append(clusterGroupId);
-
- for (ClusterKey.Node node : hierarchy) {
- b.append(DELIM_NODE);
- b.append(node.toString());
- }
- key = b.toString();
- }
-
- return key;
- }
-
- /**
- * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM
- */
- @Override
- public String toString() {
- return getKey();
- }
-
- /**
- * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM.
- * ResourceTypeId replaced with Plugin:ResourceTypeName tuple.
- */
- public String toNamedString(EntityManager em) {
- if (null == namedKey) {
- ResourceGroup clusterResourceGroup = em.find(ResourceGroup.class,
this.clusterGroupId);
-
- StringBuilder b = new StringBuilder();
- b.append((null == clusterResourceGroup) ? this.clusterGroupId :
clusterResourceGroup.getName());
-
- for (ClusterKey.Node node : hierarchy) {
- b.append(DELIM_NODE);
- b.append(node.toNamedString(em));
- }
- namedKey = b.toString();
- }
-
- return namedKey;
- }
-
- public static ClusterKey valueOf(String clusterKey) {
- ClusterKey result = null;
-
- try {
- String[] nodes = clusterKey.split(DELIM_NODE);
- int groupId = Integer.valueOf(nodes[0]);
-
- result = new ClusterKey(groupId);
-
- for (int i = 1; i < nodes.length; ++i) {
- String[] nodeInfo = nodes[i].split(DELIM);
-
- if ((nodeInfo.length != 2) || "".equals(nodeInfo[0].trim()) ||
"".equals(nodeInfo[1].trim())) {
- throw new IllegalArgumentException("Invalid cluster key node:
" + nodeInfo);
- }
-
- result.addChildToHierarchy(Integer.valueOf(nodeInfo[0]), nodeInfo[1]);
- }
- } catch (Exception e) {
- LogFactory.getLog(ClusterKey.class).error("Invalid clusterKey |" +
clusterKey + "| encountered: " + e);
- result = null;
- }
-
- return result;
- }
-
- /**
- * @param clusterKey
- * @return The ResourceType id of the resource group this clusterKey defines.
- */
- public static int getResourceType(ClusterKey clusterKey) {
- List<ClusterKey.Node> nodes = clusterKey.getHierarchy();
-
- return nodes.get(nodes.size() - 1).getResourceTypeId();
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof ClusterKey)) return false;
-
- ClusterKey that = (ClusterKey) o;
-
- if (!getKey().equals(that.getKey())) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return getKey().hashCode();
- }
-
- /**
- * Immutable class representing a node in an AutoCluster hierarchy. The node
describes a
- * Set of like resources (same type and same resource key). By itself the node lacks
any context
- * and so typically this class is for use within a ClusterKey, which qualifies the
node with
- * the root group and constraining node ancestry.. */
- public static class Node {
- int resourceTypeId;
- String resourceKey;
-
- public Node(int resourceTypeId, String resourceKey) {
- super();
- this.resourceTypeId = resourceTypeId;
- this.resourceKey = encode(resourceKey);
- }
-
- public int getResourceTypeId() {
- return resourceTypeId;
- }
-
- public String getResourceKey() {
- return decode(resourceKey);
- }
-
- /**
- * format: resourceTypeId:resourceKey (actual delimiter is ClusterKey.DELIM)
- */
- @Override
- public String toString() {
- return resourceTypeId + DELIM + resourceKey;
- }
-
- /*
- * format: resourceTypePlugin:resourceTypeName:resourceKey (actual delimiter is
ClusterKey.DELIM)
- */
- public String toNamedString(EntityManager em) {
- ResourceType resourceType = em.find(ResourceType.class,
this.resourceTypeId);
- String resourceTypePart = null;
-
- if (null == resourceType) {
- resourceTypePart = this.resourceTypeId + DELIM + this.resourceTypeId;
- } else
- resourceTypePart = resourceType.getPlugin() + DELIM +
resourceType.getName();
-
- return resourceTypePart + DELIM + resourceKey;
- }
-
- private String encode(String info) {
- return info.replace(":","%3a");
- }
- private String decode(String code) {
- return code.replace("%3a", ":");
- }
- }
-}
commit 7ce3f39a8a246e32b1d6183e555b8ec0da051dde
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:44:51 2010 -0400
Don't take over full screen when portal login page is shown (as it'll always
be in a gwt container now)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp
index a9b0844..804ee5f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp
@@ -28,8 +28,8 @@
<title><fmt:message key="login.title" /></title>
<link rel="stylesheet" href="<html:rewrite
page="/css/win.css"/>" type="text/css">
<script language="JavaScript" type="text/javascript">
- if (top != self)
- top.location.href = self.document.location;
+// if (top != self)
+// top.location.href = self.document.location;
var path = "<html:rewrite page="/images/"/>";
commit f14436b69d270a649125a5eb19b266ef4ca13729
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 23 12:44:05 2010 -0400
Add the ability to filter by the root resource... let's us use criteria to load an
entire platform or search within one
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java
index ad52f4c..a332b77 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java
@@ -65,6 +65,7 @@ public class ResourceCriteria extends TaggedCriteria {
private List<Integer> filterIds; // needs overrides
private List<Integer> filterExplicitGroupIds; // requires overrides
private List<Integer> filterImplicitGroupIds; // requires overrides
+ private Integer filterRootResourceId; // requires overrides
private boolean fetchResourceType;
private boolean fetchChildResources;
@@ -124,6 +125,8 @@ public class ResourceCriteria extends TaggedCriteria {
+ " FROM Resource ires " //
+ " JOIN ires.implicitGroups implicitGroup " //
+ " WHERE implicitGroup.id IN ( ? ) )");
+ filterOverrides.put("rootResourceId",
+ "agent.id = (SELECT r2.agent.id FROM Resource r2 where r2.id =
?)");
sortOverrides.put("resourceTypeName", "resourceType.name");
sortOverrides.put("resourceCategory",
"resourceType.category");
@@ -222,6 +225,10 @@ public class ResourceCriteria extends TaggedCriteria {
this.filterImplicitGroupIds = Arrays.asList(filterImplicitGroupIds);
}
+ public void addFilterRootResourceId(Integer filterRootResourceId) {
+ this.filterRootResourceId = filterRootResourceId;
+ }
+
public void fetchResourceType(boolean fetchResourceType) {
this.fetchResourceType = fetchResourceType;
}
commit b227633c1d95e870b3de26d0cf622f09b4df64a8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 23 11:26:29 2010 -0400
BZ-617567: don't use nested forms
* outer details.xhtml was already declaring a form for custom content beans
* roles.xhtml / subjects.xhtml, thus, don't need to define their own form
diff --git a/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml
b/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml
index 1341fb4..f807414 100644
--- a/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml
+++ b/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml
@@ -9,7 +9,6 @@
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<body>
- <h:form id="rolesForm">
<rich:pickList fastMoveControlsVisible="false"
sourceListWidth="200px"
targetListWidth="200px"
@@ -18,7 +17,6 @@
value="#{rolesBean.currentRoles}">
<f:selectItems value="#{rolesBean.availableRolesMap}" />
</rich:pickList>
- </h:form>
</body>
</html>
\ No newline at end of file
diff --git
a/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml
b/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml
index 9994c5c..39d86e8 100644
--- a/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml
+++ b/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml
@@ -9,7 +9,6 @@
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<body>
- <h:form id="subjectsForm">
<rich:pickList fastMoveControlsVisible="false"
sourceListWidth="200px"
targetListWidth="200px"
@@ -18,7 +17,6 @@
value="#{subjectsBean.currentSubjects}">
<f:selectItems value="#{subjectsBean.availableSubjectsMap}"
/>
</rich:pickList>
- </h:form>
</body>
</html>
\ No newline at end of file
commit b13693f2a55c24422be11d38bf23361ed1db3950
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 23 11:00:46 2010 -0400
BZ 615377 workaround sun bug
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
index d6546a2..c9c1d54 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
@@ -31,6 +31,8 @@ import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.security.auth.login.Configuration;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -114,6 +116,11 @@ public class PluginContainer implements ContainerService {
}
private PluginContainer() {
+ // for why we need to do this, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
+ try {
+ Configuration.getConfiguration();
+ } catch (Throwable t) {
+ }
}
/**
@@ -337,6 +344,13 @@ public class PluginContainer implements ContainerService {
private void cleanMemory() {
Introspector.flushCaches();
LogFactory.releaseAll();
+
+ // for why we need to do this, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
+ try {
+ Configuration.setConfiguration(null);
+ } catch (Throwable t) {
+ }
+
System.gc();
}
@@ -563,4 +577,4 @@ public class PluginContainer implements ContainerService {
public boolean isInsideAgent() {
return (this.configuration != null &&
this.configuration.isInsideAgent());
}
-}
\ No newline at end of file
+}
commit 8d6b4f8b43d62b7375468b363af0c1841c7d3a05
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Jul 22 18:52:14 2010 +0200
BZ 601744 - backing out the position:relative part of the original fix in main.xhtml.
This effectively reverts the page to the state it was before we had the rich:tabPanel,
which was eventually removed.
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
index e249621..aa9f90d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
@@ -50,7 +50,7 @@ id - the id of the Resource being accessed
</div>
<div id="centerContent" class="column"
style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;">
<div id="centerContentWrapper"
class="content-right">
- <div style="left: 0; right: 0; height: 100%; position:
relative">
+ <div style="left: 0; right: 0; height: 100%;">
<ui:insert name="summary"><p>Default Entity
Summary</p></ui:insert>
<ui:insert name="tabBar"><p>Default Entity
TabBar</p></ui:insert>
<ui:insert name="content"><p>Default Entity
Content</p></ui:insert>
commit 9ed8f96c231bdce5ca78f3b2ea32b7ef5949e2fb
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 22 12:20:34 2010 -0400
BZ-617257: windows does not open on IE if name includes whitespace
diff --git
a/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml
b/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml
index 2eb3f88..0502e73 100644
---
a/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml
+++
b/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml
@@ -21,7 +21,7 @@
<h:panelGroup rendered="#{operationsBean.selectionMode eq
'SPECIFIC'}">
<h:inputText value="#{operationsBean.resourceId}"
id="resourceId" />
<a href="#"
-
onclick="window.open('/rhq/inventory/resourcePicker.xhtml?nomenu=true&fieldId=customContentForm:resourceId',
'Pick a
resource','width=1000,height=700,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,left=100,top=100');
return false;"
+
onclick="window.open('/rhq/inventory/resourcePicker.xhtml?nomenu=true&fieldId=customContentForm:resourceId',
'ResourcePicker','width=1000,height=700,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,left=100,top=100');
return false;"
class="buttonmed">Pick</a>
</h:panelGroup>
commit 67994d4d27d36390317e91a3e472adc29267a017
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Jul 22 11:40:07 2010 -0400
fix error in description of snmpAgentPort plugin config prop
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 9119de3..b3f5aa3 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
@@ -277,7 +277,7 @@
<c:simple-property name="snmpAgentHost" displayName="SNMP
Agent Host" default="127.0.0.1"
description="the host name or IP address of the Apache
SNMP agent (typically '127.0.0.1')"/>
<c:simple-property name="snmpAgentPort" displayName="SNMP
Agent Port" type="integer" default="1610"
- description="the TCP port of the Apache SNMP agent
(typically '1610')"/>
+ description="the UDP port of the Apache SNMP agent
(typically '1610')"/>
<c:simple-property name="snmpAgentCommunity" displayName="SNMP
Agent Community" default="public"
description="the SNMP community of the Apache SNMP agent
(typically 'public')"/>
commit f0b6101bf98bac9c3a64a625ba84692770bdb7e0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jul 22 11:41:45 2010 +0200
BZ 617131 - roll back the 'channel' -> 'repo' renaming introduced
in 29a4fadac497136b7a6360eed0821984baf35c55
diff --git
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java
new file mode 100644
index 0000000..4bf06a9
--- /dev/null
+++
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java
@@ -0,0 +1,64 @@
+/*
+ * Jopr Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.jbosscache;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+/**
+ * Resource component that deals with JGroups channels
+ *
+ * @author Heiko W. Rupp
+ */
+public class JGroupsChannelComponent implements
ResourceComponent<JBossCacheComponent> {
+
+ ResourceContext<JBossCacheComponent> context;
+
+ /**
+ * This one does not (yet) have an availability of its own, but just follows the
+ * JBossCache instance it is associated with.
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
+ */
+ public AvailabilityType getAvailability() {
+ return context.getParentResourceComponent().getAvailability();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
+ */
+ public void start(ResourceContext<JBossCacheComponent> context) throws
Exception {
+ // TODO Auto-generated method stub
+ this.context = context;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
+ */
+ public void stop() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java
new file mode 100644
index 0000000..ccfb985
--- /dev/null
+++
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java
@@ -0,0 +1,143 @@
+/*
+ * Jopr Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.jbosscache;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+import org.mc4j.ems.connection.EmsConnection;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas.util.DeploymentUtility;
+
+/**
+ * This component will discover JGroups channels within a JBoss Cache instance.
+ * The deal here is that we want to have zero or one JGroups channels per cache.
+ * We will look at the Cache config and see if it contains a
+ * <attribute name="ClusterConfig"> element. If so, we return a
JGroups instance,
+ * else we return nothing.
+ *
+ * @author Heiko W. Rupp
+ */
+public class JGroupsChannelDiscovery implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory.getLog(JGroupsChannelDiscovery.class);
+
+ /* (non-Javadoc)
+ * @see
org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
+ */
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext context)
+ throws InvalidPluginConfigurationException, Exception {
+
+ JBossCacheComponent parent = (JBossCacheComponent)
context.getParentResourceComponent();
+ EmsConnection emsConnection = parent.getEmsConnection();
+ String resKey = context.getParentResourceContext().getResourceKey();
+ File file = DeploymentUtility.getDescriptorFile(emsConnection, resKey);
+ if (file == null) {
+ log.warn("File is null for " + resKey);
+ return null;
+ }
+
+ boolean found = false;
+ try {
+ SAXBuilder builder = new SAXBuilder();
+ Document doc = builder.build(file);
+
+ // Get the root element
+ Element root = doc.getRootElement();
+
+ // XPath xpath = XPathFactory.newInstance().newXPath();
+ // TODO this expression would need to work against non-normalized versions of
the name attribute
+ // XPathExpression xp = xpath
+ // .compile("/server/mbean[@name='" + resKey +
"']/attribute[@name='ClusterConfig']");
+ // InputSource inputSource = new InputSource(new
FileInputStream(file));
+ // NodeList cconfig = (NodeList) xp.evaluate(inputSource,
XPathConstants.NODESET);
+ // if (cconfig != null && cconfig.getLength() > 0)
+ // found = true;
+
+ // First look for the right mbean of *our* cache - the file may contain more
than one
+
+ // TODO move code in helper, as we'll need it later again
+ // TODO replace the access of 'our' ClusterConfig attribute with an
XPath expression
+ for (Object mbeanObj : root.getChildren("mbean")) {
+ if (mbeanObj instanceof Element) {
+ Element mbean = (Element) mbeanObj;
+ String nameAttrib = mbean.getAttributeValue("name");
+ try {
+ ObjectName on = new ObjectName(nameAttrib);
+ nameAttrib = on.getCanonicalName();
+ } catch (MalformedObjectNameException e) {
+ log.warn("Can't canonicalize " + nameAttrib);
+ }
+ if (nameAttrib.equals(resKey)) {
+ // our cache instance, look for the right attribute
+ List children = mbean.getChildren("attribute");
+ for (Object childObj : children) {
+ if (childObj instanceof Element) {
+ Element child = (Element) childObj;
+ String name = child.getAttributeValue("name");
+ if (name.equals("ClusterConfig"))
+ found = true;
+ }
+ }
+ }
+ }
+ }
+ } catch (IOException e) {
+ log.error("IO error occurred while reading file: " + file, e);
+ } catch (JDOMException e) {
+ log.error("Parsing error occurred while reading file: " + file,
e);
+ }
+
+ if (found) {
+ DiscoveredResourceDetails detail = new
DiscoveredResourceDetails(context.getResourceType(), // Resource Type
+ resKey + "jgroupsChannel", // ResourceKey TODO good choice ?
+ "JGroups channel", // resource name
+ null, // Version
+ "JGroups config for parent JBossCache", // description
+ context.getDefaultPluginConfiguration(), // config
+ null); // process info
+ Set<DiscoveredResourceDetails> res = new
HashSet<DiscoveredResourceDetails>(1);
+ res.add(detail);
+ return res;
+ }
+
+ return null;
+ }
+
+}
diff --git
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java
deleted file mode 100644
index 85375ac..0000000
---
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Jopr Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.plugins.jbosscache;
-
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-
-/**
- * Resource component that deals with JGroups repos
- *
- * @author Heiko W. Rupp
- */
-public class JGroupsRepoComponent implements ResourceComponent<JBossCacheComponent>
{
-
- ResourceContext<JBossCacheComponent> context;
-
- /**
- * This one does not (yet) have an availability of its own, but just follows the
- * JBossCache instance it is associated with.
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
- */
- public AvailabilityType getAvailability() {
- return context.getParentResourceComponent().getAvailability();
- }
-
- /* (non-Javadoc)
- * @see
org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
- */
- public void start(ResourceContext<JBossCacheComponent> context) throws
Exception {
- // TODO Auto-generated method stub
- this.context = context;
-
- }
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
- */
- public void stop() {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java
b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java
deleted file mode 100644
index 3436aa1..0000000
---
a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Jopr Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.plugins.jbosscache;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.mc4j.ems.connection.EmsConnection;
-
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jbossas.util.DeploymentUtility;
-
-/**
- * This component will discover JGroups repos within a JBoss Cache instance.
- * The deal here is that we want to have zero or one JGroups repos per cache.
- * We will look at the Cache config and see if it contains a
- * <attribute name="ClusterConfig"> element. If so, we return a
JGroups instance,
- * else we return nothing.
- *
- * @author Heiko W. Rupp
- */
-public class JGroupsRepoDiscovery implements ResourceDiscoveryComponent {
-
- private final Log log = LogFactory.getLog(JGroupsRepoDiscovery.class);
-
- /* (non-Javadoc)
- * @see
org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
- */
- public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext context)
- throws InvalidPluginConfigurationException, Exception {
-
- JBossCacheComponent parent = (JBossCacheComponent)
context.getParentResourceComponent();
- EmsConnection emsConnection = parent.getEmsConnection();
- String resKey = context.getParentResourceContext().getResourceKey();
- File file = DeploymentUtility.getDescriptorFile(emsConnection, resKey);
- if (file == null) {
- log.warn("File is null for " + resKey);
- return null;
- }
-
- boolean found = false;
- try {
- SAXBuilder builder = new SAXBuilder();
- Document doc = builder.build(file);
-
- // Get the root element
- Element root = doc.getRootElement();
-
- // XPath xpath = XPathFactory.newInstance().newXPath();
- // TODO this expression would need to work against non-normalized versions of
the name attribute
- // XPathExpression xp = xpath
- // .compile("/server/mbean[@name='" + resKey +
"']/attribute[@name='ClusterConfig']");
- // InputSource inputSource = new InputSource(new
FileInputStream(file));
- // NodeList cconfig = (NodeList) xp.evaluate(inputSource,
XPathConstants.NODESET);
- // if (cconfig != null && cconfig.getLength() > 0)
- // found = true;
-
- // First look for the right mbean of *our* cache - the file may contain more
than one
-
- // TODO move code in helper, as we'll need it later again
- // TODO replace the access of 'our' ClusterConfig attribute with an
XPath expression
- for (Object mbeanObj : root.getChildren("mbean")) {
- if (mbeanObj instanceof Element) {
- Element mbean = (Element) mbeanObj;
- String nameAttrib = mbean.getAttributeValue("name");
- try {
- ObjectName on = new ObjectName(nameAttrib);
- nameAttrib = on.getCanonicalName();
- } catch (MalformedObjectNameException e) {
- log.warn("Can't canonicalize " + nameAttrib);
- }
- if (nameAttrib.equals(resKey)) {
- // our cache instance, look for the right attribute
- List children = mbean.getChildren("attribute");
- for (Object childObj : children) {
- if (childObj instanceof Element) {
- Element child = (Element) childObj;
- String name = child.getAttributeValue("name");
- if (name.equals("ClusterConfig"))
- found = true;
- }
- }
- }
- }
- }
- } catch (IOException e) {
- log.error("IO error occurred while reading file: " + file, e);
- } catch (JDOMException e) {
- log.error("Parsing error occurred while reading file: " + file,
e);
- }
-
- if (found) {
- DiscoveredResourceDetails detail = new
DiscoveredResourceDetails(context.getResourceType(), // Resource Type
- resKey + "jgroupsRepo", // ResourceKey TODO good choice ?
- "JGroups repo", // resource name
- null, // Version
- "JGroups config for parent JBossCache", // description
- context.getDefaultPluginConfiguration(), // config
- null); // process info
- Set<DiscoveredResourceDetails> res = new
HashSet<DiscoveredResourceDetails>(1);
- res.add(detail);
- return res;
- }
-
- return null;
- }
-
-}
diff --git a/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml
index fe28e78..2ef0f4f 100644
--- a/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml
@@ -16,8 +16,8 @@
discovery="JBossCacheSubsystemDiscovery"
description="The JBoss Cache instances on this server"
singleton="true"
- >
-
+
+
<runs-inside>
<parent-resource-type name="JBossAS Server"
plugin="JBossAS"/>
</runs-inside>
@@ -28,28 +28,28 @@
description="Statistics for JBossCache"
createDeletePolicy="create-only"
-
+
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true"
default="*:cache-interceptor=CacheMgmtInterceptor,*|*:treecache-interceptor=CacheMgmtInterceptor,*"/>
<c:simple-property name="isTreeCache" readOnly="true"
type="boolean" default="false" description="Is this a TreeCache
instance or a POJO Cache"/>
</plugin-configuration>
-
+
<operation name="resetStatistics" displayName="Reset
Statistics" description="Resets all statistics" />
<operation name="listAssociatedMBeans" displayName="List
associated MBeans" description="List all MBeans that form this Cache
instance">
<results><c:simple-property
name="mbeans"></c:simple-property></results>
</operation>
-
+
<metric property=":numberOfNodes" displayName="Number of
Nodes" displayType="summary" />
-
- <metric property="ActivationInterceptor:activations"
displayName="Activations"
+
+ <metric property="ActivationInterceptor:activations"
displayName="Activations"
description="Number of passivated nodes that have been
activated."/>
-
- <metric property="CacheLoaderInterceptor:cacheLoaderLoads"
displayName="Cache Loader Loads"
+
+ <metric property="CacheLoaderInterceptor:cacheLoaderLoads"
displayName="Cache Loader Loads"
measurementType="trendsup" description="Number of nodes
loaded through a cache loader."/>
<metric property="CacheLoaderInterceptor:cacheLoaderMisses"
displayName="Cache Loader Misses"
measurementType="trendsup" description="Number of
unsuccessful attempts to load a node through a cache loader."/>
-
- <metric property="CacheMgmtInterceptor:hits"
displayName="Cache Hits" category="performance"
+
+ <metric property="CacheMgmtInterceptor:hits"
displayName="Cache Hits" category="performance"
measurementType="trendsup" description="Number of
successful attribute retrievals."/>
<metric property="CacheMgmtInterceptor:misses"
displayName="Cache Misses" category="performance"
measurementType="trendsup" description="Number of
unsuccessful attribute retrievals."/>
@@ -57,44 +57,44 @@
description="Ratio of hits to hits and misses. A hit is a get
attribute operation that results in an object being returned to the client. The retrieval
may be from a cache loader if the entry isn't in the local cache."/>
<metric property="CacheMgmtInterceptor:readWriteRatio"
displayName="Read-write-ratio" displayType="summary"
description="Ratio of read operations to write operations. This is
the ratio of cache hits and misses to cache stores."/>
- <metric property="CacheMgmtInterceptor:stores"
displayName="Cache Stores" category="performance"
+ <metric property="CacheMgmtInterceptor:stores"
displayName="Cache Stores" category="performance"
measurementType="trendsup" description="Number of
attribute store operations."/>
- <metric property="CacheMgmtInterceptor:evictions"
displayName="Cache Evictions" category="performance"
+ <metric property="CacheMgmtInterceptor:evictions"
displayName="Cache Evictions" category="performance"
measurementType="trendsup" description="Number of node
evictions."/>
- <metric property="CacheMgmtInterceptor:numberOfAttributes"
displayName="Number of Attributes"
+ <metric property="CacheMgmtInterceptor:numberOfAttributes"
displayName="Number of Attributes"
category="performance" description="Number of attributes
currently cached." />
- <metric property="CacheMgmtInterceptor:numberOfNodes"
displayName="Number of Nodes cached"
+ <metric property="CacheMgmtInterceptor:numberOfNodes"
displayName="Number of Nodes cached"
category="performance" description="Number of nodes
currently cached."/>
- <metric property="CacheMgmtInterceptor:elapsedTime"
displayName="Elapsed Time" category="utilization"
- measurementType="trendsup" description="Number of seconds
that the cache has been running."
+ <metric property="CacheMgmtInterceptor:elapsedTime"
displayName="Elapsed Time" category="utilization"
+ measurementType="trendsup" description="Number of seconds
that the cache has been running."
units="seconds"/>
- <metric property="CacheMgmtInterceptor:timeSinceReset"
displayName="Time since reset" category="utilization"
- measurementType="trendsup" description="Number of seconds
since the cache statistics have been reset."
+ <metric property="CacheMgmtInterceptor:timeSinceReset"
displayName="Time since reset" category="utilization"
+ measurementType="trendsup" description="Number of seconds
since the cache statistics have been reset."
units="seconds"/>
- <metric property="CacheMgmtInterceptor:averageReadTime"
displayName="Average Read Time" category="performance"
- description="Average time in milliseconds to retrieve a cache
attribute, including unsuccessful attribute retrievals."
+ <metric property="CacheMgmtInterceptor:averageReadTime"
displayName="Average Read Time" category="performance"
+ description="Average time in milliseconds to retrieve a cache
attribute, including unsuccessful attribute retrievals."
units="milliseconds"/>
- <metric property="CacheMgmtInterceptor:averageWriteTime"
displayName="Average Write Time"
- category="performance" description="Average time in
milliseconds to write a cache attribute."
+ <metric property="CacheMgmtInterceptor:averageWriteTime"
displayName="Average Write Time"
+ category="performance" description="Average time in
milliseconds to write a cache attribute."
units="milliseconds"/>
-
- <metric property="CacheStoreInterceptor:cacheLoaderStores"
displayName="Cache Loader Stores"
+
+ <metric property="CacheStoreInterceptor:cacheLoaderStores"
displayName="Cache Loader Stores"
category="utilization" description="Number of nodes
written to the cache loader." measurementType="trendsup" />
-
- <metric property="InvalidationInterceptor:invalidations"
displayName="Invalidataions"
- category="utilization" description="Number of cached
nodes that have been invalidated."
+
+ <metric property="InvalidationInterceptor:invalidations"
displayName="Invalidataions"
+ category="utilization" description="Number of cached
nodes that have been invalidated."
measurementType="trendsup" />
-
- <metric property="PassivationInterceptor:passivations"
displayName="Passivations" category="utilization"
+
+ <metric property="PassivationInterceptor:passivations"
displayName="Passivations" category="utilization"
description="Number of cached nodes that have been
passivated." measurementType="trendsup"/>
-
- <metric property="TxInterceptor:prepares" displayName="Tx
prepares"
- description="Number of transaction prepare operations
performed." measurementType="trendsup" />
- <metric property="TxInterceptor:commits" displayName="Tx
commits"
- description="Number of transaction commit operations
performed." measurementType="trendsup" />
- <metric property="TxInterceptor:rollbacks" displayName="Tx
rollbacks"
- description="Number of transaction rollback operations
performed." measurementType="trendsup" />
-
+
+ <metric property="TxInterceptor:prepares" displayName="Tx
prepares"
+ description="Number of transaction prepare operations
performed." measurementType="trendsup" />
+ <metric property="TxInterceptor:commits" displayName="Tx
commits"
+ description="Number of transaction commit operations
performed." measurementType="trendsup" />
+ <metric property="TxInterceptor:rollbacks" displayName="Tx
rollbacks"
+ description="Number of transaction rollback operations
performed." measurementType="trendsup" />
+
<resource-configuration>
<c:simple-property name="Flavour" default="treecache"
description="Is this going to be a Pojo Cache or a Tree
Cache">
@@ -103,7 +103,7 @@
<c:option name="Tree Cache" value="treecache"
default="true"/>
</c:property-options>
</c:simple-property>
- <c:simple-property name="TransactionManagerLookupClass"
+ <c:simple-property name="TransactionManagerLookupClass"
default="org.jboss.cache.JBossTransactionManagerLookup"
description="What class should be used to get a transaction manager
instance"/>
<c:simple-property name="IsolationLevel"
default="REPEATABLE_READ"
@@ -132,39 +132,39 @@
<c:simple-property name="UseReplQueue" type="boolean"
default="false"
description="Just used for async repl: use a replication queue
"/>
<c:simple-property name="ReplQueueInterval"
type="integer" default="100"
- description="Replication interval for replication queue (in ms)
"/>
+ description="Replication interval for replication queue (in ms)
"/>
<c:simple-property name="ReplQueueMaxElements"
type="integer" default="10"
description="Max number of elements which trigger
replication" />
<c:simple-property name="ClusterName"
default="DefaultPartition"
description="Name of cluster. Needs to be the same for all
clusters, in order to find each other"/>
-
- <c:simple-property name="FetchStateOnStartup"
type="boolean" default="true"
+
+ <c:simple-property name="FetchStateOnStartup"
type="boolean" default="true"
description="Whether or not to fetch state on joining a
cluster"/>
- <c:simple-property name="InitialStateRetrievalTimeout"
type="long"
+ <c:simple-property name="InitialStateRetrievalTimeout"
type="long"
description=" The max amount of time (in milliseconds) we wait
until the
initial state (ie. the contents of the cache) are retrieved from
- existing members in a clustered environment"
default="5000"/>
+ existing members in a clustered environment"
default="5000"/>
<c:simple-property name="SyncReplTimeout" type="long"
default="15000"
description="Number of milliseconds to wait until all responses
for a
synchronous call have been received."/>
<c:simple-property name="LockAcquisitionTimeout"
type="long" default="10000"
description="Max number of milliseconds to wait for a lock
acquisition."/>
-
+
</resource-configuration>
<help>
<![CDATA[
- <p>Please note that the number of possible metrics varies depending on
the configuration and flavour of
+ <p>Please note that the number of possible metrics varies depending on
the configuration and flavour of
Cache used.</p>
]]>
</help>
-
- <service name="JGroupsRepo"
- description="The underlying JGroups repo for this cache instance"
- class="JGroupsRepoComponent"
- discovery="JGroupsRepoDiscovery">
+
+ <service name="JGroupsChannel"
+ description="The underlying JGroups channel for this cache
instance"
+ class="JGroupsChannelComponent"
+ discovery="JGroupsChannelDiscovery">
</service>
</service>
-
+
</server>
-
+
</plugin>
\ No newline at end of file
commit 22aba8e0ae4db5d976807ceaa1e051f0a9e92771
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 22 01:23:35 2010 -0400
add the ability to sort the ResourceGroupCriteria object by plugin name
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
index 67a66a9..7544422 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
@@ -67,6 +67,7 @@ public class ResourceGroupCriteria extends TaggedCriteria {
private PageOrdering sortName;
private PageOrdering sortResourceTypeName; // requires overrides
+ private PageOrdering sortPluginName; // requires overrides
public ResourceGroupCriteria() {
filterOverrides.put("resourceTypeId", "resourceType.id =
?");
@@ -110,7 +111,7 @@ public class ResourceGroupCriteria extends TaggedCriteria {
filterOverrides.put("groupDefinitionId", "groupDefinition.id =
?");
sortOverrides.put("resourceTypeName", "resourceType.name");
-
+ sortOverrides.put("pluginName", "resourceType.plugin");
}
@Override
@@ -238,6 +239,11 @@ public class ResourceGroupCriteria extends TaggedCriteria {
this.sortResourceTypeName = sortResourceTypeName;
}
+ public void addSortPluginName(PageOrdering sortPluginName) {
+ addSortField("pluginName");
+ this.sortPluginName = sortPluginName;
+ }
+
/** subclasses should override as necessary */
@Override
public boolean isSecurityManagerRequired() {
commit 26c62395c00fd7917693a3a103298428f2f1c86e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 22 01:23:18 2010 -0400
BZ-616634: support criteria-based sorting by nullable path expressions
* for each ordering token, decide whether it's a path expression
* if it is, determine if it has at least 3 parts (criteriaAlias + path + leaf)
* if it does, add left join for part that precedes the leaf, and generate an alias for
this path
** only add the join clause if it doesn't already exist in the generated query
* finally, add the order by clause, with the generated path aliases as necessary
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 6c43b46..3216ec7 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
@@ -42,6 +42,7 @@ import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.criteria.Criteria;
import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
import org.rhq.core.domain.criteria.SubjectCriteria;
import org.rhq.core.domain.operation.OperationRequestStatus;
@@ -321,6 +322,58 @@ public final class CriteriaQueryGenerator {
results.append(authorizationJoinFragment);
}
+ // figure out the 'LEFT JOIN's needed for 'ORDER BY' tokens
+ PageControl pc = getPageControl(criteria);
+ List<String> orderingFieldRequiredJoins = new ArrayList<String>();
+ List<String> orderingFieldTokens = new ArrayList<String>();
+
+ for (OrderingField orderingField : pc.getOrderingFields()) {
+ PageOrdering ordering = orderingField.getOrdering();
+ String fieldName = orderingField.getField();
+ String override = criteria.getJPQLSortOverride(fieldName);
+ String suffix = (override == null) ? fieldName : override;
+
+ /*
+ * do not prefix the alias when:
+ *
+ * 1) if the suffix is numerical, which allows usto sort by column
ordinal
+ * 2) if the user wants full control and has explicitly chosen to disable
alias prepending
+ */
+ boolean doNotPrefixAlias = isNumber(suffix) ||
criteria.hasCustomizedSorting();
+ String sortFragment = doNotPrefixAlias ? suffix : (alias + "." +
suffix);
+
+ int lastDelimiterIndex = sortFragment.lastIndexOf('.');
+ if (lastDelimiterIndex == -1) {
+ // does not require joins, just add the ordering field token directly
+ orderingFieldTokens.add(sortFragment + " " + ordering);
+ continue;
+ }
+
+ int firstDelimiterIndex = sortFragment.indexOf('.');
+ if (firstDelimiterIndex == lastDelimiterIndex) {
+ // only one dot implies its a property/field directly off of the primary
alias
+ // thus, also does not require joins, just add the ordering field token
directly
+ orderingFieldTokens.add(sortFragment + " " + ordering);
+ continue;
+ }
+
+ String expressionRoot = sortFragment.substring(0, lastDelimiterIndex);
+ String expressionLeaf = sortFragment.substring(lastDelimiterIndex + 1);
+ int expressionRootIndex =
orderingFieldRequiredJoins.indexOf(expressionRoot);
+
+ String joinAlias = null;
+ if (expressionRootIndex == -1) {
+ // new join
+ joinAlias = "orderingField" +
orderingFieldRequiredJoins.size();
+ orderingFieldRequiredJoins.add(expressionRoot);
+ results.append("LEFT JOIN
").append(expressionRoot).append(" ").append(joinAlias).append(NL);
+ } else {
+ joinAlias = "orderingField" + expressionRootIndex;
+ }
+
+ orderingFieldTokens.add(joinAlias + "." + expressionLeaf + "
" + ordering);
+ }
+
Map<String, Object> filterFields = getFilterFields(criteria);
if (filterFields.size() > 0 || authorizationJoinFragment != null ||
searchExpressionWhereClause != null) {
results.append("WHERE ");
@@ -410,36 +463,19 @@ public final class CriteriaQueryGenerator {
results.append(NL).append("HAVING ").append(havingClause);
}
- // order by clause
- PageControl pc = getPageControl(criteria);
-
+ // ordering clause
boolean first = true;
- for (OrderingField orderingField : pc.getOrderingFields()) {
+ for (String next : orderingFieldTokens) {
if (first) {
results.append(NL).append("ORDER BY ");
first = false;
} else {
results.append(", ");
}
-
- String fieldName = orderingField.getField();
- String override = criteria.getJPQLSortOverride(fieldName);
- String suffix = (override == null) ? fieldName : override;
-
- /*
- * do not prefix the alias when:
- *
- * 1) if the suffix is numerical, which allows usto sort by column
ordinal
- * 2) if the user wants full control and has explicitly chosen to
disable alias prepending
- */
- boolean doNotPrefixAlias = isNumber(suffix) ||
criteria.hasCustomizedSorting();
- String sortFragment = doNotPrefixAlias ? suffix : (alias + "."
+ suffix);
-
- PageOrdering ordering = orderingField.getOrdering();
-
- results.append(sortFragment).append(' ').append(ordering);
+ results.append(next);
}
}
+
results.append(NL);
LOG.debug(results);
@@ -532,8 +568,8 @@ public final class CriteriaQueryGenerator {
try {
Class<?> entityClass = criteria.getPersistentClass();
- SearchTranslationManager searchManager = new
SearchTranslationManager(subject, SearchSubsystem
- .get(entityClass));
+ SearchTranslationManager searchManager = new
SearchTranslationManager(subject,
+ SearchSubsystem.get(entityClass));
searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling
'AND' to the where clause
@@ -696,7 +732,8 @@ public final class CriteriaQueryGenerator {
//testSubjectCriteria();
//testAlertCriteria();
//testInheritanceCriteria();
- testResourceCriteria();
+ //testResourceCriteria();
+ testResourceGroupCriteria();
}
public static void testSubjectCriteria() {
@@ -747,6 +784,26 @@ public final class CriteriaQueryGenerator {
System.out.println(generator.getQueryString(true));
}
+ public static void testResourceGroupCriteria() {
+ ResourceGroupCriteria groupCriteria = new ResourceGroupCriteria();
+ groupCriteria.addSortName(PageOrdering.DESC);
+ groupCriteria.addSortResourceTypeName(PageOrdering.ASC);
+ groupCriteria.addSortPluginName(PageOrdering.DESC);
+
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(new Subject(),
groupCriteria);
+ System.out.println(generator.getQueryString(false));
+ System.out.println(generator.getQueryString(true));
+
+ PageControl customPC = new PageControl();
+ customPC.addDefaultOrderingField("0", PageOrdering.DESC);
+ customPC.addDefaultOrderingField("name", PageOrdering.DESC);
+ customPC.addDefaultOrderingField("resourceType.name",
PageOrdering.ASC);
+ groupCriteria.setPageControl(customPC);
+
+ System.out.println(generator.getQueryString(false));
+ System.out.println(generator.getQueryString(true));
+ }
+
public static void testResourceCriteria() {
ResourceCriteria resourceCriteria = new ResourceCriteria();
resourceCriteria.addFilterResourceCategory(ResourceCategory.SERVER);
@@ -758,8 +815,8 @@ public final class CriteriaQueryGenerator {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord,
resourceCriteria);
- generator.getQueryString(false);
- generator.getQueryString(true);
+ System.out.println(generator.getQueryString(false));
+ System.out.println(generator.getQueryString(true));
}
public static PageControl getPageControl(Criteria criteria) {
commit feb80e3201b76fdb3464515d7cf75dd3057155f4
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 21 19:16:06 2010 -0400
fix compiler error concerning type erasure
* the following two methods had the same erasure
** locateProperty(List<Property>, String)
** locateProperty(List<PropertySimple>, String)
* renamed the second method to 'locatePropertySimple'
* updating calling paths to use new method name
diff --git
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
index 7c80417..1384498 100644
---
a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
+++
b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java
@@ -80,11 +80,11 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
// Test get configuration
Configuration configRetrieved = WEBSERVICE_REMOTE.getConfiguration(
// JaxbConfiguration configRetrieved =
- // WEBSERVICE_REMOTE.getConfiguration(
+ // WEBSERVICE_REMOTE.getConfiguration(
subject, configuration.getId());
assertNotNull("Configuration was not located.", configRetrieved);
- assertEquals("Configuration information was not correct.",
configuration.getVersion(), configRetrieved
- .getVersion());
+ assertEquals("Configuration information was not correct.",
configuration.getVersion(),
+ configRetrieved.getVersion());
boolean isUpdating =
WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.getId());
assertFalse("Config should not be in process of modification.",
isUpdating);
@@ -93,7 +93,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
// Configuration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration(
WsConfiguration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration(
// JaxbConfiguration pluginConfig =
- // WEBSERVICE_REMOTE.getPluginConfiguration(
+ // WEBSERVICE_REMOTE.getPluginConfiguration(
subject, resource.getId());
assertNotNull("Configuration was not located.", configRetrieved);
assertNotNull("The property definition map should not be null.",
pluginConfig.getProperties());
@@ -143,7 +143,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
return located;
}
- private PropertySimple locateProperty(List<PropertySimple> properties, String
name) {
+ private PropertySimple locatePropertySimple(List<PropertySimple> properties,
String name) {
PropertySimple located = null;
if ((properties != null) && (name != null) &&
(name.trim().length() > 0)) {
// List<Entry> list = properties.getEntry();
@@ -159,7 +159,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements
TestPrope
}
private PropertySimple getSimple(List<PropertySimple> list, String name) {
- Property property = locateProperty(list, name);
+ Property property = locatePropertySimple(list, name);
return (PropertySimple) property;
}
commit a107fd99796ca3ad2d997516a947755d92554289
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 21 19:11:33 2010 -0400
update .classpath file to the latest project dependencies defined by poms
diff --git a/.classpath b/.classpath
index a3d9d09..ac5cafd 100644
--- a/.classpath
+++ b/.classpath
@@ -157,7 +157,7 @@
<accessrule kind="accessible"
pattern="com/sun/org/apache/bcel/internal/generic/**"/>
</accessrules>
</classpathentry>
- <classpathentry exported="true" kind="var"
path="M2_REPO/i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/gnu-getopt/getopt/1.0.13/getopt-1.0.13.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/jboss/jboss-remoting/2.2.2.SP8/jboss-remoting-2.2.2.SP8.jar"/>
@@ -202,14 +202,14 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar"
sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11.jar"
sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar"
sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/javax/mail/mail/1.3.1/mail-1.3.1.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-api/3.3.2.SR1/richfaces-api-3.3.2.SR1.jar"
sourcepath="/M2_REPO/org/richfaces/framework/richfaces-api/3.1.3.GA/richfaces-api-3.1.3.GA-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-impl/3.3.2.SR1/richfaces-impl-3.3.2.SR1.jar"
sourcepath="/M2_REPO/org/richfaces/framework/richfaces-impl/3.3.0.GA/richfaces-impl-3.3.0.GA-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/richfaces/ui/richfaces-ui/3.3.2.SR1/richfaces-ui-3.3.2.SR1.jar"
sourcepath="/M2_REPO/org/richfaces/ui/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/postgresql/postgresql/8.4-701.jdbc3/postgresql-8.4-701.jdbc3.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/jboss/jboss-cache/1.4.1.SP9/jboss-cache-1.4.1.SP9.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar"
sourcepath="/M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/hyperic/sigar/1.6.5.132/sigar-1.6.5.132.jar"
sourcepath="/M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/transaction/jboss-jta/4.2.3.SP5/jboss-jta-4.2.3.SP5.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/transaction/jboss-jts-common/4.2.3.SP5/jboss-jts-common-4.2.3.SP5.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/jbossws-spi/1.1.1.GA/jbossws-spi-1.1.1.GA.jar"/>
@@ -218,7 +218,7 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/codehaus/swizzle/swizzle-confluence/1.2.Alpha1/swizzle-confluence-1.2.Alpha1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jvnet/inflector/0.7.0/inflector-0.7.0.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/net/augeas/augeas/0.0.1/augeas-0.0.1.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/net/augeas/augeas/0.0.2/augeas-0.0.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/json/json/20080701/json-20080701.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/freemarker/freemarker/2.3.11/freemarker-2.3.11.jar"/>
@@ -237,12 +237,12 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/pircbot/pircbot/1.4.2/pircbot-1.4.2.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/net/homeip/yusuke/twitter4j/2.0.9/twitter4j-2.0.9.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/twitter4j/twitter4j-core/2.1.2/twitter4j-core-2.1.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jmock/jmock/2.5.1/jmock-2.5.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar"/>
- <classpathentry exported="true" kind="lib"
path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-3.0.0-SNAPSHOT/wsconsume-output"/>
+ <classpathentry exported="true" kind="lib"
path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.0.0-SNAPSHOT/wsconsume-output"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/jboss/web/jbossweb/2.0.1.GA/jbossweb-2.0.1.GA.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/libvirt/libvirt/0.4.1/libvirt-0.4.1.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman/1.2.1/byteman-1.2.1.jar"/>
commit d6ba7b1ab1a8fe54e3fa65bbfff0b53181e0c020
Merge: 76bbed4... 09963f3...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 21 17:39:06 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-work
commit 76bbed4c0d1362c83356f0382cd99700b8c07e41
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 21 17:37:20 2010 -0400
[bz 616978] extend transactional timeout to compensate for removal of an
obsolete type with a large number of doomed resources.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index 1cc1b44..64e9afd 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -49,6 +49,8 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.TransactionTimeout;
+
import org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph;
import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager;
import org.rhq.core.clientapi.agent.metadata.SubCategoriesMetadataParser;
@@ -429,7 +431,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
return;
}
- private void updateTypes(Set<ResourceType> resourceTypes) throws Exception {
+ private void updateTypes(Set<ResourceType> resourceTypes) throws Exception {
// Only process the type if it is a non-runs-inside type (i.e. not a child of
some other type X at this same
// level in the type hierarchy). runs-inside types which we skip here will get
processed at the next level down
// when we recursively process type X's children.
@@ -462,8 +464,10 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
+ // up timeout to 60 minutes in case of large inventories
@SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
+ @TransactionTimeout(60 * 60)
public void removeObsoleteTypesInNewTransaction(String pluginName) {
try {
Query query =
entityManager.createNamedQuery(ResourceType.QUERY_FIND_BY_PLUGIN);
@@ -512,8 +516,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
private void removeResourceTypes(Subject overlord, Set<ResourceType>
candidateTypes,
- Set<ResourceType> typesToBeRemoved)
- throws Exception {
+ Set<ResourceType> typesToBeRemoved) throws Exception {
for (ResourceType candidateType : candidateTypes) {
// Remove obsolete descendant types first.
Set<ResourceType> childTypes = candidateType.getChildResourceTypes();
@@ -533,7 +536,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
private void removeResourceType(Subject overlord, ResourceType existingType) {
- log.info("Removing ResourceType [" + toConciseString(existingType) +
"]...");
+ log.info("Removing ResourceType [" + toConciseString(existingType) +
"]...");
if (entityManager.contains(existingType)) {
entityManager.refresh(existingType);
@@ -635,8 +638,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
ResourceType existingType;
try {
- existingType =
resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(),
- resourceType.getPlugin());
+ existingType =
resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), resourceType
+ .getPlugin());
} catch (NonUniqueResultException nure) {
log.debug("Found more than one existing ResourceType for " +
resourceType);
// TODO: Delete the redundant ResourceTypes to get the DB into a valid
state.
@@ -701,8 +704,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
// above already took care of any modifications to the ResourceSubCategories
themselves).
} else if (newSubCat == null) {
if (oldSubCat != null) {
- log.debug("Metadata update: Subcategory of ResourceType [" +
resourceType.getName()
- + "] changed from " + oldSubCat + " to " +
newSubCat);
+ log.debug("Metadata update: Subcategory of ResourceType [" +
resourceType.getName() + "] changed from "
+ + oldSubCat + " to " + newSubCat);
existingType.setSubCategory(null);
}
} else {
@@ -762,14 +765,14 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
if (log.isDebugEnabled()) {
if (existingType != null) {
log.debug("Setting parent types on existing type: " +
existingType + " to ["
- + newType.getParentResourceTypes() + "] - current parent
types are ["
- + existingType.getParentResourceTypes() + "]...");
+ + newType.getParentResourceTypes() + "] - current parent types
are ["
+ + existingType.getParentResourceTypes() + "]...");
} else {
- log.debug("Setting parent types on new type: " + newType
- + " to [" + newType.getParentResourceTypes() +
"]...");
+ log.debug("Setting parent types on new type: " + newType +
" to [" + newType.getParentResourceTypes()
+ + "]...");
}
}
-
+
Set<ResourceType> newParentTypes = newType.getParentResourceTypes();
newType.setParentResourceTypes(new HashSet<ResourceType>());
Set<ResourceType> originalExistingParentTypes = new
HashSet<ResourceType>();
@@ -778,7 +781,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
for (ResourceType newParentType : newParentTypes) {
try {
- boolean isExistingParent =
originalExistingParentTypes.remove(newParentType);
+ boolean isExistingParent =
originalExistingParentTypes.remove(newParentType);
if (existingType == null || !isExistingParent) {
ResourceType realParentType = (ResourceType)
entityManager.createNamedQuery(
ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name",
newParentType.getName())
@@ -786,19 +789,19 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
ResourceType type = (existingType != null) ? existingType : newType;
if (existingType != null) {
log.info("Adding ResourceType [" +
toConciseString(type) + "] as child of ResourceType ["
- + toConciseString(realParentType) + "]...");
+ + toConciseString(realParentType) + "]...");
}
realParentType.addChildResourceType(type);
}
} catch (NoResultException nre) {
- throw new RuntimeException("Couldn't persist type [" +
newType
- + "] because parent [" + newParentType + "] wasn't
already persisted.");
+ throw new RuntimeException("Couldn't persist type [" +
newType + "] because parent [" + newParentType
+ + "] wasn't already persisted.");
}
}
for (ResourceType obsoleteParentType : originalExistingParentTypes) {
log.info("Removing type [" + toConciseString(existingType) +
"] from parent type ["
- + toConciseString(obsoleteParentType) + "]...");
+ + toConciseString(obsoleteParentType) + "]...");
obsoleteParentType.removeChildResourceType(existingType);
moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes);
}
@@ -810,7 +813,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
return (type != null) ? (type.getPlugin() + ":" + type.getName() +
"(id=" + type.getId() + ")") : "null";
}
- private void moveResourcesToNewParent(ResourceType existingType, ResourceType
obsoleteParentType, Set<ResourceType> newParentTypes) {
+ private void moveResourcesToNewParent(ResourceType existingType, ResourceType
obsoleteParentType,
+ Set<ResourceType> newParentTypes) {
Subject overlord = subjectManager.getOverlord();
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterResourceTypeId(existingType.getId());
@@ -818,8 +822,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
List<Resource> resources =
resourceManager.findResourcesByCriteria(overlord, criteria);
for (Resource resource : resources) {
Resource newParent = null;
- newParentTypes:
- for (ResourceType newParentType : newParentTypes) {
+ newParentTypes: for (ResourceType newParentType : newParentTypes) {
Resource ancestorResource = resource.getParentResource();
while (ancestorResource != null) {
if (ancestorResource.getResourceType().equals(newParentType)) {
@@ -846,7 +849,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
newParent.addChildResource(resource);
} else {
log.debug("We were unable to move " + resource + " from
invalid parent " + resource.getParentResource()
- + " to a new valid parent with one of the following types:
" + newParentTypes);
+ + " to a new valid parent with one of the following types:
" + newParentTypes);
}
}
}
commit 09963f393cdfd19d2a54d9b6985259a22aa4ecac
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jul 21 17:34:03 2010 -0400
BZ 614886
three things
one, change view check to CONFIG_READ check for resource
two, change view check to *group* CONFIG_READ check
three, remove getConfiguration from remote interface
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 99e2d5a..a691bd1 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
@@ -272,7 +272,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
throw new NoResultException("Cannot get live configuration for unknown
resource [" + resourceId + "]");
}
- if (!authorizationManager.canViewResource(subject, resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to view resource configuration for
[" + resource + "]");
}
@@ -1980,7 +1980,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
GroupResourceConfigurationUpdate update =
getGroupResourceConfigurationById(configurationUpdateId);
int groupId = update.getGroup().getId();
- if (authorizationManager.canViewGroup(subject, groupId) == false) {
+ if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ,
groupId) == false) {
throw new PermissionException("User[" + subject.getName()
+ "] does not have permission to view group
resourceConfiguration[id=" + configurationUpdateId + "]");
}
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 4242153..6a1c114 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
@@ -381,6 +381,8 @@ public interface ConfigurationManagerLocal {
*/
void checkForTimedOutConfigurationUpdateRequests();
+ public Configuration getConfiguration(Subject subject, int configurationId);
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// The following are shared with the Remote Interface
@@ -392,8 +394,6 @@ public interface ConfigurationManagerLocal {
public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject
subject,
int configurationUpdateId);
- public Configuration getConfiguration(Subject subject, int configurationId);
-
/**
* Get the current plugin configuration for the {@link Resource} with the given id,
or <code>null</code> if the
* resource's plugin configuration is not yet initialized.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java
index b25fa9d..b4836c6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java
@@ -65,11 +65,6 @@ public interface ConfigurationManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "configurationUpdateId") int configurationUpdateId);
- @WebMethod
- Configuration getConfiguration( //
- @WebParam(name = "subject") Subject subject, //
- @WebParam(name = "configurationId") int configurationId);
-
/**
* Get the current plugin configuration for the {@link Resource} with the given id,
or <code>null</code> if the
* resource's plugin configuration is not yet initialized.
commit 55ee9efc60ff941d8e838430e8ee9dfe1387174c
Merge: f31dda5... 9b1dd9c...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 21 17:12:08 2010 -0400
Merge branch 'master' into master-jay
commit f31dda5fb516089f0cb3847699ed8bbc64f6dabf
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 21 17:07:14 2010 -0400
[bz 616978] remove umbrella transaction from removal of obsolete types,
allowing more flexible type removal for large inventories.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index dbf95c7..8218909 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -52,7 +52,6 @@ import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
-import javax.persistence.QueryHint;
import javax.persistence.SequenceGenerator;
import javax.persistence.SqlResultSetMapping;
import javax.persistence.Table;
@@ -90,11 +89,8 @@ import org.rhq.core.domain.util.Summary;
query = "SELECT rt FROM ResourceType AS rt WHERE :parent MEMBER OF
rt.parentResourceTypes AND rt.name = :name"),
/* authz'ed queries for ResourceTypeManagerBean */
- @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN, query = "SELECT
res.resourceType "
- + "FROM Resource res, IN (res.implicitGroups) g, IN (g.roles) r, IN
(r.subjects) s " + "WHERE s = :subject "
- + "AND res.parentResource = :parent"),
- @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN_admin, query = "SELECT
res.resourceType "
- + "FROM Resource res " + "WHERE res.parentResource =
:parent"),
+ @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN, query = "SELECT
rt.childResourceTypes "
+ + "FROM ResourceType rt WHERE rt.id = :resourceTypeId "),
@NamedQuery(name = ResourceType.FIND_CHILDREN_BY_PARENT, query = "SELECT
DISTINCT rt FROM ResourceType AS rt "
+ "JOIN FETCH rt.parentResourceTypes AS pa " + // also fetch parents,
as we need them later
"WHERE pa IN (:resourceType)"),
@@ -251,7 +247,6 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
public static final String QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS =
"ResourceType.findByIdWithAllOperations";
public static final String QUERY_FIND_BY_CATEGORY =
"ResourceType.findByCategory";
public static final String QUERY_FIND_CHILDREN =
"ResourceType.findChildren";
- public static final String QUERY_FIND_CHILDREN_admin =
"ResourceType.findChildren_admin";
/** find child resource types for resource :parentResource and category :category */
public static final String QUERY_FIND_CHILDREN_BY_CATEGORY =
"ResourceType.findChildrenByCategory";
public static final String QUERY_FIND_CHILDREN_BY_CATEGORY_admin =
"ResourceType.findChildrenByCategory_admin";
@@ -322,8 +317,7 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
@ManyToMany(cascade = CascadeType.PERSIST)
// persist so self-injecting plugins work
- @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = {
@JoinColumn(name = "RESOURCE_TYPE_ID") },
- inverseJoinColumns = { @JoinColumn(name =
"PARENT_RESOURCE_TYPE_ID") })
+ @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = {
@JoinColumn(name = "RESOURCE_TYPE_ID") }, inverseJoinColumns = {
@JoinColumn(name = "PARENT_RESOURCE_TYPE_ID") })
@OrderBy
//@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
private Set<ResourceType> parentResourceTypes;
@@ -818,87 +812,86 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
+ this.plugin + /*", parents=" + parents +*/"]";
}
+ /*
+ TODO: GWT
+ public void writeExternal(ObjectOutput out) throws IOException {
+ ExternalizableStrategy.Subsystem strategy =
ExternalizableStrategy.getStrategy();
+ out.writeChar(strategy.id());
-/*
-TODO: GWT
- public void writeExternal(ObjectOutput out) throws IOException {
- ExternalizableStrategy.Subsystem strategy =
ExternalizableStrategy.getStrategy();
- out.writeChar(strategy.id());
-
- if (ExternalizableStrategy.Subsystem.REMOTEAPI == strategy) {
- writeExternalRemote(out);
- } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION == strategy)
{
- EntitySerializer.writeExternalRemote(this, out);
- } else {
- writeExternalAgent(out);
+ if (ExternalizableStrategy.Subsystem.REMOTEAPI == strategy) {
+ writeExternalRemote(out);
+ } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION ==
strategy) {
+ EntitySerializer.writeExternalRemote(this, out);
+ } else {
+ writeExternalAgent(out);
+ }
}
- }
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
- char c = in.readChar();
- if (ExternalizableStrategy.Subsystem.REMOTEAPI.id() == c) {
- readExternalRemote(in);
- } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION.id() == c)
{
- EntitySerializer.readExternalRemote(this, in);
- } else {
- readExternalAgent(in);
+ public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
+ char c = in.readChar();
+ if (ExternalizableStrategy.Subsystem.REMOTEAPI.id() == c) {
+ readExternalRemote(in);
+ } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION.id() ==
c) {
+ EntitySerializer.readExternalRemote(this, in);
+ } else {
+ readExternalAgent(in);
+ }
+ }
+
+ public void writeExternalAgent(ObjectOutput out) throws IOException {
+ out.writeUTF(this.name);
+ out.writeUTF(this.plugin);
+ }
+
+ public void readExternalAgent(ObjectInput in) throws IOException,
ClassNotFoundException {
+ this.name = in.readUTF();
+ this.plugin = in.readUTF();
}
- }
- public void writeExternalAgent(ObjectOutput out) throws IOException {
- out.writeUTF(this.name);
- out.writeUTF(this.plugin);
- }
-
- public void readExternalAgent(ObjectInput in) throws IOException,
ClassNotFoundException {
- this.name = in.readUTF();
- this.plugin = in.readUTF();
- }
-
- public void writeExternalRemote(ObjectOutput out) throws IOException {
- out.writeInt(this.id);
- out.writeUTF(this.name);
- out.writeUTF((null == this.description) ? "" : this.description);
- out.writeObject(this.category);
- out.writeObject(this.creationDataType);
- out.writeObject(this.createDeletePolicy);
- out.writeBoolean(this.supportsManualAdd);
- out.writeBoolean(this.singleton);
- out.writeUTF(this.plugin);
- out.writeLong(this.ctime);
- out.writeLong(this.mtime);
- out.writeObject(this.subCategory);
- out.writeObject(this.bundleType);
- out.writeObject((null == childResourceTypes) ? null : new
LinkedHashSet<ResourceType>(childResourceTypes));
- out.writeObject((null == parentResourceTypes) ? null : new
LinkedHashSet<ResourceType>(parentResourceTypes));
- out.writeObject(pluginConfigurationDefinition);
- out.writeObject(resourceConfigurationDefinition);
- out.writeObject((null == metricDefinitions) ? null
- : new LinkedHashSet<MeasurementDefinition>(metricDefinitions));
- out.writeObject((null == eventDefinitions) ? null : new
LinkedHashSet<EventDefinition>(eventDefinitions));
- out.writeObject((null == operationDefinitions) ? null : new
LinkedHashSet<OperationDefinition>(
- operationDefinitions));
- out.writeObject((null == processScans) ? null : new
LinkedHashSet<ProcessScan>(processScans));
- out.writeObject((null == packageTypes) ? null : new
LinkedHashSet<PackageType>(packageTypes));
- out.writeObject((null == subCategories) ? null : new
LinkedHashSet<ResourceSubCategory>(subCategories));
- out.writeObject((null == resources) ? null : new
LinkedHashSet<Resource>(resources));
- out.writeObject((null == productVersions) ? null : new
LinkedHashSet<ProductVersion>(productVersions));
- // not supplied by remote: helpText
- }
-
- public void readExternalRemote(ObjectInput in) throws IOException,
ClassNotFoundException {
- this.id = in.readInt();
- this.name = in.readUTF();
- this.description = in.readUTF();
- this.category = (ResourceCategory) in.readObject();
- this.creationDataType = (ResourceCreationDataType) in.readObject();
- this.createDeletePolicy = (CreateDeletePolicy) in.readObject();
- this.supportsManualAdd = in.readBoolean();
- this.singleton = in.readBoolean();
- this.plugin = in.readUTF();
- this.ctime = in.readLong();
- this.mtime = in.readLong();
- }
-*/
+ public void writeExternalRemote(ObjectOutput out) throws IOException {
+ out.writeInt(this.id);
+ out.writeUTF(this.name);
+ out.writeUTF((null == this.description) ? "" : this.description);
+ out.writeObject(this.category);
+ out.writeObject(this.creationDataType);
+ out.writeObject(this.createDeletePolicy);
+ out.writeBoolean(this.supportsManualAdd);
+ out.writeBoolean(this.singleton);
+ out.writeUTF(this.plugin);
+ out.writeLong(this.ctime);
+ out.writeLong(this.mtime);
+ out.writeObject(this.subCategory);
+ out.writeObject(this.bundleType);
+ out.writeObject((null == childResourceTypes) ? null : new
LinkedHashSet<ResourceType>(childResourceTypes));
+ out.writeObject((null == parentResourceTypes) ? null : new
LinkedHashSet<ResourceType>(parentResourceTypes));
+ out.writeObject(pluginConfigurationDefinition);
+ out.writeObject(resourceConfigurationDefinition);
+ out.writeObject((null == metricDefinitions) ? null
+ : new LinkedHashSet<MeasurementDefinition>(metricDefinitions));
+ out.writeObject((null == eventDefinitions) ? null : new
LinkedHashSet<EventDefinition>(eventDefinitions));
+ out.writeObject((null == operationDefinitions) ? null : new
LinkedHashSet<OperationDefinition>(
+ operationDefinitions));
+ out.writeObject((null == processScans) ? null : new
LinkedHashSet<ProcessScan>(processScans));
+ out.writeObject((null == packageTypes) ? null : new
LinkedHashSet<PackageType>(packageTypes));
+ out.writeObject((null == subCategories) ? null : new
LinkedHashSet<ResourceSubCategory>(subCategories));
+ out.writeObject((null == resources) ? null : new
LinkedHashSet<Resource>(resources));
+ out.writeObject((null == productVersions) ? null : new
LinkedHashSet<ProductVersion>(productVersions));
+ // not supplied by remote: helpText
+ }
+
+ public void readExternalRemote(ObjectInput in) throws IOException,
ClassNotFoundException {
+ this.id = in.readInt();
+ this.name = in.readUTF();
+ this.description = in.readUTF();
+ this.category = (ResourceCategory) in.readObject();
+ this.creationDataType = (ResourceCreationDataType) in.readObject();
+ this.createDeletePolicy = (CreateDeletePolicy) in.readObject();
+ this.supportsManualAdd = in.readBoolean();
+ this.singleton = in.readBoolean();
+ this.plugin = in.readUTF();
+ this.ctime = in.readLong();
+ this.mtime = in.readLong();
+ }
+ */
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
index 7589096..a2a6ece 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
@@ -113,14 +113,8 @@ public class ResourceTypeManagerBean implements
ResourceTypeManagerLocal, Resour
public List<ResourceType> getChildResourceTypes(Subject subject, ResourceType
parent) {
Query query = null;
- if (authorizationManager.isInventoryManager(subject)) {
- query =
entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN_admin);
- } else {
- query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN);
- query.setParameter("subject", subject);
- }
-
- query.setParameter("parent", parent);
+ query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN);
+ query.setParameter("resourceTypeId", parent.getId());
List<ResourceType> results = query.getResultList();
return results;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index 1cc1b44..a136561 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -284,26 +284,29 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
return results;
}
+ // Start with no transaction so we can control the transactional boundaries. This is
important for a
+ // few reasons. Registering the plugin and removing obsolete types are perfromed in
different, subsequent,
+ // transactions. The register may update types, and that locks various rows of the
database. Those rows
+ // must be unlocked before obsolete type removal. Type removal executes (resource)
bulk delete under the covers,
+ // and that will deadlock with the rows locked by the type update (at least in
oracle) if performed in the same
+ // transaction. Furthermore, as mentioned, obsolete type removal removes resources
of the obsolete type. We
+ // need to avoid an umbrella transaction for the type removal because large
inventories of obsolete resources
+ // will generate very large transactions. Potentially resulting in timeouts or other
issues.
@RequiredPermission(Permission.MANAGE_SETTINGS)
- public void registerPlugin(Subject whoami, Plugin plugin, PluginDescriptor
pluginDescriptor, File pluginFile,
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void registerPlugin(Subject subject, Plugin plugin, PluginDescriptor
pluginDescriptor, File pluginFile,
boolean forceUpdate) throws Exception {
- // Registering the plugin is performed in a new transaction in order to allow the
removal
- // of obsolete types, in a subsequent transaction. The register may update
types, and that
- // locks various rows of the database. Those rows must be unlocked before type
removal. Type
- // removal executes (resource) bulk delete under the covers, in another new
trans, and that
- // trans will will deadlock with the rows locked by the type update (at least in
oracle) if that
- // transaction has not been committed.
- boolean typesUpdated =
resourceMetadataManager.registerPluginInNewTransaction(whoami, plugin, pluginDescriptor,
+ boolean typesUpdated = resourceMetadataManager.registerPluginTypes(subject,
plugin, pluginDescriptor,
pluginFile, forceUpdate);
if (typesUpdated) {
-
resourceMetadataManager.removeObsoleteTypesInNewTransaction(plugin.getName());
+ removeObsoleteTypes(subject, plugin.getName());
}
}
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
- public boolean registerPluginInNewTransaction(Subject whoami, Plugin plugin,
PluginDescriptor pluginDescriptor,
+ @RequiredPermission(Permission.MANAGE_SETTINGS)
+ public boolean registerPluginTypes(Subject subject, Plugin plugin, PluginDescriptor
pluginDescriptor,
File pluginFile, boolean forceUpdate) throws Exception {
// TODO GH: Consider how to remove features from plugins in updates without
breaking everything
@@ -429,7 +432,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
return;
}
- private void updateTypes(Set<ResourceType> resourceTypes) throws Exception {
+ private void updateTypes(Set<ResourceType> resourceTypes) throws Exception {
// Only process the type if it is a non-runs-inside type (i.e. not a child of
some other type X at this same
// level in the type hierarchy). runs-inside types which we skip here will get
processed at the next level down
// when we recursively process type X's children.
@@ -462,18 +465,56 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
+ // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY
+ // Start with no transaction so we can control the transactional boundaries. Obsolete
type removal removes
+ // resources of the obsolete type. We need to avoid an umbrella transaction for the
type removal because large
+ // inventories of obsolete resources will generate very large transactions.
Potentially resulting in timeouts
+ // or other issues.
+ private void removeObsoleteTypes(Subject subject, String pluginName) {
+
+ Set<ResourceType> obsoleteTypes = new HashSet<ResourceType>();
+ Set<ResourceType> legitTypes = new HashSet<ResourceType>();
+
+ try {
+ resourceMetadataManager.getPluginTypes(subject, pluginName, legitTypes,
obsoleteTypes);
+
+ if (!obsoleteTypes.isEmpty()) {
+ // TODO: Log this at DEBUG instead.
+ log.info("Removing " + obsoleteTypes.size() + " obsolete
types: " + obsoleteTypes + "...");
+ removeResourceTypes(subject, obsoleteTypes, new
HashSet<ResourceType>(obsoleteTypes));
+ }
+
+ // Now it's safe to remove any obsolete subcategories on the legit
types.
+ for (ResourceType legitType : legitTypes) {
+ ResourceType updateType =
PLUGIN_METADATA_MANAGER.getType(legitType.getName(), legitType.getPlugin());
+
+ // If we've got a type from the descriptor which matches an existing
one,
+ // then let's see if we need to remove any subcategories from the
existing one.
+ if (updateType != null) {
+ try {
+ resourceMetadataManager.removeObsoleteSubCategories(subject,
updateType, legitType);
+ } catch (Exception e) {
+ throw new Exception("Failed to delete obsolete subcategories
from " + legitType + ".", e);
+ }
+ }
+ }
+ } catch (Exception e) {
+ // Catch all exceptions, so a failure here does not cause the outer tx to
rollback.
+ log.error("Failure during removal of obsolete ResourceTypes and
Subcategories.", e);
+ }
+ }
+
+ @RequiredPermission(Permission.MANAGE_SETTINGS)
@SuppressWarnings("unchecked")
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
- public void removeObsoleteTypesInNewTransaction(String pluginName) {
+ public void getPluginTypes(Subject subject, String pluginName,
Set<ResourceType> legitTypes,
+ Set<ResourceType> obsoleteTypes) {
try {
Query query =
entityManager.createNamedQuery(ResourceType.QUERY_FIND_BY_PLUGIN);
query.setParameter("plugin", pluginName);
List<ResourceType> existingTypes = query.getResultList();
if (existingTypes != null) {
- Set<ResourceType> obsoleteTypes = new
HashSet<ResourceType>();
- Set<ResourceType> legitTypes = new HashSet<ResourceType>();
- Subject overlord = subjectManager.getOverlord();
+
for (ResourceType existingType : existingTypes) {
if (PLUGIN_METADATA_MANAGER.getType(existingType.getName(),
existingType.getPlugin()) == null) {
// The type is obsolete - (i.e. it's no longer defined by the
plugin).
@@ -482,28 +523,6 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
legitTypes.add(existingType);
}
}
-
- if (!obsoleteTypes.isEmpty()) {
- // TODO: Log this at DEBUG instead.
- log.info("Removing " + obsoleteTypes.size() + "
obsolete types: " + obsoleteTypes + "...");
- removeResourceTypes(overlord, obsoleteTypes, new
HashSet<ResourceType>(obsoleteTypes));
- }
-
- // Now it's safe to remove any obsolete subcategories on the legit
types.
- for (ResourceType legitType : legitTypes) {
- ResourceType updateType =
PLUGIN_METADATA_MANAGER.getType(legitType.getName(), legitType
- .getPlugin());
-
- // If we've got a type from the descriptor which matches an
existing one,
- // then let's see if we need to remove any subcategories from the
existing one.
- if (updateType != null) {
- try {
- removeObsoleteSubCategories(updateType, legitType);
- } catch (Exception e) {
- throw new Exception("Failed to delete obsolete
subcategories from " + legitType + ".", e);
- }
- }
- }
}
} catch (Exception e) {
// Catch all exceptions, so a failure here does not cause the outer tx to
rollback.
@@ -511,19 +530,20 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
- private void removeResourceTypes(Subject overlord, Set<ResourceType>
candidateTypes,
- Set<ResourceType> typesToBeRemoved)
- throws Exception {
+ // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY
+ private void removeResourceTypes(Subject subject, Set<ResourceType>
candidateTypes,
+ Set<ResourceType> typesToBeRemoved) throws Exception {
for (ResourceType candidateType : candidateTypes) {
// Remove obsolete descendant types first.
- Set<ResourceType> childTypes = candidateType.getChildResourceTypes();
+ //Set<ResourceType> childTypes =
candidateType.getChildResourceTypes();
+ List<ResourceType> childTypes =
resourceTypeManager.getChildResourceTypes(subject, candidateType);
if (childTypes != null && !childTypes.isEmpty()) {
// Wrap child types in new HashSet to avoid
ConcurrentModificationExceptions.
- removeResourceTypes(overlord, new
HashSet<ResourceType>(childTypes), typesToBeRemoved);
+ removeResourceTypes(subject, new HashSet<ResourceType>(childTypes),
typesToBeRemoved);
}
if (typesToBeRemoved.contains(candidateType)) {
try {
- removeResourceType(overlord, candidateType);
+ removeResourceType(subject, candidateType);
} catch (Exception e) {
throw new Exception("Failed to remove " + candidateType +
".", e);
}
@@ -532,35 +552,44 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
- private void removeResourceType(Subject overlord, ResourceType existingType) {
- log.info("Removing ResourceType [" + toConciseString(existingType) +
"]...");
-
- if (entityManager.contains(existingType)) {
- entityManager.refresh(existingType);
- }
-
- // Completely remove the type from the type hierarchy.
- removeFromParents(existingType);
- removeFromChildren(existingType);
- entityManager.merge(existingType);
+ // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY
+ private void removeResourceType(Subject subject, ResourceType existingType) {
+ log.info("Removing ResourceType [" + toConciseString(existingType) +
"]...");
// Remove all Resources that are of the type.
- List<Resource> resources = existingType.getResources();
+ ResourceCriteria c = new ResourceCriteria();
+ c.addFilterResourceTypeId(existingType.getId());
+ List<Resource> resources = resourceManager.findResourcesByCriteria(subject,
c);
if (resources != null) {
Iterator<Resource> resIter = resources.iterator();
while (resIter.hasNext()) {
Resource res = resIter.next();
- List<Integer> deletedIds =
resourceManager.uninventoryResource(overlord, res.getId());
+ List<Integer> deletedIds =
resourceManager.uninventoryResource(subject, res.getId());
// do this out of band because the current transaction is locking rows
that due to
// updates that may need to get deleted. If you do it here the NewTrans
used below
// may deadlock with the current transactions locks.
for (Integer deletedResourceId : deletedIds) {
- resourceManager.uninventoryResourceAsyncWork(overlord,
deletedResourceId);
+ resourceManager.uninventoryResourceAsyncWork(subject,
deletedResourceId);
}
resIter.remove();
}
}
- entityManager.flush();
+
+ resourceMetadataManager.completeRemoveResourceType(subject, existingType);
+ }
+
+ @RequiredPermission(Permission.MANAGE_SETTINGS)
+ public void completeRemoveResourceType(Subject subject, ResourceType existingType) {
+ existingType = entityManager.find(ResourceType.class, existingType.getId());
+
+ if (entityManager.contains(existingType)) {
+ entityManager.refresh(existingType);
+ }
+
+ // Completely remove the type from the type hierarchy.
+ removeFromParents(existingType);
+ removeFromChildren(existingType);
+ entityManager.merge(existingType);
// Remove all compatible groups that are of the type.
List<ResourceGroup> compatGroups = existingType.getResourceGroups();
@@ -569,7 +598,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
while (compatGroupIterator.hasNext()) {
ResourceGroup compatGroup = compatGroupIterator.next();
try {
- resourceGroupManager.deleteResourceGroup(overlord,
compatGroup.getId());
+ resourceGroupManager.deleteResourceGroup(subject,
compatGroup.getId());
} catch (ResourceGroupDeleteException e) {
throw new RuntimeException(e);
}
@@ -623,7 +652,6 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
}
- @SuppressWarnings("unchecked")
private void updateType(ResourceType resourceType) {
entityManager.flush();
@@ -635,8 +663,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
ResourceType existingType;
try {
- existingType =
resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(),
- resourceType.getPlugin());
+ existingType =
resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), resourceType
+ .getPlugin());
} catch (NonUniqueResultException nure) {
log.debug("Found more than one existing ResourceType for " +
resourceType);
// TODO: Delete the redundant ResourceTypes to get the DB into a valid
state.
@@ -701,8 +729,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
// above already took care of any modifications to the ResourceSubCategories
themselves).
} else if (newSubCat == null) {
if (oldSubCat != null) {
- log.debug("Metadata update: Subcategory of ResourceType [" +
resourceType.getName()
- + "] changed from " + oldSubCat + " to " +
newSubCat);
+ log.debug("Metadata update: Subcategory of ResourceType [" +
resourceType.getName() + "] changed from "
+ + oldSubCat + " to " + newSubCat);
existingType.setSubCategory(null);
}
} else {
@@ -762,14 +790,14 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
if (log.isDebugEnabled()) {
if (existingType != null) {
log.debug("Setting parent types on existing type: " +
existingType + " to ["
- + newType.getParentResourceTypes() + "] - current parent
types are ["
- + existingType.getParentResourceTypes() + "]...");
+ + newType.getParentResourceTypes() + "] - current parent types
are ["
+ + existingType.getParentResourceTypes() + "]...");
} else {
- log.debug("Setting parent types on new type: " + newType
- + " to [" + newType.getParentResourceTypes() +
"]...");
+ log.debug("Setting parent types on new type: " + newType +
" to [" + newType.getParentResourceTypes()
+ + "]...");
}
}
-
+
Set<ResourceType> newParentTypes = newType.getParentResourceTypes();
newType.setParentResourceTypes(new HashSet<ResourceType>());
Set<ResourceType> originalExistingParentTypes = new
HashSet<ResourceType>();
@@ -778,7 +806,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
}
for (ResourceType newParentType : newParentTypes) {
try {
- boolean isExistingParent =
originalExistingParentTypes.remove(newParentType);
+ boolean isExistingParent =
originalExistingParentTypes.remove(newParentType);
if (existingType == null || !isExistingParent) {
ResourceType realParentType = (ResourceType)
entityManager.createNamedQuery(
ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name",
newParentType.getName())
@@ -786,19 +814,19 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
ResourceType type = (existingType != null) ? existingType : newType;
if (existingType != null) {
log.info("Adding ResourceType [" +
toConciseString(type) + "] as child of ResourceType ["
- + toConciseString(realParentType) + "]...");
+ + toConciseString(realParentType) + "]...");
}
realParentType.addChildResourceType(type);
}
} catch (NoResultException nre) {
- throw new RuntimeException("Couldn't persist type [" +
newType
- + "] because parent [" + newParentType + "] wasn't
already persisted.");
+ throw new RuntimeException("Couldn't persist type [" +
newType + "] because parent [" + newParentType
+ + "] wasn't already persisted.");
}
}
for (ResourceType obsoleteParentType : originalExistingParentTypes) {
log.info("Removing type [" + toConciseString(existingType) +
"] from parent type ["
- + toConciseString(obsoleteParentType) + "]...");
+ + toConciseString(obsoleteParentType) + "]...");
obsoleteParentType.removeChildResourceType(existingType);
moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes);
}
@@ -810,7 +838,8 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
return (type != null) ? (type.getPlugin() + ":" + type.getName() +
"(id=" + type.getId() + ")") : "null";
}
- private void moveResourcesToNewParent(ResourceType existingType, ResourceType
obsoleteParentType, Set<ResourceType> newParentTypes) {
+ private void moveResourcesToNewParent(ResourceType existingType, ResourceType
obsoleteParentType,
+ Set<ResourceType> newParentTypes) {
Subject overlord = subjectManager.getOverlord();
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterResourceTypeId(existingType.getId());
@@ -818,8 +847,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
List<Resource> resources =
resourceManager.findResourcesByCriteria(overlord, criteria);
for (Resource resource : resources) {
Resource newParent = null;
- newParentTypes:
- for (ResourceType newParentType : newParentTypes) {
+ newParentTypes: for (ResourceType newParentType : newParentTypes) {
Resource ancestorResource = resource.getParentResource();
while (ancestorResource != null) {
if (ancestorResource.getResourceType().equals(newParentType)) {
@@ -846,7 +874,7 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
newParent.addChildResource(resource);
} else {
log.debug("We were unable to move " + resource + " from
invalid parent " + resource.getParentResource()
- + " to a new valid parent with one of the following types:
" + newParentTypes);
+ + " to a new valid parent with one of the following types:
" + newParentTypes);
}
}
}
@@ -1326,8 +1354,10 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
* @param newType new resource type containing updated definitions
* @param existingType old resource type with existing definitions
*/
- private void removeObsoleteSubCategories(ResourceType newType, ResourceType
existingType) {
+ @RequiredPermission(Permission.MANAGE_SETTINGS)
+ public void removeObsoleteSubCategories(Subject subject, ResourceType newType,
ResourceType existingType) {
// Remove all definitions that are in the existing type but not in the new type
+ existingType = entityManager.find(ResourceType.class, existingType.getId());
List<ResourceSubCategory> removedSubCategories = new
ArrayList<ResourceSubCategory>(existingType
.getChildSubCategories());
removedSubCategories.removeAll(newType.getChildSubCategories());
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java
index 683f287..d25f4cf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.server.resource.metadata;
import java.io.File;
import java.util.List;
+import java.util.Set;
import javax.ejb.Local;
import javax.persistence.NoResultException;
@@ -28,6 +29,7 @@ import org.rhq.core.clientapi.descriptor.plugin.PluginDescriptor;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.plugin.Plugin;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceType;
/**
* Provides functionality surrounding agent plugins and their resource metadata.
@@ -44,25 +46,6 @@ public interface ResourceMetadataManagerLocal {
void setPluginEnabledFlag(Subject subject, int pluginId, boolean enabled) throws
Exception;
/**
- * For server-side registration of plugin archives. At server startup or as new
plugins are runtime deployed the jar
- * will have its descriptor read and parsed and the metadata for the plugin will be
updated in the db.
- * If you provide a non-null <code>pluginFile</code>, and the plugin is
deemed to be new or updated, the content
- * of the file will be streamed to the database. Note that if you provide a non-null
file, you must ensure
- * its MD5 matches that of the file (i.e. this method will not attempt to recompute
the file's MD5, it will assume
- * the caller has already done that and provided the proper MD5 in
<code>plugin</code>).
- * <br/><br/>
- * NOTE ** This call will register the plugin in a new transaction.
- *
- * @param plugin The plugin object being deployed
- * @param metadata The plugin descriptor file
- * @param pluginFile the actual plugin file whose content will be stored in the
database (will be ignored if null)
- * @param forceUpdate if <code>true</code>, the plugin's types will
be updated, even if the plugin hasn't changed since
- * the last time it was registered
- */
- void registerPlugin(Subject whoami, Plugin plugin, PluginDescriptor metadata, File
pluginFile, boolean forceUpdate)
- throws Exception;
-
- /**
* Returns the list of all plugins deployed in the server.
*
* @return list of plugins deployed
@@ -82,10 +65,36 @@ public interface ResourceMetadataManagerLocal {
*/
Plugin getPlugin(String name);
- /** Exists only to have code execute within its own transaction. Not for general
consumption. */
- boolean registerPluginInNewTransaction(Subject whoami, Plugin plugin,
PluginDescriptor pluginDescriptor,
- File pluginFile, boolean forceUpdate) throws Exception;
+ /**
+ * For server-side registration of plugin archives. At server startup or as new
plugins are runtime deployed the jar
+ * will have its descriptor read and parsed and the metadata for the plugin will be
updated in the db.
+ * If you provide a non-null <code>pluginFile</code>, and the plugin is
deemed to be new or updated, the content
+ * of the file will be streamed to the database. Note that if you provide a non-null
file, you must ensure
+ * its MD5 matches that of the file (i.e. this method will not attempt to recompute
the file's MD5, it will assume
+ * the caller has already done that and provided the proper MD5 in
<code>plugin</code>).
+ * <br/><br/>
+ * NOTE ** This call will register the plugin in a new transaction.
+ *
+ * @param plugin The plugin object being deployed
+ * @param metadata The plugin descriptor file
+ * @param pluginFile the actual plugin file whose content will be stored in the
database (will be ignored if null)
+ * @param forceUpdate if <code>true</code>, the plugin's types will
be updated, even if the plugin hasn't changed since
+ * the last time it was registered
+ */
+ void registerPlugin(Subject subject, Plugin plugin, PluginDescriptor metadata, File
pluginFile, boolean forceUpdate)
+ throws Exception;
+
+ /** Exists only to for transactional boundary reasons. Not for general consumption.
*/
+ boolean registerPluginTypes(Subject subject, Plugin plugin, PluginDescriptor
pluginDescriptor, File pluginFile,
+ boolean forceUpdate) throws Exception;
+
+ /** Exists only to for transactional boundary reasons. Not for general consumption.
*/
+ void removeObsoleteSubCategories(Subject subject, ResourceType newType, ResourceType
existingType);
+
+ /** Exists only to for transactional boundary reasons. Not for general consumption.
*/
+ void getPluginTypes(Subject subject, String pluginName, Set<ResourceType>
legitTypes,
+ Set<ResourceType> obsoleteTypes);
- /** Exists only to have code execute within its own transaction. Not for general
consumption. */
- void removeObsoleteTypesInNewTransaction(String pluginName);
+ /** Exists only to for transactional boundary reasons. Not for general consumption.
*/
+ void completeRemoveResourceType(Subject subject, ResourceType existingType);
}
\ No newline at end of file
commit a004880be5d249296f30cbc82306109bd92136bd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 21 11:59:17 2010 -0400
remove ability to sort by type/plugin columns on group browser
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 87bb3ee..3683968 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -150,9 +150,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="resourceType.name">
- <h:outputText styleClass="headerText"
value="Group Type" />
- </onc:sortableColumnHeader>
+ <h:outputText styleClass="headerText" value="Group
Type" />
</f:facet>
<h:outputText
value="#{item.resourceGroup.resourceType.name}" />
@@ -160,9 +158,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader
sort="resourceType.plugin">
- <h:outputText styleClass="headerText"
value="Plugin" />
- </onc:sortableColumnHeader>
+ <h:outputText styleClass="headerText"
value="Plugin" />
</f:facet>
<h:outputText
value="#{item.resourceGroup.resourceType.plugin}" />
commit 9b1dd9c8b9e9ac9c6671c33cc23099aa91abed30
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 21 11:19:01 2010 -0400
fix merge error
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 41d0744..cc1edd1 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -35,12 +35,8 @@
<version>${project.version}</version>
</dependency>
-<<<<<<< HEAD
- <dependency>
-=======
<dependency>
->>>>>>> 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d
- <groupId>commons-io</groupId>
+ <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
commit bef80e64b048d548f3c46d9e0cec982cd2303fc1
Merge: 3d0764e... 4cdfaf9...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 21 09:37:20 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 1d25a6cec3aa71897ad109ddcad0cade752ae289
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 21 01:39:06 2010 -0400
BZ-616661: keep alert notifications sticky to the definitions that defined them
* was incrementing the definitionId counter before persisting the configuration
* stop adding leading/trailing ',' to email-based notifications
** this would only occur when multiple notifications were defined for an alert
definition
** if an alert definition would only have email-based notifications, the upgrade did
not add the extra ','
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
index 52713d4..7ddfad2 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
@@ -289,12 +289,14 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
int nextDefinitionId = ((Number) next[0]).intValue();
String nextData = String.valueOf(next[1]);
if (nextDefinitionId != definitionId) {
- definitionId = nextDefinitionId;
if (buffer.length() != 0) {
// buffer will be 0 the very first time, since definitionId is
initially -1
- int configId = persistConfiguration(propertyName, delimiter +
buffer.toString() + delimiter);
+ String bufferedData = bufferWithDelimiter ? (delimiter +
buffer.toString() + delimiter) : buffer
+ .toString();
+ int configId = persistConfiguration(propertyName, bufferedData);
persistNotification(definitionId, configId, sender);
}
+ definitionId = nextDefinitionId;
buffer = new StringBuilder(); // reset for the next definitionId
}
commit 4cdfaf9e0d6a4fbf56ed8194ffcaa9ae98735c4f
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Jul 20 18:06:01 2010 -0400
have the agent test the failover list that it gets immediately after registration. If
all the servers are unreachable, retry the registration again. Do this indefinitely. Also
dump a noisy message on the console telling the user what's happening.
This will do two things:
1) tell the user they screwed up their server public endpoints and gives them a chance
to fix it via the server GUI
2) lets the agent sit and wait for the server(s) to get their new endpoints - once
they do, the agent will "wake up" and continue doing its thing -it will
re-register, get the new failover list with the new (correct) endpoints and continue
normally
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index b6ccd8b..d1894cb 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -36,7 +36,9 @@ import java.io.StreamTokenizer;
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
import java.net.InetAddress;
+import java.net.Socket;
import java.net.URL;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@@ -1273,6 +1275,7 @@ public class AgentMain {
int registrationFailures = 0;
final int MAX_ALLOWED_REGISTRATION_FAILURES = 5;
boolean hide_loopback_warning =
Boolean.getBoolean("rhq.hide-agent-localhost-warning");
+ boolean hide_failover_list_warning = false;
while (retry) {
try {
@@ -1303,7 +1306,7 @@ public class AgentMain {
LOG.debug(AgentI18NResourceKeys.AGENT_REGISTRATION_ATTEMPT, request);
if (!hide_loopback_warning) {
- if (remote_endpoint.contains("localhost")
|| remote_endpoint.contains("127.0.0.1")) {
+ if (remote_endpoint.contains("localhost")
|| remote_endpoint.contains("127.0.0.")) {
String msg_id =
AgentI18NResourceKeys.REGISTERING_WITH_LOOPBACK;
LOG.warn(msg_id, remote_endpoint);
getOut().println(MSG.getMsg(msg_id,
remote_endpoint));
@@ -1315,15 +1318,36 @@ public class AgentMain {
// delete any old token so request is unauthenticated to
get server to accept it
agent_config.setAgentSecurityToken(null);
- FailoverListComposite failoverList = null;
+ FailoverListComposite failover_list = null;
try {
AgentRegistrationResults results =
remote_pojo.registerAgent(request);
+ failover_list = results.getFailoverList();
+
+ // Try to do a simple connect to each server in the
failover list
+ // If only some of the servers are unreachable, just
keep going;
+ // the agent will eventually switchover to one of
the live servers.
+ // But if all servers in the list are unreachable, we
need to keep retrying hoping
+ // someone fixes the servers' public endpoints so
the agent can reach one or more of them.
+ List<String> failed =
testFailoverList(failover_list);
+ if (failed.size() > 0) {
+ if (failed.size() == failover_list.size()) {
+ retry = true;
+ retry_interval = 30000L;
+ if (!hide_failover_list_warning) {
+ String msg_id =
AgentI18NResourceKeys.FAILOVER_LIST_CHECK_FAILED;
+ LOG.warn(msg_id, failed.size(),
failed.toString());
+ getOut().println(MSG.getMsg(msg_id,
failed.size(), failed.toString()));
+ getOut().println();
+ hide_failover_list_warning = true; //
don't bother logging more than once
+ }
+ continue; // immediately go back and start
the retry
+ }
+ }
+
m_registration = results;
got_registered = true;
retry = false;
token = results.getAgentToken();
- failoverList = results.getFailoverList();
-
LOG.info(AgentI18NResourceKeys.AGENT_REGISTRATION_RESULTS, results);
} finally {
// stores the new one if successful; restores the old
one if we failed for some reason to register
@@ -1333,25 +1357,25 @@ public class AgentMain {
LOG.debug(AgentI18NResourceKeys.NEW_SECURITY_TOKEN,
token);
}
- storeServerFailoverList(failoverList);
- m_serverFailoverList = failoverList;
+ storeServerFailoverList(failover_list);
+ m_serverFailoverList = failover_list;
// switch away from the registration server and point
this agent to the top of the list
// - this is our primary server that we should connect
to
// note that if we are already pointing to the one at the
head of the failover list,
// we don't have to failover to another server; the
current one is the one we already want
- if (failoverList.hasNext()) {
+ if (failover_list.hasNext()) {
String currentAddress =
agent_config.getServerBindAddress();
int currentPort = agent_config.getServerBindPort();
String currentTransport =
agent_config.getServerTransport();
- ServerEntry nextServer = failoverList.peek();
+ ServerEntry nextServer = failover_list.peek();
if (currentAddress.equals(nextServer.address)
&& currentPort ==
(SecurityUtil.isTransportSecure(currentTransport) ? nextServer.securePort
: nextServer.port)) {
// we are already pointing to the primary server,
so all we have to do is
// call next to move the index to the next in the
list for when we have to failover in the future
- nextServer = failoverList.next();
+ nextServer = failover_list.next();
// [mazz] I don't think we need to do this
here anymore - with the addition of
// the remote communicator's initialize
callback, this connect request
@@ -2503,6 +2527,51 @@ public class AgentMain {
}
/**
+ * Given a failover list, this makes very rudimentary connection attempts to each
server to see if
+ * this agent can at least reach the server endpoints. If an endpoint cannot be
reached,
+ * a warning is logged.
+ *
+ * @param failoverList the list of servers this agent will potentially need to talk
to.
+ * @return the servers that failed to be connected to
+ */
+ private List<String> testFailoverList(FailoverListComposite failoverList) {
+ List<String> failedServers = new ArrayList<String>(0);
+
+ if (failoverList != null) {
+ for (int i = 0; i < failoverList.size(); i++) {
+ ServerEntry server = failoverList.get(i);
+ Socket socket = null;
+ try {
+ socket = new Socket(server.address, server.port);
+ } catch (UnknownHostException e) {
+ LOG.error(AgentI18NResourceKeys.FAILOVER_LIST_UNKNOWN_HOST,
server.address);
+ } catch (IOException e) {
+ try {
+ socket = new Socket(server.address, server.securePort);
+ } catch (UnknownHostException e1) {
+ LOG.error(AgentI18NResourceKeys.FAILOVER_LIST_UNKNOWN_HOST,
server.address);
+ } catch (IOException e1) {
+ String err = ThrowableUtil.getAllMessages(e1);
+ LOG.warn(AgentI18NResourceKeys.FAILOVER_LIST_UNREACHABLE_HOST,
server.address, server.port,
+ server.securePort, err);
+ }
+ } finally {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch (Exception e) {
+ }
+ } else {
+ failedServers.add(server.toString());
+ }
+ }
+ }
+ }
+
+ return failedServers;
+ }
+
+ /**
* Given a failover list, this will persist it so the agent can recover it if the
agent itself fails.
* If this method fails to persist the list, an error is logged but otherwise this
method
* returns normally.
@@ -2539,7 +2608,7 @@ public class AgentMain {
.getAllMessages(e));
}
- // let's be kind to the user - if any server address is
"localhost" or "127.0.0.1"
+ // let's be kind to the user - if any server address is
"localhost" or "127.0.0.#"
// or starts with "localhost." (such as localhost.localdomain) then
we should output a
// warning to let the user know that that probably isn't what they want.
// In cases when someone is demo'ing/testing/developing, and they
don't want to see this, provide
@@ -2550,7 +2619,7 @@ public class AgentMain {
for (int i = 0; i < numServers; i++) {
ServerEntry server = failoverList.get(i);
String addr = (server.address != null) ? server.address :
"";
- if ("localhost".equals(addr) ||
"127.0.0.1".equals(addr) || addr.startsWith("localhost.")) {
+ if ("localhost".equals(addr) ||
addr.startsWith("127.0.0.") || addr.startsWith("localhost.")) {
LOG.warn(AgentI18NResourceKeys.FAILOVER_LIST_HAS_LOCALHOST,
server.address);
getOut().println(MSG.getMsg(AgentI18NResourceKeys.FAILOVER_LIST_HAS_LOCALHOST,
server.address));
break; // just show the warning once
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index de3acca..7e621e8 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -236,6 +236,21 @@ public interface AgentI18NResourceKeys {
@I18NMessage("Failed to download an updated server failover list. Cause:
{0}")
String FAILOVER_LIST_DOWNLOAD_FAILURE =
"AgentMain.failover-list-download-failure";
+ @I18NMessage("Failover list has an unknown host [{0}]")
+ String FAILOVER_LIST_UNKNOWN_HOST =
"AgentMain.failover-list-unknown-host";
+
+ @I18NMessage("Failover list has an unreachable host [{0}] (tested ports
[{1,number,#}] and [{2,number,#}]). Cause: {3}")
+ String FAILOVER_LIST_UNREACHABLE_HOST =
"AgentMain.failover-list-unreachable-host";
+
+ @I18NMessage("!!! There are [{0}] servers that are potentially unreachable by
this agent.\\n\\\n"
+ + "Please double check all public endpoints of your servers and
ensure\\n\\\n"
+ + "they are all reachable by this agent. The failed server endpoints
are:\\n\\\n" //
+ + "{1}\\n\\\n" //
+ + "See the Administration > High Availability > Servers in the server
GUI\\n\\\n"
+ + "to change the public endpoint of a server.\\n\\\n"
+ + "THIS AGENT WILL WAIT UNTIL ONE OF ITS SERVERS BECOMES REACHABLE!")
+ String FAILOVER_LIST_CHECK_FAILED =
"AgentMain.failover-list-check-failed";
+
@I18NMessage("The prompt input reader returned null. EOF?")
String INPUT_EOF = "AgentMain.input-eof";
commit e34d07b12622b278aedef07e5c0752c4acdfd1fe
Merge: d454338... bc83892...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 20 17:15:34 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-work
commit d454338af878eb9490814548b665e567abcc0a21
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 20 17:08:25 2010 -0400
[bz 616395] reduce the default # of threads used for plugin deployment
to 1 (from 5) in rhq-server.properties. This is to remove the frequent
deadlocks we see during upgrade. Further work on meta-data update is
needed to remove the contention. When done this should be upped again.
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 238f6d2..477f62f 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
@@ -472,7 +472,8 @@ 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
-rhq.server.plugin-deployer-threads=5
+# 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.
commit bc83892683c0cdbf4277de773b984f46b1a54047
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 20 14:13:57 2010 -0400
Revert "fix so vertical scrolling of right content div on resource/group pages
works correctly in IE7 (
https://bugzilla.redhat.com/show_bug.cgi?id=601744)"
This reverts commit 070e9611ebcdfc678c4ddee886c067592edd5e8e.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
index f0c4fda..e6ad8cc 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
@@ -2321,14 +2321,15 @@ ul.radio-group .unspecified {
.content-left {
width: 100%;
height: 100%;
- background-color: #FFFFFF;
+ background-color: #ffffff;
overflow: auto;
}
-.content-right {
+.content-right {
+ left: 6px;
right: 0;
- width: 100%;
- height: 100%;
+ height: 100%;
+ margin-left: 6px;
overflow: auto;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
index c4ade43..e249621 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
@@ -43,14 +43,14 @@ id - the id of the Resource being accessed
<div id="contentParent">
<!--<![endif]-->
<div id="leftContent" class="column"
style="width: #{UserPreferencesUIBean.leftResourceNavState}%">
- <div id="leftContentWrapper" class="content-left"
style="position: relative">
+ <div id="leftContentWrapper"
class="content-left">
<ui:insert name="nav"><p>Default Entity
Navigation</p></ui:insert>
</div>
</div>
- <div id="centerContent" class="column"
style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%">
- <div id="centerContentWrapper"
class="content-right" style="position: relative">
- <div style="left: 0; right: 0; height: 100%">
+ <div id="centerContent" class="column"
style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;">
+ <div id="centerContentWrapper"
class="content-right">
+ <div style="left: 0; right: 0; height: 100%; position:
relative">
<ui:insert name="summary"><p>Default Entity
Summary</p></ui:insert>
<ui:insert name="tabBar"><p>Default Entity
TabBar</p></ui:insert>
<ui:insert name="content"><p>Default Entity
Content</p></ui:insert>
@@ -68,7 +68,7 @@ id - the id of the Resource being accessed
</a4j:form>
</a4j:region>
- <script language="JavaScript" type="text/javascript">
+ <script language="JavaScript" type="text/JavaScript">
<!--
function recalcContentSizes() {
@@ -85,7 +85,7 @@ id - the id of the Resource being accessed
//this has to be computed AFTER we change the parent's width above
to accomodate
//for the change of the left width caused by it.
var rightWidth = body.getDimensions().width -
left.getDimensions().width;
- rightWrapper.style.width = (rightWidth) + 'px';
+ rightWrapper.style.width = (rightWidth - 6) + 'px'; //6 - the
margin defined by the content-right css class
}
commit a774a02f24f889aa8ae65b0cae7cf21609ba6eb7
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 20 14:12:59 2010 -0400
Fix merge problem (btw, we need to get our IJ/Eclipse formatting in better
sync)
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 4e9f17a..396aa0e 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
@@ -28,7 +28,6 @@ import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.GroupCategory;
@@ -37,25 +36,11 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
-import org.rhq.enterprise.gui.coregui.client.alert.definitions.AlertDefinitionsView;
-import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTitleBar;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/**
@@ -86,8 +71,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
private ViewId tabView;
private ViewId subtabView;
-
-
@Override
protected void onDraw() {
super.onDraw();
@@ -95,7 +78,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
setWidth100();
setHeight100();
-
// The Tabs section
topTabSet = new TwoLevelTabSet();
@@ -129,8 +111,8 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
contentTab = new TwoLevelTab("Content",
"/images/icons/Content_grey_16.png");
contentTab.registerSubTabs("Deployed", "New",
"Subscriptions", "History");
- topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab, eventsTab, contentTab);
-
+ topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab,
+ eventsTab, contentTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -139,7 +121,7 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
addMember(topTabSet);
-// CoreGUI.addBreadCrumb(getPlace());
+ // CoreGUI.addBreadCrumb(getPlace());
}
public void onResourceSelected(ResourceGroup group) {
@@ -152,80 +134,75 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
// TODO all of the tabs
-// FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
-// summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
-// summaryTab.updateSubTab("Timeline", timelinePane);
-
-
-// monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); //
new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
-// monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
-// monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
-// monitoringTab.updateSubTab("Availability", new
FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
-// monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
-// monitoringTab.updateSubTab("Call Time", new CallTimeView(resource));
-//
-//
-// inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
-// inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
-//
-// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
-//
-// configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
-// configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
-//
-// alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
-// alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
-//
-// eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
-//
-// contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
-// contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
-// contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
-// contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
-
-
-// topTabSet.setSelectedTab(selectedTab);
+ // FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
+ // summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
+ // summaryTab.updateSubTab("Timeline", timelinePane);
+
+ // monitoringTab.updateSubTab("Graphs", new
GraphListView(resource)); // new
FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
+ // monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
+ // monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
+ // monitoringTab.updateSubTab("Availability", new
FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
+ // monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
+ // monitoringTab.updateSubTab("Call Time", new
CallTimeView(resource));
+ //
+ //
+ // inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
+ // inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
+ //
+ // operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
+ //
+ // configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
+ // configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
+ //
+ // alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
+ // alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
+ //
+ // eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
+ //
+ // contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
+ // contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
+ // contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
+ // contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+
+ // topTabSet.setSelectedTab(selectedTab);
updateTabStatus();
topTabSet.markForRedraw();
}
-
private void updateTabStatus() {
// Go and get the type with all needed metadata
// and then get the permissions for this resource
if (group.getGroupCategory() == GroupCategory.COMPATIBLE) {
ResourceType groupType = group.getResourceType();
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(groupType.getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.content,
- ResourceTypeRepository.MetadataType.operations,
- ResourceTypeRepository.MetadataType.events,
-
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ groupType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content,
ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.events,
+
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
ResourceGroupDetailView.this.groupType = type;
- GWTServiceLookup.getAuthorizationService().
-
getImplicitGroupPermissions(ResourceGroupDetailView.this.group.getId(),
- new AsyncCallback<Set<Permission>>()
{
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError("Failed to load group permissions",
caught);
- }
-
- public void onSuccess(Set<Permission>
result) {
- ResourceGroupDetailView.this.permissions
= new ResourcePermission(result);
- completeTabUpdate();
- }
- });
+
GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(
+ ResourceGroupDetailView.this.group.getId(), new
AsyncCallback<Set<Permission>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
load group permissions", caught);
+ }
+
+ public void onSuccess(Set<Permission> result) {
+ ResourceGroupDetailView.this.permissions = new
ResourcePermission(result);
+ completeTabUpdate();
+ }
+ });
}
});
}
}
-
private void completeTabUpdate() {
if (!permissions.isMeasure()) {
@@ -234,26 +211,27 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
topTabSet.enableTab(monitoringTab);
}
- if (groupType.getOperationDefinitions() == null ||
groupType.getOperationDefinitions().isEmpty() || !permissions.isControl()) {
+ if (groupType.getOperationDefinitions() == null ||
groupType.getOperationDefinitions().isEmpty()
+ || !permissions.isControl()) {
topTabSet.disableTab(operationsTab);
} else {
topTabSet.enableTab(operationsTab);
}
-
if (!permissions.isAlert()) {
topTabSet.disableTab(alertsTab);
} else {
topTabSet.enableTab(alertsTab);
}
- if (groupType.getResourceConfigurationDefinition() == null ||
!permissions.isConfigure()) {
+ if (groupType.getResourceConfigurationDefinition() == null ||
!permissions.isConfigureRead()) {
topTabSet.disableTab(configurationTab);
} else {
topTabSet.enableTab(configurationTab);
}
- if (groupType.getEventDefinitions() == null ||
groupType.getEventDefinitions().isEmpty() || !permissions.isMeasure()) {
+ if (groupType.getEventDefinitions() == null ||
groupType.getEventDefinitions().isEmpty()
+ || !permissions.isMeasure()) {
topTabSet.enableTab(eventsTab);
} else {
topTabSet.enableTab(eventsTab);
@@ -265,13 +243,11 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
topTabSet.enableTab(contentTab);
}
-
}
-
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
-// System.out.println("TAB: " + currentView.getPath() + tabPath);
+ // System.out.println("TAB: " + currentView.getPath() +
tabPath);
if (group != null) {
String path = "ResourceGroup/" + group.getId() + tabPath;
@@ -279,7 +255,6 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
}
}
-
public void renderView(ViewPath viewPath) {
// TODO: Implement this method.
@@ -299,14 +274,11 @@ public class ResourceGroupDetailView extends VLayout implements
BookmarkableView
tab.getLayout().selectTab(subtabView.getPath());
-
}
}
-
}
-
}
}
\ No newline at end of file
commit 27ec0c3bbf507b42f32c532064ccc8fdde483ad0
Merge: 13f415c... 48dc31b...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 20 13:53:38 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 13f415ca210fea4f228aaa5f7022e43c506d331c
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 20 13:52:06 2010 -0400
fix NPE that occurred when trying to view a group configuration update
(
https://bugzilla.redhat.com/show_bug.cgi?id=614886)
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 5f7203a..99e2d5a 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-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -1739,7 +1739,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public Map<Integer, Configuration>
getResourceConfigurationMapForGroupUpdate(Subject subject,
Integer groupResourceConfigurationUpdateId) {
// this method will perform the CONFIGURE_READ security check for us, no need to
keep reference to result
- getGroupPluginConfigurationUpdate(subject, groupResourceConfigurationUpdateId);
+ getGroupResourceConfigurationUpdate(subject,
groupResourceConfigurationUpdateId);
Tuple<String, Object> groupIdParameter = new Tuple<String,
Object>("groupConfigurationUpdateId",
groupResourceConfigurationUpdateId);
commit 48dc31be4c50301c53a1c77aa9b629466588ab0e
Merge: 54931b5... e0075fb...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 20 13:33:17 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 54931b509fcb42b50bf39436d08fe59edc6a3c1c
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 20 13:32:16 2010 -0400
Fixing unit test failures
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java
index 2bd80c5..bb71777 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java
@@ -23,10 +23,13 @@
package org.rhq.enterprise.server.configuration;
+import static org.rhq.core.domain.authz.Permission.CONFIGURE_READ;
+import static org.rhq.core.domain.authz.Permission.CONFIGURE_WRITE;
import static org.rhq.test.AssertUtils.*;
import static org.rhq.core.domain.configuration.ConfigurationUpdateStatus.*;
import static org.testng.Assert.*;
+import org.rhq.core.domain.authz.Permission;
import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.test.JMockTest;
import org.rhq.test.jmock.PropertyMatcher;
@@ -123,6 +126,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());
context.checking(new Expectations() {{
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_WRITE, fixture.resourceId);
+ will(returnValue(true));
+
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject,
@@ -159,6 +165,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
context.checking(new Expectations() {{
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_WRITE, fixture.resourceId);
+ will(returnValue(true));
+
oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject,
fixture.resourceId, fixture.configuration, INPROGRESS,
fixture.subject.getName(),
fixture.isPartOfGroupUpdate);
@@ -255,7 +264,11 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
final Sequence configUdpate =
context.sequence("structured-config-update");
context.checking(new Expectations() {{
- allowing(authorizationMgr).canViewResource(fixture.subject,
fixture.resourceId); will(returnValue(true));
+ oneOf(authorizationMgr).canViewResource(fixture.subject,
fixture.resourceId);
+ will(returnValue(true));
+
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_WRITE, fixture.resourceId);
+ will(returnValue(true));
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
@@ -303,6 +316,12 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
final Sequence configUdpate = context.sequence("raw-config-update");
context.checking(new Expectations() {{
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_READ, fixture.resourceId);
+ will(returnValue(true));
+
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_WRITE, fixture.resourceId);
+ will(returnValue(true));
+
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
allowing(authorizationMgr).canViewResource(fixture.subject,
fixture.resourceId); will(returnValue(true));
@@ -346,6 +365,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
context.checking(new Expectations() {{
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
+
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_WRITE, fixture.resourceId);
+ will(returnValue(true));
oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject,
fixture.resourceId,
fixture.configuration, INPROGRESS, fixture.subject.getName(),
fixture.isPartOfGroupUpdate);
@@ -375,10 +397,11 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
context.checking(new Expectations() {{
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
- oneOf(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId);
will(returnValue(true));
-
allowing(agentMgr).getAgentClient(fixture.resource.getAgent());
will(returnValue(agentClient));
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_READ, fixture.resourceId);
+ will(returnValue(true));
+
allowing(agentClient).getConfigurationAgentService();
will(returnValue(configAgentService));
oneOf(configAgentService).merge(fixture.configuration, fixture.resourceId,
FROM_STRUCTURED);
@@ -406,7 +429,8 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
context.checking(new Expectations() {{
allowing(entityMgr).find(Resource.class, fixture.resourceId);
will(returnValue(fixture.resource));
- oneOf(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId);
will(returnValue(true));
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject,
CONFIGURE_READ, fixture.resourceId);
+ will(returnValue(true));
allowing(agentMgr).getAgentClient(fixture.resource.getAgent());
will(returnValue(agentClient));
commit 070e9611ebcdfc678c4ddee886c067592edd5e8e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 20 13:30:21 2010 -0400
fix so vertical scrolling of right content div on resource/group pages works correctly
in IE7 (
https://bugzilla.redhat.com/show_bug.cgi?id=601744)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
index e6ad8cc..f0c4fda 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
@@ -2321,15 +2321,14 @@ ul.radio-group .unspecified {
.content-left {
width: 100%;
height: 100%;
- background-color: #ffffff;
+ background-color: #FFFFFF;
overflow: auto;
}
-.content-right {
- left: 6px;
+.content-right {
right: 0;
- height: 100%;
- margin-left: 6px;
+ width: 100%;
+ height: 100%;
overflow: auto;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
index e249621..c4ade43 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
@@ -43,14 +43,14 @@ id - the id of the Resource being accessed
<div id="contentParent">
<!--<![endif]-->
<div id="leftContent" class="column"
style="width: #{UserPreferencesUIBean.leftResourceNavState}%">
- <div id="leftContentWrapper"
class="content-left">
+ <div id="leftContentWrapper" class="content-left"
style="position: relative">
<ui:insert name="nav"><p>Default Entity
Navigation</p></ui:insert>
</div>
</div>
- <div id="centerContent" class="column"
style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;">
- <div id="centerContentWrapper"
class="content-right">
- <div style="left: 0; right: 0; height: 100%; position:
relative">
+ <div id="centerContent" class="column"
style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%">
+ <div id="centerContentWrapper"
class="content-right" style="position: relative">
+ <div style="left: 0; right: 0; height: 100%">
<ui:insert name="summary"><p>Default Entity
Summary</p></ui:insert>
<ui:insert name="tabBar"><p>Default Entity
TabBar</p></ui:insert>
<ui:insert name="content"><p>Default Entity
Content</p></ui:insert>
@@ -68,7 +68,7 @@ id - the id of the Resource being accessed
</a4j:form>
</a4j:region>
- <script language="JavaScript" type="text/JavaScript">
+ <script language="JavaScript" type="text/javascript">
<!--
function recalcContentSizes() {
@@ -85,7 +85,7 @@ id - the id of the Resource being accessed
//this has to be computed AFTER we change the parent's width above
to accomodate
//for the change of the left width caused by it.
var rightWidth = body.getDimensions().width -
left.getDimensions().width;
- rightWrapper.style.width = (rightWidth - 6) + 'px'; //6 - the
margin defined by the content-right css class
+ rightWrapper.style.width = (rightWidth) + 'px';
}
commit e0075fbf05954ead36fe462ea4d510a744898d0a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 20 13:04:10 2010 -0400
BZ-616465: remove beginning/trailing commas around email-based notifications
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
index 7dc1a4d..52713d4 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
@@ -208,7 +208,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "subjectId";
String senderName = "System Users";
- persist(data, propertyName, senderName, "|");
+ persist(data, propertyName, senderName, "|", true);
}
private void upgradeRoleNotifications() throws SQLException {
@@ -223,7 +223,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "roleId";
String senderName = "System Roles";
- persist(data, propertyName, senderName, "|");
+ persist(data, propertyName, senderName, "|", true);
}
private void upgradeEmailNotifications() throws SQLException {
@@ -238,7 +238,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "emailAddress";
String senderName = "Direct Emails";
- persist(data, propertyName, senderName, ",");
+ persist(data, propertyName, senderName, ",", false);
}
private void upgradeSNMPNotifications() throws SQLException {
@@ -281,7 +281,8 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
}
}
- private void persist(List<Object[]> data, String propertyName, String sender,
String delimiter) throws SQLException {
+ private void persist(List<Object[]> data, String propertyName, String sender,
String delimiter,
+ boolean bufferWithDelimiter) throws SQLException {
int definitionId = -1;
StringBuilder buffer = new StringBuilder();
for (Object[] next : data) {
@@ -307,7 +308,8 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
if (buffer.length() != 0) {
// always add <delimiter> to both side of the buffer -- this will
enable searches for data
// using the JPQL fragment notification.configuration.value =
<delimiter><data><delimiter>'
- int configId = persistConfiguration(propertyName, delimiter +
buffer.toString() + delimiter);
+ String bufferedData = bufferWithDelimiter ? (delimiter + buffer.toString() +
delimiter) : buffer.toString();
+ int configId = persistConfiguration(propertyName, bufferedData);
persistNotification(definitionId, configId, sender);
}
}
commit c4228063c198191b9a4ba2fe0e9a1a0cd53abe28
Merge: 4d7a0dc... 4b8e7d1...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 20 11:54:22 2010 -0400
Merge branch 'release-3.0.0-jay' into master-jay
Conflicts:
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
modules/plugins/apache/src/test/resources/httpd.aug
modules/plugins/apache/src/test/resources/httpd.conf
modules/plugins/apache/src/test/resources/nested.conf
modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
modules/plugins/apache/src/test/resources/updateconfig/nested.conf
diff --cc modules/core/dbutils/pom.xml
index 31e3e0a,7ff6a10..8769bfc
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@@ -22,7 -22,7 +22,7 @@@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
-- <db.schema.version>2.91</db.schema.version>
++ <db.schema.version>2.92</db.schema.version>
</properties>
<dependencies>
diff --cc modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 7071839,951d972..f3b3106
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@@ -3111,18 -3070,18 +3121,31 @@@
</schema-directSQL>
</schemaSpec>
+
<schemaSpec version="2.91">
+ <schema-directSQL>
+ <statement desc="Add end time index on call time data to
speed up purges">
+ CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE
(end_time)
+ </statement>
+ <statement desc="Add index on measurement definition numeric
type">
+ CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF
(numeric_type)
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
+
++ <schemaSpec version="2.92">
+ <!-- if some role previously had CONFIGURE perm (now called
CONFIGURE_WRITE), give it the implied perm
+ CONFIGURE_READ so users don't experience an unexpected
permission restriction after upgrade -->
+ <schema-directSQL>
+ <statement desc="Upgrading configuration
permissions">
+ INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION)
+ SELECT PERM.ROLE_ID, 13
+ FROM RHQ_PERMISSION PERM
+ WHERE PERM.OPERATION = 11
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
++
</dbupgrade>
</target>
</project>
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
index 8ecfde5,5526b3d..42600a5
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
@@@ -64,11 -64,11 +64,10 @@@ public class SearchGUI implements Entry
public static void checkLoginStatus() {
- if (detectIe6()) {
- forceIe6Hacks();
+ if (CoreGUI.detectIe6()) {
+ CoreGUI.forceIe6Hacks();
}
--
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/sessionAccess");
try {
b.setCallback(new RequestCallback() {
@@@ -141,8 -141,8 +140,6 @@@
return searchBar;
}
--
--
/**
* Detects IE6.
* <p/>
@@@ -150,20 -150,20 +147,20 @@@
* js libraries on the same page at the same time as gwt.
*/
public static native boolean detectIe6() /*-{
-- if (typeof $doc.body.style.maxHeight != "undefined")
-- return(false);
-- else
-- return(true);
--}-*/;
++ if (typeof $doc.body.style.maxHeight !=
"undefined")
++ return(false);
++ else
++ return(true);
++ }-*/;
public static native void forceIe6Hacks() /*-{
-- $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest;
-- $wnd.XMLHttpRequest = null;
--}-*/;
++ $wnd.XMLHttpRequestBackup =
$wnd.XMLHttpRequest;
++ $wnd.XMLHttpRequest = null;
++ }-*/;
public static native void unforceIe6Hacks() /*-{
-- $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup;
-- $wnd.XMLHttpRequestBackup = null;
--}-*/;
++ $wnd.XMLHttpRequest =
$wnd.XMLHttpRequestBackup;
++ $wnd.XMLHttpRequestBackup = null;
++ }-*/;
}
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 55a7d47,9992897..35b2acb
---
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
@@@ -18,7 -18,7 +18,6 @@@
*/
package org.rhq.enterprise.gui.coregui.client.menu;
--import com.google.gwt.dom.client.Document;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
@@@ -26,16 -26,16 +25,11 @@@ import com.google.gwt.user.client.Windo
import com.google.gwt.user.client.ui.Hyperlink;
import com.smartgwt.client.types.ContentsType;
import com.smartgwt.client.types.VerticalAlignment;
--import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
--import com.smartgwt.client.widgets.events.DrawEvent;
--import com.smartgwt.client.widgets.events.DrawHandler;
--import com.smartgwt.client.widgets.events.ShowContextMenuEvent;
--import com.smartgwt.client.widgets.events.ShowContextMenuHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
@@@ -57,7 -57,7 +51,7 @@@ public class MenuBarView extends VLayou
private AboutModalWindow aboutModalWindow;
-- public static final String[] SECTIONS = {"Dashboard", "Demo",
"Inventory", "Bundles", "Administration"};
++ public static final String[] SECTIONS = { "Dashboard", "Demo",
"Inventory", "Bundles", "Administration" };
private String selected = "Dashboard";
@@@ -68,10 -68,10 +62,8 @@@
setHeight(50);
setWidth100();
--
}
--
protected void onDraw() {
super.onDraw();
@@@ -80,10 -80,11 +72,9 @@@
-
HLayout topBar = new HLayout();
topBar.setHeight(28);
topBar.setStyleName("topMenuBar");
--// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0
#DDDDDD
--// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png");
--// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X);
--
++ // url("./images/cssButton/button_stretch.png") repeat-x scroll
0 0 #DDDDDD
++ //
topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png");
++ // topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X);
Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@@@ -92,36 -93,36 +83,36 @@@
}
});
--
topBar.addMember(logo);
--
// Create a menu bar
final MenuBar menu = new MenuBar();
menu.setHeight(28);
--
--
Menu subsystemsMenu = new Menu();
subsystemsMenu.setTitle("Subsystems");
-- subsystemsMenu.addItem(new EMenuItem("Configuration Changes",
LinkManager.getSubsystemConfigurationLink(),
"subsystems/configure/Configure_16.png"));//, new
LinkCommand("#config"));
-- subsystemsMenu.addItem(new EMenuItem("Suspect Metrics",
LinkManager.getSubsystemSuspectMetricsLink(),
"subsystems/monitor/Monitor_failed_16.png"));//, new
LinkCommand("#config"));
-- subsystemsMenu.addItem(new EMenuItem("Operations",
LinkManager.getSubsystemOperationHistoryLink(),
"subsystems/control/Operation_16.png"));//, new
LinkCommand("#config"));
-- subsystemsMenu.addItem(new EMenuItem("Alerts",
LinkManager.getSubsystemAlertHistoryLink(),
"subsystems/alert/Alert_HIGH_16.png"));//, new
LinkCommand("#config"));
-- subsystemsMenu.addItem(new EMenuItem("Alert Definitions",
LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//,
new LinkCommand("#config"));
--
++ subsystemsMenu.addItem(new EMenuItem("Configuration Changes",
LinkManager.getSubsystemConfigurationLink(),
++ "subsystems/configure/Configure_16.png"));//, new
LinkCommand("#config"));
++ subsystemsMenu.addItem(new EMenuItem("Suspect Metrics",
LinkManager.getSubsystemSuspectMetricsLink(),
++ "subsystems/monitor/Monitor_failed_16.png"));//, new
LinkCommand("#config"));
++ subsystemsMenu.addItem(new EMenuItem("Operations",
LinkManager.getSubsystemOperationHistoryLink(),
++ "subsystems/control/Operation_16.png"));//, new
LinkCommand("#config"));
++ subsystemsMenu.addItem(new EMenuItem("Alerts",
LinkManager.getSubsystemAlertHistoryLink(),
++ "subsystems/alert/Alert_HIGH_16.png"));//, new
LinkCommand("#config"));
++ subsystemsMenu.addItem(new EMenuItem("Alert Definitions",
LinkManager.getSubsystemAlertDefsLink(),
++ "subsystems/alert/Alerts_16.png"));//, new
LinkCommand("#config"));
final Menu overviewMenu = new Menu();
overviewMenu.setTitle("Overview");
overviewMenu.setStyleName("SimpleMenuBarButton");
overviewMenu.setBorder("none");
-- com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new
com.smartgwt.client.widgets.menu.MenuItem("Subsystems");
++ com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new
com.smartgwt.client.widgets.menu.MenuItem(
++ "Subsystems");
subsystemsSubMenuItem.setSubmenu(subsystemsMenu);
overviewMenu.addItem(subsystemsSubMenuItem);
-- overviewMenu.addItem(new EMenuItem("AutoDiscovery
Queue",LinkManager.getAutodiscoveryQueueLink()));//,new
LinkCommand("#cofng"));
-- overviewMenu.addItem(new
EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new
LinkCommand("#cofng"));
--
++ overviewMenu.addItem(new EMenuItem("AutoDiscovery Queue",
LinkManager.getAutodiscoveryQueueLink()));//,new LinkCommand("#cofng"));
++ overviewMenu.addItem(new EMenuItem("Dashboard",
LinkManager.getDashboardLink()));//,new LinkCommand("#cofng"));
Menu resourcesMenu = new Menu();
resourcesMenu.setTitle("Resources");
@@@ -129,7 -130,7 +120,8 @@@
resourcesMenu.setBorder("none");
resourcesMenu.setStyleName("menuBarMenuButton");
resourcesMenu.addItem(new EMenuItem("All Resources",
LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf"));
-- resourcesMenu.addItem(new EMenuItem("Platforms",
LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new
LinkCommand("#fsdf"));
++ resourcesMenu
++ .addItem(new EMenuItem("Platforms",
LinkManager.getHubPlatformsLink(), "types/Platform_up_16.png"));//, new
LinkCommand("#fsdf"));
resourcesMenu.addItem(new EMenuItem("Servers",
LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new
LinkCommand("#fsdf"));
resourcesMenu.addItem(new EMenuItem("Services",
LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new
LinkCommand("#fsdf"));
resourcesMenu.addItem(new MenuItemSeparator());
@@@ -154,52 -155,52 +146,46 @@@
groupsMenu.addItem(new EMenuItem("New Group",
LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf"));
groupsMenu.addItem(new EMenuItem("New Group Definition",
LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf"));
groupsMenu.addItem(new MenuItemSeparator());
--// groupsMenu.addItem(new MenuItem("Favorites")); //, new
LinkCommand("#sf"));
--
++ // groupsMenu.addItem(new MenuItem("Favorites")); //, new
LinkCommand("#sf"));
Menu securityMenu = new Menu();
securityMenu.setTitle("Security");
-- securityMenu.addItem(new
EMenuItem("Users",LinkManager.getAdminUsersLink()));
-- securityMenu.addItem(new
EMenuItem("Roles",LinkManager.getAdminRolesLink()));
++ securityMenu.addItem(new EMenuItem("Users",
LinkManager.getAdminUsersLink()));
++ securityMenu.addItem(new EMenuItem("Roles",
LinkManager.getAdminRolesLink()));
MenuItem securitySubMenuItem = new MenuItem("Security");
securitySubMenuItem.setSubmenu(securityMenu);
--
Menu sysConfigMenu = new Menu();
sysConfigMenu.setTitle("System Configuration");
-- sysConfigMenu.addItem(new
EMenuItem("Settings",LinkManager.getAdminSysConfigLink()));
-- sysConfigMenu.addItem(new
EMenuItem("Plugins",LinkManager.getAdminPluginsLink()));
-- sysConfigMenu.addItem(new
EMenuItem("Templates",LinkManager.getAdminTemplatesLink()));
++ sysConfigMenu.addItem(new EMenuItem("Settings",
LinkManager.getAdminSysConfigLink()));
++ sysConfigMenu.addItem(new EMenuItem("Plugins",
LinkManager.getAdminPluginsLink()));
++ sysConfigMenu.addItem(new EMenuItem("Templates",
LinkManager.getAdminTemplatesLink()));
MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration");
sysConfigSubMenuItem.setSubmenu(sysConfigMenu);
--
Menu contentMenu = new Menu();
contentMenu.setTitle("Content");
-- contentMenu.addItem(new EMenuItem("Bundles","#Bundles"));
-- contentMenu.addItem(new EMenuItem("Content
Providers",LinkManager.getAdminContentProvidersLink()));
-- contentMenu.addItem(new EMenuItem("Content
Repositories",LinkManager.getAdminContentReposLink()));
++ contentMenu.addItem(new EMenuItem("Bundles", "#Bundles"));
++ contentMenu.addItem(new EMenuItem("Content Providers",
LinkManager.getAdminContentProvidersLink()));
++ contentMenu.addItem(new EMenuItem("Content Repositories",
LinkManager.getAdminContentReposLink()));
MenuItem contentSubMenuItem = new MenuItem("Content");
contentSubMenuItem.setSubmenu(contentMenu);
--
Menu haMenu = new Menu();
haMenu.setTitle("High Availability");
-- haMenu.addItem(new
EMenuItem("Servers",LinkManager.getHAServersLink()));
-- haMenu.addItem(new
EMenuItem("Agents",LinkManager.getHAAgentsLink()));
-- haMenu.addItem(new EMenuItem("Affinity
Groups",LinkManager.getHAAffinityGroupsLink()));
-- haMenu.addItem(new EMenuItem("Partition
Events",LinkManager.getHAEventsLink()));
++ haMenu.addItem(new EMenuItem("Servers",
LinkManager.getHAServersLink()));
++ haMenu.addItem(new EMenuItem("Agents",
LinkManager.getHAAgentsLink()));
++ haMenu.addItem(new EMenuItem("Affinity Groups",
LinkManager.getHAAffinityGroupsLink()));
++ haMenu.addItem(new EMenuItem("Partition Events",
LinkManager.getHAEventsLink()));
MenuItem haSubMentItem = new MenuItem("High Availability");
haSubMentItem.setSubmenu(haMenu);
--
Menu reportsMenu = new Menu();
reportsMenu.setTitle("Reports");
reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report",
LinkManager.getReportsInventoryLink()));
MenuItem reportsSubMenuItem = new MenuItem("Reports");
reportsSubMenuItem.setSubmenu(reportsMenu);
--
Menu adminMenu = new Menu();
adminMenu.setTitle("Administration");
adminMenu.addItem(securitySubMenuItem);
@@@ -210,23 -211,23 +196,17 @@@
adminMenu.addItem(new EMenuItem("Downloads",
LinkManager.getAdminDownloadsLink()));
adminMenu.addItem(new EMenuItem("License",
LinkManager.getAdminLicenseLink()));
--
--
--
--
Menu helpMenu = new Menu();
helpMenu.setStyleName("menuBarMenuButton");
helpMenu.setTitle("Help");
helpMenu.addItem(new EMenuItem("Online Documentation",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
helpMenu.addItem(new EMenuItem("Open a support case",
"http://www.rhq-project.org")); //, new LinkCommand("#sdfs"));
--// helpMenu.addItem(new MenuItem("About")); //, new
LinkCommand("#sdfs"));
++ // helpMenu.addItem(new MenuItem("About")); //, new
LinkCommand("#sdfs"));
menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu);
--
topBar.addMember(menu);
--
addMember(topBar);
addMember(new SearchBarPane());
@@@ -241,7 -242,7 +221,6 @@@
addMember(menu);
}
--
// @Override
protected void onDraw3() {
@@@ -261,7 -262,7 +240,6 @@@
}
});
--
ToolStrip topStrip = new ToolStrip();
topStrip.setHeight(34);
topStrip.setWidth100();
@@@ -328,7 -329,7 +306,7 @@@
private String setupLinks() {
StringBuilder headerString = new StringBuilder(
-- "<table style=\"height: 34px;\"
cellpadding=\"0\" cellspacing=\"0\"><tr>");
++ "<table style=\"height: 34px;\"
cellpadding=\"0\" cellspacing=\"0\"><tr>");
boolean first = true;
for (String section : SECTIONS) {
@@@ -354,7 -355,7 +332,6 @@@
return headerString.toString();
}
--
public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem {
String link;
commit e395447b05a549f9771dcc1f2a362dc86c284210
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 20 11:22:23 2010 -0400
BZ-616465: fix delimiter for email-based alert notifications
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
index 1bddef4..7dc1a4d 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
@@ -208,7 +208,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "subjectId";
String senderName = "System Users";
- persist(data, propertyName, senderName);
+ persist(data, propertyName, senderName, "|");
}
private void upgradeRoleNotifications() throws SQLException {
@@ -223,7 +223,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "roleId";
String senderName = "System Roles";
- persist(data, propertyName, senderName);
+ persist(data, propertyName, senderName, "|");
}
private void upgradeEmailNotifications() throws SQLException {
@@ -238,7 +238,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
String propertyName = "emailAddress";
String senderName = "Direct Emails";
- persist(data, propertyName, senderName);
+ persist(data, propertyName, senderName, ",");
}
private void upgradeSNMPNotifications() throws SQLException {
@@ -281,7 +281,7 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
}
}
- private void persist(List<Object[]> data, String propertyName, String sender)
throws SQLException {
+ private void persist(List<Object[]> data, String propertyName, String sender,
String delimiter) throws SQLException {
int definitionId = -1;
StringBuilder buffer = new StringBuilder();
for (Object[] next : data) {
@@ -291,23 +291,23 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
definitionId = nextDefinitionId;
if (buffer.length() != 0) {
// buffer will be 0 the very first time, since definitionId is
initially -1
- int configId = persistConfiguration(propertyName, "|" +
buffer.toString() + "|");
+ int configId = persistConfiguration(propertyName, delimiter +
buffer.toString() + delimiter);
persistNotification(definitionId, configId, sender);
}
buffer = new StringBuilder(); // reset for the next definitionId
}
if (buffer.length() != 0) {
- // elements are already in the list, always add '|' separator
between them
- buffer.append('|');
+ // elements are already in the list, always add <delimiter> between
them
+ buffer.append(delimiter);
}
buffer.append(nextData);
}
if (buffer.length() != 0) {
- // always add '|' separator to both side of the buffer
- // this will enable searches for data using the JPQL fragment
notification.configuration.value = '|<data>|'
- int configId = persistConfiguration(propertyName, "|" +
buffer.toString() + "|");
+ // always add <delimiter> to both side of the buffer -- this will
enable searches for data
+ // using the JPQL fragment notification.configuration.value =
<delimiter><data><delimiter>'
+ int configId = persistConfiguration(propertyName, delimiter +
buffer.toString() + delimiter);
persistNotification(definitionId, configId, sender);
}
}
commit 95018277d65928258f606e526952f9e4bdcb5399
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 16 11:35:59 2010 -0400
Up the timeout for upload servlet session
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
index 32b1ddc..2c8e514 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
@@ -33,6 +33,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
@@ -51,9 +52,17 @@ import org.rhq.enterprise.server.util.LookupUtil;
public class FileUploadServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
+ /* The number of seconds the session can remain inactive. The default is 600 (10
minutes).
+ * It may take longer than 10 minutes to upload a large file, so we'll
increase...
+ */
+ private static final int MAX_INACTIVE_INTERVAL = 60 * 60;
+
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ HttpSession session = req.getSession();
+ session.setMaxInactiveInterval(MAX_INACTIVE_INTERVAL);
+
if (ServletFileUpload.isMultipartContent(req)) {
DiskFileItemFactory fileItemFactory = new DiskFileItemFactory();
commit 4b8e7d151a964386044ed4efb37c0dba0e646bd1
Merge: 67fe77e... c487acd...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 20 10:47:45 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit c487acda658988f3016e2e4ec71ec03261bf50fd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 20 09:30:50 2010 -0400
BZ-616400: fix alert notification log custom upgrade task
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
index 4e2f328..1bddef4 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java
@@ -76,12 +76,12 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
private void upgradeSubjectNotificationLogs() throws SQLException {
/*
* alert.alertNotificationLog.sender = "System Users"
- * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL"
+ * alert.alertNotificationLog.result_state = "UNKNOWN" //
success-failure is unknown for existing alerts
* alert.alertNotificationLog.message = "Sending to subjects:
[<alert.alertNotificationLog.subjects>]"
*/
String field = "notif.subjects";
String message = concat("'Sending to subjects: '", field);
- String insertSQL = getNotificationLogConversionSQL("'System
Users'", "'DEFERRED_EMAIL'", message, field);
+ String insertSQL = getNotificationLogConversionSQL("'System
Users'", "'UNKNOWN'", message, field);
System.out.println("Executing: " + insertSQL);
databaseType.executeSql(connection, insertSQL);
}
@@ -89,12 +89,12 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
private void upgradeRoleNotificationLogs() throws SQLException {
/*
* alert.alertNotificationLog.sender = "System Roles"
- * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL"
+ * alert.alertNotificationLog.result_state = "UNKNOWN" //
success-failure is unknown for existing alerts
* alert.alertNotificationLog.message = "Sending to roles:
[<alert.alertNotificationLog.roles>]"
*/
String field = "notif.roles";
String message = concat("'Sending to roles: '", field);
- String insertSQL = getNotificationLogConversionSQL("'System
Roles'", "'DEFERRED_EMAIL'", message, field);
+ String insertSQL = getNotificationLogConversionSQL("'System
Roles'", "'UNKNOWN'", message, field);
System.out.println("Executing: " + insertSQL);
databaseType.executeSql(connection, insertSQL);
}
@@ -102,12 +102,12 @@ public class CustomAlertSenderUpgradeTask implements
DatabaseUpgradeTask {
private void upgradeEmailNotificationLogs() throws SQLException {
/*
* alert.alertNotificationLog.sender = "Direct Emails"
- * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL"
+ * alert.alertNotificationLog.result_state = "UNKNOWN" //
success-failure is unknown for existing alerts
* alert.alertNotificationLog.message = "Sending to subjects:
[<alert.alertNotificationLog.emails>]"
*/
String field = "notif.emails";
String message = concat("'Sending to addresses: '", field);
- String insertSQL = getNotificationLogConversionSQL("'Direct
Emails'", "'DEFERRED_EMAIL'", message, field);
+ String insertSQL = getNotificationLogConversionSQL("'Direct
Emails'", "'UNKNOWN'", message, field);
System.out.println("Executing: " + insertSQL);
databaseType.executeSql(connection, insertSQL);
}
commit 67fe77e638ef6bfb394b81476eaefc2830364199
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 19 18:01:44 2010 -0400
[BZ 611456] Change the way PackageBits is handled to ensure lazy load of
the blob. This involves extracting the Lob into its own entity to
put in place a mapping that Hibernate will honor for Lazy fetch.
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..6d55f5e 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -37,12 +37,13 @@
<version>${project.version}</version>
</dependency>
- <!-- required by PersistenceUtil -->
+ <!-- required by PersistenceUtil (provided by AS) -->
+ <!-- required also by hibernate Instrument task. (but use compile scope for
this) -->
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
- <scope>provided</scope> <!-- by JBossAS -->
+ <scope>compile</scope>
</dependency>
<dependency>
@@ -51,7 +52,7 @@
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
<scope>provided</scope> <!-- by JBossAS -->
</dependency>
-
+
<!-- required by PersistenceUtil and EJB3 Embedded -->
<dependency>
<groupId>hibernate-entitymanager</groupId>
@@ -72,6 +73,23 @@
<artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
</dependency>
+
+ <!-- needed for hibernate Instrument task
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${jboss-javassist.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ -->
+
+ <!-- needed for hibernate Instrument task
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ -->
<!-- needed if you want to use the logging JDBC wrapper
<dependency>
@@ -94,6 +112,13 @@
<!--================ Test Deps ================-->
<dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${jboss-javassist.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement
section. -->
@@ -175,13 +200,6 @@
</dependency>
<dependency>
- <groupId>jboss</groupId>
- <artifactId>javassist</artifactId>
- <version>3.4.ga</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>oswego-concurrent</groupId>
<artifactId>concurrent</artifactId>
<version>1.3.4</version>
@@ -222,10 +240,8 @@
<version>2.0</version>
</dependency>-->
-
</dependencies>
-
<build>
<finalName>rhq-core-domain-ejb3</finalName>
@@ -249,7 +265,6 @@
<plugins>
-
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
@@ -317,26 +332,45 @@
<plugins>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
<execution>
- <id>deploy</id>
- <phase>compile</phase>
+ <phase>process-classes</phase>
<configuration>
- <tasks>
- <property name="deployment.dir"
location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from
target${file.separator}classes${file.separator} to
${deployment.dir}${file.separator}...</echo>
- <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
- <fileset dir="target/classes" />
- </copy>
- </tasks>
+ <tasks>
+ <!-- don't instrument...
+ I'm leaving this here as an example of how to apply
Hibernate Instrumentation to a class.
+ Instrumentation is useful for various property-level things
such as field-level lazy load.
+ Using it turned out not t be a current option since the
instrumented class carries with
+ it hibernate imports that we can't put in the domain jar
since it's used on the Agent and
+ in Remote Java Clients. But this worked, so here ya go...
+ <taskdef
+ name="instrument"
+
classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
+ <classpath>
+ <path refid="maven.runtime.classpath"
/>
+ <path refid="maven.plugin.classpath"
/>
+ </classpath>
+ </taskdef>
+ <instrument verbose="true">
+ <fileset
dir="${project.build.outputDirectory}">
+ <include
name="**/domain/**/PackageBits.class" />
+ </fileset>
+ </instrument>
+ -->
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
target${file.separator}classes${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="target/classes" />
+ </copy>
+ </tasks>
</configuration>
<goals>
- <goal>run</goal>
+ <goal>run</goal>
</goals>
- </execution>
+ </execution>
<execution>
<id>undeploy</id>
@@ -353,7 +387,7 @@
</goals>
</execution>
- </executions>
+ </executions>
</plugin>
</plugins>
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java
index 17ad568..5cc2ff9 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java
@@ -24,17 +24,14 @@ package org.rhq.core.domain.content;
import java.io.Serializable;
-import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.Lob;
+import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
-import javax.persistence.SequenceGenerator;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlTransient;
@@ -42,22 +39,25 @@ import javax.xml.bind.annotation.XmlTransient;
* Contains the actual package contents ("the bits") for a particular {@link
PackageVersion}.
*
* @author John Mazzitelli
+ * @author Jay Shaughnessy
*/
@Entity
@NamedQueries( {
- @NamedQuery(name = PackageBits.QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID,
query = "SELECT new org.rhq.core.domain.content.composite.LoadedPackageBitsComposite(
"
- + " pv.id, "
- + " pv.fileName, "
+ @NamedQuery(name = PackageBits.QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID,
query = "" //
+ + " SELECT new
org.rhq.core.domain.content.composite.LoadedPackageBitsComposite( " //
+ + " pv.id, " //
+ + " pv.fileName, " //
+ " pv.packageBits.id, "
- + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS
NOT NULL) "
- + " ) "
- + " FROM PackageVersion pv " + " WHERE pv.id = :id "),
+ + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits
IS NOT NULL) " //
+ + " ) " //
+ + " FROM PackageVersion pv " + " WHERE pv.id = :id "),
// deletes orphaned package bits - that is, if they have no associated package
version
- @NamedQuery(name = PackageBits.DELETE_IF_NO_PACKAGE_VERSION, query = "DELETE
PackageBits AS pb "
- + " WHERE pb.id NOT IN ( SELECT pv.packageBits.id " + "
FROM PackageVersion pv "
+ @NamedQuery(name = PackageBits.DELETE_IF_NO_PACKAGE_VERSION, query = "" //
+ + " DELETE PackageBits AS pb " //
+ + " WHERE pb.id NOT IN ( SELECT pv.packageBits.id " //
+ + " FROM PackageVersion pv " //
+ " WHERE pv.packageBits IS NOT NULL ) ") })
-@SequenceGenerator(name = "SEQ", sequenceName =
"RHQ_PACKAGE_BITS_ID_SEQ")
@Table(name = PackageBits.TABLE_NAME)
public class PackageBits implements Serializable {
public static final String TABLE_NAME = "RHQ_PACKAGE_BITS";
@@ -65,18 +65,30 @@ public class PackageBits implements Serializable {
public static final String QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID =
"PackageBits.isLoaded";
public static final String DELETE_IF_NO_PACKAGE_VERSION =
"PackageBits.deleteIfNoPackageVersion";
+ /**
+ * Can be used as initial contents for a PackageVersion's PackageBits whenever a
predictable non-null
+ * value is required. Use as an initial value for the PackageBits.blob.bits. The
value will
+ * typically be replaced with the actual streamed content bits...<br>
+ * Note: This is a String and not a byte[] because gwt can't handle
String.getBytes().
+ */
+ public static final String EMPTY_BLOB = "EmptyBlob";
+
private static final long serialVersionUID = 1L;
+ // Note that the persistance for this table is done through the PackageBitsBlob
entity to avoid
+ // constraint violations.
@Column(name = "ID", nullable = false)
- @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ")
@Id
private int id;
- @Lob
- @Basic(fetch = FetchType.LAZY)
- @Column(name = "BITS", nullable = true)
+ // To get lazy load semantics for the Lob field we would need to instrument the
class. We can't do that
+ // because it introduces hibernate class dependencies into the domain jar. As a
workaround, we access
+ // the Lob through a required relational mapping *to ourself*.
+ // Note: To get Lazy load on xxxToOne mappings "optional=false" must be
declared!
+ @JoinColumn(name = "ID", referencedColumnName = "ID", nullable =
false)
+ @OneToOne(optional = false, fetch = FetchType.LAZY)
@XmlTransient
- private byte[] bits;
+ private PackageBitsBlob blob;
public PackageBits() {
// for JPA use
@@ -91,24 +103,21 @@ public class PackageBits implements Serializable {
}
/**
- * The actual content of the package ("the bits"). If the package content
is not stored in the database, this will
- * return <code>null</code>. In this case, the content is probably stored
somewhere else on a local file system.
- * When <code>null</code> is returned, it is assumed that who ever needs
the content can know where to find it based
- * on the {@link PackageVersion} details.
+ * @return the blob wrapper. This is never null although the actual bits
(PackageBitsBlob.getBits()) can be null.
*
* For large file contents, you should use ContentManager.updateBlobStream() to write
and
* ContentManager.writeBlobOutToStream() to read/direct file contents into as no
byte[] is used.
*/
@XmlTransient
- public byte[] getBits() {
- return bits;
+ public PackageBitsBlob getBlob() {
+ return blob;
}
- /** For large file contents, you should use ContentManager.updateBlobStream() to
write and
- * ContentManager.writeBlobOutToStream() to read/direct file contents into as no
byte[] is used.
- *
+ /**
+ * For large file contents, you should use ContentManager.updateBlobStream() to write
and
+ * ContentManager.writeBlobOutToStream() to stream the binary bits and avoid a
byte[].
*/
- public void setBits(byte[] bits) {
- this.bits = bits;
+ public void setBlob(PackageBitsBlob blob) {
+ this.blob = blob;
}
}
\ No newline at end of file
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java
new file mode 100644
index 0000000..4252e97
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java
@@ -0,0 +1,107 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.content;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * The actual Lob contents for a PackageBits entity. Note that PackageBits and
PackageBitsBlob are two
+ * entities that *share* the same db row. This is done to allow for Lazy load semantics
on the Lob. Hibernate
+ * does not honor field-level Lazy load on a Lob (or any field) unless the entity class
is instrumented.
+ * We can't use that approach because it introduces Hibernate imports into the domain
class, and that violates our
+ * restriction of exposing hibernate classes to the Agent and Remote clients. As a
workaround we pull the Lob into
+ * its own entity and access it through a relational mapping. Note that the entities
share the same Id since they
+ * share the same physical row. The row is persisted via this class and as such the
sequence is declared here. Creating
+ * this entity first allows us to satisfy the required 1-1 mapping in {@link
PackageBits}.
+ * <br>
+ * Related Links:
+ *
<
br>http://docs.jboss.org/hibernate/stable/core/reference/en/html/perfo...
+ * <
br>http://community.jboss.org/wiki/Someexplanationsonlazyloadingone-to...
+ *
<
br>http://docs.jboss.org/hibernate/stable/annotations/reference/en/htm...
+ * <
br>http://community.jboss.org/wiki/AShortPrimerOnFetchingStrategies
+ *
<
br>http://docs.codehaus.org/display/MAVENUSER/Howto+instrument+domain+...
+ *
+ * @author Jay Shaughnessy
+ */
+@Entity
+@SequenceGenerator(name = "SEQ", sequenceName =
"RHQ_PACKAGE_BITS_ID_SEQ")
+@Table(name = PackageBits.TABLE_NAME)
+public class PackageBitsBlob implements Serializable {
+ public static final String TABLE_NAME = "RHQ_PACKAGE_BITS";
+
+ private static final long serialVersionUID = 1L;
+
+ @Column(name = "ID", nullable = false)
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ")
+ @Id
+ private int id;
+
+ @Lob
+ @Column(name = "BITS")
+ @XmlTransient
+ private byte[] bits;
+
+ public PackageBitsBlob() {
+ // for JPA use
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * The actual content of the package ("the bits"). If the package content
is not stored in the database, this will
+ * return <code>null</code>. In this case, the content is probably stored
somewhere else on a local file system.
+ * When <code>null</code> is returned, it is assumed that who ever needs
the content can know where to find it based
+ * on the {@link PackageVersion} details.
+ *
+ * For large file contents, you should use ContentManager.updateBlobStream() to write
and
+ * ContentManager.writeBlobOutToStream() to read/direct file contents into as no
byte[] is used.
+ */
+ @XmlTransient
+ public byte[] getBits() {
+ return bits;
+ }
+
+ /**
+ * For large file contents, you should use ContentManager.updateBlobStream() to write
and
+ * ContentManager.writeBlobOutToStream() to stream the binary bits and avoid a
byte[].
+ */
+ public void setBits(byte[] bits) {
+ this.bits = bits;
+ }
+}
\ No newline at end of file
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java
index 6db423a..f05b36c 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java
@@ -39,6 +39,7 @@ import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlTransient;
import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;
@@ -177,7 +178,7 @@ import org.rhq.core.domain.resource.ProductVersion;
+ " AND pv.repoPackageVersions IS EMPTY "
+ " AND pv.installedPackages IS EMPTY "
+ " AND pv.installedPackageHistory IS EMPTY "
- + " AND pb.bits IS NULL "),
+ + " AND pb.blob.bits IS NULL "),
@NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITE_BY_ID, query = "SELECT
new org.rhq.core.domain.content.composite.PackageVersionComposite( "
+ " pv, "
+ " pv.generalPackage.packageType.name, "
@@ -186,7 +187,7 @@ import org.rhq.core.domain.resource.ProductVersion;
+ " pv.architecture.name, "
+ " pv.generalPackage.classification, "
+ " pv.packageBits.id, "
- + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS
NOT NULL) "
+ + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits
IS NOT NULL) "
+ " ) "
+ " FROM PackageVersion pv WHERE pv.id = :id "),
@NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITE_BY_ID_WITH_PROPS, query =
"SELECT new org.rhq.core.domain.content.composite.PackageVersionComposite( "
@@ -198,7 +199,7 @@ import org.rhq.core.domain.resource.ProductVersion;
+ " pv.architecture.name, "
+ " pv.generalPackage.classification, "
+ " pv.packageBits.id, "
- + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS
NOT NULL) "
+ + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits
IS NOT NULL) "
+ " ) "
+ " FROM PackageVersion pv WHERE pv.id = :id"),
@NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITES_BY_IDS, query = "SELECT
new org.rhq.core.domain.content.composite.PackageVersionComposite( "
@@ -343,8 +344,10 @@ public class PackageVersion implements Serializable {
@OneToMany(mappedBy = "packageVersion", fetch = FetchType.LAZY)
private Set<InstalledPackageHistory> installedPackageHistory;
+ // No longer use cascade PERSIST on this. We'll associate it manually due to
intracacies in blob handling
@JoinColumn(name = "PACKAGE_BITS_ID", referencedColumnName =
"ID", nullable = true)
- @OneToOne(cascade = { CascadeType.REMOVE, CascadeType.PERSIST }, fetch =
FetchType.LAZY)
+ @OneToOne(cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
+ @XmlTransient
private PackageBits packageBits; // do NOT eager load this - is has the BLOB contents
of the package
@OneToMany(mappedBy = "packageVersion", cascade = { CascadeType.REMOVE },
fetch = FetchType.LAZY)
@@ -654,6 +657,7 @@ public class PackageVersion implements Serializable {
* of an entity manager session. If you do, this will load in the {@link PackageBits}
object which potentially will
* load the entire package's contents in memory (and thus, if large enough, will
cause an OutOfMemoryError).
*/
+ @XmlTransient
public PackageBits getPackageBits() {
return packageBits;
}
diff --git
a/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java
b/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java
index 59cc693..0903628 100644
---
a/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java
+++
b/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java
@@ -37,6 +37,7 @@ import org.rhq.core.domain.content.ContentSource;
import org.rhq.core.domain.content.ContentSourceType;
import org.rhq.core.domain.content.Package;
import org.rhq.core.domain.content.PackageBits;
+import org.rhq.core.domain.content.PackageBitsBlob;
import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.PackageVersion;
import org.rhq.core.domain.content.PackageVersionContentSource;
@@ -240,7 +241,7 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test
{
Architecture arch = new Architecture("testPVCSInsertArch");
PackageType pt = new PackageType("testPVCSInsertPT",
resource.getResourceType());
Package pkg = new Package("testPVCSInsertPackage", pt);
- PackageBits bits = new PackageBits();
+ PackageBits bits = createPackageBits(em);
PackageVersion pv = new PackageVersion(pkg, "version", arch);
ContentSourceType cst = new
ContentSourceType("testPVCSContentSourceType");
ContentSource cs = new ContentSource("testPVCSContentSource",
cst);
@@ -254,8 +255,8 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test
{
pvConfig.put(new PropertySimple("pvConfig1",
"pvConfig1Value"));
pv.setExtraProperties(pvConfig);
- bits.setBits("testDeleteOrphanedPV".getBytes());
- pv.setPackageBits(bits); // this will cascade on persist
+ bits.getBlob().setBits("testDeleteOrphanedPV".getBytes());
+ pv.setPackageBits(bits);
em.persist(rt);
em.persist(resource);
@@ -289,7 +290,7 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test
{
em.close();
assert findBits != null : "The bits did not cascade-persist for some
reason";
assert findBits.getId() > 0 : "The package bits did not
cascade-persist for some reason!";
- assert new String(bits.getBits()).equals(new String(findBits.getBits()));
+ assert new String(bits.getBlob().getBits()).equals(new
String(findBits.getBlob().getBits()));
em = getEntityManager();
q =
em.createNamedQuery(PackageVersion.DELETE_IF_NO_CONTENT_SOURCES_OR_REPOS);
@@ -309,4 +310,25 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test
{
getTransactionManager().rollback();
}
}
+
+ private PackageBits createPackageBits(EntityManager em) {
+ PackageBits bits = null;
+ PackageBitsBlob blob = null;
+
+ // We have to work backwards to avoid constraint violations. PackageBits requires
a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ em.persist(blob);
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do not
persist the
+ // entity, the row already exists. Just perform and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ em.flush();
+
+ // return the new PackageBits and associated PackageBitsBlob
+ return bits;
+ }
+
}
\ No newline at end of file
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java
index f92face..5fdcb4e 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java
@@ -265,7 +265,7 @@ public class ContentManager extends AgentService implements
ContainerService, Co
ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be
of this type, we gave it to the plugin
ContentServerService serverService = getContentServerService();
- //we need to load the content to server before we will start download the
content
+ // we need to load the content to server before we will start download the
content
// it is because of timeout on remoteStreams
serverService.preLoadRemoteContent(contextImpl.getResourceId(),
packageDetailsKey);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
index 2c01712..11d69e9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
@@ -71,6 +71,7 @@ import org.rhq.core.domain.content.InstalledPackageHistory;
import org.rhq.core.domain.content.InstalledPackageHistoryStatus;
import org.rhq.core.domain.content.Package;
import org.rhq.core.domain.content.PackageBits;
+import org.rhq.core.domain.content.PackageBitsBlob;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.PackageInstallationStep;
import org.rhq.core.domain.content.PackageType;
@@ -808,12 +809,13 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
try {
InstalledPackage installedPackage =
entityManager.find(InstalledPackage.class, installedPackageId);
PackageBits bits = installedPackage.getPackageVersion().getPackageBits();
- if (bits == null || bits.getBits().length == 0) {
+ if (bits == null || bits.getBlob().getBits().length == 0) {
long start = System.currentTimeMillis();
retrieveBitsFromResource(user, resourceId, installedPackageId);
bits = installedPackage.getPackageVersion().getPackageBits();
- while ((bits == null || bits.getBits() == null) &&
(System.currentTimeMillis() - start < 30000)) {
+ while ((bits == null || bits.getBlob().getBits() == null)
+ && (System.currentTimeMillis() - start < 30000)) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
@@ -830,13 +832,12 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
}
- return bits.getBits();
+ return bits.getBlob().getBits();
} catch (Exception e) {
throw new RuntimeException("Unable to retrieve package bits for
resource: " + resourceId + " and package: "
+ installedPackageId + " before timeout.");
}
-
}
public List<DeployPackageStep> translateInstallationSteps(int resourceId,
ResourcePackageDetails packageDetails)
@@ -917,11 +918,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
try {
log.debug("Saving content for response: " + response);
- PackageBits packageBits = new PackageBits();
- entityManager.persist(packageBits);
-
- packageVersion.setPackageBits(packageBits);
- entityManager.flush(); // push the new package bits row to the DB
+ PackageBits packageBits = initializePackageBits(null);
// Could use the following, but only on jdk6 as builds
// @since 1.6
@@ -947,8 +944,8 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
}
bits = loadPackageBits(bitStream, packageVersion.getId(), pkgName,
packageVersion.getVersion(),
bits, null);
- entityManager.merge(bits);
+ entityManager.merge(bits);
} finally {
if (ps != null) {
@@ -1504,6 +1501,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
* as the agent side discovery mechanism, and passes in additional parameters
available
* when file has been uploaded via the UI.
*/
+ @SuppressWarnings("unchecked")
public PackageVersion getUploadedPackageVersion(String packageName, int
packageTypeId, String version,
int architectureId, InputStream packageBitStream, Map<String, String>
packageUploadDetails,
int newResourceTypeId) {
@@ -1570,6 +1568,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
packageVersion.setMD5(packageUploadDetails.get(ContentManagerBean.UPLOAD_MD5));
packageVersion.setSHA256(packageUploadDetails.get(ContentManagerBean.UPLOAD_SHA256));
}
+
entityManager.merge(packageVersion);
entityManager.flush();
@@ -1586,40 +1585,69 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
*/
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
private PackageBits loadPackageBits(InputStream packageBitStream, int
packageVersionId, String packageName,
- String packageVersion, PackageBits existingPkgBits, Map<String, String>
contentDetails) {
- PackageBits bits = null;
+ String packageVersion, PackageBits existingBits, Map<String, String>
contentDetails) {
- //use or instantiate PackageBits instance.
- if (existingPkgBits == null) {
- bits = new PackageBits();
- entityManager.persist(bits);
- } else {
- bits = existingPkgBits;
- }
+ // use existing or instantiate PackageBits instance.
+ PackageBits bits = (null == existingBits) ? initializePackageBits(null) :
existingBits;
//locate related packageVersion
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
- //associate the two if located
+ //associate the two if located.
if (pv != null) {//np check.
pv.setPackageBits(bits);
entityManager.flush();
}
- bits = entityManager.find(PackageBits.class, bits.getId());
-
//write data from stream into db using Hibernate Blob mechanism
updateBlobStream(packageBitStream, bits, contentDetails);
return bits;
}
+ /**
+ * This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated
PackageBitsBlob.
+ * Note that PackageBits and PackageBitsBlob are two entities that *share* the same
db row. This is
+ * done to allow for Lazy load semantics on the Lob. Hibernate does not honor
field-level Lazy load
+ * on a Lob unless the entity class is instrumented. We can't usethat approach
because it introduces
+ * hibernate imports into the domain class, and that violates our restriction of
exposing hibernate
+ * classes to the Agent and Remote clients.
+ *
+ * @return
+ */
+ private PackageBits initializePackageBits(PackageBits bits) {
+ if (null == bits) {
+ PackageBitsBlob blob = null;
+
+ // We have to work backwards to avoid constraint violations. PackageBits
requires a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ blob.setBits(PackageBits.EMPTY_BLOB.getBytes());
+ entityManager.persist(blob);
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do
not persist the
+ // entity, the row already exists. Just perform and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ } else {
+ PackageBitsBlob blob = entityManager.find(PackageBitsBlob.class,
bits.getId());
+ // don't bother testing for null, that may pull a large blob, just make
sure it's not null
+ blob.setBits(PackageBits.EMPTY_BLOB.getBytes());
+ }
+
+ // write to the db and return the new PackageBits and associated PackageBitsBlob
+ entityManager.flush();
+ return bits;
+ }
+
/** Takes an input stream and copies it into the PackageBits table using Hibernate
* Blob mechanism with PreparedStatements. As all content into Bits are not stored
as type OID, t
*
* @param stream
* @param contentDetails Map to store content details in used in PackageVersioning
*/
+ @SuppressWarnings("unused")
public void updateBlobStream(InputStream stream, PackageBits bits, Map<String,
String> contentDetails) {
//TODO: are there any db specific limits that we should check/verify here before
stuffing
@@ -1628,29 +1656,18 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
if (stream == null) {
return; // no stream content to update.
}
- if (bits == null) {
- bits = new PackageBits();
- }
- //persist to db if not already
- if (bits.getId() <= 0) {
- entityManager.persist(bits);
- }
+ bits = initializePackageBits(bits);
- //locate the existing PackageBits instance
+ //locate the existing PackageBitsBlob instance
bits = entityManager.find(PackageBits.class, bits.getId());
-
- ///initialize Bits field so non-empty.
- bits.setBits(new String("a").getBytes());
- entityManager.merge(bits);
- entityManager.flush();
+ PackageBitsBlob blob = bits.getBlob();
//Create prepared statements to work with Blobs and hibernate.
Connection conn = null;
PreparedStatement ps = null;
PreparedStatement ps2 = null;
try {
-
conn = dataSource.getConnection();
//we are loading the PackageBits saved in the previous step
@@ -1663,7 +1680,7 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
//We can not create a blob directly because BlobImpl from Hibernate
is not acceptable
//for oracle and Connection.createBlob is not working on postgres.
- //This blob will be not empty because we saved there a bytes from
String("a").
+ //This blob will be not empty because we saved there
PackageBits.EMPTY_BLOB
Blob blb = rs.getBlob(1);
//copy the stream to the Blob
@@ -1721,45 +1738,11 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
}
}
+ // not sure this merge (or others like it in this file are necessary...
entityManager.merge(bits);
entityManager.flush();
}
- /**Writes the contents of a the Blob out to the stream passed in.
- *
- * @param stream non null stream where contents to be written to.
- */
- public void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean
closeStreams) {
-
- if (stream == null) {
- return; // no locate to write to
- }
- if ((bits == null) || (bits.getId() <= 0)) {
- //then PackageBits instance passed in is insufficiently initialized.
- log.warn("PackageBits insufficiently initialized. No data to write
out.");
- return;
- }
- try {
- //open connection
- Connection conn = dataSource.getConnection();
-
- //prepared statement for retrieval of Blob.bits
- PreparedStatement ps = conn
- .prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME
+ " WHERE ID = ?");
- ps.setInt(1, bits.getId());
- ResultSet results = ps.executeQuery();
- if (results.next()) {
- //retrieve the Blob
- Blob blob = results.getBlob(1);
- //now copy the contents to the stream passed in
- StreamUtil.copy(blob.getBinaryStream(), stream, closeStreams);
- }
- } catch (Exception ex) {
- log.error("An error occurred while writing Blob contents out to stream
:" + ex.getMessage());
- ex.printStackTrace();
- }
- }
-
/** Functions same as StreamUtil.copy(), but calculates SHA hash and file size and
write it to
* the Map<String,String> passed in.
*
@@ -1818,4 +1801,41 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
return numBytesCopied;
}
+ /** For Testing only<br><br>
+ *
+ * Writes the contents of a the Blob out to the stream passed in.
+ *
+ * @param stream non null stream where contents to be written to.
+ */
+ public void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean
closeStreams) {
+
+ if (stream == null) {
+ return; // no locate to write to
+ }
+ if ((bits == null) || (bits.getId() <= 0)) {
+ //then PackageBits instance passed in is insufficiently initialized.
+ log.warn("PackageBits insufficiently initialized. No data to write
out.");
+ return;
+ }
+ try {
+ //open connection
+ Connection conn = dataSource.getConnection();
+
+ //prepared statement for retrieval of Blob.bits
+ PreparedStatement ps = conn
+ .prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME
+ " WHERE ID = ?");
+ ps.setInt(1, bits.getId());
+ ResultSet results = ps.executeQuery();
+ if (results.next()) {
+ //retrieve the Blob
+ Blob blob = results.getBlob(1);
+ //now copy the contents to the stream passed in
+ StreamUtil.copy(blob.getBinaryStream(), stream, closeStreams);
+ }
+ } catch (Exception ex) {
+ log.error("An error occurred while writing Blob contents out to stream
:" + ex.getMessage());
+ ex.printStackTrace();
+ }
+ }
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java
index 0b0e5a5..f4387ce 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java
@@ -345,6 +345,9 @@ public interface ContentManagerLocal {
*/
InstalledPackage getBackingPackageForResource(Subject subject, int resourceId);
+ /**
+ * @see {@link ContentManagerRemote#getPackageBytes(Subject, int, int)
+ */
byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId);
void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean
closeStreams);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java
index 1b28633..087b5bf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java
@@ -159,6 +159,13 @@ public interface ContentManagerRemote {
@WebParam(name = "subject") Subject subject, //
@WebParam(name = "resourceId") int resourceId);
+ /**
+ * This can be a dangerous call for large packages as the entire package will attempt
to be loaded.
+ * @param user
+ * @param resourceId
+ * @param installedPackageId
+ * @return the package bytes
+ */
@WebMethod
byte[] getPackageBytes(@WebParam(name = "subject") Subject user,
@WebParam(name = "resourceId") int resourceId,
@WebParam(name = "installedPackageId") int installedPackageId);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
index c57932c..4160793 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
@@ -52,8 +52,10 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.annotation.ejb.TransactionTimeout;
import org.jboss.util.StringPropertyReplacer;
+
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.content.Advisory;
@@ -70,6 +72,7 @@ import org.rhq.core.domain.content.DistributionType;
import org.rhq.core.domain.content.DownloadMode;
import org.rhq.core.domain.content.Package;
import org.rhq.core.domain.content.PackageBits;
+import org.rhq.core.domain.content.PackageBitsBlob;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.PackageVersion;
@@ -379,6 +382,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
query.setParameter("id", contentSourceId);
countQuery.setParameter("id", contentSourceId);
+ @SuppressWarnings("unchecked")
List<Repo> results = query.getResultList();
long count = (Long) countQuery.getSingleResult();
@@ -788,7 +792,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
throw new RuntimeException(t);
}
}
-
+
@RequiredPermission(Permission.MANAGE_INVENTORY)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@TransactionTimeout(90 * 60)
@@ -831,23 +835,18 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
PreparedStatement ps = null;
PreparedStatement ps2 = null;
try {
- packageBits = new PackageBits();
- //we need to save not null value so that we can in next step load the
value as a Blob
- packageBits.setBits(new String("a").getBytes());
- entityManager.persist(packageBits);
+ packageBits = createPackageBits(pk.getContentSource().getDownloadMode()
== DownloadMode.DATABASE);
PackageVersion pv = entityManager.find(PackageVersion.class,
packageVersionId);
- pv.setPackageBits(packageBits);
-
- entityManager.flush(); // push the new package bits row to the DB
+ pv.setPackageBits(packageBits); // associate the entities
+ entityManager.flush(); // may not be necessary
if (pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE) {
-
- // bitsStream = null;
conn = dataSource.getConnection();
- //we are loading the PackageBits saved in the previous step
- //we need to lock the row which will be updated so we are using FOR
UPDATE
- ps = conn.prepareStatement("SELECT BITS FROM " +
PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE");
+ // The blob has been initialized to EMPTY_BLOB already by
createPackageBits...
+ // we need to lock the row which will be updated so we are using FOR
UPDATE
+ ps = conn.prepareStatement("SELECT BITS FROM " +
PackageBits.TABLE_NAME
+ + " WHERE ID = ? FOR UPDATE");
ps.setInt(1, packageBits.getId());
ResultSet rs = ps.executeQuery();
if (rs != null) {
@@ -858,12 +857,13 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
Blob blb = rs.getBlob(1);
StreamUtil.copy(bitsStream, blb.setBinaryStream(1), true);
- ps2 = conn.prepareStatement("UPDATE " +
PackageBits.TABLE_NAME + " SET bits = ? where id = ?");
+ ps2 = conn.prepareStatement("UPDATE " +
PackageBits.TABLE_NAME
+ + " SET bits = ? where id = ?");
ps2.setBlob(1, blb);
ps2.setInt(2, packageBits.getId());
if (ps2.execute()) {
throw new Exception("Did not download the package
bits to the DB for ");
- }
+ }
ps2.close();
}
}
@@ -947,17 +947,50 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return packageBits;
}
- private InputStream preloadPackageBits(PackageVersionContentSource pvcs) throws
Exception{
+ /**
+ * This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated
PackageBitsBlob.
+ * Note that PackageBits and PackageBitsBlob are two entities that *share* the same
db row. This is
+ * done to allow for Lazy load semantics on the Lob. Hibernate does not honor
field-level Lazy load
+ * on a Lob unless the entity class is instrumented. We can't usethat approach
because it introduces
+ * hibernate imports into the domain class, and that violates our restriction of
exposing hibernate
+ * classes to the Agent and Remote clients.
+ *
+ * @return
+ */
+ private PackageBits createPackageBits(boolean initialize) {
+ PackageBits bits = null;
+ PackageBitsBlob blob = null;
+
+ // We have to work backwards to avoid constraint violations. PackageBits requires
a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ if (initialize) {
+ blob.setBits(PackageBits.EMPTY_BLOB.getBytes());
+ }
+ entityManager.persist(blob);
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do not
persist the
+ // entity, the row already exists. Just perform and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ entityManager.flush();
+
+ // return the new PackageBits and associated PackageBitsBlob
+ return bits;
+ }
+
+ private InputStream preloadPackageBits(PackageVersionContentSource pvcs) throws
Exception {
PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK();
- int contentSourceId = pk.getContentSource().getId();
+ int contentSourceId = pk.getContentSource().getId();
int packageVersionId = pk.getPackageVersion().getId();
String packageVersionLocation = pvcs.getLocation();
-
+
ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
InputStream bitsStream = pc.getAdapterManager().loadPackageBits(contentSourceId,
packageVersionLocation);
-
+
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
-
+
switch (pk.getContentSource().getDownloadMode()) {
case NEVER: {
return null; // no-op, our content source was told to never download package
bits
@@ -971,7 +1004,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
OutputStream tempStream = new BufferedOutputStream(new
FileOutputStream(tempFile));
StreamUtil.copy(bitsStream, tempStream, true);
InputStream inp = new BufferedInputStream(new FileInputStream(tempFile));
- return inp;
+ return inp;
}
case FILESYSTEM: {
@@ -989,8 +1022,8 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
String actualMD5 = MessageDigestGenerator.getDigestString(outputFile);
if (!expectedMD5.trim().toLowerCase().equals(actualMD5.toLowerCase())) {
log.error("Already have package bits for [" + pv + "]
located at [" + outputFile
- + "] but the MD5 hashcodes do not match. Expected
MD5=[" + expectedMD5
- + "], Actual MD5=[" + actualMD5 + "] -
redownloading package");
+ + "] but the MD5 hashcodes do not match. Expected
MD5=[" + expectedMD5 + "], Actual MD5=["
+ + actualMD5 + "] - redownloading package");
download = true;
} else {
log.info("Asked to download package bits but we already have it
at [" + outputFile
@@ -1011,65 +1044,63 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
throw new IllegalStateException(" Unknown download mode - this is a bug,
please report it: " + pvcs);
}
}
-
+
return null;
}
-
+
+ // TODO: Just noticing that this method seems pretty redundant with
+ // downloadPackageBits(Subject subject, PackageVersionContentSource pvcs) and
should probably be
+ // refactored. Also *** the transactional decls below are not being honored
because the method
+ // is not being called through the Local, so not establishing a new
transactional context.
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@TransactionTimeout(40 * 60)
- private PackageBits preparePackageBits(Subject subject,InputStream bitsStream,
PackageVersionContentSource pvcs) {
+ private PackageBits preparePackageBits(Subject subject, InputStream bitsStream,
PackageVersionContentSource pvcs) {
PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK();
int contentSourceId = pk.getContentSource().getId();
int packageVersionId = pk.getPackageVersion().getId();
- String packageVersionLocation = pvcs.getLocation();
+ String packageVersionLocation = pvcs.getLocation();
PackageBits packageBits = null;
try {
-
+
Connection conn = null;
PreparedStatement ps = null;
PreparedStatement ps2 = null;
try {
- packageBits = new PackageBits();
-
- entityManager.persist(packageBits);
+ packageBits = createPackageBits(pk.getContentSource().getDownloadMode()
== DownloadMode.DATABASE);
PackageVersion pv = entityManager.find(PackageVersion.class,
packageVersionId);
- pv.setPackageBits(packageBits);
-
- entityManager.flush(); // push the new package bits row to the DB
+ pv.setPackageBits(packageBits); // associate entities
+ entityManager.flush(); // not sure this is necessary
if (pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE) {
packageBits = entityManager.find(PackageBits.class,
packageBits.getId());
- //we need to save not null value so that we can in next step load the
value as a Blob
- // packageBits.setBits(new String("a").getBytes());
- packageBits.setBits(new String("a").getBytes());
- entityManager.merge(packageBits);
- entityManager.flush();
-
+
conn = dataSource.getConnection();
//we are loading the PackageBits saved in the previous step
//we need to lock the row which will be updated so we are using FOR
UPDATE
- ps = conn.prepareStatement("SELECT BITS FROM " +
PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE");
+ ps = conn.prepareStatement("SELECT BITS FROM " +
PackageBits.TABLE_NAME
+ + " WHERE ID = ? FOR UPDATE");
ps.setInt(1, packageBits.getId());
ResultSet rs = ps.executeQuery();
if (rs != null) {
while (rs.next()) {
-
+
//We can not create a blob directly because BlobImpl from
Hibernate is not acceptable
//for oracle and Connection.createBlob is not working on
postgres.
//This blob will be not empty because we saved there a bytes
from String("a").
Blob blb = rs.getBlob(1);
-
+
StreamUtil.copy(bitsStream, blb.setBinaryStream(1), false);
bitsStream.close();
- ps2 = conn.prepareStatement("UPDATE " +
PackageBits.TABLE_NAME + " SET bits = ? where id = ?");
+ ps2 = conn.prepareStatement("UPDATE " +
PackageBits.TABLE_NAME
+ + " SET bits = ? where id = ?");
ps2.setBlob(1, blb);
ps2.setInt(2, packageBits.getId());
if (ps2.execute()) {
throw new Exception("Did not download the package
bits to the DB for ");
- }
+ }
ps2.close();
}
}
@@ -1088,7 +1119,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
+ "] on content source [" + contentSourceId +
"]");
}
}
-
+
if (ps2 != null) {
try {
ps2.close();
@@ -1132,7 +1163,6 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return contentProviderManager.synchronizeContentProvider(contentSourceId);
}
- @SuppressWarnings("unchecked")
public ContentSourceSyncResults
persistContentSourceSyncResults(ContentSourceSyncResults results) {
ContentManagerHelper helper = new ContentManagerHelper(entityManager);
Query q =
entityManager.createNamedQuery(ContentSourceSyncResults.QUERY_GET_INPROGRESS_BY_CONTENT_SOURCE_ID);
@@ -1314,7 +1344,6 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return syncResults;
}
- @SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public RepoSyncResults _mergeAdvisorySyncReportADD(ContentSource contentSource,
AdvisorySyncReport report,
RepoSyncResults syncResults, StringBuilder progress) {
@@ -1511,7 +1540,6 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return syncResults;
}
- @SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public RepoSyncResults _mergePackageSyncReportADD(ContentSource contentSource, Repo
repo,
Collection<ContentProviderPackageDetails> newPackages,
@@ -1827,7 +1855,6 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return syncResults;
}
- @SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public RepoSyncResults _mergeDistributionSyncReportADD(ContentSource contentSource,
DistributionSyncReport report,
RepoSyncResults syncResults, StringBuilder progress) {
@@ -1940,11 +1967,11 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
@TransactionTimeout(45 * 60)
public long outputPackageVersionBitsRangeGivenResource(int resourceId,
PackageDetailsKey packageDetailsKey,
OutputStream outputStream, long startByte, long endByte) {
- if (startByte < 0) {
+ if (startByte < 0L) {
throw new IllegalArgumentException("startByte[" + startByte +
"] < 0");
}
- if ((endByte > -1) && (endByte < startByte)) {
+ if ((endByte > -1L) && (endByte < startByte)) {
throw new IllegalArgumentException("endByte[" + endByte + "]
< startByte[" + startByte + "]");
}
@@ -1994,7 +2021,8 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
packageVersion.getId());
}
- public boolean downloadPackageBits(int resourceId, PackageDetailsKey
packageDetailsKey){
+ @SuppressWarnings( { "unchecked", "unused" })
+ public boolean downloadPackageBits(int resourceId, PackageDetailsKey
packageDetailsKey) {
Query query =
entityManager.createNamedQuery(PackageVersion.QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID);
query.setParameter("packageName", packageDetailsKey.getName());
query.setParameter("packageTypeName",
packageDetailsKey.getPackageTypeName());
@@ -2056,18 +2084,18 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
pvcs = pvcss.get(0);
- try {
- // Make it a true EJB call so we suspend our tx and get a new tx.
- // This way, we start with a fresh tx timeout when downloading and this
- // won't affect the time we are in in this method's tx (I hope
that's how it works).
- // This is because this method itself may take a long time to send the data
to the output stream
- // and we don't want out tx timing out due to the time it takes
downloading.
- InputStream stream = preloadPackageBits(pvcs);
- PackageBits bits = null;
- bits = preparePackageBits(subjectManager.getOverlord(),stream, pvcs);
- }catch(Exception e){
- return false;
- }
+ try {
+ // Make it a true EJB call so we suspend our tx and get a new tx.
+ // This way, we start with a fresh tx timeout when downloading and this
+ // won't affect the time we are in in this method's tx (I hope
that's how it works).
+ // This is because this method itself may take a long time to send the
data to the output stream
+ // and we don't want out tx timing out due to the time it takes
downloading.
+ InputStream stream = preloadPackageBits(pvcs);
+ PackageBits bits = null;
+ bits = preparePackageBits(subjectManager.getOverlord(), stream, pvcs);
+ } catch (Exception e) {
+ return false;
+ }
}
return true;
}
@@ -2179,16 +2207,16 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
results.next();
Blob blob = results.getBlob(1);
- long bytesRetrieved=0;
- if (endByte < 0) {
- if (startByte == 0) {
+ long bytesRetrieved = 0L;
+ if (endByte < 0L) {
+ if (startByte == 0L) {
bytesRetrieved = StreamUtil.copy(blob.getBinaryStream(),
outputStream, false);
}
- } else {
- long length = (endByte - startByte) + 1;
+ } else {
+ long length = (endByte - startByte) + 1;
//InputStream stream = blob.getBinaryStream(startByte, length);
// JDK 6 api
InputStream stream = blob.getBinaryStream();
- bytesRetrieved = StreamUtil.copy(stream, outputStream, startByte
, length);
+ bytesRetrieved = StreamUtil.copy(stream, outputStream, startByte,
length);
}
log.debug("Retrieved and sent [" + bytesRetrieved + "]
bytes for [" + packageDetailsKey + "]");
ps.close();
@@ -2210,8 +2238,8 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
// the magic happens here - outputStream is probably a remote stream down to
the agent
long bytesRetrieved;
- if (endByte < 0) {
- if (startByte > 0) {
+ if (endByte < 0L) {
+ if (startByte > 0L) {
bitsStream.skip(startByte);
}
bytesRetrieved = StreamUtil.copy(bitsStream, outputStream, false);
@@ -2404,7 +2432,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
@TransactionTimeout(45 * 60)
public long outputDistributionFileBits(DistributionFile distFile, OutputStream
outputStream) {
- long numBytes = 0;
+ long numBytes = 0L;
InputStream bitStream = null;
try {
Distribution dist = distFile.getDistribution();
@@ -2429,4 +2457,3 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
return numBytes;
}
}
-
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java
index 3160074..54cfb67 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java
@@ -24,20 +24,18 @@ import java.io.FileOutputStream;
import javax.persistence.EntityManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.rhq.core.domain.content.Architecture;
import org.rhq.core.domain.content.Package;
import org.rhq.core.domain.content.PackageBits;
+import org.rhq.core.domain.content.PackageBitsBlob;
import org.rhq.core.domain.content.PackageType;
import org.rhq.core.domain.content.PackageVersion;
import org.rhq.core.domain.content.composite.LoadedPackageBitsComposite;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.util.MessageDigestGenerator;
-import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.content.ContentManagerLocal;
import org.rhq.enterprise.server.content.ContentUIManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
@@ -54,10 +52,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
private static final boolean ENABLE_TESTS = true;
- private final Log log = LogFactory.getLog(this.getClass());
-
private ContentUIManagerLocal contentUIManager;
- private SubjectManagerLocal subjectManager;
private ContentManagerLocal contentManager;
// Setup --------------------------------------------
@@ -65,7 +60,6 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
@BeforeClass
public void setupBeforeClass() throws Exception {
contentUIManager = LookupUtil.getContentUIManager();
- subjectManager = LookupUtil.getSubjectManager();
contentManager = LookupUtil.getContentManager();
}
@@ -100,8 +94,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the
DB
- PackageBits packageBits = new PackageBits();
- em.persist(packageBits);
+ PackageBits packageBits = createPackageBits(em);
pkgVer.setPackageBits(packageBits);
pkgVer = em.merge(pkgVer);
em.flush();
@@ -117,12 +110,13 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
// let's make sure there really is no data in the DB
packageBits = em.find(PackageBits.class, packageBits.getId());
assert packageBits != null;
- assert packageBits.getBits() == null;
+ assert packageBits.getBlob().getBits() == null;
// now lets store some bits in the DB
final String DATA = "testPackageBits data";
- packageBits.setBits(DATA.getBytes());
- em.merge(packageBits);
+ PackageBitsBlob packageBitsBlob = em.find(PackageBitsBlob.class,
packageBits.getId());
+ packageBitsBlob.setBits(DATA.getBytes());
+ em.merge(packageBitsBlob);
em.flush();
// test that the bits are available and stored in the DB
@@ -136,7 +130,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
// let's make sure the data really is in the DB
packageBits = em.find(PackageBits.class, packageBits.getId());
assert packageBits != null;
- assert DATA.equals(new String(packageBits.getBits()));
+ assert DATA.equals(new String(packageBits.getBlob().getBits()));
////////////////////////////////////////////////////
// create another package version and test with that
@@ -162,8 +156,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the
DB
- PackageBits packageBits2 = new PackageBits();
- em.persist(packageBits2);
+ PackageBits packageBits2 = createPackageBits(em);
pkgVer2.setPackageBits(packageBits2);
pkgVer2 = em.merge(pkgVer2);
em.flush();
@@ -187,12 +180,12 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
// let's make sure there really is no data in the DB
packageBits2 = em.find(PackageBits.class, packageBits2.getId());
assert packageBits2 != null;
- assert packageBits2.getBits() == null;
+ assert packageBits2.getBlob().getBits() == null;
// now lets store some bits in the DB
final String DATA2 = "testPackageBits more data";
- packageBits2.setBits(DATA2.getBytes());
- em.merge(packageBits2);
+ packageBits2.getBlob().setBits(DATA2.getBytes());
+ em.merge(packageBits2.getBlob());
em.flush();
// make sure the query still gets the right answer for the first pkgVer
@@ -214,7 +207,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
// let's make sure the data really is in the DB
packageBits2 = em.find(PackageBits.class, packageBits2.getId());
assert packageBits2 != null;
- assert DATA2.equals(new String(packageBits2.getBits()));
+ assert DATA2.equals(new String(packageBits2.getBlob().getBits()));
} catch (Throwable t) {
t.printStackTrace();
throw t;
@@ -252,8 +245,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the
DB
- PackageBits packageBits = new PackageBits();
- em.persist(packageBits);
+ PackageBits packageBits = createPackageBits(em);
pkgVer.setPackageBits(packageBits);
pkgVer = em.merge(pkgVer);
em.flush();
@@ -269,7 +261,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
// let's make sure there really is no data in the DB
packageBits = em.find(PackageBits.class, packageBits.getId());
assert packageBits != null;
- assert packageBits.getBits() == null;
+ assert packageBits.getBlob().getBits() == null;
// now lets store some bits in the DB using PreparedStatements and BLOB
mechanism
// to simulate large file transfers where streaming is used instead of
reading entire
@@ -311,4 +303,25 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
getTransactionManager().rollback();
}
}
+
+ private PackageBits createPackageBits(EntityManager em) {
+ PackageBits bits = null;
+ PackageBitsBlob blob = null;
+
+ // We have to work backwards to avoid constraint violations. PackageBits requires
a PackageBitsBlob,
+ // so create and persist that first, getting the ID
+ blob = new PackageBitsBlob();
+ em.persist(blob);
+
+ // Now create the PackageBits entity and assign the Id and blob. Note, do not
persist the
+ // entity, the row already exists. Just perform and flush the update.
+ bits = new PackageBits();
+ bits.setId(blob.getId());
+ bits.setBlob(blob);
+ em.flush();
+
+ // return the new PackageBits and associated PackageBitsBlob
+ return bits;
+ }
+
}
\ No newline at end of file
commit 61d7e502e70484583f3fc3da22cb308e8486870a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Jul 19 17:55:30 2010 -0400
mask values of type="password" props in HTML source on both group resource
config and group plugin config pages (fix for
https://bugzilla.redhat.com/show_bug.cgi?id=601892)
diff --git
a/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java
b/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java
index c7bd28e..d84aa14 100644
---
a/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java
+++
b/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -33,6 +33,7 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.gui.configuration.ConfigurationMaskingUtility;
/**
* @author Ian Springer
@@ -90,6 +91,20 @@ public class ConfigurationSet {
return groupConfiguration;
}
+ public void mask() {
+ for (ConfigurationSetMember member : this.members) {
+ ConfigurationMaskingUtility.maskConfiguration(member.getConfiguration(),
this.configurationDefinition);
+ }
+ ConfigurationMaskingUtility.maskConfiguration(this.groupConfiguration,
this.configurationDefinition);
+ }
+
+ public void unmask() {
+ for (ConfigurationSetMember member : this.members) {
+ ConfigurationMaskingUtility.unmaskConfiguration(member.getConfiguration(),
this.configurationDefinition);
+ }
+ ConfigurationMaskingUtility.unmaskConfiguration(this.groupConfiguration,
this.configurationDefinition);
+ }
+
private static void calculateGroupProperty(PropertyDefinition propertyDefinition,
List<AbstractPropertyMap> sourceParentPropertyMaps, AbstractPropertyMap
targetParentPropertyMap) {
if (propertyDefinition instanceof PropertyDefinitionSimple) {
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java
index de3c7b9..57e575c 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -84,6 +84,7 @@ public abstract class AbstractGroupResourceConfigurationUIBean {
} else {
this.configurationSet =
GroupResourceConfigurationUtility.buildConfigurationSet(
EnterpriseFacesContextUtility.getSubject(), this.group,
this.resourceConfigurations);
+ this.configurationSet.mask();
}
return;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
index 8a5c6ae..1ba9b78 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -63,10 +63,12 @@ public class EditGroupResourceConfigurationUIBean extends
AbstractGroupResourceC
* Agents. This gets called when user clicks the SAVE button.
*/
public void updateConfigurations() {
- String viewId = null;
+ String viewId;
try {
// TODO: See if there's some way for the config renderer to handle
calling applyGroupConfiguration(),
// so the managed bean doesn't have to worry about doing it.
+ getConfigurationSet().unmask();
+
getConfigurationSet().applyGroupConfiguration();
getConfigurationManager().scheduleGroupResourceConfigurationUpdate(
EnterpriseFacesContextUtility.getSubject(), getGroup().getId(),
getResourceConfigurations());
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java
index 4d8d6ee..fc142bf 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -69,6 +69,7 @@ public abstract class AbstractGroupPluginConfigurationUIBean {
}
this.configurationSet =
GroupPluginConfigurationUtility.buildConfigurationSet(EnterpriseFacesContextUtility
.getSubject(), this.group, this.pluginConfigurations);
+ this.configurationSet.mask();
return;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java
index 030f336..d1f874a 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -65,6 +65,7 @@ public class EditGroupPluginConfigurationUIBean extends
AbstractGroupPluginConfi
try {
// TODO: See if there's some way for the config renderer to handle
calling applyGroupConfiguration(),
// so the managed bean doesn't have to worry about doing it.
+ getConfigurationSet().unmask();
getConfigurationSet().applyGroupConfiguration();
getConfigurationManager().scheduleGroupPluginConfigurationUpdate(
EnterpriseFacesContextUtility.getSubject(), getGroup().getId(),
getPluginConfigurations());
commit 273b5adbddf03b97fbe3601c150f46d8eb2b3f7c
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Jul 19 17:30:03 2010 -0400
updating WS version string to indicate remote model/interface changes.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java
index e2db512..e8114aa 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java
@@ -43,7 +43,7 @@ public class ServerVersion implements Serializable {
private String build;
//This value must be set by build system just before Build Time.
- public static final String namespace =
"http://www.rhq-project.org/2.3/2009/9/Webservices.xsd";
+ public static final String namespace =
"http://www.rhq-project.org/2.4/2010/7/Webservices.xsd";
// private final String namespace = "@ws-namespace@";
commit 63d9c78d672d3830d6d98399cbe1f9525665126f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 17:29:16 2010 -0400
BZ-616233: use MODIFY_RESOURCE to protect edit of group plugin config
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml
index 3f4de40..08b2eae 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml
@@ -29,7 +29,7 @@
<h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
<h:commandButton value="EDIT"
action="#{ViewGroupPluginConfigurationUIBean.edit}"
title="Edit this Compatible Group
Configuration"
-
rendered="${ResourceGroupUIBean.permissions.configure}"
+
rendered="${ResourceGroupUIBean.permissions.inventory}"
styleClass="buttonmed"/>
<h:commandButton value="VIEW HISTORY"
action="#{ViewGroupConnectionPropertyHistoryUIBean.begin}"
title="View History for Group Connection Property
Updates" styleClass="buttonmed"/>
@@ -48,7 +48,7 @@
<h:panelGrid columns="2" styleClass="buttons-table"
columnClasses="button-cell">
<h:commandButton value="EDIT"
action="#{ViewGroupPluginConfigurationUIBean.edit}"
title="Edit this Compatible Group
Configuration"
-
rendered="${ResourceGroupUIBean.permissions.configure}"
+
rendered="${ResourceGroupUIBean.permissions.inventory}"
styleClass="buttonmed"/>
<h:commandButton value="VIEW HISTORY"
action="#{ViewGroupConnectionPropertyHistoryUIBean.begin}"
title="View History for Group Connection Property
Updates" styleClass="buttonmed"/>
commit 166ca107283f7cda30c7b8223c1555c054415ed1
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 15:20:27 2010 -0400
use db-upgrade properly
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index ccc3b31..7ff6a10 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.90</db.schema.version>
+ <db.schema.version>2.91</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 5a92c0c..951d972 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3074,10 +3074,12 @@
<!-- if some role previously had CONFIGURE perm (now called
CONFIGURE_WRITE), give it the implied perm
CONFIGURE_READ so users don't experience an unexpected
permission restriction after upgrade -->
<schema-directSQL>
- INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION)
- SELECT PERM.ROLE_ID, 13
- FROM RHQ_PERMISSION PERM
- WHERE PERM.OPERATION = 11
+ <statement desc="Upgrading configuration
permissions">
+ INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION)
+ SELECT PERM.ROLE_ID, 13
+ FROM RHQ_PERMISSION PERM
+ WHERE PERM.OPERATION = 11
+ </statement>
</schema-directSQL>
</schemaSpec>
</dbupgrade>
commit 0c772ee3660ad349147e267bb1f95ff5211f39bc
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 14:55:13 2010 -0400
this default error handling for value-completion is obsolete, removing it
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 6ba0c9c..5209c26 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -14,6 +14,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.server.search.SearchExpressionException;
import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -67,20 +68,13 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
public List<String> getParameters(String context, String filter) {
if (getParameterizedContexts().contains(context) == false) {
- throw new IllegalArgumentException("context[" + context
+ throw new SearchExpressionException("context[" + context
+ "] is not parameterized, no completions available");
}
return Collections.emptyList();
}
public List<String> getValues(String context, String param, String filter) {
- if (getSimpleContexts().contains(context) && param != null) {
- throw new IllegalArgumentException("context[" + context + "]
is simple, param[" + param
- + "] can not be handled");
- }
- if (getParameterizedContexts().contains(context) && param == null) {
- throw new IllegalArgumentException("context[" + context + "]
is parameterized, param must not be null");
- }
return Collections.emptyList();
}
commit d4280e5e51f66d56d480802607898f4219471a85
Merge: 6eafe39... d487e39...
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 13:22:30 2010 -0400
Merge branch 'release-3.0.0' into config-permissions
commit d487e3959c4e6f0860816a3900b3caf253752962
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 12:46:29 2010 -0400
BZ-615017: fix QueryException when using connection-based search terms
* remove duplicate 'AND' token from the generated query
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index cfdb156..b28bfb3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -79,7 +79,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
- + " AND " +
conditionallyAddAuthzFragment(getConfigAuthzFragment()) //
+ + conditionallyAddAuthzFragment(getConfigAuthzFragment()) //
+ " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
commit 9c2972b0e0abdfb4a89870a22a17a80ea01f9aa2
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 10:44:41 2010 -0400
BZ-610228: pretty up SearchBar error messages
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java
b/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java
index e29daf1..c21e3c2 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java
@@ -1,25 +1,25 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.util.exception;
import java.io.ByteArrayOutputStream;
@@ -226,10 +226,16 @@ public class ThrowableUtil {
return getAllSqlExceptionMessagesArray(t, true);
}
-
public static String getStackAsString(Throwable t) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
t.printStackTrace(new PrintStream(baos));
return baos.toString();
}
+
+ public static String getRootMessage(Throwable t) {
+ while ((t.getCause() != null) && (t != t.getCause())) {
+ t = t.getCause();
+ }
+ return t.getMessage();
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
index 382e5e7..345f3de 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
@@ -14,6 +14,7 @@ import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.core.gui.util.StringUtility;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean;
import org.rhq.enterprise.gui.common.paging.PageControlView;
import org.rhq.enterprise.gui.common.paging.PagedListDataModel;
@@ -82,7 +83,7 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean {
return results;
} catch (Throwable t) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed
to fetch results: "
- + t.getMessage());
+ + ThrowableUtil.getRootMessage(t));
return new PageList<ResourceGroupComposite>(pc);
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
index be5a302..f927357 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
@@ -15,6 +15,7 @@ import org.rhq.core.domain.util.PageList;
import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.core.gui.util.StringUtility;
import org.rhq.core.util.IntExtractor;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean;
import org.rhq.enterprise.gui.common.paging.PageControlView;
import
org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListDataModel;
@@ -94,7 +95,7 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean {
return results;
} catch (Throwable t) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed
to fetch results: "
- + t.getMessage());
+ + ThrowableUtil.getRootMessage(t));
return new PageList<ResourceComposite>(pc);
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 54ccae2..1848192 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,6 +1,7 @@
package org.rhq.enterprise.server.search.translation;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.server.search.SearchExpressionException;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -43,7 +44,7 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
return fragment + operator.getDefaultTranslation() + getEnum(enumClass,
value, useOrdinal);
} else {
- throw new IllegalArgumentException("Unsupported operator " +
operator);
+ throw new SearchExpressionException("Unsupported operator " +
operator);
}
}
@@ -58,7 +59,7 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
}
}
}
- throw new IllegalArgumentException("No enum of type '" +
enumClass.getSimpleName() + "' with name matching '"
+ throw new SearchExpressionException("No enum of type '" +
enumClass.getSimpleName() + "' with name matching '"
+ value + "'");
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
index 781e581..5f87ed7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
@@ -4,6 +4,7 @@ import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtili
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.enterprise.server.search.SearchExpressionException;
import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragment;
@@ -65,9 +66,9 @@ public class GroupSearchTranslator extends AbstractSearchTranslator {
} else {
if (param == null) {
- throw new IllegalArgumentException("No search fragment available for
" + path);
+ throw new SearchExpressionException("No search fragment available
for " + path);
} else {
- throw new IllegalArgumentException("No search fragment available for
" + path + "[" + param + "]");
+ throw new SearchExpressionException("No search fragment available
for " + path + "[" + param + "]");
}
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index bece19d..cfdb156 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -7,6 +7,7 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
+import org.rhq.enterprise.server.search.SearchExpressionException;
import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragment;
@@ -96,9 +97,9 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
} else {
if (param == null) {
- throw new IllegalArgumentException("No search fragment available for
" + path);
+ throw new SearchExpressionException("No search fragment available
for " + path);
} else {
- throw new IllegalArgumentException("No search fragment available for
" + path + "[" + param + "]");
+ throw new SearchExpressionException("No search fragment available
for " + path + "[" + param + "]");
}
}
}
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 78885b0..6c43b46 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
@@ -544,6 +544,10 @@ public final class CriteriaQueryGenerator {
}
} catch (SearchExpressionException see) {
throw see; // bubble up to the top
+ } catch (RuntimeException re) {
+ LOG.error("Could not get JPQL translation for '" +
searchExpression + "': "
+ + ThrowableUtil.getAllMessages(re, true));
+ throw re; // don't wrap exceptions that are already RuntimeExceptions in
another RuntimeException
} catch (Exception e) {
LOG.error("Could not get JPQL translation for '" +
searchExpression + "': "
+ ThrowableUtil.getAllMessages(e, true));
commit c043ed77936cd2a3e03a608383755093191eb5b6
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 10:43:04 2010 -0400
BZ-615952: ensure old alertNotification/Log rows are removed during upgrade
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 1cfda87..536932e 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2096,9 +2096,16 @@
<!-- turn first-class notification data into configuration objects for
custom alert senders -->
<schema-alterColumn table="RHQ_ALERT_NOTIFICATION"
column="NOTIFICATION_TYPE" nullable="TRUE" />
<schema-javaTask className="CustomAlertSenderUpgradeTask"
/>
+ <!-- the old alert notification rows won't have SENDER_NAME set,
remove them -->
<schema-directSQL>
<statement desc="Removing obsolete alert
notifications">
- DELETE FROM RHQ_ALERT_NOTIFICATION WHERE NOTIFICATION_TYPE IS NOT
NULL
+ DELETE FROM RHQ_ALERT_NOTIFICATION WHERE SENDER_NAME IS NULL
+ </statement>
+ </schema-directSQL>
+ <!-- the old alert notification log rows won't have SENDER set,
remove them -->
+ <schema-directSQL>
+ <statement desc="Removing obsolete alert notification
logs">
+ DELETE FROM RHQ_ALERT_NOTIF_LOG WHERE SENDER IS NULL
</statement>
</schema-directSQL>
<schema-deleteColumn table="RHQ_ALERT_NOTIFICATION"
column="NOTIFICATION_TYPE" />
commit 5480942d169a44b52969fc8b1c32ab72daf3fef4
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Mon Jul 19 16:19:09 2010 +0200
[apache] tests will use xerces XMLSerializer.
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index b4f9208..700a6af 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -57,6 +57,14 @@
<version>${sigar.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
index 06a9f71..8a0c75c 100644
---
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
@@ -29,8 +29,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+import org.apache.xml.serialize.XMLSerializer;
/**
*
@@ -170,7 +169,6 @@ public class ApacheConfigurationUtil {
return prop;
}
- @SuppressWarnings("restriction")
private static void saveXML(Document document,String fileName) throws
UnitTestException{
try {
File file = new File(fileName);
commit 6eafe393c583fdc260868248a69a827211c5195a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 02:25:21 2010 -0400
BZ-614886: respect authz when displaying configUpdates in subsystem view
* only show config update rows that reference resources with CONFIGURE_READ perm
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 cf3186f..e0a2460 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
@@ -117,8 +117,8 @@ import org.rhq.core.domain.resource.Resource;
+ " JOIN cu.resource res " //
+ "LEFT JOIN res.parentResource parent " //
+ " WHERE 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 ) " //
+ + " JOIN rr.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions perm " //
+ + " WHERE s.id = :subjectId AND perm = 13 ) " //
+ " AND (cu.modifiedTime <> (SELECT MIN(icu.modifiedTime) "
//
+ " FROM ResourceConfigurationUpdate icu
" //
+ " WHERE icu.resource.id = res.id))"
//
commit 2bcb6f216b47999fd85b1f1b136cdb188dc81c30
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 01:29:00 2010 -0400
BZ-614886: finally, perform necessary upgrade tasks so users see no upgrade impact
* if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the
implied perm
CONFIGURE_READ so users don't experience an unexpected permission restriction
after upgrade
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 1cfda87..4298ca5 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3063,6 +3063,16 @@
</schema-directSQL>
</schemaSpec>
+ <schemaSpec version="2.91">
+ <!-- if some role previously had CONFIGURE perm (now called
CONFIGURE_WRITE), give it the implied perm
+ CONFIGURE_READ so users don't experience an unexpected
permission restriction after upgrade -->
+ <schema-directSQL>
+ INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION)
+ SELECT PERM.ROLE_ID, 13
+ FROM RHQ_PERMISSION PERM
+ WHERE PERM.OPERATION = 11
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
commit 5c5877e4f6c8ae0770e65cc5482a33a4bf75f17b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 19 01:03:37 2010 -0400
BZ-614886: fix all callpaths originating from existing UI to respect configuration
authorization
----- security changes in resource-specific facelets -----
resource/summary/overview.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
resource/configuration/view.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
editButtons: ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
resource/configuration/edit.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
editButtons: ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
resource/configuration/history.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
editButtons: ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
resource/configuration/raw.xhtml (included from other protected pages)
ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
resource/configuration/structured.xhtml (included from other protected pages)
ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
----- security changes in resource-specific jsf managed beans -----
resource/configuration/view.xhtml -> ResourceConfigurationViewer
getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured)
canViewResource -> hasResourcePermission(CONFIGURE_READ)
isResourceConfigurationUpdateInProgress(subject, resourceId)
canViewResource -> hasResourcePermission(CONFIGURE_READ)
resource/configuration/edit.xhtml -> ResourceConfigurationEditor
translateResourceConfiguration(subject, resourceId, configuration, fromStructured)
canViewResource -> hasResourcePermission(CONFIGURE_READ)
updateStructuredOrRawConfiguration(subject, resourceId, configuration,
fromStructured)
!!MISSING!! -> hasResourcePermission(CONFIGURE_WRITE)
updateResourceConfiguration(subject, resourceId, configuration, fromStructured)
!!MISSING!! -> hasResourcePermission(CONFIGURE_WRITE)
resource/configuration/history.xhtml -> GetLatestConfigurationUpdateUIBean
getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured)
already secured as part of resource/configuration/view.xhtml work
resource/configuration/history.xhtml -> ListConfigurationUpdateUIBean
updateStructuredOrRawConfiguration(subject, resourceId, configuration,
fromStructured)
already secured as part of resource/configuration/edit.xhtml work
updateResourceConfiguration(subject, resourceId, configuration, fromStructured)
already secured as part of resource/configuration/edit.xhtml work
purgeResourceConfigurationUpdate(subject, configurationUpdateId, purgeInProgress)
this method was already correctly using CONFIGURE_WRITE permission
findResourceConfigurationUpdates(subject, resourceId, beginDate, endDate,
suppressOldest, pc)
!!MISSING!! -> hasResourcePermission(CONFIGURE_READ)
resource/configuration/history.xhtml -> ViewResourceConfigurationUpdateUIBean
translateResourceConfiguration(subject, resourceId, configuration, fromStructured)
already secured as part of resource/configuration/edit.xhtml work
updateStructuredOrRawConfiguration(subject, resourceId, configuration,
fromStructured)
already secured as part of resource/configuration/edit.xhtml work
updateResourceConfiguration(subject, resourceId, configuration, fromStructured)
already secured as part of resource/configuration/edit.xhtml work
getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured)
already secured as part of resource/configuration/view.xhtml work
----- security changes in group-specific facelets -----
group/configuration/viewCurrent.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
editButtons: ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
group/configuration/editCurrent.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
save/reset/cancel buttons: ResourceUIBean.permissions.configure ->
ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
group/configuration/history.xhtml
configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
deleteButton: !!MISSING!! -> ResourceUIBean.permissions.configureWrite
added error message if user doesn't have read permission on the resource
----- security changes in group-specific jsf managed beans -----
group/configuration/viewCurrent.xhtml -> ViewGroupResourceConfigurationUIBean
getResourceConfigurationsForCompatibleGroup(subject, groupId)
!!MISSING!! -> hasResourcePermission(CONFIGURE_READ)
group/configuration/editCurrent.xhtml -> EditGroupResourceConfigurationUIBean
scheduleGroupResourceConfigurationUpdate(subject, groupId, map(resourceId,
config))
already secured correctly CONFIGURE_WRITE, no changes necessary
group/configuration/history.xhtml -> GroupResourceConfigurationHistoryUIBean
deleteGroupResourceConfigurationUpdates(subject, groupId, groupConfigUpdateIds)
already secured correctly CONFIGURE_WRITE, no changes necessary
findGroupResourceConfigurationUpdates(groupId, pc)
!!MISSING!! - added subject it to interface, then added
hasGroupPermission(CONFIGURE_READ)
group/configuration/history.xhtml ->
GroupResourceConfigurationHistoryDetailsUIBean
getResourceConfigurationMapForGroupUpdate(groupConfigUpdateId)
!!MISSING!! - added subject it to interface
add call into getGroupPluginConfigurationUpdate(subject,
groupConfigurationUpdateId)
canViewGroup -> hasGroupPermission(CONFIGURE_READ)
findResourceConfigurationUpdateCompositesByParentId(groupConfigUpdateId)
!!MISSING!! - added subject it to interface
add call into into getGroupPluginConfigurationUpdate(subject,
groupConfigurationUpdateId)
already secured as part of group/configuration/history.xhtml work
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java
index 9575f4f..8a29d06 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java
@@ -66,8 +66,8 @@ public class GroupResourceConfigurationHistoryDetailsUIBean extends
PagedDataTab
ResourceGroup group = EnterpriseFacesContextUtility.getResourceGroup();
int groupResourceConfigurationUpdateId =
getGroupResourceConfigurationUpdateId();
- this.resourceConfigurations = this.configurationManager
-
.getResourceConfigurationMapForGroupUpdate(groupResourceConfigurationUpdateId);
+ this.resourceConfigurations =
this.configurationManager.getResourceConfigurationMapForGroupUpdate(
+ getSubject(), groupResourceConfigurationUpdateId);
this.configurationSet =
GroupResourceConfigurationUtility.buildConfigurationSet(subject, group,
resourceConfigurations);
}
@@ -89,7 +89,8 @@ public class GroupResourceConfigurationHistoryDetailsUIBean extends
PagedDataTab
public PageList<ConfigurationUpdateComposite> fetchPage(PageControl pc) {
int groupResourceConfigurationUpdateId =
getGroupResourceConfigurationUpdateId();
PageList<ConfigurationUpdateComposite> childUpdates =
configurationManager
-
.findResourceConfigurationUpdateCompositesByParentId(groupResourceConfigurationUpdateId,
pc);
+ .findResourceConfigurationUpdateCompositesByParentId(getSubject(),
groupResourceConfigurationUpdateId,
+ pc);
return childUpdates;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java
index 1201b33..86fedc7 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java
@@ -77,7 +77,7 @@ public class GroupResourceConfigurationHistoryUIBean extends
PagedDataTableUIBea
@Override
public PageList<GroupResourceConfigurationUpdate> fetchPage(PageControl pc)
{
- return
configurationManager.findGroupResourceConfigurationUpdates(getResourceGroup().getId(),
+ return
configurationManager.findGroupResourceConfigurationUpdates(getSubject(),
getResourceGroup().getId(),
pc);
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java
index 0645fb8..a02cfe1 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java
@@ -23,9 +23,24 @@
package org.rhq.enterprise.gui.configuration.resource;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.event.ValueChangeEvent;
+import javax.servlet.http.HttpServletResponse;
+
import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.*;
-import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate;
import org.rhq.core.domain.configuration.Configuration;
@@ -39,14 +54,6 @@ import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
-import javax.faces.application.FacesMessage;
-import javax.faces.event.ValueChangeEvent;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.*;
-
@Name("configurationViewer")
@Scope(ScopeType.PAGE)
public class ResourceConfigurationViewer {
@@ -89,30 +96,34 @@ public class ResourceConfigurationViewer {
* </p>
*/
public void initialize() {
- resourceId = FacesContextUtility.getRequiredRequestParameter("id",
Integer.class);
-
- loadResourceConfigurationDefinition();
-
- if (resourceConfigurationDefinition == null) {
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
- "This resource does not expose a configuration.");
- return;
- }
+ try {
+ resourceId = FacesContextUtility.getRequiredRequestParameter("id",
Integer.class);
- loadResourceConfiguration();
+ loadResourceConfigurationDefinition();
- if (resourceConfiguration == null) {
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
- "This resource's configuration has not yet been
initialized.");
- return;
- }
+ if (resourceConfigurationDefinition == null) {
+ FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
+ "This resource does not expose a configuration.");
+ return;
+ }
- initRawConfigDirectories();
- initMode();
+ loadResourceConfiguration();
- initialized = true;
+ if (resourceConfiguration == null) {
+ FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
+ "This resource's configuration has not yet been
initialized.");
+ return;
+ }
+
+ initRawConfigDirectories();
+ initMode();
- doInitialization();
+ initialized = true;
+
+ doInitialization();
+ } catch (Throwable t) {
+ FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, t.getMessage());
+ }
}
protected void doInitialization() {
@@ -124,7 +135,7 @@ public class ResourceConfigurationViewer {
ConfigurationManagerLocal configurationManager =
LookupUtil.getConfigurationManager();
resourceConfigurationDefinition =
configurationManager.getResourceConfigurationDefinitionForResourceType(
- loggedInUser.getSubject(), resourceTypeId);
+ loggedInUser.getSubject(), resourceTypeId);
}
private void loadResourceConfiguration() {
@@ -132,8 +143,8 @@ public class ResourceConfigurationViewer {
ConfigurationManagerLocal configurationManager =
LookupUtil.getConfigurationManager();
- AbstractResourceConfigurationUpdate configurationUpdate =
- configurationManager.getLatestResourceConfigurationUpdate(subject,
resourceId);
+ AbstractResourceConfigurationUpdate configurationUpdate = configurationManager
+ .getLatestResourceConfigurationUpdate(subject, resourceId);
resourceConfiguration = (configurationUpdate != null) ?
configurationUpdate.getConfiguration() : null;
if (resourceConfiguration != null) {
@@ -145,8 +156,7 @@ public class ResourceConfigurationViewer {
protected void initRawConfigDirectories() {
if (isRawSupported() || isStructuredAndRawSupported()) {
initConfigDirectories();
- }
- else {
+ } else {
rawConfigDirectories = Collections.emptyList();
}
}
@@ -185,13 +195,11 @@ public class ResourceConfigurationViewer {
private void initMode() {
if (isStructuredSupported()) {
mode = STRUCTURED_MODE;
- }
- else if (isRawMode()) {
+ } else if (isRawMode()) {
mode = RAW_MODE;
- }
- else { // else structured and raw is supported and (at
least for now) we will just start
- mode = STRUCTURED_MODE; // the user off in structured mode. We may at some
later point want to add logic
- // to remember what mode the user should start in.
+ } else { // else structured and raw is supported and (at least for now) we will
just start
+ mode = STRUCTURED_MODE; // the user off in structured mode. We may at some
later point want to add logic
+ // to remember what mode the user should start in.
}
}
@@ -223,7 +231,7 @@ public class ResourceConfigurationViewer {
// however this property is read and its value applied to the modalEditor
component before the mode is updated.
//
// jsanda - 02/10/2010
-
+
return isRawSupported() || isStructuredAndRawSupported();
}
@@ -253,8 +261,7 @@ public class ResourceConfigurationViewer {
public void setSelectedTab(String tab) {
if (tab.equals("structuredTab")) {
mode = STRUCTURED_MODE;
- }
- else {
+ } else {
mode = RAW_MODE;
}
}
@@ -263,8 +270,7 @@ public class ResourceConfigurationViewer {
if (event.getNewValue().equals("rawTab")) {
mode = RAW_MODE;
changeToRawTab();
- }
- else if (event.getNewValue().equals("structuredTab")) {
+ } else if (event.getNewValue().equals("structuredTab")) {
mode = STRUCTURED_MODE;
changeToStructuredTab();
}
@@ -314,9 +320,8 @@ public class ResourceConfigurationViewer {
FacesContextUtility.getFacesContext().responseComplete();
return null;
- }
- catch (IOException e) {
-// log.error("Failed to complete download request for " +
getCurrentPath(), e);
+ } catch (IOException e) {
+ // log.error("Failed to complete download request for "
+ getCurrentPath(), e);
throw new RuntimeException(e);
}
}
@@ -328,5 +333,5 @@ public class ResourceConfigurationViewer {
public String getModalEditorContents() {
return selectedRawUIBean.getContents();
}
-
+
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml
index 251abd2..129ea66 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml
@@ -17,16 +17,23 @@
<ui:composition template="/rhq/group/layout/main.xhtml">
- <ui:param name="pageTitle" value="Edit Current Configuration for
Compatible Group '#{EditGroupResourceConfigurationUIBean.group.name}'"/>
+ <ui:param name="pageTitle" value="Edit Current Configuration for
Compatible Group '#{ResourceGroupUIBean.name}'"/>
<ui:param name="selectedTabName"
value="Configuration.Current"/>
<ui:define name="content">
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
<h:form id="configSetForm"
onsubmit="prepareInputsForSubmission(this)"
- rendered="#{EditGroupResourceConfigurationUIBean.configurationSet ne
null}">
+ rendered="#{ResourceGroupUIBean.permissions.configureRead and
EditGroupResourceConfigurationUIBean.configurationSet ne null}">
+
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureWrite}"
+ value="You do not have permissions to change the
configuration of this group"/>
<input type="hidden" name="groupId"
value="#{param.groupId}"/>
- <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}">
<h:commandButton type="submit"
action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}"
value="SAVE" title="Click to Save
Changes"
styleClass="buttonmed"/>
@@ -42,14 +49,13 @@
<a4j:region selfRendered="false">
<a4j:outputPanel layout="block"
ajaxRendered="true" keepTransient="true">
-
<onc:configSet id="rhq_configSet"
configurationSet="#{EditGroupResourceConfigurationUIBean.configurationSet}"/>
-
</a4j:outputPanel>
</a4j:region>
- <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell">
+ <h:panelGrid columns="3" styleClass="buttons-table"
columnClasses="button-cell"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}">
<h:commandButton type="submit"
action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}"
value="SAVE" title="Click to Save
Changes"
styleClass="buttonmed"/>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml
index fb98381..ab0b103 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml
@@ -20,7 +20,10 @@
<ui:param name="selectedTabName"
value="Configuration.History"/>
<ui:define name="content">
- <h:form id="historyForm">
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
+ <h:form id="historyForm"
rendered="#{ResourceGroupUIBean.permissions.configureRead}">
<input type="hidden" name="groupId"
value="#{param.groupId}"/>
<input type="hidden" name="arcuId"
value="#{param.arcuId}"/>
<input type="hidden" name="mode"
value="#{param.mode}"/>
@@ -133,6 +136,7 @@
<rich:columnGroup>
<rich:column colspan="7" width="100%">
<onc:selectCommandButton
action="#{GroupResourceConfigurationHistoryUIBean.deleteSelectedUpdates}"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
value="DELETE SELECTED"
target="selectedUpdates"
styleClass="on-pager-button
buttonsmall" />
@@ -149,7 +153,7 @@
</rich:panel>
</h:form>
- <rich:panel rendered="#{param.mode eq 'group' and not empty
param.arcuId}">
+ <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and
param.mode eq 'group' and not empty param.arcuId}">
<f:facet name="header">
<h:outputText value="Group Configuration Update Request"/>
</f:facet>
@@ -168,7 +172,7 @@
</h:form>
</rich:panel>
- <rich:panel rendered="#{param.mode eq 'details' and not empty
param.arcuId}">
+ <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and
param.mode eq 'details' and not empty param.arcuId}">
<f:facet name="header">
<h:outputText value="Individual Resource Configuration
Updates"/>
</f:facet>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml
index 2b405c3..c158192 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml
@@ -16,38 +16,41 @@
<ui:composition template="/rhq/group/layout/main.xhtml">
- <ui:param name="pageTitle" value="View Current Configuration for
Compatible Group '#{ViewGroupResourceConfigurationUIBean.group.name}'"/>
+ <ui:param name="pageTitle" value="View Current Configuration for
Compatible Group '#{ResourceGroupUIBean.name}'"/>
<ui:param name="selectedTabName"
value="Configuration.Current"/>
<ui:define name="content">
- <h:form id="configSetForm"
rendered="#{ViewGroupResourceConfigurationUIBean.configurationSet ne null}">
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data
for this group" />
+
+ <h:form id="configSetForm"
rendered="#{ResourceGroupUIBean.permissions.configureRead and
ViewGroupResourceConfigurationUIBean.configurationSet ne null}">
<input type="hidden" name="groupId"
value="#{ViewGroupResourceConfigurationUIBean.group.id}" />
- <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configure}" value="You do not have permissions
to change the configuration of this group"/>
+ <h:outputText rendered="#{not
ResourceGroupUIBean.permissions.configureWrite}"
+ value="You do not have permissions to change the
configuration of this group"/>
+ <!-- edit button at top of config -->
<h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
<h:commandButton value="EDIT"
action="#{ViewGroupResourceConfigurationUIBean.edit}"
title="Edit this Compatible Group
Configuration"
-
rendered="${ResourceGroupUIBean.permissions.configure}"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
styleClass="buttonmed"/>
</h:panelGrid>
<a4j:region selfRendered="false">
<a4j:outputPanel layout="block" ajaxRendered="true"
keepTransient="true">
-
<onc:configSet id="rhq_configSet"
configurationSet="#{ViewGroupResourceConfigurationUIBean.configurationSet}"
readOnly="true"/>
-
</a4j:outputPanel>
</a4j:region>
-
+ <!-- edit button at bottom of config -->
<h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell">
<h:commandButton value="EDIT"
action="#{ViewGroupResourceConfigurationUIBean.edit}"
title="Edit this Compatible Group
Configuration"
-
rendered="${ResourceGroupUIBean.permissions.configure}"
+
rendered="${ResourceGroupUIBean.permissions.configureWrite}"
styleClass="buttonmed"/>
</h:panelGrid>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml
index 9aafddc..39b1281 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml
@@ -26,14 +26,25 @@ THIS TEXT WILL BE REMOVED.
<ui:define name="content">
- <h:panelGroup layout="block" styleClass="InfoBlock"
- rendered="#{configurationEditor.updateInProgress}">
- <b>${msg['note']}</b>
${msg['resource.config.Current.updateInProgress']}
- </h:panelGroup>
+ <ui:remove>
+ Don't need outputText here, because configurationViewer appears to ALWAYS load
before ResourceUIBean, which
+ means the authorization checks the SLSB do will bubbled up to it. So the strategy
here will be to allow
+ configurationViewer.initialize to be called, which will throw the
PermissionException and add a FacesMessage.
+ <h:outputText rendered="#{not
ResourceUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data for
this resource" />
+ </ui:remove>
<h:form id="editResourceConfigurationForm"
onsubmit="prepareInputsForSubmission(this)"
- rendered="#{configurationEditor.initialized}">
+ rendered="#{ResourceUIBean.permissions.configureRead and
configurationEditor.initialized}">
+
+ <h:outputText rendered="#{not
ResourceUIBean.permissions.configureWrite}"
+ value="You do not have permissions to edit configuration data
for this resource" />
+
+ <h:panelGroup layout="block" styleClass="InfoBlock"
+ rendered="#{configurationEditor.updateInProgress}">
+ <b>${msg['note']}</b>
${msg['resource.config.Current.updateInProgress']}
+ </h:panelGroup>
<input type="hidden" name="id"
value="#{ResourceUIBean.id}"/>
@@ -48,7 +59,7 @@ THIS TEXT WILL BE REMOVED.
action="#{configurationEditor.updateConfiguration}"
title="Click to Save Changes"
styleClass="buttonmed"
-
rendered="${ResourceUIBean.permissions.configure}"/>
+
rendered="${ResourceUIBean.permissions.configureWrite}"/>
<s:button id="upperCancelButton"
value="Cancel"
view="view.xhtml"
@@ -77,7 +88,7 @@ THIS TEXT WILL BE REMOVED.
action="#{configurationEditor.updateConfiguration}"
title="Click to Save Changes"
styleClass="buttonmed"
-
rendered="${ResourceUIBean.permissions.configure}"/>
+
rendered="${ResourceUIBean.permissions.configureWrite}"/>
<s:button id="lowerCancelButton"
value="Cancel"
view="view.xhtml"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml
index ac824f8..640e35d 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml
@@ -20,12 +20,16 @@
<ui:param name="selectedTabName"
value="Configuration.History"/>
<ui:define name="content">
-<ui:param name="latestConfig"
value="#{GetLatestConfigurationUpdateUIBean.latestConfigurationUpdate}"/>
+<h:outputText rendered="#{not ResourceUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data for this
resource" />
-<h:form id="historyForm">
+<h:form id="historyForm"
+ rendered="#{ResourceUIBean.permissions.configureRead}">
<input type="hidden" name="id"
value="${ResourceUIBean.id}"/>
<rich:panel>
+ <ui:param name="latestConfig"
value="#{GetLatestConfigurationUpdateUIBean.latestConfigurationUpdate}"/>
+
<f:facet name="header">Current Configuration:</f:facet>
<table>
<tr>
@@ -89,7 +93,7 @@
<onc:paginationControl id="ConfigurationHistory"/>
</f:facet>
- <rich:column
rendered="#{ResourceUIBean.permissions.configure}">
+ <rich:column
rendered="#{ResourceUIBean.permissions.configureWrite}">
<f:facet name="header">
<onc:allSelect target="selectedItems"/>
</f:facet>
@@ -184,18 +188,18 @@
<f:facet name="footer">
<rich:columnGroup>
- <rich:column
colspan="#{ResourceUIBean.permissions.configure ? 7 : 6}"
width="100%">
+ <rich:column
colspan="#{ResourceUIBean.permissions.configureWrite ? 7 : 6}"
width="100%">
<onc:selectCommandButton
action="#{ListConfigurationUpdateUIBean.delete}"
value="DELETE SELECTED"
target="selectedItems"
styleClass="on-pager-button
buttonsmall"
-
rendered="${ResourceUIBean.permissions.configure}"/>
+
rendered="${ResourceUIBean.permissions.configureWrite}"/>
<onc:selectCommandButton
action="#{ListConfigurationUpdateUIBean.compare}"
value="COMPARE SELECTED"
low="2" high="2" target="selectedItems"
styleClass="on-pager-button
buttonsmall" rendered="false"/>
<onc:selectCommandButton
action="#{ListConfigurationUpdateUIBean.rollback}"
value="ROLLBACK TO
SELECTED" high="1" target="selectedItems"
styleClass="on-pager-button
buttonsmall"
-
rendered="${ResourceUIBean.permissions.configure}"/>
+
rendered="${ResourceUIBean.permissions.configureWrite}"/>
<ui:param name="paginationDataTableName"
value="configurationUpdateDataTable"/>
<ui:param name="paginationDataModel"
value="#{configurationUpdateDataModel}"/>
@@ -213,7 +217,7 @@
</rich:panel>
</h:form>
-<rich:panel rendered="#{!empty param.configId}">
+<rich:panel rendered="#{ResourceUIBean.permissions.configureRead and !empty
param.configId}">
<f:facet name="header">
<h:outputText value="Selected Configuration
(#{param.configId})"/>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml
index b22194e..9bee981 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml
@@ -32,7 +32,7 @@
</c:choose>
<h:outputText value=" #{messages.nopermissionedit}"
- rendered="#{!ResourceUIBean.permissions.configure}"/>
+ rendered="#{!ResourceUIBean.permissions.configureWrite}"/>
<h:panelGrid columns="2"
styleClass="raw-outer-table"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml
index 49ff1b0..d162d6f 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml
@@ -14,7 +14,7 @@
</c:if>
<h:outputText value=" #{messages.nopermissionedit}"
- rendered="#{!ResourceUIBean.permissions.configure}"/>
+ rendered="#{!ResourceUIBean.permissions.configureWrite}"/>
<onc:config
configurationDefinition="#{resourceConfigurationDefinition}"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml
index 7a40797..a64a078 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml
@@ -28,12 +28,22 @@ THIS TEXT WILL BE REMOVED.
<ui:define name="content">
- <h:panelGroup layout="block" styleClass="InfoBlock"
- rendered="#{configurationViewer.updateInProgress}">
- <b>${msg['note']}</b>
${msg['resource.config.Current.updateInProgress']}
- </h:panelGroup>
-
- <h:form id="viewResourceConfigurationForm"
rendered="#{configurationViewer.initialized}">
+ <ui:remove>
+ Don't need outputText here, because configurationViewer appears to ALWAYS load
before ResourceUIBean, which
+ means the authorization checks the SLSB do will bubbled up to it. So the strategy
here will be to allow
+ configurationViewer.initialize to be called, which will throw the
PermissionException and add a FacesMessage.
+ <h:outputText rendered="#{not
ResourceUIBean.permissions.configureRead}"
+ value="You do not have permissions to view configuration data for
this resource" />
+ </ui:remove>
+
+ <h:form id="viewResourceConfigurationForm"
+ rendered="#{ResourceUIBean.permissions.configureRead and
configurationViewer.initialized}">
+
+ <h:panelGroup layout="block" styleClass="InfoBlock"
+ rendered="#{configurationViewer.updateInProgress}">
+ <b>${msg['note']}</b>
${msg['resource.config.Current.updateInProgress']}
+ </h:panelGroup>
+
<input type="hidden" name="id"
value="#{ResourceUIBean.id}"/>
<h:panelGrid columns="2" style="width:100%">
@@ -43,7 +53,7 @@ THIS TEXT WILL BE REMOVED.
value="Edit"
view="edit.xhtml"
styleClass="buttonmed"
- rendered="#{!configurationViewer.updateInProgress}">
+ rendered="#{ResourceUIBean.permissions.configureWrite and
!configurationViewer.updateInProgress}">
<f:param name="id"
value="#{ResourceUIBean.id}"/>
<f:param name="tab"
value="#{configurationViewer.selectedTab}"/>
</s:button>
@@ -61,7 +71,7 @@ THIS TEXT WILL BE REMOVED.
value="Edit"
view="edit.xhtml"
styleClass="buttonmed"
- rendered="#{!configurationViewer.updateInProgress}">
+ rendered="#{ResourceUIBean.permissions.configureWrite and
!configurationViewer.updateInProgress}">
<f:param name="id" value="#{ResourceUIBean.id}"/>
<f:param name="tab"
value="#{configurationViewer.selectedTab}"/>
</s:button>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml
index 2a27139..53c59f9 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml
@@ -41,12 +41,14 @@
</td>
<td width="50%" valign="top"
nowrap="nowrap">
- <ui:include
src="/rhq/resource/summary/table/recentConfigUpdates.xhtml"
- rendered="#{ResourceUIBean.facets.configuration}"
/>
- <br />
- <rich:separator lineType="beveled"
- width="50%" height="3px"
- style="align: center;" />
+ <c:if test="#{ResourceUIBean.permissions.configureRead}">
+ <ui:include
src="/rhq/resource/summary/table/recentConfigUpdates.xhtml"
+ rendered="#{ResourceUIBean.facets.configuration}"
/>
+ <br />
+ <rich:separator lineType="beveled"
+ width="50%" height="3px"
+ style="align: center;" />
+ </c:if>
<ui:include
src="/rhq/resource/summary/table/recentOperations.xhtml"
rendered="#{ResourceUIBean.facets.operation}" />
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 bc2321c..5f7203a 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
@@ -321,7 +321,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
}
}
- if (!authorizationManager.canViewResource(subject, resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to view resource configuration for
[" + resource + "]");
}
@@ -443,7 +443,8 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
Query query =
entityManager.createNamedQuery(ResourceConfigurationUpdate.QUERY_FIND_LATEST_BY_RESOURCE_ID);
query.setParameter("resourceId", resourceId);
ResourceConfigurationUpdate latestConfigUpdate =
(ResourceConfigurationUpdate) query.getSingleResult();
- if (!authorizationManager.canViewResource(subject,
latestConfigUpdate.getResource().getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, latestConfigUpdate
+ .getResource().getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to view Resource configuration for
["
+ latestConfigUpdate.getResource() + "]");
@@ -522,6 +523,12 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public Map<Integer, Configuration>
getResourceConfigurationsForCompatibleGroup(Subject subject, int groupId)
throws ConfigurationUpdateStillInProgressException, Exception {
+
+ if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ,
groupId) == false) {
+ throw new PermissionException("User[name=" + subject.getName()
+ + "] does not have permission to view configuration for
group[id=" + groupId + "]");
+ }
+
// The below call will also handle the check to see if the subject has perms to
view the group.
ResourceGroupComposite groupComposite =
this.resourceGroupManager.getResourceGroupComposite(subject, groupId);
@@ -846,6 +853,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdates(Subject subject, Integer resourceId,
Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resourceId)) {
+ throw new PermissionException("User[" + subject.getName()
+ + "] does not have permission to view configuration history for
resource[id=" + resourceId + "]");
+ }
+
// TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential,
because our sequences are configured to
// pre-create and cache blocks of 10 sequence id's, so
it may be better to order by
// "cu.createdTime", rather than
"cu.id".
@@ -987,6 +999,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
Configuration newConfiguration, boolean fromStructured) throws
ResourceNotFoundException,
ConfigurationUpdateStillInProgressException {
+ if (authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_WRITE, resourceId) == false) {
+ throw new PermissionException("User[name=" + subject.getName()
+ + "] does not have the permission to update configuration for
resource[id=" + resourceId + "]");
+ }
+
Configuration configToUpdate = newConfiguration;
if (isStructuredAndRawSupported(resourceId)) {
@@ -1062,6 +1079,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
+ "whether the structured or raw was updated.");
}
+ if (authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_WRITE, resourceId) == false) {
+ throw new PermissionException("User[name=" + subject.getName()
+ + "] does not have the permission to update configuration for
resource[id=" + resourceId + "]");
+ }
+
// must do this in a separate transaction so it is committed prior to sending the
agent request
// (consider synchronizing to avoid the condition where someone calls this method
twice quickly
// in two different txs which would put two updates in INPROGRESS and cause
havoc)
@@ -1650,8 +1672,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
}
@SuppressWarnings("unchecked")
- public PageList<ConfigurationUpdateComposite>
findResourceConfigurationUpdateCompositesByParentId(
+ public PageList<ConfigurationUpdateComposite>
findResourceConfigurationUpdateCompositesByParentId(Subject subject,
int configurationUpdateId, PageControl pageControl) {
+ // will perform CONFIGURE_READ security check for us, no need to save the
+ getGroupResourceConfigurationUpdate(subject, configurationUpdateId);
+
pageControl.initDefaultOrderingField("cu.modifiedTime");
Query query = PersistenceUtility.createQueryWithOrderBy(entityManager,
@@ -1711,8 +1736,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
}
@SuppressWarnings("unchecked")
- public Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(
+ public Map<Integer, Configuration>
getResourceConfigurationMapForGroupUpdate(Subject subject,
Integer groupResourceConfigurationUpdateId) {
+ // this method will perform the CONFIGURE_READ security check for us, no need to
keep reference to result
+ getGroupPluginConfigurationUpdate(subject, groupResourceConfigurationUpdateId);
+
Tuple<String, Object> groupIdParameter = new Tuple<String,
Object>("groupConfigurationUpdateId",
groupResourceConfigurationUpdateId);
return
executeGetConfigurationMapQuery(Configuration.QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_UPDATE_ID,
100,
@@ -1786,7 +1814,13 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
}
@SuppressWarnings("unchecked")
- public PageList<GroupResourceConfigurationUpdate>
findGroupResourceConfigurationUpdates(int groupId, PageControl pc) {
+ public PageList<GroupResourceConfigurationUpdate>
findGroupResourceConfigurationUpdates(Subject subject,
+ int groupId, PageControl pc) {
+ if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ,
groupId) == false) {
+ throw new PermissionException("User[name=" + subject.getName()
+ + "] does not have permission to view configuration for
group[id=" + groupId + "]");
+ }
+
pc.initDefaultOrderingField("modifiedTime", PageOrdering.DESC);
Query query = PersistenceUtility.createQueryWithOrderBy(entityManager,
@@ -1933,7 +1967,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
GroupPluginConfigurationUpdate update =
getGroupPluginConfigurationById(configurationUpdateId);
int groupId = update.getGroup().getId();
- if (authorizationManager.canViewGroup(subject, groupId) == false) {
+ if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ,
groupId) == false) {
throw new PermissionException("User[" + subject.getName()
+ "] does not have permission to view group
resourceConfiguration[id=" + configurationUpdateId + "]");
}
@@ -1968,7 +2002,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
throw new NoResultException("Cannot get live configuration for unknown
resource [" + resourceId + "]");
}
- if (!authorizationManager.canViewResource(subject, resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_READ, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to view resource configuration for
[" + resource + "]");
}
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 01adabe..4242153 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
@@ -306,7 +306,7 @@ public interface ConfigurationManagerLocal {
PageList<ConfigurationUpdateComposite>
findPluginConfigurationUpdateCompositesByParentId(int configurationUpdateId,
PageControl pageControl);
- PageList<ConfigurationUpdateComposite>
findResourceConfigurationUpdateCompositesByParentId(
+ PageList<ConfigurationUpdateComposite>
findResourceConfigurationUpdateCompositesByParentId(Subject subject,
int configurationUpdateId, PageControl pageControl);
PageList<Integer> findPluginConfigurationUpdatesByParentId(int
configurationUpdateId, PageControl pageControl);
@@ -320,7 +320,8 @@ public interface ConfigurationManagerLocal {
PageList<GroupPluginConfigurationUpdate>
findGroupPluginConfigurationUpdates(int groupId, PageControl pc);
- PageList<GroupResourceConfigurationUpdate>
findGroupResourceConfigurationUpdates(int groupId, PageControl pc);
+ PageList<GroupResourceConfigurationUpdate>
findGroupResourceConfigurationUpdates(Subject subject, int groupId,
+ PageControl pc);
ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int
groupPluginConfigurationUpdateId,
String errorMessages);
@@ -345,7 +346,8 @@ public interface ConfigurationManagerLocal {
GroupResourceConfigurationUpdate getGroupResourceConfigurationById(int
configurationUpdateId);
- Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Integer
groupResourceConfigurationUpdateId);
+ Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject
subject,
+ Integer groupResourceConfigurationUpdateId);
Map<Integer, Configuration>
getResourceConfigurationMapForCompatibleGroup(ResourceGroup compatibleGroup);
commit c09481313e95c91d65c758117ff2bbe03b5e9eac
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Jul 18 22:45:03 2010 -0400
BZ-614886: update view/edit role page to accomodate new read/write config permissions
* new layout for permissions we may eventually want to have separate read/write bits
* new properties in ApplicationResources.properties for i18n
* use javascript to keep the read/write bits in "sync"
** if config-write is checked, also check config-read
** if config-read is unckeched, also uncheck config-write
* update the RoleManagerBean to ensure config-read is added when config-write is
selected
** this will mostly be for remote callers, since our UI already uses javascript to
handle this more intuitively
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
index d72193e..be7826c 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
+++
b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
@@ -300,7 +300,11 @@ admin.role.props.100=Please limit the description to 100 characters
admin.role.perms.PermissionsTab=Permissions
admin.role.perms.GlobalPermissions=Global Permissions
admin.role.perms.ResourcePermissions=Resource Permissions
+admin.role.perms.SubsystemPermissions=Subsystem Permissions
admin.role.perms.Authorized=Authorized?
+admin.role.perms.Read=Read?
+admin.role.perms.Write=Write?
+admin.role.perms.NotApplicable=N/A
admin.role.perms.perm.MANAGE_SECURITY=Manage security (users/roles)
admin.role.perms.perm.MANAGE_SECURITY.warning=This permission implicitly grants (and
explicitly forces selection of) all other permissions
admin.role.perms.perm.MANAGE_INVENTORY=Manage inventory (resources/groups)
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp
index 2d00e33..105448a 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp
@@ -19,7 +19,7 @@
<html:img page="/images/spacer.gif" width="175"
height="1" border="0"/><br>
<fmt:message key="admin.role.perms.GlobalPermissions"/></td>
- <td width="300px" class="ListHeaderInactive"><div
align="center">
+ <td width="150px" class="ListHeaderInactive"
colspan="2"><div align="center">
<html:img page="/images/spacer.gif" width="50"
height="1" border="0"/><br>
<fmt:message
key="admin.role.perms.Authorized"/></div></td>
</tr>
@@ -37,15 +37,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_SECURITY']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_SECURITY" onclick="ToggleAll(this)"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="MANAGE_SECURITY" onclick="ToggleAll(this)"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -58,15 +58,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_INVENTORY']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_INVENTORY" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="MANAGE_INVENTORY" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -79,15 +79,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_SETTINGS']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_SETTINGS" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="MANAGE_SETTINGS" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -100,15 +100,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_BUNDLE']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_BUNDLE" onclick="ToggleSelection(this,
'MANAGE_BUNDLE')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="MANAGE_BUNDLE" onclick="ToggleSelection(this,
'MANAGE_BUNDLE')"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -121,7 +121,7 @@
<html:img page="/images/spacer.gif" width="175"
height="1" border="0"/><br>
<fmt:message
key="admin.role.perms.ResourcePermissions"/></td>
- <td class="ListHeaderInactive" nowrap="nowrap"><div
align="center">
+ <td class="ListHeaderInactive" nowrap="nowrap"
colspan="2"><div align="center">
<html:img page="/images/spacer.gif" width="50"
height="1" border="0"/><br>
<fmt:message
key="admin.role.perms.Authorized"/></div></td>
</tr>
@@ -136,15 +136,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MODIFY_RESOURCE']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MODIFY_RESOURCE" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="MODIFY_RESOURCE" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -157,15 +157,15 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['DELETE_RESOURCE']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="DELETE_RESOURCE" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="DELETE_RESOURCE" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -178,19 +178,34 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when
test="${rolePermissions['CREATE_CHILD_RESOURCES']}">
- <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_enabled.gif"
width="11" height="11" border="0"/></td>
</c:when>
<c:otherwise>
- <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ <td align="center" class="ListCell"
colspan="2"><html:img page="/images/permission_disabled.gif"
width="11" height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="CREATE_CHILD_RESOURCES" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center" class="ListCellCheckboxSelected"
colspan="2"><html:multibox property="p"
value="CREATE_CHILD_RESOURCES" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
</tr>
+ <!-- THE SUBSYSTEM PERMISSIONS HEADER ROW -->
+ <tr class="ListHeader">
+ <td class="ListHeaderInactive">
+ <html:img page="/images/spacer.gif" width="175"
height="1" border="0"/><br>
+ <fmt:message
key="admin.role.perms.SubsystemPermissions"/></td>
+
+ <td class="ListHeaderInactive" nowrap="nowrap"><div
align="center">
+ <html:img page="/images/spacer.gif" width="25"
height="1" border="0"/><br>
+ <fmt:message key="admin.role.perms.Read"/></div></td>
+
+ <td class="ListHeaderInactive" nowrap="nowrap"><div
align="center">
+ <html:img page="/images/spacer.gif" width="25"
height="1" border="0"/><br>
+ <fmt:message key="admin.role.perms.Write"/></div></td>
+ </tr>
+
<!-- MANAGE_ALERTS -->
<tr class="ListRow">
<td class="ListCell"><b><fmt:message
key="admin.role.perms.perm.MANAGE_ALERTS"/></b></td>
@@ -199,14 +214,17 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_ALERTS']}">
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
</c:when>
<c:otherwise>
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
+ <td align="center"
class="ListCellCheckboxSelected"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_ALERTS" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
@@ -220,14 +238,17 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when
test="${rolePermissions['MANAGE_MEASUREMENTS']}">
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
</c:when>
<c:otherwise>
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
+ <td align="center"
class="ListCellCheckboxSelected"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_MEASUREMENTS" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
@@ -241,14 +262,17 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['MANAGE_CONTENT']}">
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
</c:when>
<c:otherwise>
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
+ <td align="center"
class="ListCellCheckboxSelected"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="MANAGE_CONTENT" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
@@ -262,14 +286,17 @@
<c:when test="${mode eq 'view'}">
<c:choose>
<c:when test="${rolePermissions['CONTROL']}">
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
</c:when>
<c:otherwise>
+ <td align="center" class="ListCell"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
+ <td align="center"
class="ListCellCheckboxSelected"><fmt:message
key="admin.role.perms.NotApplicable"/></td>
<td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="CONTROL" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
</c:otherwise>
</c:choose>
@@ -282,7 +309,15 @@
<c:choose>
<c:when test="${mode eq 'view'}">
<c:choose>
- <c:when test="${rolePermissions['CONFIGURE']}">
+ <c:when test="${rolePermissions['CONFIGURE_READ']}">
+ <td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
+ </c:when>
+ <c:otherwise>
+ <td align="center" class="ListCell"><html:img
page="/images/permission_disabled.gif" width="11"
height="11" border="0"/></td>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${rolePermissions['CONFIGURE_WRITE']}">
<td align="center" class="ListCell"><html:img
page="/images/permission_enabled.gif" width="11" height="11"
border="0"/></td>
</c:when>
<c:otherwise>
@@ -291,7 +326,8 @@
</c:choose>
</c:when>
<c:otherwise>
- <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="CONFIGURE" onclick="ToggleSelection(this,
'MANAGE_SECURITY')"/></td>
+ <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="CONFIGURE_READ" onclick="ToggleSelection(this,
'MANAGE_SECURITY'); ToggleSelectionState(this, 'CONFIGURE_WRITE',
0)"/></td>
+ <td align="center"
class="ListCellCheckboxSelected"><html:multibox property="p"
value="CONFIGURE_WRITE" onclick="ToggleSelection(this,
'MANAGE_SECURITY'); ToggleSelectionState(this, 'CONFIGURE_READ',
1)"/></td>
</c:otherwise>
</c:choose>
</tr>
@@ -301,10 +337,10 @@
<c:if test="${mode eq edit || mode eq new}">
<script language="JavaScript" src="<html:rewrite
page="/js/adminEditRole_checkAll.js"/>"></script>
<tr class="ListRow">
- <td colspan="2">**<fmt:message
key="admin.role.perms.perm.MANAGE_SECURITY.warning"/></td>
+ <td colspan="3">**<fmt:message
key="admin.role.perms.perm.MANAGE_SECURITY.warning"/></td>
</tr>
</c:if>
</table>
-<!-- / -->
+<!-- / -->
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js
b/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js
index b81be15..6db14f6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js
@@ -11,14 +11,32 @@ function ToggleSelection(e, depends) {
var len = uList.elements.length;
for (var i = 0; i < len; i++) {
- var e = uList.elements[i];
- if (e.getAttribute("type")=="checkbox" &&
e.getAttribute("value")==depends) {
- e.checked = false;
+ var elt = uList.elements[i];
+ if (elt.getAttribute("type")=="checkbox" &&
elt.getAttribute("value")==depends) {
+ elt.checked = false;
}
}
}
}
+function ToggleSelectionState(e, depends, state) {
+ if (isIE)
+ e = event.srcElement;
+
+ var form = e.form;
+ var uList = e.form;
+ var len = uList.elements.length;
+
+ for (var i = 0; i < len; i++) {
+ var elt = uList.elements[i];
+ if (elt.getAttribute("type")=="checkbox" &&
elt.getAttribute("value")==depends) {
+ if (e.checked == state) {
+ elt.checked = e.checked;
+ }
+ }
+ }
+}
+
function ToggleAll(e) {
if (isIE)
e = event.srcElement;
@@ -55,4 +73,3 @@ function ClearAll(e) {
}
}
/*-- END adminEditRole_checkAll.js --*/
-
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
index bcf6daf..4f5aa4d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
@@ -482,6 +482,13 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
if (role.getPermissions().contains(Permission.MANAGE_SECURITY)) {
role.getPermissions().addAll(Arrays.asList(Permission.values()));
}
+
+ /*
+ * write-access implies read-access
+ */
+ if ((role.getPermissions().contains(Permission.CONFIGURE_WRITE))) {
+ role.getPermissions().add(Permission.CONFIGURE_READ);
+ }
}
public PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId,
PageControl pc) {
commit c1472c2fa4cc5c3c05321961bfd63408d7b8f08a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sun Jul 18 18:06:03 2010 -0400
BZ-614886: add secondary permission for configuration subsystem
part 1 - new enum
* rename CONFIGURE perm to CONFIGURE_WRITE
** rename action is safe because permissions are persisted using ordinals, not string
names
* add new CONFIGURE_READ permission
** must be added to the end of the enum, becuase permissions are persisted using
ordinals
part 2 - update code paths
* update code paths previously using CONFIGURE perm to now use CONFIGURE_WRITE
* for ResourceDetailView, change logic to show tab if user has config-read perm on
resource
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
index f1f6cca..e20d15b 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java
@@ -94,13 +94,19 @@ public enum Permission {
CONTROL(Target.RESOURCE),
/**
- * can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port
1199)
+ * can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port
1199);
+ * having this permission implies having @link {@link #CONFIGURE_READ}
*/
- CONFIGURE(Target.RESOURCE),
+ CONFIGURE_WRITE(Target.RESOURCE),
/* ========== New Bundle Global Permission ========== */
- MANAGE_BUNDLE(Target.GLOBAL);
+ MANAGE_BUNDLE(Target.GLOBAL),
+
+ /**
+ * can read resource configu, but can not necessarily C/U/D unless @link {@link
#CONFIGURE_WRITE} is also possessed
+ */
+ CONFIGURE_READ(Target.RESOURCE);
/**
* The target that a permission applies to.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index 269e4d3..52420f4 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -569,7 +569,8 @@ import org.rhq.core.domain.util.Summary;
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 4), " // we want
MODIFY_RESOURCE (4), not VIEW_RESOURCE (3)
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 10), " // we want
CONTROL, 10
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 7), " // we want
MANAGE_ALERTS, 7
- + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want
CONFIGURE, 11
+ + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 13), " // we want
CONFIGURE_READ, 13
+ + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want
CONFIGURE_WRITE, 11
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 9), " // we want
MANAGE_CONTENT, 9
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 6), " // we want
CREATE_CHILD_RESOURCES, 6
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 5)) " // we want
DELETE_RESOURCES, 5
@@ -590,7 +591,8 @@ import org.rhq.core.domain.util.Summary;
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 4), " // we want
MODIFY_RESOURCE (4), not VIEW_RESOURCE (3)
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 10), " // we want
CONTROL, 10
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 7), " // we want
MANAGE_ALERTS, 7
- + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want
CONFIGURE, 11
+ + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 13), " // we want
CONFIGURE_READ, 13
+ + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want
CONFIGURE_WRITE, 11
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 9), " // we want
MANAGE_CONTENT, 9
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 6), " // we want
CREATE_CHILD_RESOURCES, 6
+ " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN
r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 5)) " // we want
DELETE_RESOURCES, 5
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
index aa4f1aa..96745a8 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java
@@ -74,22 +74,22 @@ public class ResourceComposite implements Serializable {
* Provides specified permissions - used for non-admin queries.
*/
public ResourceComposite(Resource resource, AvailabilityType availability, Number
measure, Number inventory,
- Number control, Number alert, Number configure, Number content, Number
createChildResources,
- Number deleteResources) {
+ Number control, Number alert, Number configureRead, Number configureWrite, Number
content,
+ Number createChildResources, Number deleteResources) {
this(resource, null, availability, new ResourcePermission(measure.intValue() >
0, inventory.intValue() > 0,
- control.intValue() > 0, alert.intValue() > 0, configure.intValue() >
0, content.intValue() > 0,
- createChildResources.intValue() > 0, deleteResources.intValue() > 0));
+ control.intValue() > 0, alert.intValue() > 0, configureRead.intValue()
> 0, configureWrite.intValue() > 0,
+ content.intValue() > 0, createChildResources.intValue() > 0,
deleteResources.intValue() > 0));
}
/**
* Provides specified permissions - used for non-admin queries.
*/
public ResourceComposite(Resource resource, Resource parent, AvailabilityType
availability, Number measure,
- Number inventory, Number control, Number alert, Number configure, Number content,
Number createChildResources,
- Number deleteResources) {
+ Number inventory, Number control, Number alert, Number configureRead, Number
configureWrite, Number content,
+ Number createChildResources, Number deleteResources) {
this(resource, parent, availability, new ResourcePermission(measure.intValue()
> 0, inventory.intValue() > 0,
- control.intValue() > 0, alert.intValue() > 0, configure.intValue() >
0, content.intValue() > 0,
- createChildResources.intValue() > 0, deleteResources.intValue() > 0));
+ control.intValue() > 0, alert.intValue() > 0, configureRead.intValue()
> 0, configureWrite.intValue() > 0,
+ content.intValue() > 0, createChildResources.intValue() > 0,
deleteResources.intValue() > 0));
}
/**
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
index e064482..ee8e8a8 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java
@@ -1,29 +1,29 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.domain.resource.composite;
-import java.util.Set;
import java.io.Serializable;
+import java.util.Set;
import org.rhq.core.domain.authz.Permission;
@@ -43,7 +43,9 @@ public class ResourcePermission implements Serializable {
private boolean alert;
- private boolean configure;
+ private boolean configureRead;
+
+ private boolean configureWrite;
private boolean content;
@@ -55,26 +57,40 @@ public class ResourcePermission implements Serializable {
* All permissions
*/
public ResourcePermission() {
- this(true, true, true, true, true, true, true, true);
+ this(true, true, true, true, true, true, true, true, true);
}
- public ResourcePermission(boolean measure, boolean inventory, boolean control,
boolean alert, boolean configure,
- boolean content, boolean createChildResources, boolean deleteResource) {
+ public ResourcePermission(//
+ boolean measure, //
+ boolean inventory, //
+ boolean control, //
+ boolean alert, //
+ boolean configureRead, //
+ boolean configureWrite, //
+ boolean content, //
+ boolean createChildResources,//
+ boolean deleteResource) {
this.measure = measure;
this.inventory = inventory;
this.control = control;
this.alert = alert;
- this.configure = configure;
+ this.configureRead = configureRead;
+ this.configureWrite = configureWrite;
this.content = content;
this.createChildResources = createChildResources;
this.deleteResource = deleteResource;
}
public ResourcePermission(Set<Permission> permissions) {
- this(permissions.contains(Permission.MANAGE_MEASUREMENTS),
permissions.contains(Permission.MODIFY_RESOURCE),
- permissions.contains(Permission.CONTROL),
permissions.contains(Permission.MANAGE_ALERTS), permissions
- .contains(Permission.CONFIGURE),
permissions.contains(Permission.MANAGE_CONTENT), permissions
- .contains(Permission.CREATE_CHILD_RESOURCES),
permissions.contains(Permission.DELETE_RESOURCE));
+ this(permissions.contains(Permission.MANAGE_MEASUREMENTS),//
+ permissions.contains(Permission.MODIFY_RESOURCE),//
+ permissions.contains(Permission.CONTROL), //
+ permissions.contains(Permission.MANAGE_ALERTS), //
+ permissions.contains(Permission.CONFIGURE_READ), //
+ permissions.contains(Permission.CONFIGURE_WRITE), //
+ permissions.contains(Permission.MANAGE_CONTENT), //
+ permissions.contains(Permission.CREATE_CHILD_RESOURCES),//
+ permissions.contains(Permission.DELETE_RESOURCE));
}
public boolean isMeasure() {
@@ -93,8 +109,12 @@ public class ResourcePermission implements Serializable {
return alert;
}
- public boolean isConfigure() {
- return configure;
+ public boolean isConfigureRead() {
+ return configureRead;
+ }
+
+ public boolean isConfigureWrite() {
+ return configureWrite;
}
public boolean isContent() {
@@ -116,7 +136,8 @@ public class ResourcePermission implements Serializable {
"inventory: " + inventory + ", " + //
"control: " + control + ", " + //
"alert: " + alert + ", " + //
- "configure: " + configure + ", " + //
+ "configure-read: " + configureRead + ", " + //
+ "configure-write: " + configureWrite + ", " + //
"content: " + content + ", " + //
"createChildResources: " + createChildResources + ", " +
//
"deleteResource: " + deleteResource + //
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index cdf3025..7e07dad 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -241,7 +241,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
topTabSet.enableTab(alertsTab);
}
- if (type.getResourceConfigurationDefinition() == null ||
!permissions.isConfigure()) {
+ if (type.getResourceConfigurationDefinition() == null ||
!permissions.isConfigureRead()) {
topTabSet.disableTab(configurationTab);
} else {
topTabSet.enableTab(configurationTab);
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 c0add68..bc2321c 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
@@ -927,7 +927,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
// make sure the user has the proper permissions to do this
Resource resource = doomedRequest.getResource();
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE,
resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_WRITE, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to purge a plugin configuration update
audit trail for resource ["
+ resource + "]");
@@ -957,7 +957,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
// make sure the user has the proper permissions to do this
Resource resource = doomedRequest.getResource();
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE,
resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_WRITE, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to purge a configuration update audit
trail for resource [" + resource
+ "]");
@@ -1131,7 +1131,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
Resource resource = resourceManager.getResourceById(subject, resourceId);
// make sure the user has the proper permissions to do this
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE,
resource.getId())) {
+ if (!authorizationManager.hasResourcePermission(subject,
Permission.CONFIGURE_WRITE, resource.getId())) {
throw new PermissionException("User [" + subject.getName()
+ "] does not have permission to modify configuration for resource
[" + resource + "]");
}
@@ -1536,7 +1536,7 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
ResourceGroup group = getCompatibleGroupIfAuthorized(subject,
compatibleGroupId);
- if (!authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE,
group.getId())) {
+ if (!authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_WRITE,
group.getId())) {
throw new PermissionException("User [" + subject.getName() +
"] does not have permission "
+ "to modify Resource configurations for members of group [" +
group + "].");
}
@@ -1859,10 +1859,10 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public int deleteGroupResourceConfigurationUpdates(Subject subject, Integer
resourceGroupId,
Integer[] groupResourceConfigurationUpdateIds) {
- if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE,
resourceGroupId) == false) {
+ if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_WRITE,
resourceGroupId) == false) {
log.error(subject + " attempted to delete " +
groupResourceConfigurationUpdateIds.length
+ " group resource configuration updates for ResourceGroup[id"
+ resourceGroupId
- + "], but did not have the " + Permission.CONFIGURE.name() +
" permission for this group");
+ + "], but did not have the " +
Permission.CONFIGURE_WRITE.name() + " permission for this group");
return 0;
}
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 a40368a..3687b5e 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
@@ -2058,6 +2058,7 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
Resource parent = next.getParentResource();
ResourceComposite composite = new ResourceComposite(next, parent,
availType);
composite.setResourceFacets(typeManager.getResourceFacets(next.getResourceType().getId()));
+ // TODO: jmarques: need to set resource permissions here, or alter criteria
projection to include it
results.add(composite);
}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java
index a663b72..2afafb7 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java
@@ -144,7 +144,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
/* setup permissions */
testRole1.getPermissions().add(Permission.CONTROL);
- testRole2.getPermissions().add(Permission.CONFIGURE);
+ testRole2.getPermissions().add(Permission.CONFIGURE_WRITE);
em.merge(testRole1);
em.merge(testRole2);
em.flush();
@@ -186,7 +186,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
ResourceGroup testGroup1 = SessionTestHelper.createNewMixedGroupForRole(em,
testRole1, "testGroup1", false);
/* setup permissions */
- Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE,
Permission.CONTROL,
+ Set<Permission> someMixedPermissions =
EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL,
Permission.MANAGE_SECURITY);
testRole1.getPermissions().addAll(someMixedPermissions);
em.merge(testRole1);
@@ -230,7 +230,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
em.merge(testRole1);
em.flush();
- Set<Permission> otherMixedPermissions =
EnumSet.of(Permission.CONFIGURE, Permission.MANAGE_INVENTORY,
+ Set<Permission> otherMixedPermissions =
EnumSet.of(Permission.CONFIGURE_WRITE, Permission.MANAGE_INVENTORY,
Permission.MANAGE_SECURITY);
testRole2.getPermissions().addAll(otherMixedPermissions);
em.merge(testRole2);
@@ -283,7 +283,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
em.flush();
/* setup permissions */
- Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE,
Permission.CONTROL,
+ Set<Permission> someMixedPermissions =
EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL,
Permission.MANAGE_SECURITY);
testRole1.getPermissions().addAll(someMixedPermissions);
em.merge(testRole1);
@@ -336,7 +336,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
em.flush();
/* setup permissions */
- Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE,
Permission.CONTROL,
+ Set<Permission> someMixedPermissions =
EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL,
Permission.MANAGE_SECURITY);
testRole1.getPermissions().addAll(someMixedPermissions);
em.merge(testRole1);
@@ -394,13 +394,10 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test
{
List<Integer> resourceIds = Arrays.asList(r1.getId(), r2.getId());
- assertTrue(
- "The subject should have permission to view the resources",
- authorizationManager.canViewResources(subject, resourceIds)
- );
+ assertTrue("The subject should have permission to view the
resources", authorizationManager
+ .canViewResources(subject, resourceIds));
- }
- finally {
+ } finally {
getTransactionManager().rollback();
}
}
@@ -431,10 +428,8 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
assertTrue(
"The subject should have permission to view the resources in
different groups since the subject is in roles for those groups",
- authorizationManager.canViewResources(subject, resourceIds)
- );
- }
- finally {
+ authorizationManager.canViewResources(subject, resourceIds));
+ } finally {
getTransactionManager().rollback();
}
}
@@ -461,13 +456,10 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test
{
List<Integer> resourceIds = Arrays.asList(r1.getId(), r2.getId());
- assertFalse(
- "The subject should not have permission to view the
resources",
- authorizationManager.canViewResources(subjectNotInRole, resourceIds)
- );
+ assertFalse("The subject should not have permission to view the
resources", authorizationManager
+ .canViewResources(subjectNotInRole, resourceIds));
- }
- finally {
+ } finally {
getTransactionManager().rollback();
}
}
@@ -542,7 +534,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
em.flush();
/* setup permissions */
- Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE);
+ Set<Permission> somePermissions =
EnumSet.of(Permission.CONFIGURE_WRITE);
Set<Permission> otherPermissions = EnumSet.of(Permission.CONTROL);
testRole1.getPermissions().addAll(somePermissions);
testRole2.getPermissions().addAll(otherPermissions);
@@ -739,7 +731,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
em.flush();
/* setup permissions */
- Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE,
Permission.CONTROL,
+ Set<Permission> somePermissions =
EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL,
Permission.MANAGE_INVENTORY);
Set<Permission> otherPermissions = EnumSet.of(Permission.CONTROL,
Permission.MANAGE_SECURITY,
Permission.MANAGE_INVENTORY);
commit 4d7a0dc85dfc350dd1a45a0b7371319fb75cb2de
Merge: 7f76427... f08e735...
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Sun Jul 18 20:50:52 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 3e720b2bab8c4752c4b3585138b32a0396063edc
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 17 15:12:17 2010 -0400
BZ-615245: only set the sender columns to NON-NULL after the
CustomAlertSenderUpgradeTask completes
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 6cf784d..1cfda87 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2061,7 +2061,6 @@
</schemaSpec>
<schemaSpec version="2.70.1">
<schema-addColumn table="RHQ_ALERT_NOTIFICATION"
column="SENDER_NAME" precision="100" columnType="VARCHAR2"
/>
- <schema-alterColumn table="RHQ_ALERT_NOTIFICATION"
column="SENDER_NAME" nullable="FALSE" />
<schema-addColumn table="RHQ_ALERT_NOTIFICATION"
column="SENDER_CONFIG_ID" columnType="INTEGER" />
<schema-addColumn table="RHQ_ALERT_NOTIFICATION"
column="EXTRA_CONFIG_ID" columnType="INTEGER" />
<schema-directSQL>
@@ -2083,7 +2082,6 @@
</schemaSpec>
<schemaSpec version="2.70.2">
<schema-addColumn table="RHQ_ALERT_NOTIF_LOG"
column="SENDER" columnType="VARCHAR2" precision="100" />
- <schema-alterColumn table="RHQ_ALERT_NOTIF_LOG"
column="SENDER" nullable="FALSE" />
<schema-addColumn table="RHQ_ALERT_NOTIF_LOG"
column="RESULT_STATE" columnType="VARCHAR2" precision="20"
/>
<schema-addColumn table="RHQ_ALERT_NOTIF_LOG"
column="MESSAGE" columnType="VARCHAR2" precision="4000"
/>
</schemaSpec>
@@ -2128,6 +2126,11 @@
</statement>
</schema-directSQL>
</schemaSpec>
+ <schemaSpec version="2.70.8">
+ <!-- only set the sender columns to NON-NULL after the
CustomAlertSenderUpgradeTask completes -->
+ <schema-alterColumn table="RHQ_ALERT_NOTIFICATION"
column="SENDER_NAME" nullable="FALSE" />
+ <schema-alterColumn table="RHQ_ALERT_NOTIF_LOG"
column="SENDER" nullable="FALSE" />
+ </schemaSpec>
<!-- RHQ Advisory Representation -->
<schemaSpec version="2.71">
commit 99b4ba233eb532f3982c29710043884eca1ae22d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 17 10:16:09 2010 -0400
BZ-615619: properly activate the saved search when selected from the suggestions
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index c14127b..5ac3651 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -64,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
+import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers,
HasValue<String>,
HasSelectionHandlers<Suggestion> {
@@ -697,7 +698,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
protected void complete(Suggestion suggestion, int cursorPosition) {
SearchSuggestion searchSuggestion = extraSearchSuggestion(suggestion);
- String completion = suggestion.getReplacementString();
String currentText = getText().toLowerCase();
if (searchBar.welcomeMessage.equals(currentText)) {
@@ -705,35 +705,40 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
return;
}
- int previousWhitespaceIndex = cursorPosition;
- if (cursorPosition != 0) {
- while (--previousWhitespaceIndex > 0) {
- if (currentText.charAt(previousWhitespaceIndex) == ' ') {
- previousWhitespaceIndex++; // put index right after found whitespace
- break;
+ if (searchSuggestion.getKind() == SearchSuggestion.Kind.GlobalSavedSearch
+ || searchSuggestion.getKind() == SearchSuggestion.Kind.UserSavedSearch) {
+ // execute saved searches immediately, since they presumably constitute
complete expressions
+ SearchLogger.debug("selected '" + searchSuggestion.getLabel() +
"' saved search suggestion");
+ searchBar.activateSavedSearch(searchSuggestion.getValue());
+ } else {
+ // selecting a simple suggestion or advanced suggestion
+
+ int previousWhitespaceIndex = cursorPosition;
+ if (cursorPosition != 0) {
+ while (--previousWhitespaceIndex > 0) {
+ if (currentText.charAt(previousWhitespaceIndex) == ' ') {
+ previousWhitespaceIndex++; // put index right after found
whitespace
+ break;
+ }
}
}
- }
- int futureWhitespaceIndex = cursorPosition;
- while (futureWhitespaceIndex < currentText.length()) {
- if (currentText.charAt(futureWhitespaceIndex) == ' ') {
- break;
+ int futureWhitespaceIndex = cursorPosition;
+ while (futureWhitespaceIndex < currentText.length()) {
+ if (currentText.charAt(futureWhitespaceIndex) == ' ') {
+ break;
+ }
+ futureWhitespaceIndex++;
}
- futureWhitespaceIndex++;
- }
- String before = getText().substring(0, previousWhitespaceIndex);
- String after = getText().substring(futureWhitespaceIndex);
- setValue(before + completion + after, true);
- currentCursorPosition = before.length() + completion.length();
- getTextBox().setCursorPos(currentCursorPosition);
+ String before = getText().substring(0, previousWhitespaceIndex);
+ String completion = suggestion.getReplacementString();
+ String after = getText().substring(futureWhitespaceIndex);
+
+ setValue(before + completion + after, true);
+ currentCursorPosition = before.length() + completion.length();
+ getTextBox().setCursorPos(currentCursorPosition);
- if (searchSuggestion.getKind() == SearchSuggestion.Kind.GlobalSavedSearch
- || searchSuggestion.getKind() == SearchSuggestion.Kind.UserSavedSearch) {
- // execute saved searches immediately, since they presumably constitute
complete expressions
- searchBar.activateSavedSearch(searchSuggestion.getLabel());
- } else {
showSuggestions();
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 9a7d352..4afb3e7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -588,7 +588,7 @@ public class SearchAssistManager {
if (next.getResultCount() != null) {
label += " (" + next.getResultCount() + ")";
}
- String value = next.getPattern();
+ String value = next.getName();
int index = next.getName().toLowerCase().indexOf(expression);
SearchSuggestion suggestion = new SearchSuggestion(Kind.UserSavedSearch,
label, value, index, expression
.length());
@@ -615,7 +615,10 @@ public class SearchAssistManager {
List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
for (SavedSearch next : savedSearchResults) {
String label = next.getName();
- String value = next.getPattern();
+ if (next.getResultCount() != null) {
+ label += " (" + next.getResultCount() + ")";
+ }
+ String value = next.getName();
int index = next.getName().toLowerCase().indexOf(expression);
SearchSuggestion suggestion = new SearchSuggestion(Kind.GlobalSavedSearch,
label, value, index, expression
.length());
commit fc948cc2c388053a1cba610db8c25a2c949714b9
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 17 09:19:20 2010 -0400
BZ-615351: respect user's authorization when display suggestions
* only suggest resource-configuration property names for those resources which the
logged in user has CONFIGURE permission on
* only return resource results whose configuration-specific search terms respect the
aforementioned rule
-----
In order to make the query-translation routines aware of authorization,
the logged in user had to be passed to the concrete implementer of
AbstractSearchTranslator. Since the translator is an implementation
detail hidden behind the CriteriaQueryGenerator, the logged in user thus
had to be passed to the generator as well. In the future, when more
subsystems implement the search interfaces, they will automatically have
this additional contextual data available to them for advanced authz-based
filtering of suggestions and/or results.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
index a48cd85..0a2f201 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
@@ -682,7 +682,7 @@ public class AlertDefinitionManagerBean implements
AlertDefinitionManagerLocal,
@SuppressWarnings("unchecked")
public PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject
subject, AlertDefinitionCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
subject
.getId());
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
index 108e2d5..b4454ed 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
@@ -1015,7 +1015,7 @@ public class AlertManagerBean implements AlertManagerLocal,
AlertManagerRemote {
@SuppressWarnings("unchecked")
public PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria
criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
if (!authorizationManager.isInventoryManager(subject)) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
"alertDefinition.resource", subject.getId());
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
index 17be000..4e1a53d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
@@ -636,7 +636,8 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
@SuppressWarnings("unchecked")
public PageList<Subject> findSubjectsByCriteria(Subject subject,
SubjectCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<Subject> queryRunner = new
CriteriaQueryRunner(criteria, generator, entityManager);
return queryRunner.execute();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
index 30feae3..bcf6daf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
@@ -587,7 +587,8 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
+ "] requires SecurityManager permission for requested query
criteria.");
}
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<Role> queryRunner = new CriteriaQueryRunner(criteria,
generator, entityManager);
return queryRunner.execute();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
index 5cf8205..e6fc90c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
@@ -1131,7 +1131,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
public PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject
subject, BundleDeploymentCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<BundleDeployment> queryRunner = new
CriteriaQueryRunner<BundleDeployment>(criteria,
generator, entityManager);
@@ -1140,7 +1141,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject
subject,
BundleDestinationCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<BundleDestination> queryRunner = new
CriteriaQueryRunner<BundleDestination>(criteria,
generator, entityManager);
@@ -1150,7 +1152,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
public PageList<BundleResourceDeployment>
findBundleResourceDeploymentsByCriteria(Subject subject,
BundleResourceDeploymentCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (!authorizationManager.isInventoryManager(subject)) {
if (criteria.isInventoryManagerRequired()) {
// TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could
not then
@@ -1171,7 +1174,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
}
public PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject,
BundleVersionCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<BundleVersion> queryRunner = new
CriteriaQueryRunner<BundleVersion>(criteria, generator,
entityManager);
@@ -1179,7 +1183,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
}
public PageList<BundleFile> findBundleFilesByCriteria(Subject subject,
BundleFileCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<BundleFile> queryRunner = new
CriteriaQueryRunner<BundleFile>(criteria, generator,
entityManager);
@@ -1187,7 +1192,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
}
public PageList<Bundle> findBundlesByCriteria(Subject subject, BundleCriteria
criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<Bundle> queryRunner = new
CriteriaQueryRunner<Bundle>(criteria, generator, entityManager);
return queryRunner.execute();
@@ -1196,7 +1202,7 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
public PageList<BundleWithLatestVersionComposite>
findBundlesWithLatestVersionCompositesByCriteria(Subject subject,
BundleCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
String replacementSelectList = ""
+ " new
org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite( "
+ " bundle.id,"
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
index 2c01712..e24663d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java
@@ -1445,7 +1445,8 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
@SuppressWarnings("unchecked")
public PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject
subject, InstalledPackageCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (!authorizationManager.isInventoryManager(subject)) {
// Ensure we limit to packages installed to viewable resources
@@ -1473,7 +1474,8 @@ public class ContentManagerBean implements ContentManagerLocal,
ContentManagerRe
}
}
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<PackageVersion> queryRunner = new
CriteriaQueryRunner(criteria, generator, entityManager);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
index 740a6d8..7492655 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
@@ -589,7 +589,8 @@ public class RepoManagerBean implements RepoManagerLocal,
RepoManagerRemote {
RepoContentSource repoContentSourceMapping =
repo.addContentSource(contentSource);
entityManager.persist(repoContentSourceMapping);
}
- Set<PackageVersion> alreadyAssociatedPackageVersions = new
HashSet<PackageVersion>(repo.getPackageVersions());
+ Set<PackageVersion> alreadyAssociatedPackageVersions = new
HashSet<PackageVersion>(repo
+ .getPackageVersions());
// Automatically associate all of the content source's package versions
with this repo,
// but *skip* over the ones that are already linked to this repo from a
previous association.
@@ -767,7 +768,8 @@ public class RepoManagerBean implements RepoManagerLocal,
RepoManagerRemote {
@SuppressWarnings("unchecked")
@RequiredPermission(Permission.MANAGE_INVENTORY)
public PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria
criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<Repo> queryRunner = new CriteriaQueryRunner(criteria,
generator, entityManager);
return queryRunner.execute();
@@ -782,7 +784,8 @@ public class RepoManagerBean implements RepoManagerLocal,
RepoManagerRemote {
throw new IllegalArgumentException("Illegal filterResourceId: " +
repoId);
}
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<PackageVersion> queryRunner = new
CriteriaQueryRunner(criteria, generator, entityManager);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
index 8f89095..443625f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
@@ -317,7 +317,8 @@ public class EventManagerBean implements EventManagerLocal,
EventManagerRemote {
* where N is the number of events between 'begin' and 'end'. if
the severity buckets are computed in a single
* query, the wire load would only be K integers, where K is the bucketCount.
*/
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
String replacementSelectList = " event.severity, event.timestamp ";
generator.alterProjection(replacementSelectList);
@@ -395,7 +396,8 @@ public class EventManagerBean implements EventManagerLocal,
EventManagerRemote {
}
public PageList<EventComposite> findEventCompositesByCriteria(Subject subject,
EventCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
String replacementSelectList = "" //
+ " new org.rhq.core.domain.event.composite.EventComposite( " //
+ " event.detail," //
@@ -422,7 +424,8 @@ public class EventManagerBean implements EventManagerLocal,
EventManagerRemote {
@SuppressWarnings("unchecked")
public PageList<Event> findEventsByCriteria(Subject subject, EventCriteria
criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
"source.resource", subject.getId());
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
index 08f3418..770ae6e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
@@ -212,7 +212,8 @@ public class CallTimeDataManagerBean implements
CallTimeDataManagerLocal, CallTi
criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId);
}
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
String replacementSelectList = "" //
+ " new org.rhq.core.domain.measurement.calltime.CallTimeDataComposite(
" //
+ " calltimedatavalue.key.callDestination, " //
@@ -411,10 +412,10 @@ public class CallTimeDataManagerBean implements
CallTimeDataManagerLocal, CallTi
notifyAlertConditionCacheManager("insertCallTimeDataValues",
callTimeDataSet
.toArray(new CallTimeData[callTimeDataSet.size()]));
- if (insertedRowCount>0) {
+ if (insertedRowCount > 0) {
MeasurementMonitor.getMBean().incrementCalltimeValuesInserted(insertedRowCount);
- log.debug("Inserted " + insertedRowCount + " call-time
data value rows.");
+ log.debug("Inserted " + insertedRowCount + " call-time
data value rows.");
}
} catch (SQLException e) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java
index f7fddc7..8a21886 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java
@@ -137,7 +137,8 @@ public class MeasurementDefinitionManagerBean implements
MeasurementDefinitionMa
@SuppressWarnings("unchecked")
public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(Subject subject,
MeasurementDefinitionCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<MeasurementDefinition> queryRunner = new
CriteriaQueryRunner(criteria, generator,
entityManager);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
index dc1395e..bebf8a4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
@@ -651,6 +651,7 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
try {
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ ;
generator.alterProjection("resource.id");
String resourceSubQuery = generator.getParameterReplacedQuery(false);
@@ -705,7 +706,8 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
}
criteria.addFilterDefinitionIds(ArrayUtils.wrapInArray(measurementDefinitionIds));
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
generator.alterProjection("measurementschedule.id");
String measurementScheduleSubQuery = generator.getParameterReplacedQuery(false);
@@ -1211,7 +1213,8 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
criteria.setPageControl(pc); // for primary return list, use passed PageControl
// get the core definitions
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
generator.alterProjection(" distinct measurementschedule.definition
");
CriteriaQueryRunner<MeasurementDefinition> queryRunner = new
CriteriaQueryRunner(criteria, generator,
entityManager);
@@ -1296,7 +1299,8 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
@SuppressWarnings("unchecked")
public PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject,
MeasurementScheduleCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
subject
.getId());
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 d47601b..022811b 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
@@ -1789,7 +1789,8 @@ public class OperationManagerBean implements OperationManagerLocal,
OperationMan
@SuppressWarnings("unchecked")
public List<OperationDefinition> findOperationDefinitionsByCriteria(Subject
subject,
OperationDefinitionCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<OperationDefinition> queryRunner = new
CriteriaQueryRunner(criteria, generator,
entityManager);
@@ -1799,7 +1800,8 @@ public class OperationManagerBean implements OperationManagerLocal,
OperationMan
@SuppressWarnings("unchecked")
public PageList<ResourceOperationHistory>
findResourceOperationHistoriesByCriteria(Subject subject,
ResourceOperationHistoryCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
subject
.getId());
@@ -1813,7 +1815,8 @@ public class OperationManagerBean implements OperationManagerLocal,
OperationMan
@SuppressWarnings("unchecked")
public PageList<GroupOperationHistory>
findGroupOperationHistoriesByCriteria(Subject subject,
GroupOperationHistoryCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP,
subject
.getId());
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 be85557..a40368a 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
@@ -2067,7 +2067,8 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
@SuppressWarnings("unchecked")
public PageList<Resource> findResourcesByCriteria(Subject subject,
ResourceCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
if (criteria.isInventoryManagerRequired()) {
throw new PermissionException("Subject [" + subject.getName()
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
index 7937f4d..7589096 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
@@ -420,7 +420,8 @@ public class ResourceTypeManagerBean implements
ResourceTypeManagerLocal, Resour
@SuppressWarnings("unchecked")
public PageList<ResourceType> findResourceTypesByCriteria(Subject subject,
ResourceTypeCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<ResourceType> queryRunner = new
CriteriaQueryRunner(criteria, generator, entityManager);
return queryRunner.execute();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index 8e33ca1..e291c25 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -992,7 +992,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
*/
public PageList<ResourceGroupComposite>
findResourceGroupCompositesByCriteria(Subject subject,
ResourceGroupCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
String replacementSelectList = ""
+ " new
org.rhq.core.domain.resource.group.composite.ResourceGroupComposite( "
+ " ( SELECT COUNT(avail) FROM resourcegroup.explicitResources res
JOIN res.currentAvailability avail ) AS explicitCount,"
@@ -1398,7 +1399,8 @@ public class ResourceGroupManagerBean implements
ResourceGroupManagerLocal, Reso
@SuppressWarnings("unchecked")
public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
ResourceGroupCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (criteria.isSecurityManagerRequired()
&& !authorizationManager.hasGlobalPermission(subject,
Permission.MANAGE_SECURITY)) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
index 5570738..905688b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
@@ -407,7 +407,8 @@ public class GroupDefinitionManagerBean implements
GroupDefinitionManagerLocal {
public PageList<GroupDefinition> findGroupDefinitionsByCriteria(Subject
subject,
ResourceGroupDefinitionCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (authorizationManager.isInventoryManager(subject) == false) {
if (criteria.isInventoryManagerRequired()) {
throw new PermissionException("Subject [" + subject.getName()
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
index c8cf5f4..d08fefb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
@@ -85,7 +85,8 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal
/* local
}
public PageList<SavedSearch> findSavedSearchesByCriteria(Subject subject,
SavedSearchCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
if (!authorizationManager.isInventoryManager(subject)) {
generator.setAuthorizationCustomConditionFragment("(subject.id=" +
subject.getId() + " OR global=true)");
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 95295d0..f315405 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -83,7 +83,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ conditionallyAddJPQLString("definition.name", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
- + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ + conditionallyAddAuthzFragment(getConfigAuthzFragment()) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -174,7 +174,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ conditionallyAddJPQLString("property.name", param) //
+ conditionallyAddJPQLString("property.stringValue", filter)
//
+ conditionallyAddJPQLString("res.resourceType.category", tab)
//
- + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ + conditionallyAddAuthzFragment(getConfigAuthzFragment()) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -196,6 +196,18 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
}
}
+ private String getConfigAuthzFragment() {
+ return "res.id IN " //
+ + "(SELECT ires.id " //
+ + " FROM Resource ires " //
+ + " JOIN ires.implicitGroups igroup " //
+ + " JOIN igroup.roles irole " //
+ + " JOIN irole.subjects isubject " //
+ + " JOIN irole.permissions iperm " //
+ + " WHERE isubject.id = " + getSubjectId() //
+ + " AND iperm = 11)";
+ }
+
private String getAuthzFragment() {
return "res.id IN " //
+ "(SELECT ires.id " //
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
index 855d89d..04a1e32 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
@@ -9,6 +9,7 @@ import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.Token;
import org.antlr.runtime.tree.CommonTree;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.server.search.RHQLLexer;
import org.rhq.enterprise.server.search.RHQLParser;
@@ -24,7 +25,6 @@ import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLTreeOperator;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragment;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
-import org.rhq.enterprise.server.util.LookupUtil;
public class SearchTranslationManager {
@@ -40,7 +40,10 @@ public class SearchTranslationManager {
private String entity;
private String alias;
- public SearchTranslationManager(SearchSubsystem context) {
+ private Subject subject;
+
+ public SearchTranslationManager(Subject subject, SearchSubsystem context) {
+ this.subject = subject;
this.context = context;
this.entity = this.context.getEntityClass().getSimpleName();
this.alias = this.entity.toLowerCase();
@@ -54,9 +57,8 @@ public class SearchTranslationManager {
}
this.expression = expression;
- this.translator = SearchTranslatorFactory.getTranslator(this.context);
- this.assistant = SearchAssistantFactory
- .getAssistant(LookupUtil.getSubjectManager().getOverlord(), this.context);
+ this.translator = SearchTranslatorFactory.getTranslator(subject, this.context);
+ this.assistant = SearchAssistantFactory.getAssistant(subject, this.context);
ANTLRStringStream input = new ANTLRStringStream(this.expression); // Create an
input character stream from standard in
this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that
stream
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 79f14ee..54ccae2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,9 +1,35 @@
package org.rhq.enterprise.server.search.translation;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
+import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchTranslator implements SearchTranslator {
+ private int subjectId;
+ private boolean requiresAuthorizationFragment;
+
+ public AbstractSearchTranslator(Subject subject) {
+ this.subjectId = subject.getId();
+ this.requiresAuthorizationFragment =
!LookupUtil.getAuthorizationManager().isInventoryManager(subject);
+ }
+
+ public int getSubjectId() {
+ return subjectId;
+ }
+
+ public boolean requiresAuthorizationFragment() {
+ return requiresAuthorizationFragment;
+ }
+
+ protected final String conditionallyAddAuthzFragment(String fragment) {
+ if (requiresAuthorizationFragment == false) {
+ return "";
+ }
+
+ return " AND " + fragment;
+ }
+
protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator,
String value,
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
index 0a2e0f1..781e581 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
@@ -2,6 +2,7 @@ package org.rhq.enterprise.server.search.translation;
import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
@@ -10,6 +11,10 @@ import
org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
public class GroupSearchTranslator extends AbstractSearchTranslator {
+ public GroupSearchTranslator(Subject subject) {
+ super(subject);
+ }
+
public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) {
String path = term.getPath();
RHQLComparisonOperator op = term.getOperator();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index dfe53ec..bece19d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -3,6 +3,7 @@ package org.rhq.enterprise.server.search.translation;
import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
@@ -13,6 +14,10 @@ import
org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
public class ResourceSearchTranslator extends AbstractSearchTranslator {
+ public ResourceSearchTranslator(Subject subject) {
+ super(subject);
+ }
+
public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) {
String path = term.getPath();
RHQLComparisonOperator op = term.getOperator();
@@ -73,6 +78,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
+ + " AND " +
conditionallyAddAuthzFragment(getConfigAuthzFragment()) //
+ " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
@@ -96,4 +102,17 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
}
}
}
+
+ private String getConfigAuthzFragment() {
+ return "res.id IN " //
+ + "(SELECT ires.id " //
+ + " FROM Resource ires " //
+ + " JOIN ires.implicitGroups igroup " //
+ + " JOIN igroup.roles irole " //
+ + " JOIN irole.subjects isubject " //
+ + " JOIN irole.permissions iperm " //
+ + " WHERE isubject.id = " + getSubjectId() //
+ + " AND iperm = 11)";
+ }
+
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java
index 10ad8f5..16661c1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java
@@ -1,5 +1,6 @@
package org.rhq.enterprise.server.search.translation;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.search.SearchSubsystem;
public class SearchTranslatorFactory {
@@ -7,11 +8,11 @@ public class SearchTranslatorFactory {
// force use of static methods only
}
- public static SearchTranslator getTranslator(SearchSubsystem searchContext) {
+ public static SearchTranslator getTranslator(Subject subject, SearchSubsystem
searchContext) {
if (searchContext == SearchSubsystem.RESOURCE) {
- return new ResourceSearchTranslator();
+ return new ResourceSearchTranslator(subject);
} else if (searchContext == SearchSubsystem.GROUP) {
- return new GroupSearchTranslator();
+ return new GroupSearchTranslator(subject);
}
throw new IllegalArgumentException("No SearchTranslator found for
SearchContext[" + searchContext + "]");
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java
index c432e2e..a66166f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java
@@ -68,17 +68,16 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
@EJB
private AuthorizationManagerLocal authorizationManager;
-
public PageList<Tag> findTagsByCriteria(Subject subject, TagCriteria criteria)
{
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject,
criteria);
+ ;
CriteriaQueryRunner<Tag> queryRunner = new
CriteriaQueryRunner<Tag>(criteria, generator, entityManager);
return queryRunner.execute();
}
-
public Set<Tag> addTags(Subject subject, Set<Tag> tags) {
Set<Tag> results = new HashSet<Tag>();
@@ -108,7 +107,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
}
}
-
public void updateResourceTags(Subject subject, int resourceId, Set<Tag> tags)
{
if (!authorizationManager.hasResourcePermission(subject,
Permission.MODIFY_RESOURCE, resourceId)) {
throw new PermissionException("You do not have permission to modify
resource");
@@ -123,8 +121,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
tag.removeResource(resource);
}
-
-
for (Tag tag : definedTags) {
tag.addResource(resource);
}
@@ -144,7 +140,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
tag.removeResourceGroup(group);
}
-
for (Tag tag : definedTags) {
tag.addResourceGroup(group);
}
@@ -163,7 +158,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
tag.removeBundle(bundle);
}
-
for (Tag tag : definedTags) {
tag.addBundle(bundle);
}
@@ -182,7 +176,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
tag.removeBundleVersion(bundleVersion);
}
-
for (Tag tag : definedTags) {
tag.addBundleVersion(bundleVersion);
}
@@ -206,8 +199,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
}
}
-
-
@RequiredPermission(Permission.MANAGE_INVENTORY)
// todo verify
public void updateBundleDestinationTags(Subject subject, int bundleDestinationId,
Set<Tag> tags) {
@@ -226,7 +217,6 @@ public class TagManagerBean implements TagManagerLocal,
TagManagerRemote {
}
}
-
public PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject
subject, TagCriteria tagCriteria) {
// TODO criteria stuff
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 a1b809f..78885b0 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
@@ -37,6 +37,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.annotations.IndexColumn;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.criteria.Criteria;
@@ -72,6 +73,7 @@ public final class CriteriaQueryGenerator {
private Criteria criteria;
private String searchExpressionWhereClause;
+ private Subject subject;
private String authorizationJoinFragment;
private String authorizationPermsFragment;
private String authorizationCustomConditionFragment;
@@ -95,6 +97,11 @@ public final class CriteriaQueryGenerator {
}
public CriteriaQueryGenerator(Criteria criteria) {
+ this(LookupUtil.getSubjectManager().getOverlord(), criteria);
+ }
+
+ public CriteriaQueryGenerator(Subject subject, Criteria criteria) {
+ this.subject = subject;
this.criteria = criteria;
this.className = criteria.getPersistentClass().getSimpleName();
this.alias = this.criteria.getAlias();
@@ -525,7 +532,8 @@ public final class CriteriaQueryGenerator {
try {
Class<?> entityClass = criteria.getPersistentClass();
- SearchTranslationManager searchManager = new
SearchTranslationManager(SearchSubsystem.get(entityClass));
+ SearchTranslationManager searchManager = new
SearchTranslationManager(subject, SearchSubsystem
+ .get(entityClass));
searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling
'AND' to the where clause
@@ -694,7 +702,8 @@ public final class CriteriaQueryGenerator {
subjectCriteria.fetchRoles(true);
subjectCriteria.addSortName(PageOrdering.ASC);
- CriteriaQueryGenerator subjectGenerator = new
CriteriaQueryGenerator(subjectCriteria);
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ CriteriaQueryGenerator subjectGenerator = new CriteriaQueryGenerator(overlord,
subjectCriteria);
System.out.println(subjectGenerator.getQueryString(false));
System.out.println(subjectGenerator.getQueryString(true));
}
@@ -713,7 +722,8 @@ public final class CriteriaQueryGenerator {
alertCriteria.setFiltersOptional(true);
//alertCriteria.setCaseSensitive(false);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(alertCriteria);
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord,
alertCriteria);
System.out.println(generator.getQueryString(false));
System.out.println(generator.getQueryString(true));
@@ -727,7 +737,8 @@ public final class CriteriaQueryGenerator {
historyCriteria.addFilterResourceIds(1);
historyCriteria.addFilterStatus(OperationRequestStatus.FAILURE);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(historyCriteria);
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord,
historyCriteria);
System.out.println(generator.getQueryString(false));
System.out.println(generator.getQueryString(true));
}
@@ -741,7 +752,8 @@ public final class CriteriaQueryGenerator {
resourceCriteria.setCaseSensitive(true);
resourceCriteria.setFiltersOptional(true);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(resourceCriteria);
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord,
resourceCriteria);
generator.getQueryString(false);
generator.getQueryString(true);
}
commit 7f7642718af571e381c9812adb26d67db2680f50
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Fri Jul 16 22:45:04 2010 +0200
Put translations directly in the questions file. This makes it easier to stay
consistent and also to only have partial questions translated.
diff --git
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
index e47da34..649cbf5 100644
---
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
+++
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
@@ -71,12 +71,7 @@ public class XmlQuestionsReader {
DocumentBuilder builder = factory.newDocumentBuilder();
Class<? extends XmlQuestionsReader> clazz = getClass();
String lang = Locale.getDefault().getLanguage();
- InputStream input = clazz.getResourceAsStream("/"+baseName +
"_" + lang + ".xml");
- if (input==null) {
- log.debug("No localized version of " + baseName + " found,
locale=" + lang);
- log.debug("Now trying " + baseName);
- input = clazz.getResourceAsStream("/"+baseName +".xml"
);
- }
+ InputStream input = clazz.getResourceAsStream("/"+baseName
+".xml" );
if (input == null) {
throw new FileNotFoundException("Input file [" + baseName + "]
not found");
}
@@ -99,16 +94,16 @@ public class XmlQuestionsReader {
System.err.println("Type " + type + " is invalid in
" + question );
return;
}
- Element text = (Element)
question.getElementsByTagName("text").item(0);
+ Element text = getElementForLang(question,"text",lang);
NodeList prefillNodes =
question.getElementsByTagName("prefill");
String prefill = null;
if (prefillNodes.getLength()>0) {
prefill = prefillNodes.item(0).getTextContent();
}
- NodeList helpNodes = question.getElementsByTagName("help");
+ Element helpNode = getElementForLang(question,"help",lang);
String help = null;
- if (helpNodes.getLength()>0) {
- help = helpNodes.item(0).getTextContent();
+ if (helpNode!=null) {
+ help = helpNode.getTextContent();
}
boolean isBool = false;
@@ -178,6 +173,35 @@ public class XmlQuestionsReader {
}
/**
+ * Search for an element <i>tagWanted</i> within parent. If multiple
+ * elements are present, use the one with the matching <i>lang</i>.
+ * If no matching element is present, use one without a <i>lang</i>
+ * attribute
+ * @param parent containing element
+ * @param tagWanted the tag to search for
+ * @param lang the desired language version
+ * @return an element or null if not found
+ */
+ Element getElementForLang(Element parent, String tagWanted, String lang) {
+ NodeList elements = parent.getElementsByTagName(tagWanted);
+ if (elements==null || elements.getLength()==0)
+ return null;
+
+ Element noLang = (Element) elements.item(0);
+
+ for (int i = 0; i < elements.getLength(); i++) {
+ Element ele = (Element) elements.item(i);
+ String attr = ele.getAttribute("lang");
+ if (attr==null || attr.isEmpty()) {
+ noLang = ele;
+ }
+ else if (attr.equals(lang)) {
+ return ele;
+ }
+ }
+ return noLang;
+ }
+ /**
* Returns true if the passed type is a valid data type of the properties (not for a
single
* property).
* @param type A type as string
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
index 94b5c14..2dcb856 100644
--- a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
+++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
@@ -1,28 +1,35 @@
<?xml version="1.0" ?>
-<!-- DOCTYPE questions SYSTEM "questions.dtd"-->
+<!-- DOCTYPE questions SYSTEM "questions.dtd" -->
<questions>
<question prop="project">
<text>Please give the project name</text>
+ <text lang="de">Bitte geben Sie den Projektnamen an</text>
<prefill>myProject</prefill>
</question>
<question prop="bundleName">
<text>Please give the bundle name</text>
+ <text lang="de">Bitte geben Sie den Namen des Bundles
an</text>
</question>
<question prop="bundleVersion">
<text>Please specify the bundle version</text>
+ <text lang="de">Bite spezifizieren Sie die Version des
Bundles</text>
<prefill>1.0</prefill>
</question>
<question prop="bundleDescription">
<text>Please describe your bundle</text>
+ <text lang="de">Bitte beschreiben Sie Ihr Bundle</text>
</question>
<question prop="bundleFile">
<text>Please give the name (only) of your bundle content file</text>
+ <text lang="de">Bitte geben Sie (nur) den Namen der Datei mit dem
Bundle-Inhalt an.</text>
</question>
<question prop="contentDir">
<text>Please give the directory (only) of your bundle content
file</text>
+ <text lang="de">Bitte geben Sie (nur) das Verzeichnis mit der
Datei mit dem Bundle-Inhalt an.</text>
</question>
<question prop="replacePattern">
<text>Please give a patten of files to replace templates</text>
+ <text lang="de">Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen
an</text>
<help>E.g. *.jsp</help>
</question>
</questions>
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
deleted file mode 100644
index 41deb9c..0000000
--- a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" ?>
-<!-- DOCTYPE questions SYSTEM "questions.dtd"-->
-<questions>
- <question prop="project">
- <text>Bitte geben Sie den Projektnamen an</text>
- <prefill>myProject</prefill>
- </question>
- <question prop="bundleName">
- <text>Bitte geben Sie den Namen des Bundles an</text>
- </question>
- <question prop="bundleVersion">
- <text>Bite spezifizieren Sie die Version des Bundles</text>
- <prefill>1.0</prefill>
- </question>
- <question prop="bundleDescription">
- <text>Bitte beschreiben Sie Ihr Bundle</text>
- </question>
- <question prop="bundleFile">
- <text>Bitte geben Sie (nur) den Namen der Datei mit dem Bundle-Inhalt
an.</text>
- </question>
- <question prop="contentDir">
- <text>Bitte geben Sie (nur) das Verzeichnis mit der Datei mit dem
Bundle-Inhalt an.</text>
- </question>
- <question prop="replacePattern">
- <text>Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen an</text>
- <help>Z.B. *.jsp</help>
- </question>
-</questions>
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd
b/modules/helpers/bundleGen/src/main/resources/questions.dtd
index aa6ad32..ed3981a 100644
--- a/modules/helpers/bundleGen/src/main/resources/questions.dtd
+++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd
@@ -3,7 +3,7 @@
<!ELEMENT questions (question+)>
<!-- one single question -->
-<!ELEMENT question (text, options?, prefill?, help?)>
+<!ELEMENT question (text+, options?, prefill?, help*)>
<!ATTLIST question
prop CDATA #REQUIRED
@@ -17,6 +17,10 @@
<!-- The text to ask -->
<!ELEMENT text (#PCDATA)>
+<!ATTLIST text
+ lang (en|fr|pt|de|es) #IMPLIED
+>
+
<!-- The expected return type -->
<!ELEMENT type (#PCDATA)>
@@ -30,7 +34,10 @@
<!ELEMENT prefill (#PCDATA)>
<!-- A help text for this specific question that
- gives more infomation about the feateure.
+ gives more information about the feature.
Can span multiple lines -->
<!ELEMENT help (#PCDATA)>
+<!ATTLIST text
+ lang (en|fr|pt|de|es) #IMPLIED
+>
commit f08e73541ffdd6412e636ce3ad0adcee77543fa0
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 16:15:26 2010 -0400
Seriously remove hard-coded user.agent from master... really need to make this a build
property
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 14ca590..a3db099 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -38,7 +38,7 @@
<!-- limit builds to your preferred browser -->
<!-- Safari -->
- <set-property name="user.agent" value="safari"/>
+ <!-- <set-property name="user.agent" value="safari"/>
-->
<!-- Firefox 3 -->
<!--<set-property name="user.agent"
value="gecko1_8"/>-->
commit 1bc7e54d2ea1c2a0bfb4381929f70ba63b8a8d7d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 10:43:44 2010 -0400
user must be able to view resource in order to see plugin configuration
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 2e6198d..c0add68 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
@@ -886,6 +886,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int
configurationUpdateId) {
PluginConfigurationUpdate update =
entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
+ if (!authorizationManager.canViewResource(subject, update.getResource().getId()))
{
+ throw new PermissionException("User [" + subject.getName()
+ + "] does not have permission to view plugin configuration update
for [" + update.getResource() + "]");
+ }
+
update.getConfiguration(); // this is EAGER loaded, so this really doesn't do
anything
return update;
commit 1020ac708d39a850b562952bc986a291fff03c1e
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Fri Jul 16 16:18:53 2010 +0200
Apache Unit tests update.
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
new file mode 100644
index 0000000..36dd675
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
@@ -0,0 +1,123 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+import java.util.List;
+
+import org.rhq.augeas.AugeasProxy;
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
+import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
+import org.rhq.plugins.apache.util.ApacheConfigurationUtil;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+public class ApacheAugeasTest {
+
+ /**
+ * Tests if all included configuration files were loaded.
+ * @return
+ */
+ public void testFiles(AugeasProxy augeas){
+ System.out.println("Test if all included cofiguration files was discovered
and loaded.");
+ AugeasConfigurationApache config =
(AugeasConfigurationApache)augeas.getConfiguration();
+ List<File> configFiles = config.getAllConfigurationFiles();
+
+ /*
+ * There are three files one main file one which is included from main file and
one which is included from
+ * included file and which is declared in IfModule. All of them must be
discovered.
+ */
+ boolean found=false;
+ for (File confFile : configFiles){
+ found = false;
+ for (String fileName : ApacheTestConstants.CONFIG_FILE_NAMES){
+ if (!confFile.getName().equals(fileName))
+ found= true;
+ }
+ assert found;
+ }
+ }
+ /**
+ * Tests mapping of augeas tree to configuration and back.
+ * @param cont
+ * @throws Exception
+ */
+ public void testMapping(PluginContainer cont){
+ ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil();
+ try{
+ //copy all configuration files to temporary folder
+ String path = apacheUtil.prepareConfigFiles();
+ //loading of augeas from temporary folder
+ AugeasProxy proxy =
apacheUtil.initAugeas(path+File.separator+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path,
path);
+ AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+
+ testLoadConfig(tree, cont);
+ testSaveConfig(cont);
+ apacheUtil.cleanConfigFiles();
+ }catch(Exception e){
+ e.printStackTrace();
+ apacheUtil.cleanConfigFiles();
+ }
+ }
+ /**
+ * Tests mapping of augeas tree to rhq configuration.
+ * @param tree
+ * @param container
+ * @throws Exception
+ */
+ public void testLoadConfig(AugeasTree tree,PluginContainer container)throws Exception{
+ System.out.println("Test mapping of augeas tree to rhq
configuration.");
+ ApacheConfigurationUtil util = new ApacheConfigurationUtil();
+ for (Components component : Components.values()){
+ //get nodes for each component
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ for (int i=0;i<nodes.size();i++){
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ //load configuration for related component and augeas node from
tempfolder
+ Configuration conf =
util.loadConfiguration(ApacheTestConstants.getConfigFilesPathForLoad()+
+
File.separator+component.getComponentName()+String.valueOf(i));
+ assert config.equals(conf);
+ }
+ }
+ }
+
+ /**
+ * Tests mapping of rhq configuration to augeas tree.
+ *
+ * @param container
+ * @throws Exception
+ */
+ public void testSaveConfig(PluginContainer container)throws Exception{
+ System.out.println("Test mapping of rhq configuration to augeas
tree.");
+ ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil();
+ //load augeas tree from temporary folder
+ String path = ApacheTestConstants.getApacheConfigFilesPath();
+ AugeasProxy proxy =
apacheUtil.initAugeas(path+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path);
+ AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+ //load augeas tree from temporary folder "updateconfig"
+ String pathUpdate = ApacheTestConstants.getApacheConfigFilesPathForUpdate();
+ AugeasProxy proxyUpdate =
apacheUtil.initAugeas(pathUpdate+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, pathUpdate,
pathUpdate);
+ AugeasTree treeUpdate =
proxyUpdate.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+
+ for (Components component : Components.values()){
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ ConfigurationDefinition configDef =
ApacheConfigurationUtil.getConfigurationDefinition(container, component);
+
+ for (int i=0;i<nodes.size();i++){
+ //load component from first tree - transfare that tree to
configuration - and update second tree with that configuration
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ AugeasNode updateNode =
AugeasNodeSearch.findNodeById(treeUpdate.getRootNode(), key);
+
+ ApacheAugeasMapping mapping = new ApacheAugeasMapping(treeUpdate);
+ mapping.updateAugeas(updateNode, config, configDef);
+ }
+ }
+ treeUpdate.save();
+ //test if the updated augeas tree can be mapped to configuration stored at
files in "loadconfig" temporary directory
+ testLoadConfig(treeUpdate, container);
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
new file mode 100644
index 0000000..1c2c6a5
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
@@ -0,0 +1,172 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.rhq.augeas.AugeasProxy;
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
+import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache;
+import org.rhq.plugins.apache.helper.LensHelper;
+import org.rhq.plugins.apache.util.ApacheConfigurationUtil;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+public class ApacheAugeasUtil {
+
+ /**
+ * Loads augeas.
+ * @param configFilePath
+ * @param serverRootPath
+ * @param lensPath
+ * @return
+ */
+ public AugeasProxy initAugeas(String configFilePath,String serverRootPath,String
lensPath){
+ Configuration configuration = new Configuration();
+ configuration.put(new
PropertySimple("configurationFilesInclusionPatterns",configFilePath));
+ configuration.put(new PropertySimple("augeasModuleName",
ApacheTestConstants.MODULE_NAME));
+ configuration.put(new
PropertySimple(ApacheTestConstants.PLUGIN_CONFIG_PROP_SERVER_ROOT,serverRootPath));
+
+ AugeasConfigurationApache conf = new
AugeasConfigurationApache(lensPath,configuration);
+ AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache();
+ AugeasProxy augeas = new AugeasProxy(conf,builder);
+
+ augeas.load();
+
+ return augeas;
+ }
+
+ /**
+ * This method will create a new temporary directory and copy there all configuration
files.
+ * @return
+ * @throws UnitTestException
+ */
+ public String prepareConfigFiles() {
+ String tempDirPath=null;
+ try {
+
+ File tempDirectory =
LensHelper.createTempDir(ApacheTestConstants.TEMP_CONFIG_FILE_DIRECTORY);
+ if (!tempDirectory.exists())
+ tempDirectory.createNewFile();
+ //copy the apache configuration files to temp folder
+ tempDirPath = tempDirectory.getAbsolutePath()+File.separatorChar;
+ copyFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory);
+
+ File updateDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER);
+ if (!updateDir.exists()){
+ updateDir.mkdir();
+ updateDir.createNewFile();
+ }
+ //copy the apache configuration files to temp folder "updateconfig"
+ copyFiles(ApacheTestConstants.FILES_TO_LOAD,
ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory);
+
+ File loadDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER);
+ if (!loadDir.exists()){
+ loadDir.mkdir();
+ loadDir.createNewFile();
+ }
+ //copy xml files with rhq configuration to loadconfig
+ for(Components component : Components.values()){
+ copyFiles(component.getConfigurationFiles().toArray(new String[0]),
ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory);
+ }
+
+ ApacheTestConstants.TEMP_FILES_PATH=tempDirectory.getAbsolutePath();
+
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ return tempDirPath;
+ }
+
+ public void cleanConfigFiles(){
+ try {
+
+ File tempDirectory = new File(ApacheTestConstants.getApacheConfigFilesPath());
+ if (!tempDirectory.exists())
+ return;
+
+ deleteFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory);
+
+ File updateDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER);
+ if (updateDir.exists()){
+ deleteFiles(ApacheTestConstants.FILES_TO_LOAD,
ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory);
+ updateDir.delete();
+ }
+ File loadDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER);
+ if (loadDir.exists())
+ {
+ for(Components component : Components.values()){
+ deleteFiles(component.getConfigurationFiles().toArray(new String[0]),
ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory);
+ }
+ loadDir.delete();
+ }
+
+ tempDirectory.delete();
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ public void copyFiles(String[] files,String folder,File destination) throws Exception{
+ for (String fileName : files){
+ String path=null;
+
+ if (folder.equals(""))
+ path = fileName;
+ else
+ path = folder+File.separator+fileName;
+
+ File configFile =
LensHelper.cpFileFromPluginToTemp(this.getClass().getClassLoader(),destination, path);
+ if (!configFile.exists())
+ throw new UnitTestException("Creation of temporary configuration file
failed.");
+ }
+ }
+
+ public void deleteFiles(String[] files,String folder,File destination) throws
Exception{
+ for (String fileName : files){
+ String path=null;
+
+ if (folder.equals(""))
+ path = fileName;
+ else
+ path = folder+File.separator+fileName;
+
+ File configFile = new File(destination,path);;
+ if (configFile.exists())
+ configFile.delete();
+ }
+ }
+ /**
+ * Method for searching all components in ageasTree which returns List of keys which
identify the component.
+ * @param parentNodeNames
+ * @param componentName
+ * @param tree
+ * @return
+ */
+ public List<String> loadComponent(String[] parentNodeNames,String
componentName,AugeasTree tree){
+ List<String> paramsString = new ArrayList<String>();
+ List<AugeasNode> nodes = AugeasNodeSearch.searchNode(parentNodeNames,
componentName, tree.getRootNode());
+ for (AugeasNode node : nodes){
+ paramsString.add(AugeasNodeSearch.getNodeKey(node, tree.getRootNode()));
+ }
+ return paramsString;
+ }
+
+ public void saveFiles(AugeasTree tree,PluginContainer container) throws Exception{
+ for (Components component : Components.values()){
+ String name = component.getComponentName();
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ for (int i=0;i<nodes.size();i++){
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ //PATH TO THE CONFIG FILES
+ String fileName = name+String.valueOf(i);
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ ApacheConfigurationUtil.saveConfiguration(config, fileName);
+ }
+ }
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
index a1a42c1..f3ce761 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
@@ -63,7 +63,12 @@ public class ApachePluginTest {
pcConfig.setInsideAgent(false);
PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
+ PluginContainer container = PluginContainer.getInstance();
+ container.initialize();
+ container.getInventoryManager().executeServerScanImmediately();
+ container.getInventoryManager().executeServiceScanImmediately();
+ ApacheAugeasTest test = new ApacheAugeasTest();
+ test.testMapping(container);
} catch (Exception e) {
e.printStackTrace();
}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
new file mode 100644
index 0000000..5f79b42
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
@@ -0,0 +1,47 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+
+public class ApacheTestConstants {
+
+ public static final String MODULE_NAME="Httpd";
+ public static final String PLUGIN_NAME="Apache";
+ public static final String LENS_NAME="httpd.aug";
+ public static final String TEMP_CONFIG_FILE_DIRECTORY = "HttpdTest";
+ public static final String CONFIG_FILE_NAMES [] = {
+ "httpd.conf",
+ "included.conf",
+ "nested.conf"};
+ public static final String FILES_TO_LOAD [] = {
+ "httpd.conf",
+ "included.conf",
+ "nested.conf",
+ "httpd.aug"};
+ public static final String ROOT_CONFIG_FILE_NAME = "httpd.conf";
+ public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT = "serverRoot";
+ public static final String TEST_FILE_CONFIG_FOLDER="loadconfig";
+ public static final String TEST_FILE_APACHE_CONFIG_FOLDER="updateconfig";
+ public static String TEMP_FILES_PATH;
+
+ /**
+ * Path to folder containing rhq configuration in xml files.
+ * @return
+ */
+ public static String getConfigFilesPathForLoad(){
+ return TEMP_FILES_PATH+File.separator+TEST_FILE_CONFIG_FOLDER+File.separator;
+ }
+ /**
+ * Path to folder containing apache configuration in "loadconfig" folder
+ * @return
+ */
+ public static String getApacheConfigFilesPathForUpdate(){
+ return
TEMP_FILES_PATH+File.separator+TEST_FILE_APACHE_CONFIG_FOLDER+File.separator;
+ }
+ /**
+ * Path to temporary folder where are/will be stored all config files.
+ * @return
+ */
+ public static String getApacheConfigFilesPath(){
+ return TEMP_FILES_PATH+File.separator;
+ }
+}
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
new file mode 100644
index 0000000..7335806
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
@@ -0,0 +1,125 @@
+package org.rhq.plugins.apache;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+/**
+ * Enum of all components in Apache plugin.
+ * @author fdrabek
+ *
+ */
+public enum Components {
+
+ IFMODULE{
+ public String getComponentName(){
+ return "IfModule";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[2];
+ parentNames[0]="<IfModule";
+ parentNames[1]="<VirtualHost";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<IfModule";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return AugeasNodeSearch.searchNode(IFMODULE.getPossParentNodeName(),
IFMODULE.getNodeName(), tree.getRootNode());
+ }
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("IfModule0");
+ list.add("IfModule1");
+ return list;
+ }
+ },
+
+ IFMODULE_DIRECTORY{
+ public String getComponentName(){
+ return "IfModule Parameters";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[1];
+ parentNames[0]="<IfModule";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<IfModule";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ List<AugeasNode> nodes = DIRECTORY.getAllNodes(tree);
+ List<AugeasNode> ifModNodes = new ArrayList<AugeasNode>();
+ for (AugeasNode node : nodes){
+ List<AugeasNode> tempNodes =
AugeasNodeSearch.searchNode(IFMODULE_DIRECTORY.getPossParentNodeName(),
IFMODULE_DIRECTORY.getNodeName(), node);
+ if (tempNodes != null)
+ ifModNodes.addAll(tempNodes);
+ }
+ return ifModNodes;
+
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("IfModule Parameters0");
+ return list;
+ }
+ },
+
+ DIRECTORY{
+ public String getComponentName(){
+ return "Directory";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[2];
+ parentNames[0]="<IfModule";
+ parentNames[1]="<VirtualHost";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<Directory";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return AugeasNodeSearch.searchNode(DIRECTORY.getPossParentNodeName(),
DIRECTORY.getNodeName(), tree.getRootNode());
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("Directory0");
+ list.add("Directory1");
+ list.add("Directory2");
+ return list;
+ }
+ },
+
+ VIRTUALHOST{
+ public String getComponentName(){
+ return "Apache Virtual Host";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[0];
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<VirtualHost";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return tree.getRootNode().getChildByLabel("<VirtualHost");
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("Apache Virtual Host0");
+ return list;
+ }
+ };
+
+ public abstract String getComponentName();
+ public abstract String[] getPossParentNodeName();
+ public abstract String getNodeName();
+ public abstract List<AugeasNode> getAllNodes(AugeasTree tree);
+ public abstract List<String> getConfigurationFiles();
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
new file mode 100644
index 0000000..bc94e85
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
@@ -0,0 +1,21 @@
+package org.rhq.plugins.apache;
+
+public class UnitTestException extends Exception{
+
+ public UnitTestException(){
+ super();
+ }
+
+ public UnitTestException(String text){
+ super(text);
+ }
+
+ public UnitTestException(Exception e){
+ super(e);
+ }
+
+ public UnitTestException(String message,Throwable cause){
+ super(message,cause);
+ }
+
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
new file mode 100644
index 0000000..1cbb28c
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
@@ -0,0 +1,23 @@
+package org.rhq.plugins.apache.helper;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class LensFilter implements FileFilter{
+ private Pattern pattern;
+
+ public LensFilter(String name){
+ pattern = Pattern.compile(name+".*");
+ }
+
+ public boolean accept(File pathname) {
+ String name = pathname.getName();
+ Matcher match = pattern.matcher(name);
+ if (match.matches())
+ return true;
+
+ return false;
+ }
+}
\ No newline at end of file
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
new file mode 100644
index 0000000..567c0ae
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
@@ -0,0 +1,109 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.apache.helper;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class LensHelper {
+ public static final String TEMP_DIRECTORY = "java.io.tmpdir";
+ public static final String TEMP_FILE_SUFFIX = ".aug";
+
+
+ public static String getLensPath(String param) throws IOException,Exception{
+ String lensPath=null;
+
+ if (param.indexOf(File.separatorChar)==-1){
+
+ }else
+ lensPath = param;
+ return lensPath;
+
+ }
+
+ public static void copyFile(InputStream in,File destination) throws Exception{
+
+ if (!destination.canWrite())
+ throw new Exception("Creating of temporary file for lens failed.
Destination file "
+ + destination.getAbsolutePath()+" is not accessible.");
+
+ OutputStream out = new FileOutputStream(destination);
+
+ byte[] buf = new byte[1024];
+ int length;
+
+ while ((length = in.read(buf)) > 0) {
+ out.write(buf, 0, length);
+ }
+
+ in.close();
+ out.close();
+
+ }
+
+ public static File createTempDir(String name) throws IOException{
+
+ String tempDir = (String)System.getProperties().get(TEMP_DIRECTORY);
+
+ File tempDirectory = new File(tempDir);
+ File [] lens = tempDirectory.listFiles(new LensFilter(name));
+
+ File lensDirectory;
+
+ if (lens.length==0){
+ File tempFile = File.createTempFile(name, "");
+ String nm = tempFile.getName();
+ tempFile.delete();
+ lensDirectory = new File(tempDirectory,nm);
+ lensDirectory.mkdir();
+ lensDirectory.deleteOnExit();
+ }else{
+ lensDirectory = lens[0];
+ }
+
+ return lensDirectory;
+
+ }
+
+ public static String getTempDirectoryPath(){
+ return (String)System.getProperties().get(TEMP_DIRECTORY);
+ }
+
+ public static File cpFileFromPluginToTemp(ClassLoader loader,File
tempDirectory,String fileName) throws IOException,Exception{
+
+ File destinationFile = new File(tempDirectory,fileName);
+ if (!destinationFile.exists())
+ {
+ destinationFile.createNewFile();
+
+ InputStream input = loader.getResourceAsStream(fileName);
+ copyFile(input, destinationFile);
+ }
+
+ return destinationFile;
+ }
+
+}
\ No newline at end of file
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
new file mode 100644
index 0000000..6f82046
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
@@ -0,0 +1,230 @@
+package org.rhq.plugins.apache.util;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager;
+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.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.plugins.apache.ApacheTestConstants;
+import org.rhq.plugins.apache.Components;
+import org.rhq.plugins.apache.UnitTestException;
+import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ *
+ * @author Filip Drabek
+ *
+ */
+
+public class ApacheConfigurationUtil {
+
+ public static final String SIMPLE_TAG_NAME = "simple";
+ public static final String LIST_TAG_NAME = "list";
+ public static final String MAP_TAG_NAME = "map";
+ public static final String ROOT_ELEMENT = "configuration";
+ public static final String NAME_ATTRIBUTE = "name";
+
+ private Document loadXML(String file) throws UnitTestException{
+ Document document= null;
+ try {
+ File xmlFile = new File(file);
+ if (!xmlFile.exists())
+ throw new UnitTestException("Configuration file not
found.");
+
+ DocumentBuilderFactory factory =
+ DocumentBuilderFactory.newInstance();
+ DocumentBuilder loader = factory.newDocumentBuilder();
+
+ document = loader.parse(file);
+
+ }catch(Exception e){
+ throw new UnitTestException("Loading of xml file failed.",e);
+ }
+
+ return document;
+ }
+
+ public static void saveConfiguration(Configuration config,String fileName) throws
UnitTestException{
+ try {
+ Collection<Property> properties = config.getProperties();
+ DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
+ Document doc = docBuilder.newDocument();
+ Element element = doc.createElement(ROOT_ELEMENT);
+
+ for (Property property : properties){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ doc.appendChild(element);
+ saveXML(doc,fileName);
+
+ }catch(Exception e){
+ throw new UnitTestException(e);
+ }
+ }
+
+
+ private static Element configurationToDom(Property prop,Document doc){
+ Element element = null;
+ if (prop instanceof PropertySimple){
+ element = doc.createElement(SIMPLE_TAG_NAME);
+ element.appendChild(doc.createTextNode(((PropertySimple)
prop).getStringValue()));
+ }
+
+ if (prop instanceof PropertyList){
+ PropertyList list = (PropertyList) prop;
+ element = doc.createElement(LIST_TAG_NAME);
+ List<Property> propertyList = list.getList();
+ for (Property property : propertyList){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ }
+
+ if (prop instanceof PropertyMap){
+ PropertyMap map = (PropertyMap) prop;
+ element = doc.createElement(MAP_TAG_NAME);
+ Map<String,Property> propertyMap = map.getMap();
+ for (Property property : propertyMap.values()){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ }
+
+ fillElement(element,prop);
+ return element;
+ }
+
+ private static void fillElement(Element element,Property prop){
+ element.setAttribute(NAME_ATTRIBUTE, prop.getName());
+ }
+
+ public Configuration loadConfiguration(String fileName) throws UnitTestException{
+ Document document = loadXML(fileName);
+ NodeList nodeList = document.getElementsByTagName(ROOT_ELEMENT);
+ if (nodeList.getLength()!=1)
+ throw new UnitTestException("Configuration file's " +
fileName+ " format is not valid.");
+
+ Node rootElement = nodeList.item(0);
+ Configuration configuration = new Configuration();
+ NodeList childNodes = rootElement.getChildNodes();
+ for (int i=0;i<childNodes.getLength();i++){
+ configuration.put(domToConfiguration(childNodes.item(i)));
+ }
+ return configuration;
+ }
+
+ private Property domToConfiguration(Node node){
+ String nodeName = node.getNodeName();
+ NamedNodeMap attrMap = node.getAttributes();
+ Node attrNode = attrMap.getNamedItem(NAME_ATTRIBUTE);
+ String propertyName = attrNode.getNodeValue();
+
+ Property prop = null;
+
+ if (nodeName.equals(SIMPLE_TAG_NAME)){
+ PropertySimple propertySimple = new PropertySimple(propertyName,null);
+ String value = node.getTextContent();
+ propertySimple.setStringValue(value);
+ prop = propertySimple;
+ }
+
+ if (nodeName.equals(LIST_TAG_NAME)){
+ PropertyList propertyList = new PropertyList(propertyName);
+ NodeList list = node.getChildNodes();
+ for (int i=0;i<list.getLength();i++) {
+ propertyList.add(domToConfiguration(list.item(i)));
+ }
+ prop = propertyList;
+ }
+
+ if (nodeName.equals(MAP_TAG_NAME)){
+ PropertyMap propertyMap = new PropertyMap(propertyName);
+ NodeList list = node.getChildNodes();
+ for (int i=0;i<list.getLength();i++){
+ propertyMap.put(domToConfiguration(list.item(i)));
+ }
+ prop = propertyMap;
+ }
+
+ return prop;
+ }
+
+ @SuppressWarnings("restriction")
+ private static void saveXML(Document document,String fileName) throws
UnitTestException{
+ try {
+ File file = new File(fileName);
+ if (!file.exists())
+ file.createNewFile();
+
+ XMLSerializer serializer = new XMLSerializer();
+ serializer.setOutputCharStream(
+ new java.io.FileWriter(fileName));
+ serializer.serialize(document);
+ }catch(Exception e){
+ throw new UnitTestException("Saving of xml file failed",e);
+ }
+ }
+
+ public static void printConfiguration(Property prop){
+ if (prop instanceof PropertySimple){
+ System.out.println(" SimpleProperty name="+prop.getName()+"
value="+((PropertySimple)prop).getStringValue());
+ }
+
+ if (prop instanceof PropertyList){
+ PropertyList list = (PropertyList) prop;
+ System.out.println("PropertyList name="+list.getName());
+ for (Property property : list.getList()){
+ printConfiguration(property);
+ }
+ }
+
+ if (prop instanceof PropertyMap){
+ PropertyMap map = (PropertyMap) prop;
+ System.out.println(" PropertyMap name="+map.getName());
+ Map<String,Property> propertyMap = map.getMap();
+ for (Property property : propertyMap.values()){
+ printConfiguration(property);
+ }
+ }
+ }
+
+
+ public static ConfigurationDefinition getConfigurationDefinition(PluginContainer
container,Components component){
+ PluginManager pluginManager = container.getPluginManager();
+ PluginMetadataManager pluginMetadataManager =
pluginManager.getMetadataManager();
+
+ ResourceType type = pluginMetadataManager.getType(component.getComponentName(),
ApacheTestConstants.PLUGIN_NAME);
+ ConfigurationDefinition configDef = type.getResourceConfigurationDefinition();
+ return configDef;
+ }
+
+
+ public static Configuration componentToConfiguration(PluginContainer
container,Components component,String key,AugeasTree tree) throws UnitTestException{
+ ConfigurationDefinition def =
getConfigurationDefinition(container,component);
+ AugeasNode node = AugeasNodeSearch.findNodeById(tree.getRootNode(), key);
+ ApacheAugeasMapping map = new ApacheAugeasMapping(tree);
+ Configuration config = map.updateConfiguration(node, def);
+ return config;
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
new file mode 100644
index 0000000..8d8ed5e
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
@@ -0,0 +1,75 @@
+package org.rhq.plugins.apache.util;
+
+import java.io.File;
+
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.clientapi.agent.PluginContainerException;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.inventory.InventoryManager;
+import org.rhq.core.pc.inventory.ResourceContainer;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.util.ComponentUtil;
+import org.rhq.core.pc.util.FacetLockType;
+
+public class StandAloneContainer {
+
+ public PluginContainer getContainer(AugeasTree tree,String pluginPath){
+ PluginContainer container=null;
+ try {
+ container = PluginContainer.getInstance();
+ File pluginDir = new File(pluginPath);
+ PluginContainerConfiguration config = new PluginContainerConfiguration();
+ config.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ config.setPluginDirectory(pluginDir);
+
+ container.setConfiguration(config);
+ container.initialize();
+ container.getInventoryManager().executeServerScanImmediately();
+ container.getInventoryManager().executeServiceScanImmediately();
+
+ return container;
+
+ }catch(Exception e){
+ e.printStackTrace();
+ if (container!=null)
+ container.shutdown();
+ }
+ return null;
+ }
+
+
+
+ public static <T> T getComponent(int resourceId, Class<T> facetInterface,
FacetLockType lockType,
+ long timeout, boolean daemonThread, boolean
onlyIfStarted) throws PluginContainerException {
+ InventoryManager inventoryManager =
PluginContainer.getInstance().getInventoryManager();
+ ResourceContainer resourceContainer =
inventoryManager.getResourceContainer(resourceId);
+ if (resourceContainer == null) {
+ throw new PluginContainerException("Resource component container could not
be retrieved for resource: "
+ + resourceId);
+ }
+ return resourceContainer.createResourceComponentProxy(facetInterface, lockType,
timeout, daemonThread, onlyIfStarted);
+ }
+
+ public static <T> Object getComponentProxy(Resource res,Class<T>
facetInterface) throws Exception {
+ ClassLoader currenContextClassLoader = Thread.currentThread()
+ .getContextClassLoader();
+ try {
+ Resource asResource = res;
+ ClassLoader cl = PluginContainer.getInstance().getPluginComponentFactory().
+ getResourceClassloader(asResource);
+
+ Class<?> resourceSpecificFacetInterface = Class.forName(
+ facetInterface.getName(), true, cl);
+
+ Thread.currentThread().setContextClassLoader(cl);
+
+ return ComponentUtil.getComponent(asResource.getId(),resourceSpecificFacetInterface,
+ FacetLockType.WRITE, 30000, true, true);
+ } finally {
+ Thread.currentThread().setContextClassLoader(
+ currenContextClassLoader);
+ }
+ }
+}
diff --git a/modules/plugins/apache/src/test/resources/httpd.aug
b/modules/plugins/apache/src/test/resources/httpd.aug
new file mode 100644
index 0000000..12c3205
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/httpd.aug
@@ -0,0 +1,58 @@
+module Httpd =
+ autoload xfm
+
+(* Helpers *)
+
+(* Newlines can be escaped. *)
+let sep = del /([ \t]+(\\\\\n)?)+/ " "
+let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n"
+ let del_str (s:string) = del s s
+let ws = /[ \t]*/
+let alnum = /[a-zA-Z0-9_]+/
+(* the last character in the non-quoted word must not be a backslash. I guess this is not
completely semantically
+ correct but at the same time, apache discourages to use backslashes for anything else
than
+ line breaking so we should be safe here. This restriction is in place to support
+ escaped new lines in the sep and eol rules. *)
+let word =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'"
\t\n]*[^'" \t\n\\]/
+let secarg =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\"
\t\n>]+/
+let wskey (k:regexp) = del ws "" . key k
+let params (param:regexp) = [ sep . label "param" . store param ]*
+let sec (name:string) (body:lens) =
+ [ wskey ("<" . name) . params secarg . del_str ">" . eol .
+ body . del ws "" . del_str("</" . name . ">")
. eol ]
+
+(* Definitions *)
+let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ]
+
+let directive = [ wskey alnum . params word . eol ]
+
+let section (name:string) = sec name (directive|comment)*
+
+let sections (body:lens) = sec "Directory" body
+ | sec "DirectoryMatch" body
+ | sec "Files" body
+ | sec "FilesMatch" body
+ | sec "Location" body
+ | sec "LocationMatch" body
+ | sec "AuthnProviderAlias" body
+ | sec "IfDefine" body
+ | sec "IfVersion" body
+ | sec "Limit" body
+ | sec "LimitExcept" body
+ | sec "Proxy" body
+ | sec "ProxyMatch" body
+ | sec "VirtualHost" body
+ | sec "IfModule" body
+
+
+(* What we want ot say is *)
+(* let rec body = (directive|comment)* | ifModule body | directory body | ... *)
+(* but we can't typecheck that *)
+
+(* FIXME: *)
+(* - Nesting of sections *)
+let rec lns = (directive | comment | sections lns)*
+
+let filter =
+ incl "/etc/httpd/conf/httpd.conf"
+let xfm = transform lns filter
diff --git a/modules/plugins/apache/src/test/resources/httpd.conf
b/modules/plugins/apache/src/test/resources/httpd.conf
new file mode 100644
index 0000000..6cf9769
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/httpd.conf
@@ -0,0 +1,41 @@
+<VirtualHost 10.1.2.3>
+ ServerName
www.example.com:80
+ ServerAlias server
server2.domain.com server2
+ ServerAdmin www-admin(a)foo.example.com
+ DocumentRoot /home/fdrabek/Work
+ AddDefaultCharset utf-8
+ Alias /image /ftp/pub/image
+ DefaultType image/gif
+ DirectoryIndex index.html index.txt /cgi-bin/index.pl
+ ErrorDocument 404 /cgi-bin/bad_urls.pl
+ Timeout 300
+ Options Indexes FollowSymLinks
+ UseCanonicalName On
+ ErrorLog "|/usr/local/bin/httpd_errors"
+ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"
+ <Directory /usr/local/httpd/htdocs>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ <IfModule test.c>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ </IfModule>
+</Directory>
+Include included.conf
+</VirtualHost>
diff --git a/modules/plugins/apache/src/test/resources/included.conf
b/modules/plugins/apache/src/test/resources/included.conf
new file mode 100644
index 0000000..258f3f7
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/included.conf
@@ -0,0 +1,13 @@
+Include nested.conf
+<Directory ~ "^/www/.*/[0-9]{3}">
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+</Directory>
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
new file mode 100644
index 0000000..be5f4bc
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><simple
name="ErrorLog">"|/usr/local/bin/httpd_errors"</simple><list
name="CustomLog"><map name="CustomLog"><simple
name="Destination">logs/access_log</simple><simple
name="format">"%h %l %u %t \"%r\" %>s
%b"</simple><simple
name="_index">0</simple></map></list><simple
name="ServerName">www.example.com:80</simple><list
name="ServerAlias"><map name="ServerAlias"><simple
name="hostname">server</simple><simple
name="_index">0</simple></map><map
name="ServerAlias"><simple
name="hostname">server2.domain.com</simple><simple
name="_index">0</simple></map><map
name="ServerAlias"><simple
name="hostname">server2</simple><simple
name="_index">0</simple></map></list><simple
name="ServerAdmin">www-admin(a)foo.example.com</simple><simple
name="DocumentRoot">/home/fdrabek/Work</simple><simple
name="AddDefaultCharset">utf-8</simple><list
name="Alias"><map name="Alias"><simple
name="URL">/image</simple><simple
name="directory">/ftp/pub/image</simple></map></list><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map><map
name="DirectoryIndex"><simple
name="host">index.txt</simple><simple
name="_index">0</simple></map><map
name="DirectoryIndex"><simple
name="host">/cgi-bin/index.pl</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">404</simple><simple
name="document">/cgi-bin/bad_urls.pl</simple></map></list><simple
name="Timeout">300</simple><list name="Options"><map
name="Options"><simple
name="Mode">Set</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Set</simple><simple
name="Option">FollowSymLinks</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">On</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory0
b/modules/plugins/apache/src/test/resources/loadconfig/Directory0
new file mode 100644
index 0000000..1c28e70
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"/><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory1
b/modules/plugins/apache/src/test/resources/loadconfig/Directory1
new file mode 100644
index 0000000..574fe20
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory1
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory2
b/modules/plugins/apache/src/test/resources/loadconfig/Directory2
new file mode 100644
index 0000000..574fe20
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory2
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
new file mode 100644
index 0000000..88bebc2
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
new file mode 100644
index 0000000..823aee3
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test2.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
new file mode 100644
index 0000000..823aee3
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test2.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/nested.conf
b/modules/plugins/apache/src/test/resources/nested.conf
new file mode 100644
index 0000000..9068fde
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/nested.conf
@@ -0,0 +1,12 @@
+ <IfModule test2.c>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ </IfModule>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
new file mode 100644
index 0000000..12c3205
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
@@ -0,0 +1,58 @@
+module Httpd =
+ autoload xfm
+
+(* Helpers *)
+
+(* Newlines can be escaped. *)
+let sep = del /([ \t]+(\\\\\n)?)+/ " "
+let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n"
+ let del_str (s:string) = del s s
+let ws = /[ \t]*/
+let alnum = /[a-zA-Z0-9_]+/
+(* the last character in the non-quoted word must not be a backslash. I guess this is not
completely semantically
+ correct but at the same time, apache discourages to use backslashes for anything else
than
+ line breaking so we should be safe here. This restriction is in place to support
+ escaped new lines in the sep and eol rules. *)
+let word =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'"
\t\n]*[^'" \t\n\\]/
+let secarg =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\"
\t\n>]+/
+let wskey (k:regexp) = del ws "" . key k
+let params (param:regexp) = [ sep . label "param" . store param ]*
+let sec (name:string) (body:lens) =
+ [ wskey ("<" . name) . params secarg . del_str ">" . eol .
+ body . del ws "" . del_str("</" . name . ">")
. eol ]
+
+(* Definitions *)
+let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ]
+
+let directive = [ wskey alnum . params word . eol ]
+
+let section (name:string) = sec name (directive|comment)*
+
+let sections (body:lens) = sec "Directory" body
+ | sec "DirectoryMatch" body
+ | sec "Files" body
+ | sec "FilesMatch" body
+ | sec "Location" body
+ | sec "LocationMatch" body
+ | sec "AuthnProviderAlias" body
+ | sec "IfDefine" body
+ | sec "IfVersion" body
+ | sec "Limit" body
+ | sec "LimitExcept" body
+ | sec "Proxy" body
+ | sec "ProxyMatch" body
+ | sec "VirtualHost" body
+ | sec "IfModule" body
+
+
+(* What we want ot say is *)
+(* let rec body = (directive|comment)* | ifModule body | directory body | ... *)
+(* but we can't typecheck that *)
+
+(* FIXME: *)
+(* - Nesting of sections *)
+let rec lns = (directive | comment | sections lns)*
+
+let filter =
+ incl "/etc/httpd/conf/httpd.conf"
+let xfm = transform lns filter
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
new file mode 100644
index 0000000..75342e6
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
@@ -0,0 +1,10 @@
+<VirtualHost 10.1.2.3>
+ ServerName
www.example.com:80
+ <Directory /usr/local/httpd/htdocs>
+ Order Deny,Allow
+ <IfModule test.c>
+ Order Deny,Allow
+ </IfModule>
+</Directory>
+Include included.conf
+</VirtualHost>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/included.conf
b/modules/plugins/apache/src/test/resources/updateconfig/included.conf
new file mode 100644
index 0000000..4aa2557
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/included.conf
@@ -0,0 +1,4 @@
+Include nested.conf
+<Directory ~ "^/www/.*/[0-9]{3}">
+ Order Deny,Allow
+</Directory>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
new file mode 100644
index 0000000..eb10dba
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
@@ -0,0 +1,3 @@
+ <IfModule test2.c>
+ UseCanonicalName DNS
+ </IfModule>
commit 02213a76c3a6df5ffef0ee09848c77bf6d4d1463
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 03:05:09 2010 -0400
BZ-614845: ensure that the form is submitted after the ajax-selection completes
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
index d64cc27..51ca4f7 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
@@ -78,7 +78,7 @@
ignoreDupResponses="true"
requestDelay="25"
status="commonStatus"
-
onsubmit="getElementCrossBrowser('notificationListForm:refreshButton').click();"
+
oncomplete="getElementCrossBrowser('notificationListForm:refreshButton').click();"
/>
<ui:remove>
<a4j:support event="onkeyup"
commit 2a78542b7a9f055c71eab0d1e3a9f0d7c917ee31
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 01:42:31 2010 -0400
BZ-614886: fix permissions necessary for resource/plugin configuration updates
* historic/auditing data should not requires permission above and beyond the
ability to view the corresponding resource to which that data is attached
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 1652b0b..2e6198d 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
@@ -846,13 +846,6 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdates(Subject subject, Integer resourceId,
Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE,
resourceId)) {
- throw new PermissionException("User [" + subject.getName()
- + "] does not have permission to manage configuration for
resource[id=" + resourceId + "]");
- }
-
- Resource resource = entityManager.find(Resource.class, resourceId);
-
// TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential,
because our sequences are configured to
// pre-create and cache blocks of 10 sequence id's, so
it may be better to order by
// "cu.createdTime", rather than
"cu.id".
@@ -893,11 +886,6 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int
configurationUpdateId) {
PluginConfigurationUpdate update =
entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
- if (!authorizationManager.canViewResource(subject, update.getResource().getId()))
{
- throw new PermissionException("User [" + subject.getName()
- + "] does not have permission to view plugin configuration update
for [" + update.getResource() + "]");
- }
-
update.getConfiguration(); // this is EAGER loaded, so this really doesn't do
anything
return update;
commit 66cea973deee5ab37431f1b57a461201ade18143
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 01:30:14 2010 -0400
don't try to reload the data page upon authorization failures, just let it bubble
up
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
index 0b1614f..015fdf7 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
@@ -31,6 +31,7 @@ import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean;
import org.rhq.enterprise.gui.legacy.WebUser;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
+import org.rhq.enterprise.server.authz.PermissionException;
import org.rhq.enterprise.server.util.HibernatePerformanceMonitor;
/**
@@ -358,6 +359,8 @@ public abstract class PagedListDataModel<T> extends DataModel {
}
tryQueryAgain = true;
}
+ } catch (PermissionException pe) {
+ throw pe; // don't try to reload the data page upon authorization
failures, just let it bubble up
} catch (Throwable t) {
/*
* known issues during pagination:
commit c46419d2cf68dd168c4a29371af4a0713c6f8df0
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:41:52 2010 -0400
remove unnecessary debugging constructs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index 0cd5f71..c14127b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -64,7 +64,6 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
-import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers,
HasValue<String>,
HasSelectionHandlers<Suggestion> {
@@ -512,8 +511,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
String decoratedSuffix = wrap(highlightedSuggestion, "float: left;
");
String floatClear = "<br style=\"clear: both;\"
/>";
- SearchLogger.debug("decoratedSuffix: " + decoratedSuffix);
-
String innerHTML = decoratedPrefix + decoratedSuffix + floatClear;
return innerHTML;
}
@@ -532,8 +529,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
}
- SearchLogger.debug("results: " + results);
-
return results.toString();
}
@@ -556,8 +551,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
words.add(builder.toString());
}
- SearchLogger.debug("words: " + words);
-
return words;
}
commit 42401c0e7be08f80ca8b627359eb39e85b3f6e3f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:40:26 2010 -0400
BZ-612739: use more sophisticated highlighting mechanism that respects line breaks
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index 0b9ac6c..0cd5f71 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.search.suggest;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -63,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
+import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers,
HasValue<String>,
HasSelectionHandlers<Suggestion> {
@@ -502,14 +504,16 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
}
- String decoratedPrefix = decorate(prefix, style);
+ String decoratedPrefix = wrap(prefix, style);
String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 100);
String decoratedItemLabel = decorate(formattedItemLabel,
"background-color: yellow;", item.getStartIndex(),
item.getEndIndex());
String highlightedSuggestion = colorOperator(decoratedItemLabel);
- String decoratedSuffix = decorate(highlightedSuggestion, "float: left;
");
+ String decoratedSuffix = wrap(highlightedSuggestion, "float: left;
");
String floatClear = "<br style=\"clear: both;\"
/>";
+ SearchLogger.debug("decoratedSuffix: " + decoratedSuffix);
+
String innerHTML = decoratedPrefix + decoratedSuffix + floatClear;
return innerHTML;
}
@@ -575,10 +579,11 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
return data;
}
- private static String decorate(String data, String style) {
- return decorate(data, style, 0, data.length());
+ private static String wrap(String data, String style) {
+ return "<span style=\"" + style + "\">" +
data + "</span>";
}
+ /*
private static String decorate(String data, String style, int startIndex, int
endIndex) {
if (startIndex == -1) {
return data; // no match
@@ -588,6 +593,69 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
String after = data.substring(endIndex);
return before + "<span style=\"" + style +
"\">" + highlight + "</span>" + after;
}
+ */
+
+ private static String decorate(String data, String style, int startIndex, int
endIndex) {
+ if (startIndex == -1 || (startIndex == endIndex)) {
+ return data; // no match or zero-width match
+ }
+
+ String[] words = data.split("<br/>");
+ int counter = 0;
+ int wordIndex = 0;
+ int letterIndex = 0;
+
+ StringBuilder results = new StringBuilder();
+ while (counter < startIndex) {
+ if (wordIndex == words.length) {
+ break;
+ }
+
+ if (letterIndex < words[wordIndex].length()) { // more letters left in
the current word?
+ results.append(words[wordIndex].charAt(letterIndex)); // append the
next char of the current word
+ letterIndex++; // move to the next char in the current word
+ counter++; // only move counter forward when we've added non-BR
chars to the results
+ } else { // next word
+ results.append("<br/>"); // put the break point back
in between words
+ letterIndex = 0; // point to the first char
+ wordIndex++; // of the next word
+ }
+ }
+
+ // we're at start index, wrap all words and word fragments in the
specified style up to endIndex
+ results.append("<span style=\"" + style +
"\">"); // seed action
+ while (counter < endIndex) {
+ if (wordIndex == words.length) {
+ break;
+ }
+
+ if (letterIndex < words[wordIndex].length()) { // more letters left in
the current word?
+ results.append(words[wordIndex].charAt(letterIndex)); // append the
next char of the current word
+ letterIndex++; // move to the next char in the current word
+ counter++; // only move counter forward when we've added non-BR
chars to the results
+ } else { // next word
+ results.append("</span>"); // close the previous
word, we don't highlight breaks
+ results.append("<br/>"); // put the break point back
in between words
+ letterIndex = 0; // point to the first char
+ wordIndex++; // of the next word
+ results.append("<span style=\"" + style +
"\">"); // prepare for next word
+ }
+ }
+ results.append("</span>"); // end last dangling span
+
+ // append the rest of the current word fragment, if any
+ if (wordIndex != words.length) {
+ results.append(words[wordIndex].substring(letterIndex));
+ }
+
+ // append the rest of the words
+ while (++wordIndex < words.length) {
+ results.append("<br/>"); // put the break point back in
between words
+ results.append(words[wordIndex]);
+ }
+
+ return results.toString();
+ }
}
class SearchSuggestOracle extends SuggestOracle {
commit a3fa5d55e6d8a64eca20348e00270a529bbab8a0
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:39:41 2010 -0400
BZ-612739: ensure that search suggestions never overflow drop-down boundaries
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index bce49e4..0b9ac6c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -503,7 +503,7 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
String decoratedPrefix = decorate(prefix, style);
- String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 110);
+ String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 100);
String decoratedItemLabel = decorate(formattedItemLabel,
"background-color: yellow;", item.getStartIndex(),
item.getEndIndex());
String highlightedSuggestion = colorOperator(decoratedItemLabel);
@@ -514,21 +514,49 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
return innerHTML;
}
- private static String chopWithEvery(String chop, String with, int every) {
- String[] words = chop.split("\\s");
+ private static String chopWithEvery(String toChop, String with, int every) {
+ //String[] words = toChop.split("\\s");
+ List<String> words = chop(toChop, "\\/- \t\r\n");
StringBuilder results = new StringBuilder();
int currentLineLength = 0;
for (String next : words) {
+ results.append(next);
+ currentLineLength += next.length();
if (currentLineLength + next.length() > every) {
results.append(with);
currentLineLength = 0;
}
- results.append(next).append(' ');
- currentLineLength += (next.length() + 1);
}
+
+ SearchLogger.debug("results: " + results);
+
return results.toString();
}
+ // StringTokenzier doesn't exist in GWT, so have to write my own
+ private static List<String> chop(String dataToChop, String chopTokens) {
+ List<String> words = new ArrayList<String>();
+
+ StringBuilder builder = new StringBuilder();
+ for (char next : dataToChop.toCharArray()) {
+ if (chopTokens.indexOf(next) != -1) {
+ if (builder.length() > 0) {
+ words.add(builder.toString());
+ builder = new StringBuilder();
+ }
+ }
+ builder.append(next);
+ }
+
+ if (builder.length() > 0) {
+ words.add(builder.toString());
+ }
+
+ SearchLogger.debug("words: " + words);
+
+ return words;
+ }
+
private static final List<String> OPERATORS =
Arrays.asList("!==", "!=", "==", "=");
// TODO: fixing coloring strategy
commit f6888c317f7ed944379841efe9225a948a898bef
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:37:33 2010 -0400
parenthesize saved search results counts on all screens
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index ee7647b..c250f7c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -140,7 +140,7 @@ public class SavedSearchGrid extends Grid {
private static String stylize(SavedSearch savedSearch) {
String name = savedSearch.getName();
String pattern = savedSearch.getPattern();
- String count = savedSearch.getResultCount() == null ? "" :
String.valueOf(savedSearch.getResultCount());
+ String count = savedSearch.getResultCount() == null ? "" :
"(" + savedSearch.getResultCount() + ")";
return "<span class=\"savedSearchesPanel-top\">" + name
+ "</span> " + count + "<br/>" //
+ "<span class=\"savedSearchesPanel-bottom\">" +
pattern + "</span>";
}
commit 9abb570c9e6be87cc6aed9209a0e76adb671ae9a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 18:52:29 2010 -0400
BZ 535784 - pass in -e argument to readlink to support the "double linked"
problem where rc.3.d has a symlink to init.d which in turn is a symlink to
rhq-agent-wrapper.sh. Need -e so readlink recursively walks the symlinks to reach the
actual script file
diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
index ee714a9..2bb861c 100755
--- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
+++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
@@ -94,12 +94,34 @@ prepare_pid_dir ()
fi
}
+# ----------------------------------------------------------------------
+# Determine what specific platform we are running on.
+# Set some platform-specific variables.
+
+case "`uname`" in
+ CYGWIN*) _CYGWIN=true
+ ;;
+ Linux*) _LINUX=true
+ ;;
+ Darwin*) _DARWIN=true
+ ;;
+ SunOS*) _SOLARIS=true
+ ;;
+ AIX*) _AIX=true
+ ;;
+esac
+
# -------------------------------
# Get the location of this script.
# Make sure we take into account the possibility $0
# is a symlink to the real agent installation script.
+# Only certain platforms support the -e option of readlink
+
+if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ _READLINK_ARG="-e"
+fi
-_DOLLARZERO=`readlink "$0" || echo "$0"`
+_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo
"$0"`
RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
debug_wrapper_msg
"RHQ_AGENT_WRAPPER_BIN_DIR_PATH=$RHQ_AGENT_WRAPPER_BIN_DIR_PATH"
diff --git a/modules/enterprise/agent/src/etc/rhq-agent.sh
b/modules/enterprise/agent/src/etc/rhq-agent.sh
index 8ef0625..e0122bd 100755
--- a/modules/enterprise/agent/src/etc/rhq-agent.sh
+++ b/modules/enterprise/agent/src/etc/rhq-agent.sh
@@ -34,6 +34,7 @@ debug_msg ()
# ----------------------------------------------------------------------
# Try to determine the fallback JAVA_HOME if not already set
# ----------------------------------------------------------------------
+
set_java_home ()
{
if [ "x$JAVA_HOME" = "x" ]; then
@@ -56,6 +57,7 @@ set_java_home ()
# Determine what specific platform we are running on.
# Set some platform-specific variables.
# ----------------------------------------------------------------------
+
case "`uname`" in
CYGWIN*) _CYGWIN=true
;;
@@ -63,6 +65,10 @@ case "`uname`" in
;;
Darwin*) _DARWIN=true
;;
+ SunOS*) _SOLARIS=true
+ ;;
+ AIX*) _AIX=true
+ ;;
esac
case "`uname -m`" in
@@ -76,7 +82,13 @@ esac
# We also assume our custom environment script is located in the same
# place as this script.
# ----------------------------------------------------------------------
-_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
+
+if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ # only certain platforms support the -e argument for readlink
+ _READLINK_ARG="-e"
+fi
+
+_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
if [ -f "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" ]; then
diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
index 9179850..bbef0bf 100644
--- a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
+++ b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
@@ -178,12 +178,14 @@ remove_pid_files ()
case "`uname`" in
CYGWIN*) _CYGWIN=true
;;
+ Linux*) _LINUX=true
+ ;;
Darwin*) _DARWIN=true
;;
SunOS*) _SOLARIS=true
;;
- AIX*) _AIX=true
- ;;
+ AIX*) _AIX=true
+ ;;
esac
# ----------------------------------------------------------------------
@@ -193,7 +195,11 @@ esac
# ----------------------------------------------------------------------
if [ -z "$RHQ_SERVER_HOME" ]; then
- _DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
+ if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ # only certain platforms support the -e argument for readlink
+ _READLINK_ARG="-e"
+ fi
+ _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/..
else
if [ ! -d "$RHQ_SERVER_HOME" ]; then
commit 97f5d79977dbf38d027b1377b91d97c257da9256
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 16:20:36 2010 -0400
fix the highlighting strategy to respect ^ and $ boundary characters
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index e721cb4..92138bf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -643,9 +643,21 @@ public class SearchAssistManager {
private List<SearchSuggestion> convert(List<String> suggestions,
ParsedContext parsed, String term, Kind kind) {
int startIndex = getStartIndex(parsed);
+ LOG.debug("convert(suggestions.size()=" + suggestions.size() + ",
" + parsed + ", " + term + ", " + kind + ")");
term = term.toLowerCase();
List<SearchSuggestion> results = new
ArrayList<SearchSuggestion>(suggestions.size());
for (String suggestion : suggestions) {
+ boolean startBounded = term.startsWith("^");
+ boolean endBounded = term.endsWith("$");
+
+ if (startBounded && endBounded) {
+ term = term.substring(1, term.length() - 1);
+ } else if (startBounded) {
+ term = term.substring(1);
+ } else if (endBounded) {
+ term = term.substring(0, term.length() - 1);
+ }
+
int index = suggestion.toLowerCase().indexOf(term, startIndex);
results.add(new SearchSuggestion(kind, suggestion, index, term.length()));
}
commit acffdbd990b59dd1a87d602a645d18481927f1b8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 16:20:57 2010 -0400
redirect error stream of readlink to dev/null when starting standalone pc
diff --git a/etc/standalone-pc/standalone.sh b/etc/standalone-pc/standalone.sh
index 29fd40f..d8ffef6 100755
--- a/etc/standalone-pc/standalone.sh
+++ b/etc/standalone-pc/standalone.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-_DOLLARZERO=`readlink "$0" || echo "$0"`
+_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
RHQ_AGENT_MAINCLASS=org.rhq.core.pc.StandaloneContainer
export RHQ_AGENT_MAINCLASS
commit d687058c983156b48098986b1a896daec4ca6143
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 16:20:37 2010 -0400
remove the chkconfig headers - its a copy-paste from the server script - doesn't
make sense to have it here in the generate db passwd script
diff --git
a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
index e436d87..1d464d7 100755
---
a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
+++
b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
@@ -1,10 +1,5 @@
#!/bin/sh
-# chkconfig: 2345 92 26
-# description: Starts and stops the RHQ Server
-#
-# processname: java
-
# =============================================================================
# RHQ Server UNIX Generate db password script
#
commit 627f6b03c8dc03946d6dc750699e445ce769dabf
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:33:48 2010 -0400
only add fragments to the generation suggestion-JPQL as necessary
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 87e10a5..94a2bd5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -12,7 +14,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil;
-import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -95,11 +96,12 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return results;
}
- protected final String add(String fragment, String parameter) {
- if (parameter != null && !parameter.equals("")) {
- return fragment;
+ protected final String conditionallyAddJPQLString(String fragment, String filter) {
+ if (filter == null || filter.equals("")) {
+ return "";
}
- return "";
+
+ return " AND " + getJPQLForString(fragment, filter);
}
protected final List<String> filter(Class<? extends Enum<?>>
enumType, String filter) {
@@ -145,10 +147,6 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return "'" + data + "'";
}
- protected final String escape(String data) {
- return QueryUtility.escapeSearchParameter(data);
- }
-
protected final String getFormatterValueFragment(String data) {
boolean hasWhitespace = false;
for (char next : data.toCharArray()) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index b4c3069..be85fc5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -1,7 +1,5 @@
package org.rhq.enterprise.server.search.assist;
-import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -64,8 +62,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + " AND " + getJPQLForString("type.name", filter)
//
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("type.name", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -74,8 +72,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + " AND " + getJPQLForString("type.plugin", filter)
//
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("type.plugin", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -83,8 +81,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
- + " AND " + getJPQLForString("rg.name", filter) //
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("rg.name", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index e0560bf..671095f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -1,7 +1,5 @@
package org.rhq.enterprise.server.search.assist;
-import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -69,8 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + " AND " + getJPQLForString("definition.name",
filter) //
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("definition.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -81,8 +79,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + " AND " + getJPQLForString("definition.name",
filter) //
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("definition.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -92,8 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN ms.definition def " //
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
- + " AND " + getJPQLForString("ms.definition.name",
filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("ms.definition.name", filter) //
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY def.name ");
} else {
@@ -115,8 +113,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("type.name", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("type.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -124,8 +122,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.plugin " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("type.plugin", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("type.plugin", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -133,8 +131,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT res.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("res.name", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("res.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -150,9 +148,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND " + getJPQLForString("property.name",
param) //
- + " AND " +
getJPQLForString("property.stringValue", filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("property.name", param) //
+ + conditionallyAddJPQLString("property.stringValue", filter)
//
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -165,9 +163,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND " + getJPQLForString("property.name",
param) //
- + " AND " +
getJPQLForString("property.stringValue", filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("property.name", param) //
+ + conditionallyAddJPQLString("property.stringValue", filter)
//
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -177,9 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND " + getJPQLForString("ms.definition.name",
param) //
- + " AND " + getJPQLForString("trait.value", filter)
//
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("ms.definition.name", param) //
+ + conditionallyAddJPQLString("trait.value", filter) //
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY trait.value ");
} else {
commit 208832871ccc19d69b0109d66577635d7c6591d1
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:33:13 2010 -0400
support suggesting "null" values without quotes, which **is** a valid search
term value
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 45b5358..e721cb4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -681,6 +681,11 @@ public class SearchAssistManager {
List<String> results = new ArrayList<String>();
for (String next : data) {
+ if (next == null) {
+ results.add("null"); // null search comparisons should never be
quoted
+ continue;
+ }
+
boolean hasWhiteSpace = next.matches(".*\\s.*");
if (hasWhiteSpace == false) {
// don't pad things that don't need padding
commit d105e4e165264bf7770f7b0cc89cba802ca5b8ae
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:11:05 2010 -0400
BZ-615017: enhance search suggestion/execution support for boundary matching
this fix supports all three styles for search terms:
* value
* context=value
* context[parameter]=value
this fix enhances boundar matching in the following ways:
1) adds boundary matching for 'parameter' suggestions
2) adds boundary matching for 'values' suggestions
3) supports search execution for bounded 'parameter'
4) supports search execution for bounded 'values'
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index cee5ff2..b4c3069 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -62,8 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.name", filter)
//
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -72,8 +74,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.plugin", filter)
//
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -81,8 +83,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(rg.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("rg.name", filter) //
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 9900ecb..e0560bf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -67,8 +69,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("definition.name",
filter) //
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -79,8 +81,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("definition.name",
filter) //
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -90,8 +92,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN ms.definition def " //
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("ms.definition.name",
filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY def.name ");
} else {
@@ -113,8 +115,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.name", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -122,8 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.plugin " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.plugin", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -131,8 +133,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT res.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("res.name", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -148,9 +150,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("property.name",
param) //
+ + " AND " +
getJPQLForString("property.stringValue", filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -163,9 +165,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("property.name",
param) //
+ + " AND " +
getJPQLForString("property.stringValue", filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -175,9 +177,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("ms.definition.name",
param) //
+ + " AND " + getJPQLForString("trait.value", filter)
//
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY trait.value ");
} else {
@@ -185,5 +187,4 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
}
}
-
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
new file mode 100644
index 0000000..734526a
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
@@ -0,0 +1,90 @@
+package org.rhq.enterprise.server.search.common;
+
+import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
+import org.rhq.enterprise.server.util.QueryUtility;
+
+public class SearchQueryGenerationUtility {
+ public enum ValueFilter {
+ STARTS_WITH, //
+ ENDS_WITH, //
+ INDEX_OF, //
+ EXACT_MATCH;
+ }
+
+ public static String getJPQLForString(String fragment, String value) {
+ if (value == null) {
+ value = "";
+ }
+
+ return getJPQLForString(fragment, RHQLComparisonOperator.EQUALS, value);
+ }
+
+ public static String getJPQLForString(String fragment, RHQLComparisonOperator
operator, String value) {
+ if (value == null) {
+ value = "";
+ }
+
+ int size = value.length();
+ if (value.startsWith("^")) {
+ if (value.endsWith("$")) {
+ return getJPQLForString(fragment, operator, value.substring(1, size - 1),
ValueFilter.EXACT_MATCH);
+ } else {
+ return getJPQLForString(fragment, operator, value.substring(1),
ValueFilter.STARTS_WITH);
+ }
+ } else {
+ if (value.endsWith("$")) {
+ return getJPQLForString(fragment, operator, value.substring(0, size - 1),
ValueFilter.ENDS_WITH);
+ } else {
+ return getJPQLForString(fragment, operator, value,
ValueFilter.INDEX_OF);
+ }
+ }
+ }
+
+ private static String getJPQLForString(String fragment, RHQLComparisonOperator
operator, String value,
+ ValueFilter filter) {
+ if (operator == RHQLComparisonOperator.EQUALS) {
+ return lower(fragment) + " LIKE " + process(filter,
value.toLowerCase());
+
+ } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) {
+ return fragment + " LIKE " + process(filter, value);
+
+ } else if (operator == RHQLComparisonOperator.NOT_EQUALS) {
+ return lower(fragment) + " NOT LIKE " + process(filter,
value.toLowerCase());
+
+ } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
+ return fragment + " NOT LIKE " + process(filter, value);
+
+ } else if (operator == RHQLComparisonOperator.NULL) {
+ return fragment + " IS NULL";
+
+ } else if (operator == RHQLComparisonOperator.NOT_NULL) {
+ return fragment + " IS NOT NULL";
+
+ } else {
+ throw new IllegalArgumentException("Unsupported operator " +
operator);
+ }
+ }
+
+ private static String process(ValueFilter filter, String value) {
+ if (filter == ValueFilter.STARTS_WITH) {
+ return "'" + escape(value) + "%'";
+ } else if (filter == ValueFilter.ENDS_WITH) {
+ return "'%" + escape(value) + "'";
+ } else if (filter == ValueFilter.INDEX_OF) {
+ return "'%" + escape(value) + "%'";
+ } else if (filter == ValueFilter.EXACT_MATCH) {
+ return "'" + escape(value) + "'";
+ } else {
+ throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
+ }
+ }
+
+ public static String lower(String data) {
+ return "LOWER(" + data + ")";
+ }
+
+ public static String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index e94f938..45b5358 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -220,9 +220,9 @@ public class SearchAssistManager {
this.type = computeType(param, operator);
this.context = (this.type == Type.SIMPLE) ? stripQuotes(context) : context;
- this.param = param;
+ this.param = param == null ? "" : param; // ensure non-null
this.operator = operator;
- this.value = value;
+ this.value = value == null ? "" : value; // ensure non-null
}
private String stripQuotes(String data) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 938b221..79f14ee 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,72 +1,9 @@
package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
-import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
- public enum ValueFilter {
- STARTS_WITH, //
- ENDS_WITH, //
- INDEX_OF, //
- EXACT_MATCH;
- }
-
- private String process(ValueFilter filter, String value) {
- if (filter == ValueFilter.STARTS_WITH) {
- return "'" + escape(value) + "%'";
- } else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + escape(value) + "'";
- } else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + escape(value) + "%'";
- } else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + escape(value) + "'";
- } else {
- throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
- }
- }
-
- private String getJPQLForString(String fragment, RHQLComparisonOperator operator,
String value, ValueFilter filter) {
- if (operator == RHQLComparisonOperator.EQUALS) {
- return lower(fragment) + " LIKE " + process(filter,
value.toLowerCase());
-
- } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) {
- return fragment + " LIKE " + process(filter, value);
-
- } else if (operator == RHQLComparisonOperator.NOT_EQUALS) {
- return lower(fragment) + " NOT LIKE " + process(filter,
value.toLowerCase());
-
- } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return fragment + " NOT LIKE " + process(filter, value);
-
- } else if (operator == RHQLComparisonOperator.NULL) {
- return fragment + " IS NULL";
-
- } else if (operator == RHQLComparisonOperator.NOT_NULL) {
- return fragment + " IS NOT NULL";
-
- } else {
- throw new IllegalArgumentException("Unsupported operator " +
operator);
- }
- }
-
- protected String getJPQLForString(String fragment, RHQLComparisonOperator operator,
String value) {
- int size = value.length();
- if (value.startsWith("^")) {
- if (value.endsWith("$")) {
- return getJPQLForString(fragment, operator, value.substring(1, size - 1),
ValueFilter.EXACT_MATCH);
- } else {
- return getJPQLForString(fragment, operator, value.substring(1),
ValueFilter.STARTS_WITH);
- }
- } else {
- if (value.endsWith("$")) {
- return getJPQLForString(fragment, operator, value.substring(0, size - 1),
ValueFilter.ENDS_WITH);
- } else {
- return getJPQLForString(fragment, operator, value,
ValueFilter.INDEX_OF);
- }
- }
- }
-
protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator,
String value,
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
@@ -99,18 +36,10 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
+ value + "'");
}
- protected String lower(String data) {
- return "LOWER(" + data + ")";
- }
-
protected String quote(String data) {
return "'" + data + "'";
}
- protected String escape(String data) {
- return QueryUtility.escapeSearchParameter(data);
- }
-
protected final String addFragmentIfParameterNotValue(String fragment, String
parameter, String value) {
if (!parameter.equalsIgnoreCase(value)) {
return fragment;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
index 5a603ed..0a2e0f1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.translation;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index 3fd7b12..dfe53ec 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.translation;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
@@ -59,7 +61,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " JOIN res.schedules schedule " //
+ " WHERE trait.schedule = schedule " //
+ " AND schedule.definition.dataType = 1 " //
- + " AND schedule.definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("schedule.definition.name", RHQLComparisonOperator.EQUALS,
param) //
+ " AND " + getJPQLForString("trait.value", op,
filter));
} else if (path.equals("connection")) {
@@ -71,7 +73,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
- + " AND definition.name = " + quote(param) //
+ + " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) {
@@ -83,7 +85,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
- + " AND definition.name = " + quote(param) //
+ + " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
index 8750977..c7cc99f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
@@ -40,7 +40,7 @@ public class QueryUtility {
*/
public static String escapeSearchParameter(String value) {
if (value == null || value.trim().equals("")) {
- return null;
+ return ""; // if we return null, query will get created as...where
pathExpression LIKE '%null%'
}
return doEscapeSearchParameter(value);
commit 5a20de24f35418707a68f74ed51cb0614d28639d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 12:46:27 2010 -0400
do not escape enums in search
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index e2d3600..938b221 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -14,13 +14,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
private String process(ValueFilter filter, String value) {
if (filter == ValueFilter.STARTS_WITH) {
- return "'" + QueryUtility.escapeSearchParameter(value) +
"%'";
+ return "'" + escape(value) + "%'";
} else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + QueryUtility.escapeSearchParameter(value) +
"'";
+ return "'%" + escape(value) + "'";
} else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + QueryUtility.escapeSearchParameter(value) +
"%'";
+ return "'%" + escape(value) + "%'";
} else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + QueryUtility.escapeSearchParameter(value) +
"'";
+ return "'" + escape(value) + "'";
} else {
throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
}
@@ -71,14 +71,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
operator == RHQLComparisonOperator.NOT_NULL) {
- return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation());
+ return fragment + operator.getDefaultTranslation();
} else if (operator == RHQLComparisonOperator.EQUALS || //
operator == RHQLComparisonOperator.EQUALS_STRICT || //
operator == RHQLComparisonOperator.NOT_EQUALS || //
operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation()
- + getEnum(enumClass, value, useOrdinal));
+ return fragment + operator.getDefaultTranslation() + getEnum(enumClass,
value, useOrdinal);
} else {
throw new IllegalArgumentException("Unsupported operator " +
operator);
@@ -108,6 +107,10 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
return "'" + data + "'";
}
+ protected String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
protected final String addFragmentIfParameterNotValue(String fragment, String
parameter, String value) {
if (!parameter.equalsIgnoreCase(value)) {
return fragment;
commit efa06a26b20fc8b6a40697e793b540a50cf68afb
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 12:20:14 2010 -0400
BZ-610135: provide intelligent quoting for suggestions
* if a suggestion doesn't need to be quoted, don't quote it
* if a suggestion has whitespace, then determine how to quote it
** if it has only single-quotes in the value, wrap it in double-quotes
** if it has only double-quotes in the value, wrap it in single-quotes
** if it has both types of quotes in the value, don't quote it
*** thus, treat mixed-quoted values single search terms so the parser won't bomb
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
index aa02b08..fb1b135 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
@@ -89,7 +89,19 @@ public class SearchSuggestion implements Serializable,
Comparable<SearchSuggesti
if (kindComparision != 0) {
return kindComparision;
}
- return label.toLowerCase().compareTo(other.label.toLowerCase());
+ return toLowerStripQuotes(label).compareTo(toLowerStripQuotes(other.label));
+ }
+
+ private static String toLowerStripQuotes(String data) {
+ if (data.length() < 2) {
+ return data;
+ }
+ char firstChar = data.charAt(0);
+ char lastChar = data.charAt(data.length() - 1);
+ if ((firstChar == '"' && lastChar == '"') ||
(firstChar == '\'' && lastChar == '\'')) {
+ return data.substring(1, data.length() - 1);
+ }
+ return data;
}
public String toString() {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index eb57c47..e94f938 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -427,25 +427,12 @@ public class SearchAssistManager {
String primarySimpleContext = completor.getPrimarySimpleContext();
debug("getSimpleSuggestions: suggesting value completions for a simple
context [" + primarySimpleContext + "]");
- String pad = getQuotePadding(beforeCaret);
- List<String> valueSuggestions = pad(pad,
completor.getValues(primarySimpleContext, null, parsedTerm), pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(primarySimpleContext, null,
+ parsedTerm));
List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed,
parsedTerm, Kind.Simple);
return suggestions;
}
- private String getQuotePadding(String parsedTerm) {
- if (parsedTerm.equals("")) {
- return "\"";
- }
- // if not empty, it has at least one char
- char first = parsedTerm.charAt(0);
- if (first == '\'') {
- return "'";
- } else /* if (first == '"') */{
- return "\"";
- }
- }
-
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -527,7 +514,8 @@ public class SearchAssistManager {
debug("getAdvancedSuggestions: operator state");
if (allComparisonOperators.contains(parsed.operator)) {
debug("search term is complete operator, suggesting values
instead");
- List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, ""), pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(parsed.context,
+ parsed.param, ""));
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for
a simple context");
return convert(pad(parsed.context + parsed.operator,
valueSuggestions, ""));
@@ -554,8 +542,8 @@ public class SearchAssistManager {
}
case VALUE:
debug("getAdvancedSuggestions: value state");
- List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, parsed.value),
- pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(parsed.context,
+ parsed.param, parsed.value));
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for a
simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions,
""), parsed, parsed.value);
@@ -688,6 +676,57 @@ public class SearchAssistManager {
return results;
}
+ private List<String> padWithQuotes(String beforeCaret, List<String> data)
{
+ String defaultPad = getQuotePadding(beforeCaret);
+
+ List<String> results = new ArrayList<String>();
+ for (String next : data) {
+ boolean hasWhiteSpace = next.matches(".*\\s.*");
+ if (hasWhiteSpace == false) {
+ // don't pad things that don't need padding
+ results.add(next);
+ continue;
+ }
+
+ // we do have whitespace, let's also see if we have quotes
+ boolean hasSingleQuote = next.indexOf("'") != -1;
+ boolean hasDoubleQuote = next.indexOf('"') != -1;
+
+ if (hasSingleQuote && hasDoubleQuote) {
+ // don't pad if suggestion has both single- and double-quotes
+ // instead, treat suggestion as individual terms, otherwise parser will
bomb
+ results.add(next);
+ continue;
+ }
+
+ String pad = null;
+ if (hasSingleQuote) {
+ pad = "\""; // pad with double-quotes
+ } else if (hasDoubleQuote) {
+ pad = "'"; // pad with single-quotes
+ } else {
+ // otherwise respect the user-chosen padding
+ pad = defaultPad;
+ }
+
+ results.add(pad + next + pad);
+ }
+ return results;
+ }
+
+ private String getQuotePadding(String beforeCaret) {
+ if (beforeCaret.equals("")) {
+ return "\"";
+ }
+ // if not empty, it has at least one char
+ char first = beforeCaret.charAt(0);
+ if (first == '\'') {
+ return "'";
+ } else /* if (first == '"') */{
+ return "\"";
+ }
+ }
+
private void debug(String message) {
LOG.debug(message);
}
commit 024b82d4d29d8fe25c81a163ad36fb5e9a147a47
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 11:10:38 2010 -0400
BZ-610120: respect user-chosen quoting style
* if user starts with single-quote, offer suggestions wrapped with single-quotes
* in all other cases, offer suggestions wrapped with double-quotes
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 2e84d69..eb57c47 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -427,11 +427,25 @@ public class SearchAssistManager {
String primarySimpleContext = completor.getPrimarySimpleContext();
debug("getSimpleSuggestions: suggesting value completions for a simple
context [" + primarySimpleContext + "]");
- List<String> valueSuggestions = pad("\"",
completor.getValues(primarySimpleContext, null, parsedTerm), "\"");
+ String pad = getQuotePadding(beforeCaret);
+ List<String> valueSuggestions = pad(pad,
completor.getValues(primarySimpleContext, null, parsedTerm), pad);
List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed,
parsedTerm, Kind.Simple);
return suggestions;
}
+ private String getQuotePadding(String parsedTerm) {
+ if (parsedTerm.equals("")) {
+ return "\"";
+ }
+ // if not empty, it has at least one char
+ char first = parsedTerm.charAt(0);
+ if (first == '\'') {
+ return "'";
+ } else /* if (first == '"') */{
+ return "\"";
+ }
+ }
+
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -448,6 +462,9 @@ public class SearchAssistManager {
String beforeCaret = assistant.getFragmentBeforeCaret();
debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret +
"'");
+ String pad = getQuotePadding(beforeCaret);
+ debug("getAdvancedSuggestions: padding is ~" + pad + "~");
+
if (beforeCaret.startsWith("'") ||
beforeCaret.startsWith("\"")) {
return Collections.emptyList();
}
@@ -510,7 +527,7 @@ public class SearchAssistManager {
debug("getAdvancedSuggestions: operator state");
if (allComparisonOperators.contains(parsed.operator)) {
debug("search term is complete operator, suggesting values
instead");
- List<String> valueSuggestions = pad("\"",
completor.getValues(parsed.context, parsed.param, ""), "\"");
+ List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, ""), pad);
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for
a simple context");
return convert(pad(parsed.context + parsed.operator,
valueSuggestions, ""));
@@ -537,8 +554,8 @@ public class SearchAssistManager {
}
case VALUE:
debug("getAdvancedSuggestions: value state");
- List<String> valueSuggestions = pad("\"",
completor.getValues(parsed.context, parsed.param, parsed.value),
- "\"");
+ List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, parsed.value),
+ pad);
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for a
simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions,
""), parsed, parsed.value);
commit f683e9e4a8acff49955ff3b6057726b82aae00dd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 10:48:42 2010 -0400
BZ-614529: support search expressions containing ':'
diff --git
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
index 899b07e..0c0f1d5 100644
---
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
+++
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
@@ -171,7 +171,7 @@ LEVEL
;
SYMBOL
- : '!' | '@' | '#' | '$' | '%' | '^'
| '&' | '*' | '-' | '_' | '+' | '|' |
'?' | '/' | ',' | '<' | '>' | '`' |
'~'
+ : '!' | '@' | '#' | '$' | '%' | '^'
| '&' | '*' | '-' | '_' | '+' | '|' |
'?' | '/' | ',' | '<' | '>' | '`' |
'~' | ':'
;
WS
commit 3b1133f24d56f777c0707d540855654718c373d8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 23:28:31 2010 -0400
BZ-614693: ignore search terms that attempt to filter using hidden/password
properties
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index 579184b..3fd7b12 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -65,20 +65,26 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
} else if (path.equals("connection")) {
return new SearchFragment( //
SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" //
- + " FROM Resource res " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN
res.resourceType.pluginConfigurationDefinition.propertyDefinitions definition " //
+ " JOIN res.pluginConfiguration.properties property " //
- + " WHERE definition.name = " + quote(param) //
- + " AND " + getJPQLForString("property.value",
op, filter));
+ + " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ + " AND property = simple " // join to simple for filter
by 'stringValue' attribute
+ + " AND definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) {
return new SearchFragment( //
SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" //
- + " FROM Resource res " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN
res.resourceType.resourceConfigurationDefinition.propertyDefinitions definition " //
+ " JOIN res.resourceConfiguration.properties property "
//
- + " WHERE definition.name = " + quote(param) //
- + " AND " + getJPQLForString("property.value",
op, filter));
+ + " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ + " AND property = simple " // join to simple for filter
by 'stringValue' attribute
+ + " AND definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else {
if (param == null) {
commit becb1c6d0498dd02537167a7fa225c97528d790a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 23:27:39 2010 -0400
BZ-614693: suppress search suggestions for hidden/password parameters/values
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 61faf42..87e10a5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -12,6 +12,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil;
+import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -144,6 +145,10 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return "'" + data + "'";
}
+ protected final String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
protected final String getFormatterValueFragment(String data) {
boolean hasWhitespace = false;
for (char next : data.toCharArray()) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index a428edc..cee5ff2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -7,7 +7,6 @@ import java.util.List;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
-import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -64,8 +63,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -75,8 +73,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -85,9 +82,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(
- " AND LOWER(rg.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'",
- filter) //
+ + add(" AND LOWER(rg.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 124c07b..9900ecb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -9,7 +9,6 @@ import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
-import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -63,23 +62,25 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
} else if (context.equals("connection")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type, Resource res " //"
+ + " FROM ResourceType type, Resource res, PropertyDefinitionSimple
simpleDefinition " //"
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + " AND simpleDefinition = definition " // only suggest names
for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type, Resource res " //
+ + " FROM ResourceType type, Resource res, PropertyDefinitionSimple
simpleDefinition " //"
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + " AND simpleDefinition = definition " // only suggest names
for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -90,8 +91,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(def.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY def.name ");
} else {
@@ -114,8 +114,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -124,8 +123,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -134,8 +132,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(res.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -144,29 +141,31 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
} else if (context.equals("connection")) {
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
- + " FROM Resource res, PropertySimple simple " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
- + " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " JOIN
res.resourceType.pluginConfigurationDefinition.propertyDefinitions propertyDefinition
" // suggest values for existing resources only
+ + " WHERE simpleDefinition = propertyDefinition " // only
suggest values for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ + " AND property = simple " // join here so we can project
simple.stringValue
+ + " AND property.name = propertyDefinition.name " //
property/definition are linked via name
+ + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
- + " FROM Resource res, PropertySimple simple " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
- + " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " JOIN
res.resourceType.resourceConfigurationDefinition.propertyDefinitions propertyDefinition
" // suggest values for existing resources only
+ + " WHERE simpleDefinition = propertyDefinition " // only
suggest values for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ + " AND property = simple " // join here so we can project
simple.stringValue
+ + " AND property.name = propertyDefinition.name " //
property/definition are linked via name
+ + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -176,12 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " AND LOWER(ms.definition.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(trait.value) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY trait.value ");
} else {
commit 78f3557d5f2964a594e4c7d220f1dcb9c6ab98d9
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 21:12:52 2010 -0400
BZ-614591: fix inventory sync issues that manifest during specific timings of async
uninventory
part 1 - do not merge inventory report resources that have already been uninventoried
there exists a small window of time after the synchronous part of the uninventory and
before the async
quartz job comes along to perform the actual removal of the resource from the
database, that an inventory
report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to
COMMITTED. if we find,
during an inventory report merge, that the existing resource was already uninventoried
(indicating that
the quartz job has not yet come along to remove this resource from the database) we
should stop all
processing from this node and return immediately. this short-cuts the processing for
the entire sub-tree
under this resource, but that's OK because the in-band uninventory logic will have
marked entire sub-tree
for uninventory atomically. in other words, all of the descendants under a resource
would also be marked
for async uninventory too.
part 2 - async uninventory work should recursively delete resources
this handles the case when the the rare timings in part 1 made it into the system and
the inventory is
current in an inconsistent state. the likely effect is that a resource marked with
UNINVENTORIED status
has a child that is marked as COMMITTED. thus, if we recursively delete resources in
the out-of-band job,
we ensure that synchronization inconsistencies are eliminated and the inventory is
brought back to a
consistent state.
part 3 - async uninventory work should remove resources from their containing groups
even though the group removal occurs in the in-band work, there can be some group
definitions that just
happens to perform its recalculation (either manually or schedules) in the period
after the in-band work
completes but before the async job triggers. since the ExpressionEvaluator that
underlies the bulk of the
dynagroup query generations automatically adds a filter to only manipulate COMMITTED
resource, this work
should be a no-op most of the time. however, in rare circumstances it's possible
for an InventoryReport to
come across the wire and flip the status of resources from UNINVENTORIED back to
COMMITTED. in this case,
this group removal logic needs to be executed again just prior to removing the rest of
the reosurce history.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index cded63b..e9f1dc5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -561,8 +561,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
Resource parent = resource;
while (parent != null && existingResource == null) {
parent = parent.getParentResource();
- existingResource =
resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent,
- resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
+ existingResource =
resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent,
+ resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
}
if (existingResource != null) {
@@ -592,15 +592,30 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
private void updatePreviouslyInventoriedResource(Resource resource, Resource
existingResource,
Resource parentResource) throws InvalidInventoryReportException {
+ /*
+ * there exists a small window of time after the synchronous part of the
uninventory and before the async
+ * quartz job comes along to perform the actual removal of the resource from the
database, that an inventory
+ * report can come across the wire and !OVERWROTE! the UNINVENTORIED status back
to COMMITTED. if we find,
+ * during an inventory report merge, that the existing resource was already
uninventoried (indicating that
+ * the quartz job has not yet come along to remove this resource from the
database) we should stop all
+ * processing from this node and return immediately. this short-cuts the
processing for the entire sub-tree
+ * under this resource, but that's OK because the in-band uninventory logic
will have marked entire sub-tree
+ * for uninventory atomically. in other words, all of the descendants under a
resource would also be marked
+ * for async uninventory too.
+ */
+ if (existingResource.getInventoryStatus() == InventoryStatus.UNINVENTORIED) {
+ return;
+ }
+
assert (parentResource == null) || (parentResource.getId() != 0);
-
- ResourceType existingResourceParentType = (existingResource.getParentResource()
!= null)
- ? existingResource.getParentResource().getResourceType() : null;
- ResourceType resourceParentType = (resource.getParentResource() != null)
- ? resource.getParentResource().getResourceType() : null;
+
+ ResourceType existingResourceParentType = (existingResource.getParentResource()
!= null) ? existingResource
+ .getParentResource().getResourceType() : null;
+ ResourceType resourceParentType = (resource.getParentResource() != null) ?
resource.getParentResource()
+ .getResourceType() : null;
Set<ResourceType> validParentTypes =
existingResource.getResourceType().getParentResourceTypes();
- if (validParentTypes != null && !validParentTypes.isEmpty() &&
- !validParentTypes.contains(existingResourceParentType)) {
+ if (validParentTypes != null && !validParentTypes.isEmpty()
+ && !validParentTypes.contains(existingResourceParentType)) {
// The existing Resource has an invalid parent ResourceType. This may be
because its ResourceType was moved
// to a new parent ResourceType, but its new parent was not yet discovered at
the time of the type move. See
// if the Resource reported by the Agent has a valid parent type, and, if so,
update the existing Resource's
@@ -617,10 +632,10 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
existingResource.setParentResource(resource.getParentResource());
} else {
log.debug("Existing Resource " + existingResource + " has
invalid parent type ("
- + existingResourceParentType + ") and so does
plugin-reported Resource " + resource + " ("
- + resourceParentType + ") - valid parent types are [" +
validParentTypes + "].");
+ + existingResourceParentType + ") and so does plugin-reported
Resource " + resource + " ("
+ + resourceParentType + ") - valid parent types are [" +
validParentTypes + "].");
}
- }
+ }
// The below block is for Resources that were created via the RHQ GUI, whose
descriptions will be null.
if (existingResource.getDescription() == null &&
resource.getDescription() != null) {
@@ -654,11 +669,11 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
private boolean initResourceTypes(Resource resource) {
ResourceType resourceType;
try {
- resourceType =
this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(),
resource
- .getResourceType().getName(), resource.getResourceType().getPlugin());
+ resourceType =
this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(),
+ resource.getResourceType().getName(),
resource.getResourceType().getPlugin());
} catch (RuntimeException e) {
log.error("Failed to lookup Resource type [" +
resource.getResourceType() + "] for reported Resource ["
- + resource + "] - this should not have happened.");
+ + resource + "] - this should not have happened.");
return false;
}
if (resourceType == null) {
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 df9b758..be85557 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
@@ -279,14 +279,13 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
int i = 0;
log.debug("== total size : " + toBeDeletedResourceIds.size());
- while (i<toBeDeletedResourceIds.size()) {
+ while (i < toBeDeletedResourceIds.size()) {
int j = i + 1000;
if (j > toBeDeletedResourceIds.size())
j = toBeDeletedResourceIds.size();
- List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j);
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
log.debug("== Bounds " + i + ", " + j);
-
boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete);
if (hasErrors) {
throw new IllegalArgumentException("Could not remove resources from
their containing groups");
@@ -338,7 +337,21 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
throw new IllegalArgumentException("Only the overlord can execute
out-of-band async resource delete method");
}
- boolean hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId);
+ /*
+ * even though the group removal occurs in the in-band work, there can be some
group definitions that just
+ * happens to perform its recalculation (either manually or schedules) in the
period after the in-band work
+ * completes but before the async job triggers. since the ExpressionEvaluator
that underlies the bulk of the
+ * dynagroup query generations automatically adds a filter to only manipulate
COMMITTED resource, this work
+ * should be a no-op most of the time. however, in rare circumstances it's
possible for an InventoryReport to
+ * come across the wire and flip the status of resources from UNINVENTORIED back
to COMMITTED. in this case,
+ * this group removal logic needs to be executed again just prior to removing the
rest of the reosurce history.
+ */
+ boolean hasErrors = uninventoryResourcesBulkDelete(user,
Arrays.asList(resourceId));
+ if (hasErrors) {
+ return; // return early if there were any errors, because we can't remove
the resource yet
+ }
+
+ hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId);
if (hasErrors) {
return; // return early if there were any errors, because we can't remove
the resource yet
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
index 412e61d..b0d183d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
@@ -26,6 +26,7 @@ import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.server.exception.UnscheduleException;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.operation.ResourceOperationSchedule;
@@ -36,39 +37,72 @@ public class AsyncResourceDeleteJob extends AbstractStatefulJob {
private final Log log = LogFactory.getLog(AsyncResourceDeleteJob.class);
- @Override
- public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException {
-
- Subject overlord = LookupUtil.getSubjectManager().getOverlord();
- ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ private class AsyncDeletionStats {
int deletedSuccessfully = 0;
int deletedWithFailure = 0;
- long time = 0;
+ long deletionTime;
+
+ public String toString() {
+ return "Async resource deletion - " + deletedSuccessfully + "
successful, " + deletedWithFailure
+ + " failed, took [" + deletionTime + "] ms";
+ }
+ }
+
+ @Override
+ public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException {
List<Integer> toBeRemovedIds =
resourceManager.findResourcesMarkedForAsyncDeletion(overlord);
+
+ AsyncDeletionStats stats = new AsyncDeletionStats();
for (Integer doomedResourceId : toBeRemovedIds) {
try {
- log.debug("Before asynchronous deletion of resource[id=" +
doomedResourceId + "]");
- long startTime = System.currentTimeMillis();
- unscheduleJobs(overlord, doomedResourceId);
- resourceManager.uninventoryResourceAsyncWork(overlord,
doomedResourceId);
- long endTime = System.currentTimeMillis();
- time += (endTime - startTime);
- log.debug("After asynchronous deletion of resource[id=" +
doomedResourceId + "], took ["
- + (endTime - startTime) + "]ms");
- deletedSuccessfully++;
+ // do not recurse
+ uninventoryResource(overlord, doomedResourceId, stats, false);
} catch (Throwable t) {
- log.debug("Error during asynchronous deletion of resource[id="
+ doomedResourceId + "]", t);
- deletedWithFailure++;
+ log.debug("Simple asynchronous deletion of resource[id=" +
doomedResourceId + "] failed, "
+ + "trying more robust yet expensive removal method, cause:
" + ThrowableUtil.getAllMessages(t));
+ try {
+ // try more robust yet expensive recursive delete
+ uninventoryResource(overlord, doomedResourceId, stats, true);
+ } catch (Throwable tt) {
+ log.debug("Error during asynchronous deletion of
resource[id=" + doomedResourceId + "], cause: "
+ + ThrowableUtil.getAllMessages(tt));
+ stats.deletedWithFailure++;
+ }
}
}
- if (deletedSuccessfully > 0 || deletedWithFailure > 0) {
- log.info("Async resource deletion - " + deletedSuccessfully +
" successful, " + deletedWithFailure
- + " failed, took [" + time + "]ms");
+ if (stats.deletedSuccessfully > 0 || stats.deletedWithFailure > 0) {
+ log.info(stats);
}
}
+ // return true if successful
+ private void uninventoryResource(Subject overlord, Integer doomedResourceId,
AsyncDeletionStats stats,
+ boolean recurse) {
+ if (recurse) {
+ List<Integer> doomedChildrenIds =
resourceManager.findChildrenResourceIds(doomedResourceId, null);
+ for (Integer nextDoomedChildId : doomedChildrenIds) {
+ uninventoryResource(overlord, nextDoomedChildId, stats, recurse);
+ }
+ }
+ log.debug("Before " + (recurse ? "(recursive)" :
"") + " asynchronous deletion of resource[id="
+ + doomedResourceId + "]");
+ long startTime = System.currentTimeMillis();
+
+ unscheduleJobs(overlord, doomedResourceId);
+ resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId);
+ stats.deletedSuccessfully++;
+
+ long endTime = System.currentTimeMillis();
+ log.debug("After " + (recurse ? "(recursive)" : "")
+ " asynchronous deletion of resource[id="
+ + doomedResourceId + "] took [" + (endTime - startTime) +
"]ms");
+
+ stats.deletionTime += (endTime - startTime);
+ }
+
private void unscheduleJobs(Subject overlord, Integer resourceId) {
log.debug("Unscheduling jobs for resource[id=" + resourceId +
"]");
OperationManagerLocal operationManager = LookupUtil.getOperationManager();
commit d5acc2c164a7d417a1b938bb7d95d21ed7f2d519
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 21:07:11 2010 -0400
BZ-614688: support searching for values that contain single-quotes
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index cba008f..a428edc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -7,6 +7,7 @@ import java.util.List;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
+import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -63,7 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -73,7 +75,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -82,7 +85,9 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(rg.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(
+ " AND LOWER(rg.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'",
+ filter) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index e6552fc..124c07b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -9,6 +9,7 @@ import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
+import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -66,7 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -76,7 +78,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -87,7 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(def.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY def.name ");
} else {
@@ -110,7 +114,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -119,7 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -128,7 +134,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(res.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -140,9 +147,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, PropertySimple simple " //
+ " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(property.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -151,9 +161,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, PropertySimple simple " //
+ " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(property.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -163,9 +176,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(ms.definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(trait.value) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY trait.value ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 59f4888..e2d3600 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,6 +1,7 @@
package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
+import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
@@ -13,13 +14,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
private String process(ValueFilter filter, String value) {
if (filter == ValueFilter.STARTS_WITH) {
- return "'" + value + "%'";
+ return "'" + QueryUtility.escapeSearchParameter(value) +
"%'";
} else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + value + "'";
+ return "'%" + QueryUtility.escapeSearchParameter(value) +
"'";
} else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + value + "%'";
+ return "'%" + QueryUtility.escapeSearchParameter(value) +
"%'";
} else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + value + "'";
+ return "'" + QueryUtility.escapeSearchParameter(value) +
"'";
} else {
throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
}
@@ -70,20 +71,21 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
operator == RHQLComparisonOperator.NOT_NULL) {
- return fragment + operator.getDefaultTranslation();
+ return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation());
} else if (operator == RHQLComparisonOperator.EQUALS || //
operator == RHQLComparisonOperator.EQUALS_STRICT || //
operator == RHQLComparisonOperator.NOT_EQUALS || //
operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return fragment + operator.getDefaultTranslation() + getEnum(enumClass,
value, useOrdinal);
+ return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation()
+ + getEnum(enumClass, value, useOrdinal));
} else {
throw new IllegalArgumentException("Unsupported operator " +
operator);
}
}
- protected String getEnum(Class<? extends Enum<?>> enumClass, String
value, boolean useOrdinal) {
+ private String getEnum(Class<? extends Enum<?>> enumClass, String value,
boolean useOrdinal) {
value = value.toLowerCase();
for (Enum<?> nextEnum : enumClass.getEnumConstants()) {
if (nextEnum.name().toLowerCase().equals(value)) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
index bd9cc8a..8750977 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
@@ -48,16 +48,17 @@ public class QueryUtility {
private static String doEscapeSearchParameter(String value) {
init();
-
+
// Escape LIKE's wildcard characters with escaped characters so that the
user's input
// will be matched literally
value = value.replace(ESCAPE_CHARACTER, ESCAPED_ESCAPE);
value = value.replace("_", ESCAPED_UNDERSCORE);
value = value.replace("%", ESCAPED_PERCENT);
+ value = value.replace("'", "''");
return value;
- }
-
+ }
+
/**
* Given the settings for the current DatabaseType, properly handle escaping special
SQL characters as
* well as UPCASING the value (standard for rhq filter searches) and wrapping with
SQL wildcard for
commit a11d80bed0111bf051aac38d7f7c786518ea34ed
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:41:08 2010 -0400
Tests with the ListGridFieldType.LINK
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 927056b..3dc9f4c 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
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.grid.CellFormatter;
@@ -66,12 +67,15 @@ public class BundlesListView extends Table {
setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60");
- getListGrid().getField("name").setWidth("25%");
- getListGrid().getField("name").setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
- return "<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
- }
- });
+ getListGrid().getField("link").setWidth("25%");
+ getListGrid().getField("link").setType(ListGridFieldType.LINK);
+ getListGrid().getField("link").setTarget("_self");
+
+// getListGrid().getField("name").setCellFormatter(new CellFormatter()
{
+// public String format(Object o, ListGridRecord listGridRecord, int i, int
i1) {
+// return "";//<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
+// }
+// });
getListGrid().getField("description").setWidth("25%");
getListGrid().getField("latestVersion").setWidth("25%");
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 f20d65e..e3b54ac 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
@@ -22,6 +22,7 @@ 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.fields.DataSourceIntegerField;
+import com.smartgwt.client.data.fields.DataSourceLinkField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -46,8 +47,9 @@ public class BundlesWithLatestVersionDataSource extends
RPCDataSource<BundleWith
idField.setPrimaryKey(true);
addField(idField);
- DataSourceTextField nameField = new DataSourceTextField("name",
"Name");
- addField(nameField);
+ DataSourceLinkField linkField = new DataSourceLinkField("link",
"Name");
+ addField(linkField);
+
DataSourceTextField descriptionField = new
DataSourceTextField("description", "Description");
addField(descriptionField);
@@ -112,6 +114,12 @@ public class BundlesWithLatestVersionDataSource extends
RPCDataSource<BundleWith
record.setAttribute("id", from.getBundleId());
record.setAttribute("name", from.getBundleName());
+
+
+ record.setAttribute("link", "#Bundles/Bundle/" +
from.getBundleId());
+ record.setLinkText(from.getBundleName());
+
+
record.setAttribute("description", from.getBundleDescription());
record.setAttribute("latestVersion", from.getLatestVersion());
record.setAttribute("versionsCount",
Integer.valueOf(from.getVersionsCount().intValue())); // want int, not long
commit d09d01da042f20a4d3aa7ed43407cd76ce020293
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:39:10 2010 -0400
IE6 XMLHttpRequest workaround for the searchgui
Don't use CoreGUI framework features from the jsf embedded search gui components
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
index e4e7f01..8ecfde5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
@@ -95,8 +95,12 @@ public class SearchGUI implements EntryPoint {
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria,
new AsyncCallback<PageList<Subject>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
load user's subject", caught);
- new LoginView().showLoginDialog();
+ // can't use this until gwt frame is always
present, reserve for futureu
+ //CoreGUI.getErrorHandler().handleError("Failed
to load user's subject", caught);
+ //SC.say("Failed to load user's
subject.");
+ //new LoginView().showLoginDialog();
+
+ System.out.println("Failed to load user's
subject");
}
public void onSuccess(PageList<Subject> result) {
@@ -126,6 +130,7 @@ public class SearchGUI implements EntryPoint {
CoreGUI.unforceIe6Hacks();
}
}
+
}
public static Subject getSessionSubject() {
@@ -135,4 +140,30 @@ public class SearchGUI implements EntryPoint {
public SearchBar getSearchBar() {
return searchBar;
}
+
+
+
+ /**
+ * Detects IE6.
+ * <p/>
+ * This is a nasty hack; but it's extremely reliable when running with other
+ * js libraries on the same page at the same time as gwt.
+ */
+ public static native boolean detectIe6() /*-{
+ if (typeof $doc.body.style.maxHeight != "undefined")
+ return(false);
+ else
+ return(true);
+}-*/;
+
+ public static native void forceIe6Hacks() /*-{
+ $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest;
+ $wnd.XMLHttpRequest = null;
+}-*/;
+
+ public static native void unforceIe6Hacks() /*-{
+ $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup;
+ $wnd.XMLHttpRequestBackup = null;
+}-*/;
+
}
commit 66f26631cda5e42af276412d7af027c7d80a9d7d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:38:08 2010 -0400
Protect against invalid events
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index 60866e0..47dcded 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -110,9 +110,12 @@ public class SearchBar extends SimplePanel {
Event.addNativePreviewHandler(new NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent event) {
- if (event.getNativeEvent().getEventTarget().equals(searchButton)
- && event.getTypeInt() == Event.ONMOUSEDOWN) {
- prepareSearchExecution();
+ if (event.getNativeEvent() != null &&
event.getNativeEvent().getEventTarget() != null) {
+
+ if (event.getNativeEvent().getEventTarget().equals(searchButton)
+ && event.getTypeInt() == Event.ONMOUSEDOWN) {
+ prepareSearchExecution();
+ }
}
}
});
commit 6e887d7303ef5de7f90b5d0371b62865669a3d46
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 17:02:33 2010 -0400
fully qualified image path for other context path usage
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
index 44aaacd..37f553d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
@@ -35,7 +35,7 @@ public class RPCManager {
Img activityIndicator;
public RPCManager() {
- activityIndicator = new Img("ajax-loader.gif", 16, 16);
+ activityIndicator = new Img("/coregui/images/ajax-loader.gif", 16,
16);
activityIndicator.setZIndex(10000);
activityIndicator.setLeft(10);
activityIndicator.setTop(40);
commit aace8158a984fd8368541a8a54fa42c5bbf89b4d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 17:02:00 2010 -0400
Switch menubar border overrides to css !important for bug in IE dom editing
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 e5c0d93..55a7d47 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
@@ -77,25 +77,6 @@ public class MenuBarView extends VLayout {
this.aboutModalWindow = new AboutModalWindow();
-
- /*// TODO GH: This is a nasty hack... it injects the css to override the smartgwt
skin
- String css = ".menuButton, .menuButtonOver, .menuButtonDown,
.menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown,
.menuButtonSelectedOver, .menuButtonSelectedDisabled {\n" +
- " border: none;\n" +
- " font-size: 9pt; \n" +
- " font-weight: bold;\n" +
- "}\n" +
- ".menuButtonDown {\n" +
- " background:
url(\"/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_Over_stretch.png\")
repeat-x scroll 0 0 #DDDDDD";
-
- com.google.gwt.dom.client.StyleElement style =
Document.get().createStyleElement();
- style.setPropertyString("language", "text/css");
- style.setInnerText(css);
- Document.get().getBody().appendChild(style);
-
-*/
-
-
-
HLayout topBar = new HLayout();
topBar.setHeight(28);
topBar.setStyleName("topMenuBar");
commit 7d741942d29e94da90e4627648b0a6bcad51a4b8
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 16:58:11 2010 -0400
We have to release without user.agent specific builds to have proper multiple browser
support!
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 264fbd6..14ca590 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -41,7 +41,7 @@
<set-property name="user.agent" value="safari"/>
<!-- Firefox 3 -->
- <set-property name="user.agent" value="gecko1_8"/>
+ <!--<set-property name="user.agent"
value="gecko1_8"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
commit a0fa16035a5750ddca2dead531fad2ce33501b3f
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 14 21:47:24 2010 -0400
fix so unset checkbox works for textarea fields (for longString props)
(
https://bugzilla.redhat.com/show_bug.cgi?id=609456); call prepareInputsForSubmission() JS
function upon submission of form on update alert sender config page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
index 85077aa..138a5e5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
@@ -181,7 +181,7 @@ function writeProtectInputs(inputs) {
* @param form a form element
*/
function prepareInputsForSubmission(form) {
- var inputs = Form.getInputs(form);
+ var inputs = Form.getElements(form);
for ( var i = 0; i < inputs.length; i++) {
if (inputs[i].disabled) {
// NOTE: It is vital to enable any disabled inputs, since the browser will exclude
disabled inputs from the
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
index 01725e8..d64cc27 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
@@ -117,7 +117,7 @@
</rich:panel>
<h:panelGroup id="customContentPanel" rendered="#{not empty
alertNotificationsUIBean.activeNotification}">
- <h:form id="customContentForm">
+ <h:form id="customContentForm"
onsubmit="prepareInputsForSubmission(this)">
<input type="hidden" name="context"
value="#{param.context}"/>
<input type="hidden" name="contextId"
value="#{param.contextId}"/>
<input type="hidden" name="contextSubId"
value="#{param.contextSubId}"/>
@@ -189,4 +189,4 @@
</ui:composition>
-</html>
\ No newline at end of file
+</html>
commit bf4a057589b0ce6590043614b14c821cf18ef822
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 15:14:25 2010 -0400
[BZ 613918] Further ensure manage_bundle permission is sufficient
to manipulate bundles and view deployments.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
index 5520e0b..4e38e46 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
@@ -85,8 +85,12 @@ public class BundleResourceDeploymentCriteria extends Criteria {
this.fetchBundleDeployment = fetchBundleDeployment;
}
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then
+ // see his resource deployments. Until we can handle granular authorization checks
on
+ // optionally fetched resource member data, allow a bundle manager to see
+ // resouce deployments to any platform.
/**
- * Requires MANAGE_INVENTORY
+ * Requires MANAGE_INVENTORY or MANAGE_BUNDLE
*
* @param fetchResource
*/
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
index a70919e..5cf8205 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
@@ -695,7 +695,9 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
// Create the mapping between the Bundle's Repo and the BundleFile's
PackageVersion
Repo repo = bundle.getRepo();
- repoManager.addPackageVersionsToRepo(subject, repo.getId(), new int[] {
packageVersion.getId() });
+ // add the packageVersion as overlord, this allows users without MANAGE_INVENTORY
permission to add bundle files
+ repoManager.addPackageVersionsToRepo(subjectManager.getOverlord(), repo.getId(),
new int[] { packageVersion
+ .getId() });
// Classify the Package with the Bundle name in order to distinguish it from the
same package name for
// a different bundle.
@@ -1151,12 +1153,15 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
if (!authorizationManager.isInventoryManager(subject)) {
if (criteria.isInventoryManagerRequired()) {
- throw new PermissionException("Subject [" + subject.getName()
- + "] requires InventoryManager permission for requested query
criteria.");
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could
not then
+ // see his resource deployments. Until we can handle granular
authorization checks on
+ // optionally fetched resource member data, allow a bundle manager to
see
+ // resouce deployments to any platform.
+ if (!authorizationManager.hasGlobalPermission(subject,
Permission.MANAGE_BUNDLE)) {
+ throw new PermissionException("Subject [" +
subject.getName()
+ + "] requires InventoryManager or BundleManager permission
for requested query criteria.");
+ }
}
-
-
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
null,
- subject.getId());
}
CriteriaQueryRunner<BundleResourceDeployment> queryRunner = new
CriteriaQueryRunner<BundleResourceDeployment>(
commit 71f2f42e257b49bf5435b525e1ee36a3798a7bc9
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 15:12:45 2010 -0400
remove the previous bundle version field, it wasn't available w/o
another db rt and the info is already in the name/description.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
index d71992e..fd7264d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
@@ -156,13 +156,7 @@ public class ConfirmationStep extends AbstractWizardStep {
prevDescItem.setWrap(false);
prevDescItem.setValue((null != prev.getName()) ? prev.getName() :
"none");
- StaticTextItem prevVersionItem = new StaticTextItem("prevVersion",
"Bundle Version");
- prevVersionItem.setTitleAlign(Alignment.LEFT);
- prevVersionItem.setAlign(Alignment.LEFT);
- prevVersionItem.setWrap(false);
- prevVersionItem.setValue(prev.getBundleVersion().getVersion());
-
- prevForm.setItems(prevNameItem, prevDescItem, prevVersionItem);
+ prevForm.setItems(prevNameItem, prevDescItem);
layout.addMember(prevForm);
Label confirmation = new Label();
commit 941b75583637be787b795f9935b56b683cbf0a5d
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Wed Jul 14 15:31:23 2010 +0200
Don't print to stdout, but use a logger.
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 8758b72..7433805 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
@@ -24,19 +24,24 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* @author Greg Hinkle
*/
public class SerialUtility {
+ private static Log log = LogFactory.getLog(SerialUtility.class);
public static <T> T prepare(T value, String message) {
long start = System.currentTimeMillis();
try {
HibernateDetachUtility.nullOutUninitializedFields(value,
HibernateDetachUtility.SerializationType.SERIALIZATION);
-
- System.out.println("SerialUtility.prepare [" + message + "]
Detached in: " + (System.currentTimeMillis() - start) + "ms, Size is: " +
serialSize(value));
+ if (log.isDebugEnabled())
+ log.debug("SerialUtility.prepare [" + message + "] Detached
in: " + (System.currentTimeMillis() - start) +
+ "ms, Size is: " + serialSize(value));
} catch (Exception e) {
e.printStackTrace();
}
@@ -53,7 +58,7 @@ public class SerialUtility {
o.flush();
return baos.size();
} catch (IOException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ e.printStackTrace();
return -1;
}
}
commit cc1ce3352c2972f82e9d343faa88cc27a19fb0b7
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 14:28:31 2010 -0400
Shared syslog support for linux, solaris, osx via posix parent component
diff --git
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
index cd4a782..38833eb 100644
---
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
+++
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
@@ -33,9 +33,6 @@ 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.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.content.PackageType;
import org.rhq.core.domain.content.transfer.ContentResponseResult;
@@ -59,7 +56,7 @@ import org.rhq.plugins.platform.content.yum.YumContext;
import org.rhq.plugins.platform.content.yum.YumProxy;
import org.rhq.plugins.platform.content.yum.YumServer;
-public class LinuxPlatformComponent extends PlatformComponent implements ContentFacet {
+public class LinuxPlatformComponent extends PosixPlatformComponent implements
ContentFacet {
// the prefix for all distro trait names
private static final String DISTRO_TRAIT_NAME_PREFIX = "distro.";
@@ -67,18 +64,6 @@ public class LinuxPlatformComponent extends PlatformComponent
implements Content
private static final String TRAIT_DISTRO_NAME = DISTRO_TRAIT_NAME_PREFIX +
"name";
private static final String TRAIT_DISTRO_VERSION = DISTRO_TRAIT_NAME_PREFIX +
"version";
- // event tracking plugin config names
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_LOGS = "logs";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_ENABLED =
"logTrackingEnabled";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_INCLUDES_REGEX =
"logTrackingIncludesPattern";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_MIN_SEV =
"logTrackingMinimumSeverity";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_PARSER_REGEX =
"logTrackingParserRegex";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_DATETIME_FORMAT =
"logTrackingDateTimeFormat";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_TYPE =
"logTrackingType";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_PORT =
"logTrackingPort";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_BIND_ADDR =
"logTrackingBindAddress";
- public static final String PLUGIN_CONFIG_EVENT_TRACKING_FILE_PATH =
"logTrackingFilePath";
-
private final Log log = LogFactory.getLog(LinuxPlatformComponent.class);
private ContentContext contentContext;
@@ -89,12 +74,6 @@ public class LinuxPlatformComponent extends PlatformComponent
implements Content
private boolean enableContentDiscovery = false;
private boolean enableInternalYumServer = false;
- private enum EventTrackingType {
- listener, file
- };
-
- private List<SyslogListenerEventLogDelegate> listenerEventDelegates;
- private List<SyslogFileEventLogDelegate> fileEventDelegates;
@Override
public void start(ResourceContext context) {
@@ -127,55 +106,12 @@ public class LinuxPlatformComponent extends PlatformComponent
implements Content
startWithContentContext(context.getContentContext());
- // prepare the syslog listeners - must shutdown any lingering ones first
- PropertyList logs =
pluginConfiguration.getList(PLUGIN_CONFIG_EVENT_TRACKING_LOGS);
- if (logs != null && logs.getList() != null &&
logs.getList().size() > 0) {
- for (Property logProp : logs.getList()) {
- try {
- PropertyMap singleLog = (PropertyMap) logProp;
- if
(singleLog.getSimple(PLUGIN_CONFIG_EVENT_TRACKING_ENABLED).getBooleanValue()) {
- if (getEventTrackingType(singleLog) ==
EventTrackingType.listener) {
- // Start up the syslog listener
- SyslogListenerEventLogDelegate delegate = new
SyslogListenerEventLogDelegate(context,
- singleLog);
- if (this.listenerEventDelegates == null) {
- this.listenerEventDelegates = new
ArrayList<SyslogListenerEventLogDelegate>();
- }
- this.listenerEventDelegates.add(delegate);
- } else if (getEventTrackingType(singleLog) ==
EventTrackingType.file) {
- // Start up the syslog file poller
- SyslogFileEventLogDelegate delegate = new
SyslogFileEventLogDelegate(context, singleLog);
- if (this.fileEventDelegates == null) {
- this.fileEventDelegates = new
ArrayList<SyslogFileEventLogDelegate>();
- }
- this.fileEventDelegates.add(delegate);
- }
- }
- } catch (Exception e) {
- log.debug("Failed to prepare for event log [" + logProp +
"]", e);
- }
- }
- }
return;
}
- private EventTrackingType getEventTrackingType(PropertyMap logConfiguration) {
- // default is "file" as described in plugin descriptor
- String type = logConfiguration.getSimpleValue(PLUGIN_CONFIG_EVENT_TRACKING_TYPE,
EventTrackingType.file.name());
- EventTrackingType typeEnum;
- try {
- typeEnum = EventTrackingType.valueOf(type.toLowerCase());
- } catch (Exception e) {
- typeEnum = EventTrackingType.file;
- log.warn("event tracking type is invalid [" + type + "],
defaulting to: " + typeEnum);
- }
- return typeEnum;
- }
-
@Override
public void stop() {
- shutdownSyslogDelegates();
try {
yumServer.halt();
@@ -186,30 +122,6 @@ public class LinuxPlatformComponent extends PlatformComponent
implements Content
super.stop();
}
- private void shutdownSyslogDelegates() {
- if (this.listenerEventDelegates != null) {
- for (SyslogListenerEventLogDelegate delegate : this.listenerEventDelegates)
{
- try {
- delegate.shutdown();
- } catch (Exception e) {
- log.warn("Failed to shutdown a syslog listener", e);
- }
- }
- this.listenerEventDelegates.clear();
- }
-
- if (this.fileEventDelegates != null) {
- for (SyslogFileEventLogDelegate delegate : this.fileEventDelegates) {
- try {
- delegate.shutdown();
- } catch (Exception e) {
- log.warn("Failed to shutdown a syslog file poller", e);
- }
- }
- this.fileEventDelegates.clear();
- }
- }
-
private void startWithContentContext(ContentContext context) {
if (this.enableInternalYumServer) {
int port = yumPort();
diff --git
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java
index dcfaf2b..d7e9ef9 100644
---
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java
+++
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java
@@ -27,6 +27,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
@@ -73,6 +74,9 @@ public abstract class PlatformDiscoveryComponent implements
ResourceDiscoveryCom
version = "?";
}
+ Configuration config = context.getDefaultPluginConfiguration();
+ discoverConfiguration(config);
+
DiscoveredResourceDetails discoveredResource = new
DiscoveredResourceDetails(context.getResourceType(), key,
name, version, description, null, null);
@@ -82,6 +86,14 @@ public abstract class PlatformDiscoveryComponent implements
ResourceDiscoveryCom
}
/**
+ * Override this method to add additional configurations to discovered platforms
+ * @param configuration
+ */
+ protected void discoverConfiguration(Configuration configuration) {
+
+ }
+
+ /**
* This will determine what the new platform's resource key should be. This
default
* implementation first tries to use the plugin container's name which is
guaranteed
* to be unique across all agents/plugin containers. If, for some odd reason, it is
diff --git
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java
new file mode 100644
index 0000000..7327067
--- /dev/null
+++
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java
@@ -0,0 +1,146 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.platform;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+/**
+ * @author Greg Hinkle
+ */
+public class PosixPlatformComponent extends PlatformComponent {
+
+ private final Log log = LogFactory.getLog(PosixPlatformComponent.class);
+
+
+ protected List<SyslogListenerEventLogDelegate> listenerEventDelegates;
+ protected List<SyslogFileEventLogDelegate> fileEventDelegates;
+ // event tracking plugin config names
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_LOGS = "logs";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_ENABLED =
"logTrackingEnabled";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_INCLUDES_REGEX =
"logTrackingIncludesPattern";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_MIN_SEV =
"logTrackingMinimumSeverity";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_PARSER_REGEX =
"logTrackingParserRegex";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_DATETIME_FORMAT =
"logTrackingDateTimeFormat";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_TYPE =
"logTrackingType";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_PORT =
"logTrackingPort";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_BIND_ADDR =
"logTrackingBindAddress";
+ public static final String PLUGIN_CONFIG_EVENT_TRACKING_FILE_PATH =
"logTrackingFilePath";
+
+
+ protected enum EventTrackingType {
+ listener, file
+ };
+
+
+
+ @Override
+ public void start(ResourceContext context) {
+ super.start(context);
+
+ Configuration pluginConfiguration = context.getPluginConfiguration();
+
+ // prepare the syslog listeners - must shutdown any lingering ones first
+ PropertyList logs =
pluginConfiguration.getList(PLUGIN_CONFIG_EVENT_TRACKING_LOGS);
+ if (logs != null && logs.getList() != null &&
logs.getList().size() > 0) {
+ for (Property logProp : logs.getList()) {
+ try {
+ PropertyMap singleLog = (PropertyMap) logProp;
+ if
(singleLog.getSimple(PLUGIN_CONFIG_EVENT_TRACKING_ENABLED).getBooleanValue()) {
+ if (getEventTrackingType(singleLog) ==
EventTrackingType.listener) {
+ // Start up the syslog listener
+ SyslogListenerEventLogDelegate delegate = new
SyslogListenerEventLogDelegate(context,
+ singleLog);
+ if (this.listenerEventDelegates == null) {
+ this.listenerEventDelegates = new
ArrayList<SyslogListenerEventLogDelegate>();
+ }
+ this.listenerEventDelegates.add(delegate);
+ } else if (getEventTrackingType(singleLog) ==
EventTrackingType.file) {
+ // Start up the syslog file poller
+ SyslogFileEventLogDelegate delegate = new
SyslogFileEventLogDelegate(context, singleLog);
+ if (this.fileEventDelegates == null) {
+ this.fileEventDelegates = new
ArrayList<SyslogFileEventLogDelegate>();
+ }
+ this.fileEventDelegates.add(delegate);
+ }
+ }
+ } catch (Exception e) {
+ log.debug("Failed to prepare for event log [" + logProp +
"]", e);
+ }
+ }
+ }
+ }
+
+ private LinuxPlatformComponent.EventTrackingType getEventTrackingType(PropertyMap
logConfiguration) {
+ // default is "file" as described in plugin descriptor
+ String type = logConfiguration.getSimpleValue(PLUGIN_CONFIG_EVENT_TRACKING_TYPE,
LinuxPlatformComponent.EventTrackingType.file.name());
+ LinuxPlatformComponent.EventTrackingType typeEnum;
+ try {
+ typeEnum =
LinuxPlatformComponent.EventTrackingType.valueOf(type.toLowerCase());
+ } catch (Exception e) {
+ typeEnum = LinuxPlatformComponent.EventTrackingType.file;
+ log.warn("event tracking type is invalid [" + type + "],
defaulting to: " + typeEnum);
+ }
+ return typeEnum;
+ }
+
+ protected void shutdownSyslogDelegates() {
+ if (this.listenerEventDelegates != null) {
+ for (SyslogListenerEventLogDelegate delegate : this.listenerEventDelegates)
{
+ try {
+ delegate.shutdown();
+ } catch (Exception e) {
+ log.warn("Failed to shutdown a syslog listener", e);
+ }
+ }
+ this.listenerEventDelegates.clear();
+ }
+
+ if (this.fileEventDelegates != null) {
+ for (SyslogFileEventLogDelegate delegate : this.fileEventDelegates) {
+ try {
+ delegate.shutdown();
+ } catch (Exception e) {
+ log.warn("Failed to shutdown a syslog file poller", e);
+ }
+ }
+ this.fileEventDelegates.clear();
+ }
+ }
+
+ @Override
+ public void stop() {
+ shutdownSyslogDelegates();
+
+ super.stop();
+ }
+}
diff --git a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
index 7ee308e..22f4cb1 100644
--- a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
@@ -144,7 +144,46 @@
defaultOn="true"
defaultInterval="3600000"
description="Cache Size of this CPU"/>
-'>
+'>
+
+<!ENTITY syslogEventConfigurationGroup '
+ <c:group name="Event Logs">
+ <c:description>Tracking of syslog events</c:description>
+ <c:list-property name="logs">
+ <c:map-property name="log">
+ <c:simple-property name="logTrackingEnabled"
summary="true" type="boolean" required="true"
default="false" description="Enables the collection of syslog
events"/>
+ <c:simple-property name="logTrackingIncludesPattern"
displayName="Includes Pattern" required="false" description="A
regular expression that is matched against a log message's detail text to
determine if an Event should be fired for that log message. If not specified, no filtering
of log messages will be done based on their detail."/>
+ <c:simple-property name="logTrackingMinimumSeverity"
displayName="Minimum Severity" required="false"
default="Warning" description="The minimum severity of log messages that
will be collected. If not specified, there is no minimum severity (i.e. all will be
collected).">
+ <c:property-options>
+ <c:option value="Information"/>
+ <c:option value="Warning"
default="true"/>
+ <c:option value="Error"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="logTrackingType"
summary="true" required="true" default="file"
description="Defines if the log messages are to be found by polling a file or
listening to a TCP socket">
+ <c:property-options>
+ <c:option value="file"
default="true"/>
+ <c:option value="listener"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="logTrackingPort"
summary="true" displayName="Syslog Listener Port"
required="false" type="integer" default="514"
description="Port that the syslog listener will run on if using listener style. If
not defined, the default will be 514.">
+ <c:constraint>
+ <c:integer-constraint minimum="1"
maximum="65535"/>
+ </c:constraint>
+ </c:simple-property>
+ <c:simple-property name="logTrackingBindAddress"
displayName="Syslog Listener Bind Address" required="false"
type="string" default="127.0.0.1" description="Address that the
syslog listener will bind to if using listener style"/>
+ <c:simple-property name="logTrackingFilePath"
summary="true" displayName="Syslog File Path"
required="false" type="file" default="/var/log/messages"
description="File path to watch for log events if using file style. If not defined,
the default will be /var/log/messages"/>
+ <c:simple-property name="logTrackingParserRegex"
displayName="Message Parser Regular Expression" required="false"
description="A regular expression used to parse the different pieces of the log
messages. This regex must have 3 capturing groups - #1 is the timestamp, #2 is the
severity and #3 is the message details text. If not defined, a best guess will be made to
parse the log messages."/>
+ <c:simple-property name="logTrackingDateTimeFormat"
displayName="Date/Time Format" required="false" description="A
regular expression that indicates how the message's date/timestamp is formatted.
See the Javadoc on java.text.SimpleDateFormat for the syntax of this regex. If not
defined, the date will not be parsed and the time the message was seen will be
used."/>
+ </c:map-property>
+ </c:list-property>
+ </c:group>
+'>
+
+<!ENTITY syslogEventDefinition '
+ <event name="Event Log" description="Syslog event logs"
displayName="Event Log"/>
+'>
+
]>
<plugin name="Platforms"
@@ -257,37 +296,9 @@
</c:constraint>
</c:simple-property>
</c:group>
- <c:group name="Event Logs">
- <c:description>Tracking of syslog events</c:description>
- <c:list-property name="logs">
- <c:map-property name="log">
- <c:simple-property name="logTrackingEnabled"
summary="true" type="boolean" required="true"
default="false" description="Enables the collection of syslog
events"/>
- <c:simple-property name="logTrackingIncludesPattern"
displayName="Includes Pattern" required="false" description="A
regular expression that is matched against a log message's detail text to determine if
an Event should be fired for that log message. If not specified, no filtering of log
messages will be done based on their detail."/>
- <c:simple-property name="logTrackingMinimumSeverity"
displayName="Minimum Severity" required="false"
default="Warning" description="The minimum severity of log messages that
will be collected. If not specified, there is no minimum severity (i.e. all will be
collected).">
- <c:property-options>
- <c:option value="Information"/>
- <c:option value="Warning"
default="true"/>
- <c:option value="Error"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="logTrackingType"
summary="true" required="true" default="file"
description="Defines if the log messages are to be found by polling a file or
listening to a TCP socket">
- <c:property-options>
- <c:option value="file"
default="true"/>
- <c:option value="listener"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="logTrackingPort"
summary="true" displayName="Syslog Listener Port"
required="false" type="integer" default="514"
description="Port that the syslog listener will run on if using listener style. If
not defined, the default will be 514.">
- <c:constraint>
- <c:integer-constraint minimum="1"
maximum="65535"/>
- </c:constraint>
- </c:simple-property>
- <c:simple-property name="logTrackingBindAddress"
displayName="Syslog Listener Bind Address" required="false"
type="string" default="127.0.0.1" description="Address that the
syslog listener will bind to if using listener style"/>
- <c:simple-property name="logTrackingFilePath"
summary="true" displayName="Syslog File Path"
required="false" type="file" default="/var/log/messages"
description="File path to watch for log events if using file style. If not defined,
the default will be /var/log/messages"/>
- <c:simple-property name="logTrackingParserRegex"
displayName="Message Parser Regular Expression" required="false"
description="A regular expression used to parse the different pieces of the log
messages. This regex must have 3 capturing groups - #1 is the timestamp, #2 is the
severity and #3 is the message details text. If not defined, a best guess will be made to
parse the log messages."/>
- <c:simple-property name="logTrackingDateTimeFormat"
displayName="Date/Time Format" required="false" description="A
regular expression that indicates how the message's date/timestamp is formatted. See
the Javadoc on java.text.SimpleDateFormat for the syntax of this regex. If not defined,
the date will not be parsed and the time the message was seen will be used."/>
- </c:map-property>
- </c:list-property>
- </c:group>
+
+ &syslogEventConfigurationGroup;
+
</plugin-configuration>
&platformOperations;
@@ -311,8 +322,7 @@
displayType="summary"
defaultOn="true" />
- <event name="Event Log" description="Syslog event logs"
displayName="Event Log"/>
-
+ &syslogEventDefinition;
<content name="rpm" displayName="RPM File"
category="deployable" description="Red Hat installable package">
<configuration>
@@ -334,14 +344,21 @@
</platform>
<platform name="Solaris"
- class="PlatformComponent"
+ class="PosixPlatformComponent"
discovery="SolarisPlatformDiscoveryComponent"
description="SUN Solaris Operating System">
+
+ <plugin-configuration>
+ &syslogEventConfigurationGroup;
+ </plugin-configuration>
+
&platformSubcategories;
&platformOperations;
&nativeMetrics;
&platformCpu;
&metrics;
+ &syslogEventDefinition;
+
</platform>
<platform name="HP-UX"
@@ -378,14 +395,19 @@
</platform>
<platform name="Mac OS X"
- class="PlatformComponent"
+ class="PosixPlatformComponent"
discovery="MacOSXPlatformDiscoveryComponent"
description="Mac OS X Operating System">
+ <plugin-configuration>
+ &syslogEventConfigurationGroup;
+ </plugin-configuration>
+
&platformSubcategories;
&platformOperations;
&nativeMetrics;
&platformCpu;
&metrics;
+ &syslogEventDefinition;
</platform>
<platform name="Java"
commit fa321620bdaddb71fd466d15b7b53139dc58477b
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 14:26:57 2010 -0400
More GWT links
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 e2f61cd..fc93906 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
@@ -72,7 +72,11 @@ public class LinkManager {
public static String getAutodiscoveryQueueLink() {
- return "/rhq/discovery/queue.xhtml";
+ if (GWT) {
+ return "#Administration/Security/Auto%20Discovery%20Queue";
+ } else {
+ return "/rhq/discovery/queue.xhtml";
+ }
}
public static String getDashboardLink() {
@@ -93,15 +97,27 @@ public class LinkManager {
}
public static String getHubPlatformsLink() {
- return "/rhq/inventory/browseResources.xhtml?subtab=platform";
+ if (GWT) {
+ return "#Inventory/Platforms";
+ } else {
+ return "/rhq/inventory/browseResources.xhtml?subtab=platform";
+ }
}
public static String getHubServerssLink() {
- return "/rhq/inventory/browseResources.xhtml?subtab=server";
+ if (GWT) {
+ return "#Inventory/Serers";
+ } else {
+ return "/rhq/inventory/browseResources.xhtml?subtab=server";
+ }
}
public static String getHubServicesLink() {
- return "/rhq/inventory/browseResources.xhtml?subtab=service";
+ if (GWT) {
+ return "#Inventory/Services";
+ } else {
+ return "/rhq/inventory/browseResources.xhtml?subtab=service";
+ }
}
@@ -138,7 +154,7 @@ public class LinkManager {
public static String getAdminUsersLink() {
if (GWT) {
- return "#Administration/Security/Manage%20Users";
+ return "#Administration/Security/Manage Users";
} else {
return "/admin/user/UserAdmin.do?mode=list";
}
@@ -146,17 +162,17 @@ public class LinkManager {
public static String getAdminRolesLink() {
if (GWT) {
- return "#Administration/Security/Manage%20Roles";
+ return "#Administration/Security/Manage Roles";
} else {
- return "/admin/role/RoleAdmin.do?mode=list";
+ return "/admin/role/RoleAdmin.do?mode=list";
}
}
public static String getAdminSysConfigLink() {
if (GWT) {
- return "#Administration/Configuration/System%20Settings";
+ return "#Administration/Configuration/System Settings";
} else {
- return "/admin/config/Config.do?mode=edit";
+ return "/admin/config/Config.do?mode=edit";
}
}
@@ -171,7 +187,11 @@ public class LinkManager {
public static String getAdminTemplatesLink() {
- return
"/admin/config/EditDefaults.do?mode=monitor&viewMode=all";
+ if (GWT) {
+ return "#Administration/Configuration/Templates";
+ } else {
+ return
"/admin/config/EditDefaults.do?mode=monitor&viewMode=all";
+ }
}
public static String getAdminAlertNotifTemplatesLink() {
@@ -189,24 +209,44 @@ public class LinkManager {
public static String getHAServersLink() {
- return "/rhq/ha/listServers.xhtml";
+ if (GWT) {
+ return "#Administration/Cluster/Servers";
+ } else {
+ return "/rhq/ha/listServers.xhtml";
+ }
}
public static String getHAAgentsLink() {
- return "/rhq/ha/listAgents.xhtml";
+ if (GWT) {
+ return "#Administration/Cluster/Agents";
+ } else {
+ return "/rhq/ha/listAgents.xhtml";
+ }
}
public static String getHAAffinityGroupsLink() {
- return "/rhq/ha/listAffinityGroups.xhtml";
+ if (GWT) {
+ return "#Administration/Cluster/Affinity Groups";
+ } else {
+ return "/rhq/ha/listAffinityGroups.xhtml";
+ }
}
public static String getHAEventsLink() {
- return "/rhq/ha/listPartitionEvents.xhtml";
+ if (GWT) {
+ return "#Administration/Cluster/Partition Events";
+ } else {
+ return "/rhq/ha/listPartitionEvents.xhtml";
+ }
}
public static String getReportsInventoryLink() {
- return "/rhq/admin/report/resourceInstallReport.xhtml";
+ if (GWT) {
+ return "#Administration/Reports/Inventory Summary";
+ } else {
+ return "/rhq/admin/report/resourceInstallReport.xhtml";
+ }
}
public static String getAdminDownloadsLink() {
commit 13d2385b605749b63818b010ce2c6eb19013828d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 14:26:49 2010 -0400
Manually add parentless types to platforms
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 5faf1c0..701c176 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
@@ -19,12 +19,15 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.Breadcrumb;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
@@ -33,6 +36,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.configuration.Configurat
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
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.gwt.ResourceTypeGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.create.OperationCreateWizard;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.ResourceFactoryCreateWizard;
@@ -287,11 +291,39 @@ public class ResourceTreeView extends VLayout {
//todo action
}
}
+ if (resourceType.getCategory() == ResourceCategory.PLATFORM) {
+ loadManuallyAddServersToPlatforms(importChildSubMenu);
+ }
importChildMenu.setSubmenu(importChildSubMenu);
importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0);
contextMenu.addItem(importChildMenu);
}
+
+ private void loadManuallyAddServersToPlatforms(final Menu manuallyAddMenu) {
+ ResourceTypeGWTServiceAsync rts = GWTServiceLookup.getResourceTypeGWTService();
+
+ ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+ criteria.addFilterSupportsManualAdd(true);
+ criteria.fetchParentResourceTypes(true);
+ rts.findResourceTypesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
platform manual add children",caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+ for (ResourceType type : result) {
+ if (type.getParentResourceTypes() == null ||
type.getParentResourceTypes().isEmpty()) {
+ MenuItem item = new MenuItem(type.getName());
+ manuallyAddMenu.addItem(item);
+ }
+ }
+ }
+ });
+ }
+
+
private MenuItem buildMetricsMenu(final ResourceType type) {
MenuItem measurements = new MenuItem("Measurements");
final Menu measurementsSubMenu = new Menu();
commit 64bb38f5c995a7664dc03929b7cd09d6ce0de028
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 14:26:20 2010 -0400
Re-enable alert and favorite footers in master
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index 2e3e242..65fc203 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -70,9 +70,9 @@ public class Footer extends ToolStrip {
addMember(new ToolStripSeparator());
-// addMember(new FavoritesButton());
+ addMember(new FavoritesButton());
-// addMember(new AlertsMessage());
+ addMember(new AlertsMessage());
}
commit 73e9a6749b3cc9bf772c4f91bc937bf318aa968c
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jul 16 14:25:58 2010 -0400
Fix event source display
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
index f8656e3..41e7971 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
@@ -123,7 +123,7 @@ public class EventDatasource extends RPCDataSource<Event> {
record.setAttribute("detailExcerpt", from.getDetailExcerpt());
record.setAttribute("severity", from.getSeverity().name());
record.setAttribute("source", from.getSource());
- record.setAttribute("sourceLocation", from.getSourceLocation());
+ record.setAttribute("sourceLocation", from.getSource().getLocation());
record.setAttribute("type", from.getType());
record.setAttribute("timestamp", new Date(from.getTimestamp()));
commit 0a9ed45bd93e28c2370cc2466dcdea2d19864298
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 13:48:35 2010 -0400
BZ-615351: respect user's authorization when displaying suggestions
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 94a2bd5..6ba0c9c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -13,14 +13,30 @@ import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchAssistant implements SearchAssistant {
private final Log log = LogFactory.getLog(SearchAssistant.class);
+ private int subjectId;
+ private boolean requiresAuthorizationFragment;
private int maxResultCount = 20;
+ public AbstractSearchAssistant(Subject subject) {
+ this.subjectId = subject.getId();
+ this.requiresAuthorizationFragment =
!LookupUtil.getAuthorizationManager().isInventoryManager(subject);
+ }
+
+ public int getSubjectId() {
+ return subjectId;
+ }
+
+ public boolean requiresAuthorizationFragment() {
+ return requiresAuthorizationFragment;
+ }
+
public int getMaxResultCount() {
return maxResultCount;
}
@@ -104,6 +120,14 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return " AND " + getJPQLForString(fragment, filter);
}
+ protected final String conditionallyAddAuthzFragment(String fragment) {
+ if (requiresAuthorizationFragment == false) {
+ return "";
+ }
+
+ return " AND " + fragment;
+ }
+
protected final List<String> filter(Class<? extends Enum<?>>
enumType, String filter) {
return filter(enumType, filter, false);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index be85fc5..ce31d79 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
@@ -19,8 +20,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
"name"));
}
- public GroupSearchAssistant(String tab) {
- super(tab);
+ public GroupSearchAssistant(Subject subject, String tab) {
+ super(subject, tab);
}
public SearchSubsystem getSearchSubsystem() {
@@ -64,6 +65,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " AND rg.visible = true " //
+ conditionallyAddJPQLString("type.name", filter) //
+ conditionallyAddJPQLString("rg.groupCategory", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -74,6 +76,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " AND rg.visible = true " //
+ conditionallyAddJPQLString("type.plugin", filter) //
+ conditionallyAddJPQLString("rg.groupCategory", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -83,6 +86,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ conditionallyAddJPQLString("rg.name", filter) //
+ conditionallyAddJPQLString("rg.groupCategory", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY rg.name ");
} else {
@@ -91,4 +95,13 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
}
}
+ private String getAuthzFragment() {
+ return "rg.id IN " //
+ + "(SELECT igroup.id " //
+ + " FROM ResourceGroup igroup " //
+ + " JOIN igroup.roles irole " //
+ + " JOIN irole.subjects isubject " //
+ + " WHERE isubject.id = " + getSubjectId() + ")";
+ }
+
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 671095f..95295d0 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.List;
import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
@@ -22,8 +23,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
"name"));
}
- public ResourceSearchAssistant(String tab) {
- super(tab);
+ public ResourceSearchAssistant(Subject subject, String tab) {
+ super(subject, tab);
}
public SearchSubsystem getSearchSubsystem() {
@@ -69,6 +70,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ conditionallyAddJPQLString("definition.name", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -81,6 +83,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ conditionallyAddJPQLString("definition.name", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -92,6 +95,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " AND def.dataType = 1 " // trait types
+ conditionallyAddJPQLString("ms.definition.name", filter) //
+ conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY def.name ");
} else {
@@ -115,6 +119,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " WHERE res.resourceType = type " //
+ conditionallyAddJPQLString("type.name", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -124,6 +129,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " WHERE res.resourceType = type " //
+ conditionallyAddJPQLString("type.plugin", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -133,6 +139,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " WHERE res.resourceType = type " //
+ conditionallyAddJPQLString("res.name", filter) //
+ conditionallyAddJPQLString("type.category", tab) //
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -151,6 +158,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ conditionallyAddJPQLString("property.name", param) //
+ conditionallyAddJPQLString("property.stringValue", filter)
//
+ conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -166,6 +174,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ conditionallyAddJPQLString("property.name", param) //
+ conditionallyAddJPQLString("property.stringValue", filter)
//
+ conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -178,6 +187,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ conditionallyAddJPQLString("ms.definition.name", param) //
+ conditionallyAddJPQLString("trait.value", filter) //
+ conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ + conditionallyAddAuthzFragment(getAuthzFragment()) //
+ " ORDER BY trait.value ");
} else {
@@ -185,4 +195,14 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
}
}
+
+ private String getAuthzFragment() {
+ return "res.id IN " //
+ + "(SELECT ires.id " //
+ + " FROM Resource ires " //
+ + " JOIN ires.implicitGroups igroup " //
+ + " JOIN igroup.roles irole " //
+ + " JOIN irole.subjects isubject " //
+ + " WHERE isubject.id = " + getSubjectId() + ")";
+ }
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
index 9caafec..040d15f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
@@ -1,5 +1,6 @@
package org.rhq.enterprise.server.search.assist;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.search.SearchSubsystem;
public class SearchAssistantFactory {
@@ -7,21 +8,21 @@ public class SearchAssistantFactory {
// force use of static methods only
}
- public static SearchAssistant getAssistant(SearchSubsystem searchContext) {
+ public static SearchAssistant getAssistant(Subject subject, SearchSubsystem
searchContext) {
if (searchContext == SearchSubsystem.RESOURCE) {
- return new ResourceSearchAssistant(null);
+ return new ResourceSearchAssistant(subject, null);
} else if (searchContext == SearchSubsystem.GROUP) {
- return new GroupSearchAssistant(null);
+ return new GroupSearchAssistant(subject, null);
} else {
throw new IllegalArgumentException("No SearchAssistant found for
SearchSubsystem[" + searchContext + "]");
}
}
- public static SearchAssistant getTabAwareAssistant(SearchSubsystem searchContext,
String tab) {
+ public static SearchAssistant getTabAwareAssistant(Subject subject, SearchSubsystem
searchContext, String tab) {
if (searchContext == SearchSubsystem.RESOURCE) {
- return new ResourceSearchAssistant(tab);
+ return new ResourceSearchAssistant(subject, tab);
} else if (searchContext == SearchSubsystem.GROUP) {
- return new GroupSearchAssistant(tab);
+ return new GroupSearchAssistant(subject, tab);
} else {
throw new IllegalArgumentException("No SearchAssistant found for
SearchSubsystem[" + searchContext + "]");
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
index a68dc60..27f17b3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
@@ -1,9 +1,12 @@
package org.rhq.enterprise.server.search.assist;
+import org.rhq.core.domain.auth.Subject;
+
public abstract class TabAwareSearchAssistant extends AbstractSearchAssistant {
protected String tab;
- public TabAwareSearchAssistant(String tab) {
+ public TabAwareSearchAssistant(Subject subject, String tab) {
+ super(subject);
if (tab != null) {
tab = tab.trim().toLowerCase();
if (tab.equals("")) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 92138bf..9a7d352 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -344,11 +344,11 @@ public class SearchAssistManager {
}
protected SearchAssistant getSearchAssistant() {
- return SearchAssistantFactory.getAssistant(searchSubsystem);
+ return SearchAssistantFactory.getAssistant(subject, searchSubsystem);
}
protected SearchAssistant getTabAwareSearchAssistant(String tab) {
- return SearchAssistantFactory.getTabAwareAssistant(searchSubsystem, tab);
+ return SearchAssistantFactory.getTabAwareAssistant(subject, searchSubsystem,
tab);
}
private List<String> getAllContexts() {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
index 53f1f87..855d89d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
@@ -24,6 +24,7 @@ import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLTreeOperator;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragment;
import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
+import org.rhq.enterprise.server.util.LookupUtil;
public class SearchTranslationManager {
@@ -54,7 +55,8 @@ public class SearchTranslationManager {
this.expression = expression;
this.translator = SearchTranslatorFactory.getTranslator(this.context);
- this.assistant = SearchAssistantFactory.getAssistant(this.context);
+ this.assistant = SearchAssistantFactory
+ .getAssistant(LookupUtil.getSubjectManager().getOverlord(), this.context);
ANTLRStringStream input = new ANTLRStringStream(this.expression); // Create an
input character stream from standard in
this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that
stream
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
index 3b658c7..67bff40 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
@@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant;
import org.rhq.enterprise.server.search.assist.SearchAssistant;
@@ -33,6 +34,10 @@ public class TestAutoCompletionManager extends SearchAssistManager {
return Collections.unmodifiableList(Arrays.asList(items));
}
+ public TestAutoCompletor(Subject subject) {
+ super(subject);
+ }
+
@Override
public SearchSubsystem getSearchSubsystem() {
return null;
@@ -68,11 +73,11 @@ public class TestAutoCompletionManager extends SearchAssistManager {
@Override
protected AbstractSearchAssistant getSearchAssistant() {
- return new TestAutoCompletor();
+ return new TestAutoCompletor(LookupUtil.getSubjectManager().getOverlord());
}
@Override
protected SearchAssistant getTabAwareSearchAssistant(String tab) {
- return new TestAutoCompletor();
+ return new TestAutoCompletor(LookupUtil.getSubjectManager().getOverlord());
}
}
commit 03e5cb45737b76780214ffa33dd27af87ac9fcf4
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 16 11:35:59 2010 -0400
Up the timeout for upload servlet session
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
index 32b1ddc..2c8e514 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java
@@ -33,6 +33,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
@@ -51,9 +52,17 @@ import org.rhq.enterprise.server.util.LookupUtil;
public class FileUploadServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
+ /* The number of seconds the session can remain inactive. The default is 600 (10
minutes).
+ * It may take longer than 10 minutes to upload a large file, so we'll
increase...
+ */
+ private static final int MAX_INACTIVE_INTERVAL = 60 * 60;
+
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ HttpSession session = req.getSession();
+ session.setMaxInactiveInterval(MAX_INACTIVE_INTERVAL);
+
if (ServletFileUpload.isMultipartContent(req)) {
DiskFileItemFactory fileItemFactory = new DiskFileItemFactory();
commit c739b0f8e8408c8771454dfa9c718bc228f1ce8f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 10:43:44 2010 -0400
user must be able to view resource in order to see plugin configuration
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 2e6198d..c0add68 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
@@ -886,6 +886,11 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int
configurationUpdateId) {
PluginConfigurationUpdate update =
entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
+ if (!authorizationManager.canViewResource(subject, update.getResource().getId()))
{
+ throw new PermissionException("User [" + subject.getName()
+ + "] does not have permission to view plugin configuration update
for [" + update.getResource() + "]");
+ }
+
update.getConfiguration(); // this is EAGER loaded, so this really doesn't do
anything
return update;
commit e52d7671e9ec07800c84fe7e32a9445c635e69b6
Merge: 8746c03... 0842b83...
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Fri Jul 16 16:20:08 2010 +0200
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 8746c033f4a3735d0ad55ca87bae185ac7293227
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Fri Jul 16 16:18:53 2010 +0200
Apache Unit tests update.
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
new file mode 100644
index 0000000..344ab1f
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java
@@ -0,0 +1,123 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+import java.util.List;
+
+import org.rhq.augeas.AugeasProxy;
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
+import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
+import org.rhq.plugins.apache.util.ApacheConfigurationUtil;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+public class ApacheAugeasTest {
+
+ /**
+ * Tests if all included configuration files were loaded.
+ * @return
+ */
+ public void testFiles(AugeasProxy augeas){
+ System.out.println("Test if all included cofiguration files was discovered
and loaded.");
+ AugeasConfigurationApache config =
(AugeasConfigurationApache)augeas.getConfiguration();
+ List<File> configFiles = config.getAllConfigurationFiles();
+
+ /*
+ * There are three files one main file one which is included from main file and
one which is included from
+ * included file and which is declared in IfModule. All of them must be
discovered.
+ */
+ boolean found=false;
+ for (File confFile : configFiles){
+ found = false;
+ for (String fileName : ApacheTestConstants.CONFIG_FILE_NAMES){
+ if (!confFile.getName().equals(fileName))
+ found= true;
+ }
+ assert found;
+ }
+ }
+ /**
+ * Tests mapping of augeas tree to configuration and back.
+ * @param cont
+ * @throws Exception
+ */
+ public void testMapping(PluginContainer cont){
+ ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil();
+ try{
+ //copy all configuration files to temporary folder
+ String path = apacheUtil.prepareConfigFiles();
+ //loading of augeas from temporary folder
+ AugeasProxy proxy =
apacheUtil.initAugeas(path+File.separator+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path,
path);
+ AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+
+ testLoadConfig(tree, cont);
+ testSaveConfig(cont);
+ apacheUtil.cleanConfigFiles();
+ }catch(Exception e){
+ e.printStackTrace();
+ apacheUtil.cleanConfigFiles();
+ }
+ }
+ /**
+ * Tests mapping of augeas tree to rhq configuration.
+ * @param tree
+ * @param container
+ * @throws Exception
+ */
+ public void testLoadConfig(AugeasTree tree,PluginContainer container)throws Exception{
+ System.out.println("Test mapping of augeas tree to rhq
configuration.");
+ ApacheConfigurationUtil util = new ApacheConfigurationUtil();
+ for (Components component : Components.values()){
+ //get nodes for each component
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ for (int i=0;i<nodes.size();i++){
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ //load configuration for related component and augeas node from
tempfolder
+ Configuration conf =
util.loadConfiguration(ApacheTestConstants.getConfigFilesPathForLoad()+
+
File.separator+component.getComponentName()+String.valueOf(i));
+ assert config.equals(conf);
+ }
+ }
+ }
+
+ /**
+ * Tests mapping of rhq configuration to augeas tree.
+ *
+ * @param container
+ * @throws Exception
+ */
+ public void testSaveConfig(PluginContainer container)throws Exception{
+ System.out.println("Test mapping of rhq configuration to augeas
tree.");
+ ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil();
+ //load augeas tree from temporary folder
+ String path = ApacheTestConstants.getApacheConfigFilesPath();
+ AugeasProxy proxy =
apacheUtil.initAugeas(path+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path);
+ AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+ //load augeas tree from temporary folder "updateconfig"
+ String pathUpdate = ApacheTestConstants.getApacheConfigFilesPathForUpdate();
+ AugeasProxy proxyUpdate =
apacheUtil.initAugeas(pathUpdate+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, pathUpdate,
pathUpdate);
+ AugeasTree treeUpdate =
proxyUpdate.getAugeasTree(ApacheTestConstants.MODULE_NAME, true);
+
+ for (Components component : Components.values()){
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ ConfigurationDefinition configDef =
ApacheConfigurationUtil.getConfigurationDefinition(container, component);
+
+ for (int i=0;i<nodes.size();i++){
+ //load component from first tree - transfare that tree to
configuration - and update second tree with that configuration
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ AugeasNode updateNode =
AugeasNodeSearch.findNodeById(treeUpdate.getRootNode(), key);
+
+ ApacheAugeasMapping mapping = new ApacheAugeasMapping(treeUpdate);
+ mapping.updateAugeas(updateNode, config, configDef);
+ }
+ }
+ treeUpdate.save();
+ //test if the updated augeas tree can be mapped to configuration stored at
files in "loadconfig" temporary directory
+ testLoadConfig(treeUpdate, container);
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
new file mode 100644
index 0000000..969052d
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java
@@ -0,0 +1,172 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.rhq.augeas.AugeasProxy;
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
+import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache;
+import org.rhq.plugins.apache.helper.LensHelper;
+import org.rhq.plugins.apache.util.ApacheConfigurationUtil;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+public class ApacheAugeasUtil {
+
+ /**
+ * Loads augeas.
+ * @param configFilePath
+ * @param serverRootPath
+ * @param lensPath
+ * @return
+ */
+ public AugeasProxy initAugeas(String configFilePath,String serverRootPath,String
lensPath){
+ Configuration configuration = new Configuration();
+ configuration.put(new
PropertySimple("configurationFilesInclusionPatterns",configFilePath));
+ configuration.put(new PropertySimple("augeasModuleName",
ApacheTestConstants.MODULE_NAME));
+ configuration.put(new
PropertySimple(ApacheTestConstants.PLUGIN_CONFIG_PROP_SERVER_ROOT,serverRootPath));
+
+ AugeasConfigurationApache conf = new
AugeasConfigurationApache(lensPath,configuration);
+ AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache();
+ AugeasProxy augeas = new AugeasProxy(conf,builder);
+
+ augeas.load();
+
+ return augeas;
+ }
+
+ /**
+ * This method will create a new temporary directory and copy there all configuration
files.
+ * @return
+ * @throws UnitTestException
+ */
+ public String prepareConfigFiles() {
+ String tempDirPath=null;
+ try {
+
+ File tempDirectory =
LensHelper.createTempDir(ApacheTestConstants.TEMP_CONFIG_FILE_DIRECTORY);
+ if (!tempDirectory.exists())
+ tempDirectory.createNewFile();
+ //copy the apache configuration files to temp folder
+ tempDirPath = tempDirectory.getAbsolutePath()+File.separatorChar;
+ copyFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory);
+
+ File updateDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER);
+ if (!updateDir.exists()){
+ updateDir.mkdir();
+ updateDir.createNewFile();
+ }
+ //copy the apache configuration files to temp folder "updateconfig"
+ copyFiles(ApacheTestConstants.FILES_TO_LOAD,
ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory);
+
+ File loadDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER);
+ if (!loadDir.exists()){
+ loadDir.mkdir();
+ loadDir.createNewFile();
+ }
+ //copy xml files with rhq configuration to loadconfig
+ for(Components component : Components.values()){
+ copyFiles(component.getConfigurationFiles().toArray(new String[0]),
ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory);
+ }
+
+ ApacheTestConstants.TEMP_FILES_PATH=tempDirectory.getAbsolutePath();
+
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ return tempDirPath;
+ }
+
+ public void cleanConfigFiles(){
+ try {
+
+ File tempDirectory = new File(ApacheTestConstants.getApacheConfigFilesPath());
+ if (!tempDirectory.exists())
+ return;
+
+ deleteFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory);
+
+ File updateDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER);
+ if (updateDir.exists()){
+ deleteFiles(ApacheTestConstants.FILES_TO_LOAD,
ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory);
+ updateDir.delete();
+ }
+ File loadDir = new
File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER);
+ if (loadDir.exists())
+ {
+ for(Components component : Components.values()){
+ deleteFiles(component.getConfigurationFiles().toArray(new String[0]),
ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory);
+ }
+ loadDir.delete();
+ }
+
+ tempDirectory.delete();
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ public void copyFiles(String[] files,String folder,File destination) throws Exception{
+ for (String fileName : files){
+ String path=null;
+
+ if (folder.equals(""))
+ path = fileName;
+ else
+ path = folder+File.separator+fileName;
+
+ File configFile =
LensHelper.cpFileFromPluginToTemp(this.getClass().getClassLoader(),destination, path);
+ if (!configFile.exists())
+ throw new UnitTestException("Creation of temporary configuration file
failed.");
+ }
+ }
+
+ public void deleteFiles(String[] files,String folder,File destination) throws
Exception{
+ for (String fileName : files){
+ String path=null;
+
+ if (folder.equals(""))
+ path = fileName;
+ else
+ path = folder+File.separator+fileName;
+
+ File configFile = new File(destination,path);;
+ if (configFile.exists())
+ configFile.delete();
+ }
+ }
+ /**
+ * Method for searching all components in ageasTree which returns List of keys which
identify the component.
+ * @param parentNodeNames
+ * @param componentName
+ * @param tree
+ * @return
+ */
+ public List<String> loadComponent(String[] parentNodeNames,String
componentName,AugeasTree tree){
+ List<String> paramsString = new ArrayList<String>();
+ List<AugeasNode> nodes = AugeasNodeSearch.searchNode(parentNodeNames,
componentName, tree.getRootNode());
+ for (AugeasNode node : nodes){
+ paramsString.add(AugeasNodeSearch.getNodeKey(node, tree.getRootNode()));
+ }
+ return paramsString;
+ }
+
+ public void saveFiles(AugeasTree tree,PluginContainer container) throws Exception{
+ for (Components component : Components.values()){
+ String name = component.getComponentName();
+ List<AugeasNode> nodes = component.getAllNodes(tree);
+ for (int i=0;i<nodes.size();i++){
+ String key = AugeasNodeSearch.getNodeKey(nodes.get(i),
tree.getRootNode());
+ //PATH TO THE CONFIG FILES
+ String fileName = name+String.valueOf(i);
+ Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
+ ApacheConfigurationUtil.saveConfiguration(config, fileName);
+ }
+ }
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
index a1a42c1..f3ce761 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java
@@ -63,7 +63,12 @@ public class ApachePluginTest {
pcConfig.setInsideAgent(false);
PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
+ PluginContainer container = PluginContainer.getInstance();
+ container.initialize();
+ container.getInventoryManager().executeServerScanImmediately();
+ container.getInventoryManager().executeServiceScanImmediately();
+ ApacheAugeasTest test = new ApacheAugeasTest();
+ test.testMapping(container);
} catch (Exception e) {
e.printStackTrace();
}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
new file mode 100644
index 0000000..a23964b
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java
@@ -0,0 +1,47 @@
+package org.rhq.plugins.apache;
+
+import java.io.File;
+
+public class ApacheTestConstants {
+
+ public static final String MODULE_NAME="Httpd";
+ public static final String PLUGIN_NAME="Apache";
+ public static final String LENS_NAME="httpd.aug";
+ public static final String TEMP_CONFIG_FILE_DIRECTORY = "HttpdTest";
+ public static final String CONFIG_FILE_NAMES [] = {
+ "httpd.conf",
+ "included.conf",
+ "nested.conf"};
+ public static final String FILES_TO_LOAD [] = {
+ "httpd.conf",
+ "included.conf",
+ "nested.conf",
+ "httpd.aug"};
+ public static final String ROOT_CONFIG_FILE_NAME = "httpd.conf";
+ public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT = "serverRoot";
+ public static final String TEST_FILE_CONFIG_FOLDER="loadconfig";
+ public static final String TEST_FILE_APACHE_CONFIG_FOLDER="updateconfig";
+ public static String TEMP_FILES_PATH;
+
+ /**
+ * Path to folder containing rhq configuration in xml files.
+ * @return
+ */
+ public static String getConfigFilesPathForLoad(){
+ return TEMP_FILES_PATH+File.separator+TEST_FILE_CONFIG_FOLDER+File.separator;
+ }
+ /**
+ * Path to folder containing apache configuration in "loadconfig" folder
+ * @return
+ */
+ public static String getApacheConfigFilesPathForUpdate(){
+ return
TEMP_FILES_PATH+File.separator+TEST_FILE_APACHE_CONFIG_FOLDER+File.separator;
+ }
+ /**
+ * Path to temporary folder where are/will be stored all config files.
+ * @return
+ */
+ public static String getApacheConfigFilesPath(){
+ return TEMP_FILES_PATH+File.separator;
+ }
+}
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
new file mode 100644
index 0000000..ff00796
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java
@@ -0,0 +1,125 @@
+package org.rhq.plugins.apache;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.plugins.apache.util.AugeasNodeSearch;
+
+/**
+ * Enum of all components in Apache plugin.
+ * @author fdrabek
+ *
+ */
+public enum Components {
+
+ IFMODULE{
+ public String getComponentName(){
+ return "IfModule";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[2];
+ parentNames[0]="<IfModule";
+ parentNames[1]="<VirtualHost";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<IfModule";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return AugeasNodeSearch.searchNode(IFMODULE.getPossParentNodeName(),
IFMODULE.getNodeName(), tree.getRootNode());
+ }
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("IfModule0");
+ list.add("IfModule1");
+ return list;
+ }
+ },
+
+ IFMODULE_DIRECTORY{
+ public String getComponentName(){
+ return "IfModule Parameters";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[1];
+ parentNames[0]="<IfModule";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<IfModule";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ List<AugeasNode> nodes = DIRECTORY.getAllNodes(tree);
+ List<AugeasNode> ifModNodes = new ArrayList<AugeasNode>();
+ for (AugeasNode node : nodes){
+ List<AugeasNode> tempNodes =
AugeasNodeSearch.searchNode(IFMODULE_DIRECTORY.getPossParentNodeName(),
IFMODULE_DIRECTORY.getNodeName(), node);
+ if (tempNodes != null)
+ ifModNodes.addAll(tempNodes);
+ }
+ return ifModNodes;
+
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("IfModule Parameters0");
+ return list;
+ }
+ },
+
+ DIRECTORY{
+ public String getComponentName(){
+ return "Directory";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[2];
+ parentNames[0]="<IfModule";
+ parentNames[1]="<VirtualHost";
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<Directory";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return AugeasNodeSearch.searchNode(DIRECTORY.getPossParentNodeName(),
DIRECTORY.getNodeName(), tree.getRootNode());
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("Directory0");
+ list.add("Directory1");
+ list.add("Directory2");
+ return list;
+ }
+ },
+
+ VIRTUALHOST{
+ public String getComponentName(){
+ return "Apache Virtual Host";
+ }
+ public String[] getPossParentNodeName(){
+ String [] parentNames = new String[0];
+ return parentNames;
+ }
+ public String getNodeName(){
+ return "<VirtualHost";
+ }
+ public List<AugeasNode> getAllNodes(AugeasTree tree){
+ return tree.getRootNode().getChildByLabel("<VirtualHost");
+ }
+
+ public List<String> getConfigurationFiles(){
+ List<String> list = new ArrayList<String>();
+ list.add("Apache Virtual Host0");
+ return list;
+ }
+ };
+
+ public abstract String getComponentName();
+ public abstract String[] getPossParentNodeName();
+ public abstract String getNodeName();
+ public abstract List<AugeasNode> getAllNodes(AugeasTree tree);
+ public abstract List<String> getConfigurationFiles();
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
new file mode 100644
index 0000000..41b3ee9
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java
@@ -0,0 +1,21 @@
+package org.rhq.plugins.apache;
+
+public class UnitTestException extends Exception{
+
+ public UnitTestException(){
+ super();
+ }
+
+ public UnitTestException(String text){
+ super(text);
+ }
+
+ public UnitTestException(Exception e){
+ super(e);
+ }
+
+ public UnitTestException(String message,Throwable cause){
+ super(message,cause);
+ }
+
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
new file mode 100644
index 0000000..f6df6d0
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java
@@ -0,0 +1,23 @@
+package org.rhq.plugins.apache.helper;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class LensFilter implements FileFilter{
+ private Pattern pattern;
+
+ public LensFilter(String name){
+ pattern = Pattern.compile(name+".*");
+ }
+
+ public boolean accept(File pathname) {
+ String name = pathname.getName();
+ Matcher match = pattern.matcher(name);
+ if (match.matches())
+ return true;
+
+ return false;
+ }
+}
\ No newline at end of file
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
new file mode 100644
index 0000000..329b3ca
--- /dev/null
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java
@@ -0,0 +1,109 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.apache.helper;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class LensHelper {
+ public static final String TEMP_DIRECTORY = "java.io.tmpdir";
+ public static final String TEMP_FILE_SUFFIX = ".aug";
+
+
+ public static String getLensPath(String param) throws IOException,Exception{
+ String lensPath=null;
+
+ if (param.indexOf(File.separatorChar)==-1){
+
+ }else
+ lensPath = param;
+ return lensPath;
+
+ }
+
+ public static void copyFile(InputStream in,File destination) throws Exception{
+
+ if (!destination.canWrite())
+ throw new Exception("Creating of temporary file for lens failed.
Destination file "
+ + destination.getAbsolutePath()+" is not accessible.");
+
+ OutputStream out = new FileOutputStream(destination);
+
+ byte[] buf = new byte[1024];
+ int length;
+
+ while ((length = in.read(buf)) > 0) {
+ out.write(buf, 0, length);
+ }
+
+ in.close();
+ out.close();
+
+ }
+
+ public static File createTempDir(String name) throws IOException{
+
+ String tempDir = (String)System.getProperties().get(TEMP_DIRECTORY);
+
+ File tempDirectory = new File(tempDir);
+ File [] lens = tempDirectory.listFiles(new LensFilter(name));
+
+ File lensDirectory;
+
+ if (lens.length==0){
+ File tempFile = File.createTempFile(name, "");
+ String nm = tempFile.getName();
+ tempFile.delete();
+ lensDirectory = new File(tempDirectory,nm);
+ lensDirectory.mkdir();
+ lensDirectory.deleteOnExit();
+ }else{
+ lensDirectory = lens[0];
+ }
+
+ return lensDirectory;
+
+ }
+
+ public static String getTempDirectoryPath(){
+ return (String)System.getProperties().get(TEMP_DIRECTORY);
+ }
+
+ public static File cpFileFromPluginToTemp(ClassLoader loader,File
tempDirectory,String fileName) throws IOException,Exception{
+
+ File destinationFile = new File(tempDirectory,fileName);
+ if (!destinationFile.exists())
+ {
+ destinationFile.createNewFile();
+
+ InputStream input = loader.getResourceAsStream(fileName);
+ copyFile(input, destinationFile);
+ }
+
+ return destinationFile;
+ }
+
+}
\ No newline at end of file
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
new file mode 100644
index 0000000..06a9f71
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java
@@ -0,0 +1,230 @@
+package org.rhq.plugins.apache.util;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.rhq.augeas.node.AugeasNode;
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager;
+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.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.plugins.apache.ApacheTestConstants;
+import org.rhq.plugins.apache.Components;
+import org.rhq.plugins.apache.UnitTestException;
+import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ *
+ * @author Filip Drabek
+ *
+ */
+
+public class ApacheConfigurationUtil {
+
+ public static final String SIMPLE_TAG_NAME = "simple";
+ public static final String LIST_TAG_NAME = "list";
+ public static final String MAP_TAG_NAME = "map";
+ public static final String ROOT_ELEMENT = "configuration";
+ public static final String NAME_ATTRIBUTE = "name";
+
+ private Document loadXML(String file) throws UnitTestException{
+ Document document= null;
+ try {
+ File xmlFile = new File(file);
+ if (!xmlFile.exists())
+ throw new UnitTestException("Configuration file not
found.");
+
+ DocumentBuilderFactory factory =
+ DocumentBuilderFactory.newInstance();
+ DocumentBuilder loader = factory.newDocumentBuilder();
+
+ document = loader.parse(file);
+
+ }catch(Exception e){
+ throw new UnitTestException("Loading of xml file failed.",e);
+ }
+
+ return document;
+ }
+
+ public static void saveConfiguration(Configuration config,String fileName) throws
UnitTestException{
+ try {
+ Collection<Property> properties = config.getProperties();
+ DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
+ Document doc = docBuilder.newDocument();
+ Element element = doc.createElement(ROOT_ELEMENT);
+
+ for (Property property : properties){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ doc.appendChild(element);
+ saveXML(doc,fileName);
+
+ }catch(Exception e){
+ throw new UnitTestException(e);
+ }
+ }
+
+
+ private static Element configurationToDom(Property prop,Document doc){
+ Element element = null;
+ if (prop instanceof PropertySimple){
+ element = doc.createElement(SIMPLE_TAG_NAME);
+ element.appendChild(doc.createTextNode(((PropertySimple)
prop).getStringValue()));
+ }
+
+ if (prop instanceof PropertyList){
+ PropertyList list = (PropertyList) prop;
+ element = doc.createElement(LIST_TAG_NAME);
+ List<Property> propertyList = list.getList();
+ for (Property property : propertyList){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ }
+
+ if (prop instanceof PropertyMap){
+ PropertyMap map = (PropertyMap) prop;
+ element = doc.createElement(MAP_TAG_NAME);
+ Map<String,Property> propertyMap = map.getMap();
+ for (Property property : propertyMap.values()){
+ element.appendChild(configurationToDom(property,doc));
+ }
+ }
+
+ fillElement(element,prop);
+ return element;
+ }
+
+ private static void fillElement(Element element,Property prop){
+ element.setAttribute(NAME_ATTRIBUTE, prop.getName());
+ }
+
+ public Configuration loadConfiguration(String fileName) throws UnitTestException{
+ Document document = loadXML(fileName);
+ NodeList nodeList = document.getElementsByTagName(ROOT_ELEMENT);
+ if (nodeList.getLength()!=1)
+ throw new UnitTestException("Configuration file's " +
fileName+ " format is not valid.");
+
+ Node rootElement = nodeList.item(0);
+ Configuration configuration = new Configuration();
+ NodeList childNodes = rootElement.getChildNodes();
+ for (int i=0;i<childNodes.getLength();i++){
+ configuration.put(domToConfiguration(childNodes.item(i)));
+ }
+ return configuration;
+ }
+
+ private Property domToConfiguration(Node node){
+ String nodeName = node.getNodeName();
+ NamedNodeMap attrMap = node.getAttributes();
+ Node attrNode = attrMap.getNamedItem(NAME_ATTRIBUTE);
+ String propertyName = attrNode.getNodeValue();
+
+ Property prop = null;
+
+ if (nodeName.equals(SIMPLE_TAG_NAME)){
+ PropertySimple propertySimple = new PropertySimple(propertyName,null);
+ String value = node.getTextContent();
+ propertySimple.setStringValue(value);
+ prop = propertySimple;
+ }
+
+ if (nodeName.equals(LIST_TAG_NAME)){
+ PropertyList propertyList = new PropertyList(propertyName);
+ NodeList list = node.getChildNodes();
+ for (int i=0;i<list.getLength();i++) {
+ propertyList.add(domToConfiguration(list.item(i)));
+ }
+ prop = propertyList;
+ }
+
+ if (nodeName.equals(MAP_TAG_NAME)){
+ PropertyMap propertyMap = new PropertyMap(propertyName);
+ NodeList list = node.getChildNodes();
+ for (int i=0;i<list.getLength();i++){
+ propertyMap.put(domToConfiguration(list.item(i)));
+ }
+ prop = propertyMap;
+ }
+
+ return prop;
+ }
+
+ @SuppressWarnings("restriction")
+ private static void saveXML(Document document,String fileName) throws
UnitTestException{
+ try {
+ File file = new File(fileName);
+ if (!file.exists())
+ file.createNewFile();
+
+ XMLSerializer serializer = new XMLSerializer();
+ serializer.setOutputCharStream(
+ new java.io.FileWriter(fileName));
+ serializer.serialize(document);
+ }catch(Exception e){
+ throw new UnitTestException("Saving of xml file failed",e);
+ }
+ }
+
+ public static void printConfiguration(Property prop){
+ if (prop instanceof PropertySimple){
+ System.out.println(" SimpleProperty name="+prop.getName()+"
value="+((PropertySimple)prop).getStringValue());
+ }
+
+ if (prop instanceof PropertyList){
+ PropertyList list = (PropertyList) prop;
+ System.out.println("PropertyList name="+list.getName());
+ for (Property property : list.getList()){
+ printConfiguration(property);
+ }
+ }
+
+ if (prop instanceof PropertyMap){
+ PropertyMap map = (PropertyMap) prop;
+ System.out.println(" PropertyMap name="+map.getName());
+ Map<String,Property> propertyMap = map.getMap();
+ for (Property property : propertyMap.values()){
+ printConfiguration(property);
+ }
+ }
+ }
+
+
+ public static ConfigurationDefinition getConfigurationDefinition(PluginContainer
container,Components component){
+ PluginManager pluginManager = container.getPluginManager();
+ PluginMetadataManager pluginMetadataManager =
pluginManager.getMetadataManager();
+
+ ResourceType type = pluginMetadataManager.getType(component.getComponentName(),
ApacheTestConstants.PLUGIN_NAME);
+ ConfigurationDefinition configDef = type.getResourceConfigurationDefinition();
+ return configDef;
+ }
+
+
+ public static Configuration componentToConfiguration(PluginContainer
container,Components component,String key,AugeasTree tree) throws UnitTestException{
+ ConfigurationDefinition def =
getConfigurationDefinition(container,component);
+ AugeasNode node = AugeasNodeSearch.findNodeById(tree.getRootNode(), key);
+ ApacheAugeasMapping map = new ApacheAugeasMapping(tree);
+ Configuration config = map.updateConfiguration(node, def);
+ return config;
+ }
+}
diff --git
a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
new file mode 100644
index 0000000..0047faf
--- /dev/null
+++
b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java
@@ -0,0 +1,75 @@
+package org.rhq.plugins.apache.util;
+
+import java.io.File;
+
+import org.rhq.augeas.tree.AugeasTree;
+import org.rhq.core.clientapi.agent.PluginContainerException;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.inventory.InventoryManager;
+import org.rhq.core.pc.inventory.ResourceContainer;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.util.ComponentUtil;
+import org.rhq.core.pc.util.FacetLockType;
+
+public class StandAloneContainer {
+
+ public PluginContainer getContainer(AugeasTree tree,String pluginPath){
+ PluginContainer container=null;
+ try {
+ container = PluginContainer.getInstance();
+ File pluginDir = new File(pluginPath);
+ PluginContainerConfiguration config = new PluginContainerConfiguration();
+ config.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ config.setPluginDirectory(pluginDir);
+
+ container.setConfiguration(config);
+ container.initialize();
+ container.getInventoryManager().executeServerScanImmediately();
+ container.getInventoryManager().executeServiceScanImmediately();
+
+ return container;
+
+ }catch(Exception e){
+ e.printStackTrace();
+ if (container!=null)
+ container.shutdown();
+ }
+ return null;
+ }
+
+
+
+ public static <T> T getComponent(int resourceId, Class<T> facetInterface,
FacetLockType lockType,
+ long timeout, boolean daemonThread, boolean
onlyIfStarted) throws PluginContainerException {
+ InventoryManager inventoryManager =
PluginContainer.getInstance().getInventoryManager();
+ ResourceContainer resourceContainer =
inventoryManager.getResourceContainer(resourceId);
+ if (resourceContainer == null) {
+ throw new PluginContainerException("Resource component container could not
be retrieved for resource: "
+ + resourceId);
+ }
+ return resourceContainer.createResourceComponentProxy(facetInterface, lockType,
timeout, daemonThread, onlyIfStarted);
+ }
+
+ public static <T> Object getComponentProxy(Resource res,Class<T>
facetInterface) throws Exception {
+ ClassLoader currenContextClassLoader = Thread.currentThread()
+ .getContextClassLoader();
+ try {
+ Resource asResource = res;
+ ClassLoader cl = PluginContainer.getInstance().getPluginComponentFactory().
+ getResourceClassloader(asResource);
+
+ Class<?> resourceSpecificFacetInterface = Class.forName(
+ facetInterface.getName(), true, cl);
+
+ Thread.currentThread().setContextClassLoader(cl);
+
+ return ComponentUtil.getComponent(asResource.getId(),resourceSpecificFacetInterface,
+ FacetLockType.WRITE, 30000, true, true);
+ } finally {
+ Thread.currentThread().setContextClassLoader(
+ currenContextClassLoader);
+ }
+ }
+}
diff --git a/modules/plugins/apache/src/test/resources/httpd.aug
b/modules/plugins/apache/src/test/resources/httpd.aug
new file mode 100644
index 0000000..0fddced
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/httpd.aug
@@ -0,0 +1,58 @@
+module Httpd =
+ autoload xfm
+
+(* Helpers *)
+
+(* Newlines can be escaped. *)
+let sep = del /([ \t]+(\\\\\n)?)+/ " "
+let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n"
+ let del_str (s:string) = del s s
+let ws = /[ \t]*/
+let alnum = /[a-zA-Z0-9_]+/
+(* the last character in the non-quoted word must not be a backslash. I guess this is not
completely semantically
+ correct but at the same time, apache discourages to use backslashes for anything else
than
+ line breaking so we should be safe here. This restriction is in place to support
+ escaped new lines in the sep and eol rules. *)
+let word =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'"
\t\n]*[^'" \t\n\\]/
+let secarg =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\"
\t\n>]+/
+let wskey (k:regexp) = del ws "" . key k
+let params (param:regexp) = [ sep . label "param" . store param ]*
+let sec (name:string) (body:lens) =
+ [ wskey ("<" . name) . params secarg . del_str ">" . eol .
+ body . del ws "" . del_str("</" . name . ">")
. eol ]
+
+(* Definitions *)
+let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ]
+
+let directive = [ wskey alnum . params word . eol ]
+
+let section (name:string) = sec name (directive|comment)*
+
+let sections (body:lens) = sec "Directory" body
+ | sec "DirectoryMatch" body
+ | sec "Files" body
+ | sec "FilesMatch" body
+ | sec "Location" body
+ | sec "LocationMatch" body
+ | sec "AuthnProviderAlias" body
+ | sec "IfDefine" body
+ | sec "IfVersion" body
+ | sec "Limit" body
+ | sec "LimitExcept" body
+ | sec "Proxy" body
+ | sec "ProxyMatch" body
+ | sec "VirtualHost" body
+ | sec "IfModule" body
+
+
+(* What we want ot say is *)
+(* let rec body = (directive|comment)* | ifModule body | directory body | ... *)
+(* but we can't typecheck that *)
+
+(* FIXME: *)
+(* - Nesting of sections *)
+let rec lns = (directive | comment | sections lns)*
+
+let filter =
+ incl "/etc/httpd/conf/httpd.conf"
+let xfm = transform lns filter
diff --git a/modules/plugins/apache/src/test/resources/httpd.conf
b/modules/plugins/apache/src/test/resources/httpd.conf
new file mode 100644
index 0000000..7814492
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/httpd.conf
@@ -0,0 +1,41 @@
+<VirtualHost 10.1.2.3>
+ ServerName
www.example.com:80
+ ServerAlias server
server2.domain.com server2
+ ServerAdmin www-admin(a)foo.example.com
+ DocumentRoot /home/fdrabek/Work
+ AddDefaultCharset utf-8
+ Alias /image /ftp/pub/image
+ DefaultType image/gif
+ DirectoryIndex index.html index.txt /cgi-bin/index.pl
+ ErrorDocument 404 /cgi-bin/bad_urls.pl
+ Timeout 300
+ Options Indexes FollowSymLinks
+ UseCanonicalName On
+ ErrorLog "|/usr/local/bin/httpd_errors"
+ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"
+ <Directory /usr/local/httpd/htdocs>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ <IfModule test.c>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ </IfModule>
+</Directory>
+Include included.conf
+</VirtualHost>
diff --git a/modules/plugins/apache/src/test/resources/included.conf
b/modules/plugins/apache/src/test/resources/included.conf
new file mode 100644
index 0000000..258f3f7
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/included.conf
@@ -0,0 +1,13 @@
+Include nested.conf
+<Directory ~ "^/www/.*/[0-9]{3}">
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+</Directory>
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
new file mode 100644
index 0000000..be5f4bc
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><simple
name="ErrorLog">"|/usr/local/bin/httpd_errors"</simple><list
name="CustomLog"><map name="CustomLog"><simple
name="Destination">logs/access_log</simple><simple
name="format">"%h %l %u %t \"%r\" %>s
%b"</simple><simple
name="_index">0</simple></map></list><simple
name="ServerName">www.example.com:80</simple><list
name="ServerAlias"><map name="ServerAlias"><simple
name="hostname">server</simple><simple
name="_index">0</simple></map><map
name="ServerAlias"><simple
name="hostname">server2.domain.com</simple><simple
name="_index">0</simple></map><map
name="ServerAlias"><simple
name="hostname">server2</simple><simple
name="_index">0</simple></map></list><simple
name="ServerAdmin">www-admin(a)foo.example.com</simple><simple
name="DocumentRoot">/home/fdrabek/Work</simple><simple
name="AddDefaultCharset">utf-8</simple><list
name="Alias"><map name="Alias"><simple
name="URL">/image</simple><simple
name="directory">/ftp/pub/image</simple></map></list><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map><map
name="DirectoryIndex"><simple
name="host">index.txt</simple><simple
name="_index">0</simple></map><map
name="DirectoryIndex"><simple
name="host">/cgi-bin/index.pl</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">404</simple><simple
name="document">/cgi-bin/bad_urls.pl</simple></map></list><simple
name="Timeout">300</simple><list name="Options"><map
name="Options"><simple
name="Mode">Set</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Set</simple><simple
name="Option">FollowSymLinks</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">On</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory0
b/modules/plugins/apache/src/test/resources/loadconfig/Directory0
new file mode 100644
index 0000000..1c28e70
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"/><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory1
b/modules/plugins/apache/src/test/resources/loadconfig/Directory1
new file mode 100644
index 0000000..574fe20
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory1
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory2
b/modules/plugins/apache/src/test/resources/loadconfig/Directory2
new file mode 100644
index 0000000..574fe20
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory2
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
new file mode 100644
index 0000000..88bebc2
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
new file mode 100644
index 0000000..823aee3
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test2.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
new file mode 100644
index 0000000..823aee3
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<configuration><list name="IfModules"><map
name="IfModule"><simple
name="condition">test2.c</simple></map></list><simple
name="Order">Deny,Allow</simple><list
name="Allow"><map name="Allow"><simple
name="host">apache.org</simple><simple
name="_index">0</simple></map></list><list
name="Deny"><map name="Deny"><simple
name="host">all</simple><simple
name="_index">0</simple></map></list><list
name="AllowOverride"><map name="AllowOverride"><simple
name="param">AuthConfig</simple><simple
name="_index">0</simple></map><map
name="AllowOverride"><simple
name="param">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="AddDefaultCharset">utf-8</simple><simple
name="DefaultType">image/gif</simple><list
name="DirectoryIndex"><map name="DirectoryIndex"><simple
name="host">index.html</simple><simple
name="_index">0</simple></map></list><list
name="ErrorDocument"><map name="ErrorDocument"><simple
name="responseCode">403</simple><simple
name="document">"Sorry can't allow you access
today"</simple></map></list><list
name="Options"><map name="Options"><simple
name="Mode">Add</simple><simple
name="Option">Includes</simple><simple
name="_index">0</simple></map><map
name="Options"><simple
name="Mode">Remove</simple><simple
name="Option">Indexes</simple><simple
name="_index">0</simple></map></list><simple
name="UseCanonicalName">DNS</simple><simple
name="UseCanonicalPhysicalPort"/></configuration>
\ No newline at end of file
diff --git a/modules/plugins/apache/src/test/resources/nested.conf
b/modules/plugins/apache/src/test/resources/nested.conf
new file mode 100644
index 0000000..37326cb
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/nested.conf
@@ -0,0 +1,12 @@
+ <IfModule test2.c>
+ Order Deny,Allow
+ Allow from
apache.org
+ Deny from all
+ AllowOverride AuthConfig Indexes
+ DefaultType image/gif
+ AddDefaultCharset utf-8
+ DirectoryIndex index.html
+ ErrorDocument 403 "Sorry can't allow you access today"
+ Options +Includes -Indexes
+ UseCanonicalName DNS
+ </IfModule>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
new file mode 100644
index 0000000..0fddced
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug
@@ -0,0 +1,58 @@
+module Httpd =
+ autoload xfm
+
+(* Helpers *)
+
+(* Newlines can be escaped. *)
+let sep = del /([ \t]+(\\\\\n)?)+/ " "
+let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n"
+ let del_str (s:string) = del s s
+let ws = /[ \t]*/
+let alnum = /[a-zA-Z0-9_]+/
+(* the last character in the non-quoted word must not be a backslash. I guess this is not
completely semantically
+ correct but at the same time, apache discourages to use backslashes for anything else
than
+ line breaking so we should be safe here. This restriction is in place to support
+ escaped new lines in the sep and eol rules. *)
+let word =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'"
\t\n]*[^'" \t\n\\]/
+let secarg =
/\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\"
\t\n>]+/
+let wskey (k:regexp) = del ws "" . key k
+let params (param:regexp) = [ sep . label "param" . store param ]*
+let sec (name:string) (body:lens) =
+ [ wskey ("<" . name) . params secarg . del_str ">" . eol .
+ body . del ws "" . del_str("</" . name . ">")
. eol ]
+
+(* Definitions *)
+let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ]
+
+let directive = [ wskey alnum . params word . eol ]
+
+let section (name:string) = sec name (directive|comment)*
+
+let sections (body:lens) = sec "Directory" body
+ | sec "DirectoryMatch" body
+ | sec "Files" body
+ | sec "FilesMatch" body
+ | sec "Location" body
+ | sec "LocationMatch" body
+ | sec "AuthnProviderAlias" body
+ | sec "IfDefine" body
+ | sec "IfVersion" body
+ | sec "Limit" body
+ | sec "LimitExcept" body
+ | sec "Proxy" body
+ | sec "ProxyMatch" body
+ | sec "VirtualHost" body
+ | sec "IfModule" body
+
+
+(* What we want ot say is *)
+(* let rec body = (directive|comment)* | ifModule body | directory body | ... *)
+(* but we can't typecheck that *)
+
+(* FIXME: *)
+(* - Nesting of sections *)
+let rec lns = (directive | comment | sections lns)*
+
+let filter =
+ incl "/etc/httpd/conf/httpd.conf"
+let xfm = transform lns filter
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
new file mode 100644
index 0000000..75342e6
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf
@@ -0,0 +1,10 @@
+<VirtualHost 10.1.2.3>
+ ServerName
www.example.com:80
+ <Directory /usr/local/httpd/htdocs>
+ Order Deny,Allow
+ <IfModule test.c>
+ Order Deny,Allow
+ </IfModule>
+</Directory>
+Include included.conf
+</VirtualHost>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/included.conf
b/modules/plugins/apache/src/test/resources/updateconfig/included.conf
new file mode 100644
index 0000000..4aa2557
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/included.conf
@@ -0,0 +1,4 @@
+Include nested.conf
+<Directory ~ "^/www/.*/[0-9]{3}">
+ Order Deny,Allow
+</Directory>
diff --git a/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
new file mode 100644
index 0000000..ef66e99
--- /dev/null
+++ b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf
@@ -0,0 +1,3 @@
+ <IfModule test2.c>
+ UseCanonicalName DNS
+ </IfModule>
commit 0842b8358144b9af26e1e9385d8c2a60c1e337e5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 03:05:09 2010 -0400
BZ-614845: ensure that the form is submitted after the ajax-selection completes
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
index e5b1075..2eef373 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
@@ -78,7 +78,7 @@
ignoreDupResponses="true"
requestDelay="25"
status="commonStatus"
-
onsubmit="getElementCrossBrowser('notificationListForm:refreshButton').click();"
+
oncomplete="getElementCrossBrowser('notificationListForm:refreshButton').click();"
/>
<ui:remove>
<a4j:support event="onkeyup"
commit 9b91e5efdfd522c622bb8d779b01bd75b799e616
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 01:42:31 2010 -0400
BZ-614886: fix permissions necessary for resource/plugin configuration updates
* historic/auditing data should not requires permission above and beyond the
ability to view the corresponding resource to which that data is attached
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 1652b0b..2e6198d 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
@@ -846,13 +846,6 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PageList<ResourceConfigurationUpdate>
findResourceConfigurationUpdates(Subject subject, Integer resourceId,
Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE,
resourceId)) {
- throw new PermissionException("User [" + subject.getName()
- + "] does not have permission to manage configuration for
resource[id=" + resourceId + "]");
- }
-
- Resource resource = entityManager.find(Resource.class, resourceId);
-
// TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential,
because our sequences are configured to
// pre-create and cache blocks of 10 sequence id's, so
it may be better to order by
// "cu.createdTime", rather than
"cu.id".
@@ -893,11 +886,6 @@ public class ConfigurationManagerBean implements
ConfigurationManagerLocal, Conf
public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int
configurationUpdateId) {
PluginConfigurationUpdate update =
entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
- if (!authorizationManager.canViewResource(subject, update.getResource().getId()))
{
- throw new PermissionException("User [" + subject.getName()
- + "] does not have permission to view plugin configuration update
for [" + update.getResource() + "]");
- }
-
update.getConfiguration(); // this is EAGER loaded, so this really doesn't do
anything
return update;
commit 5f64058c9248af196fbf6136bfcbf2b0bc334f3e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 16 01:30:14 2010 -0400
don't try to reload the data page upon authorization failures, just let it bubble
up
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
index 0b1614f..c1c8ffe 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
@@ -31,6 +31,7 @@ import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean;
import org.rhq.enterprise.gui.legacy.WebUser;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
+import org.rhq.enterprise.server.authz.PermissionException;
import org.rhq.enterprise.server.util.HibernatePerformanceMonitor;
/**
@@ -358,6 +359,8 @@ public abstract class PagedListDataModel<T> extends DataModel {
}
tryQueryAgain = true;
}
+ } catch (PermissionException pe) {
+ throw pe; // don't try to reload the data page upon authorization
failures, just let it bubble up
} catch (Throwable t) {
/*
* known issues during pagination:
commit 632868dd3e8f3ee7a55f5bad02756d4b9df30a86
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:41:52 2010 -0400
remove unnecessary debugging constructs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index 0cd5f71..c14127b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -64,7 +64,6 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
-import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers,
HasValue<String>,
HasSelectionHandlers<Suggestion> {
@@ -512,8 +511,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
String decoratedSuffix = wrap(highlightedSuggestion, "float: left;
");
String floatClear = "<br style=\"clear: both;\"
/>";
- SearchLogger.debug("decoratedSuffix: " + decoratedSuffix);
-
String innerHTML = decoratedPrefix + decoratedSuffix + floatClear;
return innerHTML;
}
@@ -532,8 +529,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
}
- SearchLogger.debug("results: " + results);
-
return results.toString();
}
@@ -556,8 +551,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
words.add(builder.toString());
}
- SearchLogger.debug("words: " + words);
-
return words;
}
commit c8d7ffa904e66d92b89ae43df500200e7dbe5440
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:40:26 2010 -0400
BZ-612739: use more sophisticated highlighting mechanism that respects line breaks
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index 0b9ac6c..0cd5f71 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.search.suggest;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -63,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
+import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers,
HasValue<String>,
HasSelectionHandlers<Suggestion> {
@@ -502,14 +504,16 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
}
- String decoratedPrefix = decorate(prefix, style);
+ String decoratedPrefix = wrap(prefix, style);
String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 100);
String decoratedItemLabel = decorate(formattedItemLabel,
"background-color: yellow;", item.getStartIndex(),
item.getEndIndex());
String highlightedSuggestion = colorOperator(decoratedItemLabel);
- String decoratedSuffix = decorate(highlightedSuggestion, "float: left;
");
+ String decoratedSuffix = wrap(highlightedSuggestion, "float: left;
");
String floatClear = "<br style=\"clear: both;\"
/>";
+ SearchLogger.debug("decoratedSuffix: " + decoratedSuffix);
+
String innerHTML = decoratedPrefix + decoratedSuffix + floatClear;
return innerHTML;
}
@@ -575,10 +579,11 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
return data;
}
- private static String decorate(String data, String style) {
- return decorate(data, style, 0, data.length());
+ private static String wrap(String data, String style) {
+ return "<span style=\"" + style + "\">" +
data + "</span>";
}
+ /*
private static String decorate(String data, String style, int startIndex, int
endIndex) {
if (startIndex == -1) {
return data; // no match
@@ -588,6 +593,69 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
String after = data.substring(endIndex);
return before + "<span style=\"" + style +
"\">" + highlight + "</span>" + after;
}
+ */
+
+ private static String decorate(String data, String style, int startIndex, int
endIndex) {
+ if (startIndex == -1 || (startIndex == endIndex)) {
+ return data; // no match or zero-width match
+ }
+
+ String[] words = data.split("<br/>");
+ int counter = 0;
+ int wordIndex = 0;
+ int letterIndex = 0;
+
+ StringBuilder results = new StringBuilder();
+ while (counter < startIndex) {
+ if (wordIndex == words.length) {
+ break;
+ }
+
+ if (letterIndex < words[wordIndex].length()) { // more letters left in
the current word?
+ results.append(words[wordIndex].charAt(letterIndex)); // append the
next char of the current word
+ letterIndex++; // move to the next char in the current word
+ counter++; // only move counter forward when we've added non-BR
chars to the results
+ } else { // next word
+ results.append("<br/>"); // put the break point back
in between words
+ letterIndex = 0; // point to the first char
+ wordIndex++; // of the next word
+ }
+ }
+
+ // we're at start index, wrap all words and word fragments in the
specified style up to endIndex
+ results.append("<span style=\"" + style +
"\">"); // seed action
+ while (counter < endIndex) {
+ if (wordIndex == words.length) {
+ break;
+ }
+
+ if (letterIndex < words[wordIndex].length()) { // more letters left in
the current word?
+ results.append(words[wordIndex].charAt(letterIndex)); // append the
next char of the current word
+ letterIndex++; // move to the next char in the current word
+ counter++; // only move counter forward when we've added non-BR
chars to the results
+ } else { // next word
+ results.append("</span>"); // close the previous
word, we don't highlight breaks
+ results.append("<br/>"); // put the break point back
in between words
+ letterIndex = 0; // point to the first char
+ wordIndex++; // of the next word
+ results.append("<span style=\"" + style +
"\">"); // prepare for next word
+ }
+ }
+ results.append("</span>"); // end last dangling span
+
+ // append the rest of the current word fragment, if any
+ if (wordIndex != words.length) {
+ results.append(words[wordIndex].substring(letterIndex));
+ }
+
+ // append the rest of the words
+ while (++wordIndex < words.length) {
+ results.append("<br/>"); // put the break point back in
between words
+ results.append(words[wordIndex]);
+ }
+
+ return results.toString();
+ }
}
class SearchSuggestOracle extends SuggestOracle {
commit fdef972cd1fdb826536b80e6e2e44f5c07ea2351
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:39:41 2010 -0400
BZ-612739: ensure that search suggestions never overflow drop-down boundaries
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index bce49e4..0b9ac6c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -503,7 +503,7 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
}
String decoratedPrefix = decorate(prefix, style);
- String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 110);
+ String formattedItemLabel = chopWithEvery(item.getLabel(),
"<br/>", 100);
String decoratedItemLabel = decorate(formattedItemLabel,
"background-color: yellow;", item.getStartIndex(),
item.getEndIndex());
String highlightedSuggestion = colorOperator(decoratedItemLabel);
@@ -514,21 +514,49 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
return innerHTML;
}
- private static String chopWithEvery(String chop, String with, int every) {
- String[] words = chop.split("\\s");
+ private static String chopWithEvery(String toChop, String with, int every) {
+ //String[] words = toChop.split("\\s");
+ List<String> words = chop(toChop, "\\/- \t\r\n");
StringBuilder results = new StringBuilder();
int currentLineLength = 0;
for (String next : words) {
+ results.append(next);
+ currentLineLength += next.length();
if (currentLineLength + next.length() > every) {
results.append(with);
currentLineLength = 0;
}
- results.append(next).append(' ');
- currentLineLength += (next.length() + 1);
}
+
+ SearchLogger.debug("results: " + results);
+
return results.toString();
}
+ // StringTokenzier doesn't exist in GWT, so have to write my own
+ private static List<String> chop(String dataToChop, String chopTokens) {
+ List<String> words = new ArrayList<String>();
+
+ StringBuilder builder = new StringBuilder();
+ for (char next : dataToChop.toCharArray()) {
+ if (chopTokens.indexOf(next) != -1) {
+ if (builder.length() > 0) {
+ words.add(builder.toString());
+ builder = new StringBuilder();
+ }
+ }
+ builder.append(next);
+ }
+
+ if (builder.length() > 0) {
+ words.add(builder.toString());
+ }
+
+ SearchLogger.debug("words: " + words);
+
+ return words;
+ }
+
private static final List<String> OPERATORS =
Arrays.asList("!==", "!=", "==", "=");
// TODO: fixing coloring strategy
commit a3c9ba855d997ecc918e5f666b8757acf9a2804b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 23:37:33 2010 -0400
parenthesize saved search results counts on all screens
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index ee7647b..c250f7c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -140,7 +140,7 @@ public class SavedSearchGrid extends Grid {
private static String stylize(SavedSearch savedSearch) {
String name = savedSearch.getName();
String pattern = savedSearch.getPattern();
- String count = savedSearch.getResultCount() == null ? "" :
String.valueOf(savedSearch.getResultCount());
+ String count = savedSearch.getResultCount() == null ? "" :
"(" + savedSearch.getResultCount() + ")";
return "<span class=\"savedSearchesPanel-top\">" + name
+ "</span> " + count + "<br/>" //
+ "<span class=\"savedSearchesPanel-bottom\">" +
pattern + "</span>";
}
commit 58c0104617caf09db42c7802e55d6df3fb420f81
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 18:52:29 2010 -0400
BZ 535784 - pass in -e argument to readlink to support the "double linked"
problem where rc.3.d has a symlink to init.d which in turn is a symlink to
rhq-agent-wrapper.sh. Need -e so readlink recursively walks the symlinks to reach the
actual script file
diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
index ee714a9..2bb861c 100755
--- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
+++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
@@ -94,12 +94,34 @@ prepare_pid_dir ()
fi
}
+# ----------------------------------------------------------------------
+# Determine what specific platform we are running on.
+# Set some platform-specific variables.
+
+case "`uname`" in
+ CYGWIN*) _CYGWIN=true
+ ;;
+ Linux*) _LINUX=true
+ ;;
+ Darwin*) _DARWIN=true
+ ;;
+ SunOS*) _SOLARIS=true
+ ;;
+ AIX*) _AIX=true
+ ;;
+esac
+
# -------------------------------
# Get the location of this script.
# Make sure we take into account the possibility $0
# is a symlink to the real agent installation script.
+# Only certain platforms support the -e option of readlink
+
+if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ _READLINK_ARG="-e"
+fi
-_DOLLARZERO=`readlink "$0" || echo "$0"`
+_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo
"$0"`
RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
debug_wrapper_msg
"RHQ_AGENT_WRAPPER_BIN_DIR_PATH=$RHQ_AGENT_WRAPPER_BIN_DIR_PATH"
diff --git a/modules/enterprise/agent/src/etc/rhq-agent.sh
b/modules/enterprise/agent/src/etc/rhq-agent.sh
index 8ef0625..e0122bd 100755
--- a/modules/enterprise/agent/src/etc/rhq-agent.sh
+++ b/modules/enterprise/agent/src/etc/rhq-agent.sh
@@ -34,6 +34,7 @@ debug_msg ()
# ----------------------------------------------------------------------
# Try to determine the fallback JAVA_HOME if not already set
# ----------------------------------------------------------------------
+
set_java_home ()
{
if [ "x$JAVA_HOME" = "x" ]; then
@@ -56,6 +57,7 @@ set_java_home ()
# Determine what specific platform we are running on.
# Set some platform-specific variables.
# ----------------------------------------------------------------------
+
case "`uname`" in
CYGWIN*) _CYGWIN=true
;;
@@ -63,6 +65,10 @@ case "`uname`" in
;;
Darwin*) _DARWIN=true
;;
+ SunOS*) _SOLARIS=true
+ ;;
+ AIX*) _AIX=true
+ ;;
esac
case "`uname -m`" in
@@ -76,7 +82,13 @@ esac
# We also assume our custom environment script is located in the same
# place as this script.
# ----------------------------------------------------------------------
-_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
+
+if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ # only certain platforms support the -e argument for readlink
+ _READLINK_ARG="-e"
+fi
+
+_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
if [ -f "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" ]; then
diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
index 9179850..bbef0bf 100644
--- a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
+++ b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh
@@ -178,12 +178,14 @@ remove_pid_files ()
case "`uname`" in
CYGWIN*) _CYGWIN=true
;;
+ Linux*) _LINUX=true
+ ;;
Darwin*) _DARWIN=true
;;
SunOS*) _SOLARIS=true
;;
- AIX*) _AIX=true
- ;;
+ AIX*) _AIX=true
+ ;;
esac
# ----------------------------------------------------------------------
@@ -193,7 +195,11 @@ esac
# ----------------------------------------------------------------------
if [ -z "$RHQ_SERVER_HOME" ]; then
- _DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
+ if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+ # only certain platforms support the -e argument for readlink
+ _READLINK_ARG="-e"
+ fi
+ _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/..
else
if [ ! -d "$RHQ_SERVER_HOME" ]; then
commit 18ef5bdb6c05411b93e80df9c66f8e1b403f8939
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 16:20:36 2010 -0400
fix the highlighting strategy to respect ^ and $ boundary characters
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index e721cb4..92138bf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -643,9 +643,21 @@ public class SearchAssistManager {
private List<SearchSuggestion> convert(List<String> suggestions,
ParsedContext parsed, String term, Kind kind) {
int startIndex = getStartIndex(parsed);
+ LOG.debug("convert(suggestions.size()=" + suggestions.size() + ",
" + parsed + ", " + term + ", " + kind + ")");
term = term.toLowerCase();
List<SearchSuggestion> results = new
ArrayList<SearchSuggestion>(suggestions.size());
for (String suggestion : suggestions) {
+ boolean startBounded = term.startsWith("^");
+ boolean endBounded = term.endsWith("$");
+
+ if (startBounded && endBounded) {
+ term = term.substring(1, term.length() - 1);
+ } else if (startBounded) {
+ term = term.substring(1);
+ } else if (endBounded) {
+ term = term.substring(0, term.length() - 1);
+ }
+
int index = suggestion.toLowerCase().indexOf(term, startIndex);
results.add(new SearchSuggestion(kind, suggestion, index, term.length()));
}
commit c0967d64b12aa0d7852dd36a8e5f782dbd4c226b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 16:20:57 2010 -0400
redirect error stream of readlink to dev/null when starting standalone pc
diff --git a/etc/standalone-pc/standalone.sh b/etc/standalone-pc/standalone.sh
index 29fd40f..d8ffef6 100755
--- a/etc/standalone-pc/standalone.sh
+++ b/etc/standalone-pc/standalone.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-_DOLLARZERO=`readlink "$0" || echo "$0"`
+_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"`
RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
RHQ_AGENT_MAINCLASS=org.rhq.core.pc.StandaloneContainer
export RHQ_AGENT_MAINCLASS
commit 15dec636ee9519d754306c44b0f0ca0263383d4b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 15 16:20:37 2010 -0400
remove the chkconfig headers - its a copy-paste from the server script - doesn't
make sense to have it here in the generate db passwd script
diff --git
a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
index e436d87..1d464d7 100755
---
a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
+++
b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh
@@ -1,10 +1,5 @@
#!/bin/sh
-# chkconfig: 2345 92 26
-# description: Starts and stops the RHQ Server
-#
-# processname: java
-
# =============================================================================
# RHQ Server UNIX Generate db password script
#
commit 13f07907fb73d9085e26c62e85938649c8eadadd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:33:48 2010 -0400
only add fragments to the generation suggestion-JPQL as necessary
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 87e10a5..94a2bd5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -12,7 +14,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil;
-import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -95,11 +96,12 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return results;
}
- protected final String add(String fragment, String parameter) {
- if (parameter != null && !parameter.equals("")) {
- return fragment;
+ protected final String conditionallyAddJPQLString(String fragment, String filter) {
+ if (filter == null || filter.equals("")) {
+ return "";
}
- return "";
+
+ return " AND " + getJPQLForString(fragment, filter);
}
protected final List<String> filter(Class<? extends Enum<?>>
enumType, String filter) {
@@ -145,10 +147,6 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return "'" + data + "'";
}
- protected final String escape(String data) {
- return QueryUtility.escapeSearchParameter(data);
- }
-
protected final String getFormatterValueFragment(String data) {
boolean hasWhitespace = false;
for (char next : data.toCharArray()) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index b4c3069..be85fc5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -1,7 +1,5 @@
package org.rhq.enterprise.server.search.assist;
-import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -64,8 +62,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + " AND " + getJPQLForString("type.name", filter)
//
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("type.name", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -74,8 +72,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + " AND " + getJPQLForString("type.plugin", filter)
//
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("type.plugin", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -83,8 +81,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
- + " AND " + getJPQLForString("rg.name", filter) //
- + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ + conditionallyAddJPQLString("rg.name", filter) //
+ + conditionallyAddJPQLString("rg.groupCategory", tab) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index e0560bf..671095f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -1,7 +1,5 @@
package org.rhq.enterprise.server.search.assist;
-import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -69,8 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + " AND " + getJPQLForString("definition.name",
filter) //
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("definition.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -81,8 +79,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + " AND " + getJPQLForString("definition.name",
filter) //
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("definition.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -92,8 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN ms.definition def " //
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
- + " AND " + getJPQLForString("ms.definition.name",
filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("ms.definition.name", filter) //
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY def.name ");
} else {
@@ -115,8 +113,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("type.name", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("type.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -124,8 +122,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.plugin " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("type.plugin", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("type.plugin", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -133,8 +131,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT res.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + " AND " + getJPQLForString("res.name", filter)
//
- + " AND " + getJPQLForString("type.category", tab)
//
+ + conditionallyAddJPQLString("res.name", filter) //
+ + conditionallyAddJPQLString("type.category", tab) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -150,9 +148,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND " + getJPQLForString("property.name",
param) //
- + " AND " +
getJPQLForString("property.stringValue", filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("property.name", param) //
+ + conditionallyAddJPQLString("property.stringValue", filter)
//
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -165,9 +163,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND " + getJPQLForString("property.name",
param) //
- + " AND " +
getJPQLForString("property.stringValue", filter) //
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("property.name", param) //
+ + conditionallyAddJPQLString("property.stringValue", filter)
//
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -177,9 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND " + getJPQLForString("ms.definition.name",
param) //
- + " AND " + getJPQLForString("trait.value", filter)
//
- + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ + conditionallyAddJPQLString("ms.definition.name", param) //
+ + conditionallyAddJPQLString("trait.value", filter) //
+ + conditionallyAddJPQLString("res.resourceType.category", tab)
//
+ " ORDER BY trait.value ");
} else {
commit 39d835db7d1331f3c4c9f279ebb431316b7eabe9
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:33:13 2010 -0400
support suggesting "null" values without quotes, which **is** a valid search
term value
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 45b5358..e721cb4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -681,6 +681,11 @@ public class SearchAssistManager {
List<String> results = new ArrayList<String>();
for (String next : data) {
+ if (next == null) {
+ results.add("null"); // null search comparisons should never be
quoted
+ continue;
+ }
+
boolean hasWhiteSpace = next.matches(".*\\s.*");
if (hasWhiteSpace == false) {
// don't pad things that don't need padding
commit 5d75679249ad69455da1a121cb3355ab75dc9629
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 15:11:05 2010 -0400
BZ-615017: enhance search suggestion/execution support for boundary matching
this fix supports all three styles for search terms:
* value
* context=value
* context[parameter]=value
this fix enhances boundar matching in the following ways:
1) adds boundary matching for 'parameter' suggestions
2) adds boundary matching for 'values' suggestions
3) supports search execution for bounded 'parameter'
4) supports search execution for bounded 'values'
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index cee5ff2..b4c3069 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -62,8 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.name", filter)
//
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -72,8 +74,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.plugin", filter)
//
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -81,8 +83,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
- + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(rg.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("rg.name", filter) //
+ + " AND " + getJPQLForString("rg.groupCategory",
tab) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 9900ecb..e0560bf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.assist;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -67,8 +69,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("definition.name",
filter) //
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -79,8 +81,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ " AND simpleDefinition = definition " // only suggest names
for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("definition.name",
filter) //
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -90,8 +92,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN ms.definition def " //
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("ms.definition.name",
filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY def.name ");
} else {
@@ -113,8 +115,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.name", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -122,8 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT type.plugin " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("type.plugin", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -131,8 +133,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ "SELECT DISTINCT res.name " //
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
- + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("res.name", filter)
//
+ + " AND " + getJPQLForString("type.category", tab)
//
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -148,9 +150,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("property.name",
param) //
+ + " AND " +
getJPQLForString("property.stringValue", filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -163,9 +165,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ " AND property = simple " // join here so we can project
simple.stringValue
+ " AND property.name = propertyDefinition.name " //
property/definition are linked via name
- + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("property.name",
param) //
+ + " AND " +
getJPQLForString("property.stringValue", filter) //
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -175,9 +177,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
- + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ + " AND " + getJPQLForString("ms.definition.name",
param) //
+ + " AND " + getJPQLForString("trait.value", filter)
//
+ + " AND " +
getJPQLForString("res.resourceType.category", tab) //
+ " ORDER BY trait.value ");
} else {
@@ -185,5 +187,4 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
}
}
-
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
new file mode 100644
index 0000000..734526a
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java
@@ -0,0 +1,90 @@
+package org.rhq.enterprise.server.search.common;
+
+import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
+import org.rhq.enterprise.server.util.QueryUtility;
+
+public class SearchQueryGenerationUtility {
+ public enum ValueFilter {
+ STARTS_WITH, //
+ ENDS_WITH, //
+ INDEX_OF, //
+ EXACT_MATCH;
+ }
+
+ public static String getJPQLForString(String fragment, String value) {
+ if (value == null) {
+ value = "";
+ }
+
+ return getJPQLForString(fragment, RHQLComparisonOperator.EQUALS, value);
+ }
+
+ public static String getJPQLForString(String fragment, RHQLComparisonOperator
operator, String value) {
+ if (value == null) {
+ value = "";
+ }
+
+ int size = value.length();
+ if (value.startsWith("^")) {
+ if (value.endsWith("$")) {
+ return getJPQLForString(fragment, operator, value.substring(1, size - 1),
ValueFilter.EXACT_MATCH);
+ } else {
+ return getJPQLForString(fragment, operator, value.substring(1),
ValueFilter.STARTS_WITH);
+ }
+ } else {
+ if (value.endsWith("$")) {
+ return getJPQLForString(fragment, operator, value.substring(0, size - 1),
ValueFilter.ENDS_WITH);
+ } else {
+ return getJPQLForString(fragment, operator, value,
ValueFilter.INDEX_OF);
+ }
+ }
+ }
+
+ private static String getJPQLForString(String fragment, RHQLComparisonOperator
operator, String value,
+ ValueFilter filter) {
+ if (operator == RHQLComparisonOperator.EQUALS) {
+ return lower(fragment) + " LIKE " + process(filter,
value.toLowerCase());
+
+ } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) {
+ return fragment + " LIKE " + process(filter, value);
+
+ } else if (operator == RHQLComparisonOperator.NOT_EQUALS) {
+ return lower(fragment) + " NOT LIKE " + process(filter,
value.toLowerCase());
+
+ } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
+ return fragment + " NOT LIKE " + process(filter, value);
+
+ } else if (operator == RHQLComparisonOperator.NULL) {
+ return fragment + " IS NULL";
+
+ } else if (operator == RHQLComparisonOperator.NOT_NULL) {
+ return fragment + " IS NOT NULL";
+
+ } else {
+ throw new IllegalArgumentException("Unsupported operator " +
operator);
+ }
+ }
+
+ private static String process(ValueFilter filter, String value) {
+ if (filter == ValueFilter.STARTS_WITH) {
+ return "'" + escape(value) + "%'";
+ } else if (filter == ValueFilter.ENDS_WITH) {
+ return "'%" + escape(value) + "'";
+ } else if (filter == ValueFilter.INDEX_OF) {
+ return "'%" + escape(value) + "%'";
+ } else if (filter == ValueFilter.EXACT_MATCH) {
+ return "'" + escape(value) + "'";
+ } else {
+ throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
+ }
+ }
+
+ public static String lower(String data) {
+ return "LOWER(" + data + ")";
+ }
+
+ public static String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index e94f938..45b5358 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -220,9 +220,9 @@ public class SearchAssistManager {
this.type = computeType(param, operator);
this.context = (this.type == Type.SIMPLE) ? stripQuotes(context) : context;
- this.param = param;
+ this.param = param == null ? "" : param; // ensure non-null
this.operator = operator;
- this.value = value;
+ this.value = value == null ? "" : value; // ensure non-null
}
private String stripQuotes(String data) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 938b221..79f14ee 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,72 +1,9 @@
package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
-import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
- public enum ValueFilter {
- STARTS_WITH, //
- ENDS_WITH, //
- INDEX_OF, //
- EXACT_MATCH;
- }
-
- private String process(ValueFilter filter, String value) {
- if (filter == ValueFilter.STARTS_WITH) {
- return "'" + escape(value) + "%'";
- } else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + escape(value) + "'";
- } else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + escape(value) + "%'";
- } else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + escape(value) + "'";
- } else {
- throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
- }
- }
-
- private String getJPQLForString(String fragment, RHQLComparisonOperator operator,
String value, ValueFilter filter) {
- if (operator == RHQLComparisonOperator.EQUALS) {
- return lower(fragment) + " LIKE " + process(filter,
value.toLowerCase());
-
- } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) {
- return fragment + " LIKE " + process(filter, value);
-
- } else if (operator == RHQLComparisonOperator.NOT_EQUALS) {
- return lower(fragment) + " NOT LIKE " + process(filter,
value.toLowerCase());
-
- } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return fragment + " NOT LIKE " + process(filter, value);
-
- } else if (operator == RHQLComparisonOperator.NULL) {
- return fragment + " IS NULL";
-
- } else if (operator == RHQLComparisonOperator.NOT_NULL) {
- return fragment + " IS NOT NULL";
-
- } else {
- throw new IllegalArgumentException("Unsupported operator " +
operator);
- }
- }
-
- protected String getJPQLForString(String fragment, RHQLComparisonOperator operator,
String value) {
- int size = value.length();
- if (value.startsWith("^")) {
- if (value.endsWith("$")) {
- return getJPQLForString(fragment, operator, value.substring(1, size - 1),
ValueFilter.EXACT_MATCH);
- } else {
- return getJPQLForString(fragment, operator, value.substring(1),
ValueFilter.STARTS_WITH);
- }
- } else {
- if (value.endsWith("$")) {
- return getJPQLForString(fragment, operator, value.substring(0, size - 1),
ValueFilter.ENDS_WITH);
- } else {
- return getJPQLForString(fragment, operator, value,
ValueFilter.INDEX_OF);
- }
- }
- }
-
protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator,
String value,
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
@@ -99,18 +36,10 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
+ value + "'");
}
- protected String lower(String data) {
- return "LOWER(" + data + ")";
- }
-
protected String quote(String data) {
return "'" + data + "'";
}
- protected String escape(String data) {
- return QueryUtility.escapeSearchParameter(data);
- }
-
protected final String addFragmentIfParameterNotValue(String fragment, String
parameter, String value) {
if (!parameter.equalsIgnoreCase(value)) {
return fragment;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
index 5a603ed..0a2e0f1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.translation;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index 3fd7b12..dfe53ec 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -1,5 +1,7 @@
package org.rhq.enterprise.server.search.translation;
+import static
org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
@@ -59,7 +61,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " JOIN res.schedules schedule " //
+ " WHERE trait.schedule = schedule " //
+ " AND schedule.definition.dataType = 1 " //
- + " AND schedule.definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("schedule.definition.name", RHQLComparisonOperator.EQUALS,
param) //
+ " AND " + getJPQLForString("trait.value", op,
filter));
} else if (path.equals("connection")) {
@@ -71,7 +73,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
- + " AND definition.name = " + quote(param) //
+ + " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) {
@@ -83,7 +85,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
+ " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ " AND property = simple " // join to simple for filter
by 'stringValue' attribute
- + " AND definition.name = " + quote(param) //
+ + " AND " + getJPQLForString("definition.name",
RHQLComparisonOperator.EQUALS, param) //
+ " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
index 8750977..c7cc99f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
@@ -40,7 +40,7 @@ public class QueryUtility {
*/
public static String escapeSearchParameter(String value) {
if (value == null || value.trim().equals("")) {
- return null;
+ return ""; // if we return null, query will get created as...where
pathExpression LIKE '%null%'
}
return doEscapeSearchParameter(value);
commit 2456bc0b79952de2486f750e6ed61752e8711475
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 12:46:27 2010 -0400
do not escape enums in search
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index e2d3600..938b221 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -14,13 +14,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
private String process(ValueFilter filter, String value) {
if (filter == ValueFilter.STARTS_WITH) {
- return "'" + QueryUtility.escapeSearchParameter(value) +
"%'";
+ return "'" + escape(value) + "%'";
} else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + QueryUtility.escapeSearchParameter(value) +
"'";
+ return "'%" + escape(value) + "'";
} else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + QueryUtility.escapeSearchParameter(value) +
"%'";
+ return "'%" + escape(value) + "%'";
} else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + QueryUtility.escapeSearchParameter(value) +
"'";
+ return "'" + escape(value) + "'";
} else {
throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
}
@@ -71,14 +71,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
operator == RHQLComparisonOperator.NOT_NULL) {
- return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation());
+ return fragment + operator.getDefaultTranslation();
} else if (operator == RHQLComparisonOperator.EQUALS || //
operator == RHQLComparisonOperator.EQUALS_STRICT || //
operator == RHQLComparisonOperator.NOT_EQUALS || //
operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation()
- + getEnum(enumClass, value, useOrdinal));
+ return fragment + operator.getDefaultTranslation() + getEnum(enumClass,
value, useOrdinal);
} else {
throw new IllegalArgumentException("Unsupported operator " +
operator);
@@ -108,6 +107,10 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
return "'" + data + "'";
}
+ protected String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
protected final String addFragmentIfParameterNotValue(String fragment, String
parameter, String value) {
if (!parameter.equalsIgnoreCase(value)) {
return fragment;
commit 186aa9fe1f54389a86aa637577793284814c3a7d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 12:20:14 2010 -0400
BZ-610135: provide intelligent quoting for suggestions
* if a suggestion doesn't need to be quoted, don't quote it
* if a suggestion has whitespace, then determine how to quote it
** if it has only single-quotes in the value, wrap it in double-quotes
** if it has only double-quotes in the value, wrap it in single-quotes
** if it has both types of quotes in the value, don't quote it
*** thus, treat mixed-quoted values single search terms so the parser won't bomb
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
index aa02b08..fb1b135 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java
@@ -89,7 +89,19 @@ public class SearchSuggestion implements Serializable,
Comparable<SearchSuggesti
if (kindComparision != 0) {
return kindComparision;
}
- return label.toLowerCase().compareTo(other.label.toLowerCase());
+ return toLowerStripQuotes(label).compareTo(toLowerStripQuotes(other.label));
+ }
+
+ private static String toLowerStripQuotes(String data) {
+ if (data.length() < 2) {
+ return data;
+ }
+ char firstChar = data.charAt(0);
+ char lastChar = data.charAt(data.length() - 1);
+ if ((firstChar == '"' && lastChar == '"') ||
(firstChar == '\'' && lastChar == '\'')) {
+ return data.substring(1, data.length() - 1);
+ }
+ return data;
}
public String toString() {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index eb57c47..e94f938 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -427,25 +427,12 @@ public class SearchAssistManager {
String primarySimpleContext = completor.getPrimarySimpleContext();
debug("getSimpleSuggestions: suggesting value completions for a simple
context [" + primarySimpleContext + "]");
- String pad = getQuotePadding(beforeCaret);
- List<String> valueSuggestions = pad(pad,
completor.getValues(primarySimpleContext, null, parsedTerm), pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(primarySimpleContext, null,
+ parsedTerm));
List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed,
parsedTerm, Kind.Simple);
return suggestions;
}
- private String getQuotePadding(String parsedTerm) {
- if (parsedTerm.equals("")) {
- return "\"";
- }
- // if not empty, it has at least one char
- char first = parsedTerm.charAt(0);
- if (first == '\'') {
- return "'";
- } else /* if (first == '"') */{
- return "\"";
- }
- }
-
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -527,7 +514,8 @@ public class SearchAssistManager {
debug("getAdvancedSuggestions: operator state");
if (allComparisonOperators.contains(parsed.operator)) {
debug("search term is complete operator, suggesting values
instead");
- List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, ""), pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(parsed.context,
+ parsed.param, ""));
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for
a simple context");
return convert(pad(parsed.context + parsed.operator,
valueSuggestions, ""));
@@ -554,8 +542,8 @@ public class SearchAssistManager {
}
case VALUE:
debug("getAdvancedSuggestions: value state");
- List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, parsed.value),
- pad);
+ List<String> valueSuggestions = padWithQuotes(beforeCaret,
completor.getValues(parsed.context,
+ parsed.param, parsed.value));
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for a
simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions,
""), parsed, parsed.value);
@@ -688,6 +676,57 @@ public class SearchAssistManager {
return results;
}
+ private List<String> padWithQuotes(String beforeCaret, List<String> data)
{
+ String defaultPad = getQuotePadding(beforeCaret);
+
+ List<String> results = new ArrayList<String>();
+ for (String next : data) {
+ boolean hasWhiteSpace = next.matches(".*\\s.*");
+ if (hasWhiteSpace == false) {
+ // don't pad things that don't need padding
+ results.add(next);
+ continue;
+ }
+
+ // we do have whitespace, let's also see if we have quotes
+ boolean hasSingleQuote = next.indexOf("'") != -1;
+ boolean hasDoubleQuote = next.indexOf('"') != -1;
+
+ if (hasSingleQuote && hasDoubleQuote) {
+ // don't pad if suggestion has both single- and double-quotes
+ // instead, treat suggestion as individual terms, otherwise parser will
bomb
+ results.add(next);
+ continue;
+ }
+
+ String pad = null;
+ if (hasSingleQuote) {
+ pad = "\""; // pad with double-quotes
+ } else if (hasDoubleQuote) {
+ pad = "'"; // pad with single-quotes
+ } else {
+ // otherwise respect the user-chosen padding
+ pad = defaultPad;
+ }
+
+ results.add(pad + next + pad);
+ }
+ return results;
+ }
+
+ private String getQuotePadding(String beforeCaret) {
+ if (beforeCaret.equals("")) {
+ return "\"";
+ }
+ // if not empty, it has at least one char
+ char first = beforeCaret.charAt(0);
+ if (first == '\'') {
+ return "'";
+ } else /* if (first == '"') */{
+ return "\"";
+ }
+ }
+
private void debug(String message) {
LOG.debug(message);
}
commit f3fa4486e9c1b359fd9cb8b73f824630bc1430ee
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 11:10:38 2010 -0400
BZ-610120: respect user-chosen quoting style
* if user starts with single-quote, offer suggestions wrapped with single-quotes
* in all other cases, offer suggestions wrapped with double-quotes
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 2e84d69..eb57c47 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -427,11 +427,25 @@ public class SearchAssistManager {
String primarySimpleContext = completor.getPrimarySimpleContext();
debug("getSimpleSuggestions: suggesting value completions for a simple
context [" + primarySimpleContext + "]");
- List<String> valueSuggestions = pad("\"",
completor.getValues(primarySimpleContext, null, parsedTerm), "\"");
+ String pad = getQuotePadding(beforeCaret);
+ List<String> valueSuggestions = pad(pad,
completor.getValues(primarySimpleContext, null, parsedTerm), pad);
List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed,
parsedTerm, Kind.Simple);
return suggestions;
}
+ private String getQuotePadding(String parsedTerm) {
+ if (parsedTerm.equals("")) {
+ return "\"";
+ }
+ // if not empty, it has at least one char
+ char first = parsedTerm.charAt(0);
+ if (first == '\'') {
+ return "'";
+ } else /* if (first == '"') */{
+ return "\"";
+ }
+ }
+
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -448,6 +462,9 @@ public class SearchAssistManager {
String beforeCaret = assistant.getFragmentBeforeCaret();
debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret +
"'");
+ String pad = getQuotePadding(beforeCaret);
+ debug("getAdvancedSuggestions: padding is ~" + pad + "~");
+
if (beforeCaret.startsWith("'") ||
beforeCaret.startsWith("\"")) {
return Collections.emptyList();
}
@@ -510,7 +527,7 @@ public class SearchAssistManager {
debug("getAdvancedSuggestions: operator state");
if (allComparisonOperators.contains(parsed.operator)) {
debug("search term is complete operator, suggesting values
instead");
- List<String> valueSuggestions = pad("\"",
completor.getValues(parsed.context, parsed.param, ""), "\"");
+ List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, ""), pad);
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for
a simple context");
return convert(pad(parsed.context + parsed.operator,
valueSuggestions, ""));
@@ -537,8 +554,8 @@ public class SearchAssistManager {
}
case VALUE:
debug("getAdvancedSuggestions: value state");
- List<String> valueSuggestions = pad("\"",
completor.getValues(parsed.context, parsed.param, parsed.value),
- "\"");
+ List<String> valueSuggestions = pad(pad,
completor.getValues(parsed.context, parsed.param, parsed.value),
+ pad);
if (completor.getSimpleContexts().contains(parsed.context)) {
debug("getAdvancedSuggestions: suggesting value completions for a
simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions,
""), parsed, parsed.value);
commit 9e1900927a46832737a16ac0d3c2ad96e7e0b9d1
Merge: 26a8b39... 51b5d72...
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:58:03 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 26a8b39cc736d41e62292a86035864422d0593d2
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:55:00 2010 -0400
cleanup graph portlet
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
index b540699..580100c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
@@ -51,8 +51,13 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
public static final String KEY = "Resource Graph";
- PortletWindow portletWindow;
- DashboardPortlet storedPortlet;
+
+
+ private PortletWindow portletWindow;
+ private DashboardPortlet storedPortlet;
+
+ public static final String CFG_RESOURCE_ID = "resourceId";
+ public static final String CFG_DEFINITION_ID = "definitionId";
public GraphPortlet() {
setOverflow(Overflow.HIDDEN);
@@ -61,9 +66,9 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
this.portletWindow = portletWindow;
this.storedPortlet = storedPortlet;
- if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
-
setResourceId(storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue());
-
setDefinitionId(storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue());
+ if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) {
+
setResourceId(storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID).getIntegerValue());
+
setDefinitionId(storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID).getIntegerValue());
}
}
@@ -73,8 +78,8 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
public ConfigurationDefinition getConfigurationDefinition() {
ConfigurationDefinition def = new ConfigurationDefinition("Graph
Config", "Configuration of the graph portlet");
- def.put(new PropertyDefinitionSimple("resourceId", "The resource
to graph", true, PropertySimpleType.INTEGER));
- def.put(new PropertyDefinitionSimple("definitionId", "The metric
definition id to graph", true, PropertySimpleType.INTEGER));
+ def.put(new PropertyDefinitionSimple(CFG_RESOURCE_ID, "The resource to
graph", true, PropertySimpleType.INTEGER));
+ def.put(new PropertyDefinitionSimple(CFG_DEFINITION_ID, "The metric
definition id to graph", true, PropertySimpleType.INTEGER));
return def;
}
@@ -84,7 +89,7 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
@Override
protected void onDraw() {
removeMembers(getMembers());
- if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
+ if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) {
super.onDraw();
} else {
addMember(new Label("This graph is unconfigured, click the settings
button to configure."));
@@ -95,17 +100,17 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
final DynamicForm form = new DynamicForm();
- final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new
ResourceLookupComboBoxItem("resourceId", "Resource");
+ final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new
ResourceLookupComboBoxItem(CFG_RESOURCE_ID, "Resource");
resourceLookupComboBoxItem.setWidth(300);
- final SelectItem metric = new SelectItem("definitionId",
"Metric") {
+ final SelectItem metric = new SelectItem(CFG_DEFINITION_ID, "Metric")
{
@Override
protected Criteria getPickListFilterCriteria() {
Criteria criteria = new Criteria();
if (resourceLookupComboBoxItem.getValue() != null) {
int resourceId = (Integer) resourceLookupComboBoxItem.getValue();
- criteria.addCriteria("resourceId", resourceId);
+ criteria.addCriteria(CFG_RESOURCE_ID, resourceId);
}
return criteria;
}
@@ -121,24 +126,24 @@ public class GraphPortlet extends SmallGraphView implements
CustomSettingsPortle
public void onChanged(ChangedEvent
event) {
- if (form.getValue("resourceId") instanceof Integer) {
+ if (form.getValue(CFG_RESOURCE_ID) instanceof Integer) {
metric.fetchData();
form.clearValue("defininitionId");
}
}
});
- if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
- form.setValue("resourceId",
storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue());
- form.setValue("definitionId",
storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue());
+ if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) {
+ form.setValue(CFG_RESOURCE_ID,
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID).getIntegerValue());
+ form.setValue(CFG_DEFINITION_ID,
storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID).getIntegerValue());
}
form.setFields(resourceLookupComboBoxItem, metric);
form.addSubmitValuesHandler(new SubmitValuesHandler() {
public void onSubmitValues(SubmitValuesEvent submitValuesEvent) {
- storedPortlet.getConfiguration().put(new
PropertySimple("resourceId", form.getValue("resourceId")));
- storedPortlet.getConfiguration().put(new
PropertySimple("definitionId", form.getValue("definitionId")));
+ storedPortlet.getConfiguration().put(new PropertySimple(CFG_RESOURCE_ID,
form.getValue(CFG_RESOURCE_ID)));
+ storedPortlet.getConfiguration().put(new
PropertySimple(CFG_DEFINITION_ID, form.getValue(CFG_DEFINITION_ID)));
}
});
commit aab10b92069e64ab69fa1d99cbc534e173f21375
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:54:38 2010 -0400
Fixed warning icon name
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
deleted file mode 100644
index f766722..0000000
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
and /dev/null differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png
new file mode 100644
index 0000000..f766722
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png
differ
commit 4839d4b9f31fd34e1986bb59d2bd38e87c297a4d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:53:59 2010 -0400
display event severity icons
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
index 72ecded..492dc14 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
@@ -42,6 +42,8 @@ public class EventHistoryView extends Table {
}
+
+
@Override
protected void onDraw() {
super.onDraw();
@@ -49,7 +51,7 @@ public class EventHistoryView extends Table {
getListGrid().getField("severity").setWidth(120);
getListGrid().getField("severity").setCellFormatter(new CellFormatter()
{
public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
- return Canvas.imgHTML("subsystems/event/" + o, 16, 16) + o;
+ return Canvas.imgHTML("subsystems/event/" + o +
"_16.png", 16, 16) + o;
}
});
commit 234417e5ba0170168d530e583c4973a603888bfc
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:53:02 2010 -0400
fix overflow in favs portlet
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 9c5f3fe..f92e7a2 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
@@ -26,6 +26,7 @@ import java.util.Set;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent;
@@ -52,9 +53,13 @@ public class FavoriteResourcesPortlet extends ResourceSearchView
implements Port
private PortletWindow portletWindow;
public FavoriteResourcesPortlet() {
+ super();
+ setOverflow(Overflow.HIDDEN);
+
setShowHeader(false);
setShowFooter(false);
+
Set<Integer> favoriteIds =
CoreGUI.getUserPreferences().getFavoriteResources();
Integer[] favArray = favoriteIds.toArray(new Integer[favoriteIds.size()]);
@@ -62,9 +67,9 @@ public class FavoriteResourcesPortlet extends ResourceSearchView
implements Port
Criteria criteria = new Criteria();
if (favoriteIds.isEmpty()) {
- criteria.addCriteria("id",-1);
+ criteria.addCriteria("id", -1);
} else {
- criteria.addCriteria("resourceIds", favArray );
+ criteria.addCriteria("resourceIds", favArray);
}
refresh(criteria);
@@ -73,7 +78,7 @@ public class FavoriteResourcesPortlet extends ResourceSearchView
implements Port
public void onFieldStateChanged(FieldStateChangedEvent
fieldStateChangedEvent) {
String state = getListGrid().getViewState();
- storedPortlet.getConfiguration().put(new
PropertySimple(CFG_TABLE_PREFS,state));
+ storedPortlet.getConfiguration().put(new PropertySimple(CFG_TABLE_PREFS,
state));
portletWindow.save();
}
});
commit 691766463fb125a9254cb6a6e81f837309e5c6aa
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:52:42 2010 -0400
support icons in the breadcrumb trail
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
index dd8443c..2bddbf2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client;
+import com.smartgwt.client.widgets.Canvas;
+
/**
* Information about a breadcrumb (i.e. history token component) that is used to render
that breadcrumb in the
* breadcrumb trail at the top of the page.
@@ -27,6 +29,7 @@ package org.rhq.enterprise.gui.coregui.client;
public class Breadcrumb {
private String name;
private String displayName;
+ private String icon;
private boolean hyperlink;
public Breadcrumb(String name) {
@@ -34,18 +37,19 @@ public class Breadcrumb {
}
public Breadcrumb(String name, String displayName) {
- this(name, displayName, true);
+ this(name, displayName, null, true);
}
public Breadcrumb(String name, boolean hyperlink) {
- this(name, name, hyperlink);
+ this(name, name, null, hyperlink);
}
- public Breadcrumb(String name, String displayName, boolean hyperlink) {
+ public Breadcrumb(String name, String displayName, String icon, boolean hyperlink) {
if (name == null) {
throw new IllegalArgumentException("Name is null.");
}
this.name = name;
+ this.icon = icon;
setDisplayName(displayName);
this.hyperlink = hyperlink;
}
@@ -89,6 +93,25 @@ public class Breadcrumb {
return this.hyperlink;
}
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getDisplayHTML() {
+ String display = "";
+ if (icon != null) {
+ display += Canvas.imgHTML(icon, 16, 16);
+ }
+ display += this.displayName;
+
+ return display;
+ }
+
+
@Override
public String toString() {
return this.name;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
index ad0c449..29377cd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
@@ -78,12 +78,7 @@ public class BreadcrumbTrailPane extends ToolStrip {
firstBC = false;
}
- if (!breadcrumb.isHyperlink()) {
- // last item in trail is the current page and so should not be a
link
- addMember(getCrumb(breadcrumb.getDisplayName()));
- } else {
- addMember(getCrumb(breadcrumb.getDisplayName(), path.toString() +
breadcrumb.getName()));
- }
+ addMember(getCrumb(breadcrumb, path.toString()));
}
path.append(viewId.getPath());
}
@@ -106,22 +101,23 @@ public class BreadcrumbTrailPane extends ToolStrip {
redraw();
}
- private Label getCrumb(String text, String url) {
- Label l = new Label("<a href=\"#" + url +
"\">" + text + "</a>");
+ private Label getCrumb(Breadcrumb crumb, String path) {
+ Label l = null;
+ if (crumb.isHyperlink()) {
+ l = new Label("<a href=\"#" + path.toString() +
crumb.getName() + "\">" + crumb.getDisplayName() +
"</a>");
+ } else {
+ l = new Label(crumb.getDisplayName());
+ }
+ if (crumb.getIcon() != null) {
+ l.setIcon(crumb.getIcon());
+ l.setIconSize(16);
+ }
l.setValign(VerticalAlignment.CENTER);
l.setWrap(false);
l.setAutoWidth();
return l;
}
- private Label getCrumb(String text) {
- Label l = new Label(text);
- l.setValign(VerticalAlignment.CENTER);
- l.setWrap(false);
- l.setAutoFit(true);
- return l;
- }
-
private Img getSpacer() {
return new Img("header/breadcrumb_space.png", 28, 28);
}
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 ac109f8..5faf1c0 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
@@ -18,6 +18,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
@@ -26,6 +30,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
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.ResourceSelectListener;
@@ -68,7 +73,7 @@ public class ResourceTreeView extends VLayout {
private Resource rootResource;
private TreeGrid treeGrid;
- Menu contextMenu;
+ private Menu contextMenu;
private ViewId currentViewId;
@@ -78,7 +83,6 @@ public class ResourceTreeView extends VLayout {
public ResourceTreeView() {
super();
- this.selectedResource = selectedResource;
setWidth("250");
setHeight100();
@@ -105,6 +109,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.setShowHeader(false);
treeGrid.setLeaveScrollbarGap(false);
+
contextMenu = new Menu();
MenuItem item = new MenuItem("Expand node");
@@ -248,6 +253,11 @@ public class ResourceTreeView extends VLayout {
contextMenu.addItem(operations);
+
+ contextMenu.addItem(buildMetricsMenu(resourceType));
+
+
+
// Create Menu
MenuItem createChildMenu = new MenuItem("Create Child");
Menu createChildSubMenu = new Menu();
@@ -282,6 +292,65 @@ public class ResourceTreeView extends VLayout {
contextMenu.addItem(importChildMenu);
}
+ private MenuItem buildMetricsMenu(final ResourceType type) {
+ MenuItem measurements = new MenuItem("Measurements");
+ final Menu measurementsSubMenu = new Menu();
+
+
+
+
+ GWTServiceLookup.getDashboardService().findDashboardsForSubject(new
AsyncCallback<List<Dashboard>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load user
dashboards", caught);
+ }
+
+ public void onSuccess(List<Dashboard> result) {
+
+ for (final MeasurementDefinition def : type.getMetricDefinitions()) {
+
+ MenuItem defItem = new MenuItem(def.getDisplayName());
+ measurementsSubMenu.addItem(defItem);
+ Menu defSubItem = new Menu();
+ defItem.setSubmenu(defSubItem);
+
+
+
+ for (final Dashboard d : result) {
+ MenuItem addToDBItem = new MenuItem("Add chart to Dashboard:
" + d.getName());
+ defSubItem.addItem(addToDBItem);
+
+ addToDBItem.addClickHandler(new ClickHandler() {
+ public void onClick(MenuItemClickEvent menuItemClickEvent) {
+
+ DashboardPortlet p = new
DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250);
+ p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId()));
+ p.getConfiguration().put(new
PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId()));
+
+ d.addPortlet(p, 0, 0);
+
+ GWTServiceLookup.getDashboardService().storeDashboard(d,
new AsyncCallback<Dashboard>() {
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server",
caught);
+ }
+
+ public void onSuccess(Dashboard result) {
+ CoreGUI.getMessageCenter().notify(new
Message("Saved dashboard " + result.getName() + " to server",
Message.Severity.Info));
+ }
+ });
+
+ }
+ });
+
+ }
+
+
+ }
+
+ }
+ });
+ measurements.setSubmenu(measurementsSubMenu);
+ return measurements;
+ }
Resource getResource(int resourceId) {
if (this.treeGrid != null && this.treeGrid.getTree() != null) {
@@ -317,12 +386,10 @@ public class ResourceTreeView extends VLayout {
viewId.getBreadcrumbs().clear();
for (int i = parents.length - 1; i >= 0; i--) {
TreeNode n = parents[i];
- if (n instanceof ResourceTreeDatasource.ResourceTreeNode) {
- viewId.getBreadcrumbs().add(new
Breadcrumb(n.getAttribute("id"),
- n.getName() + " (" +
((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() + ")",
true));
- }
+ adjustBreadcrumb(n, viewId);
}
- viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"),
node.getName(), true));
+ adjustBreadcrumb(node, viewId);
+
CoreGUI.refreshBreadCrumbTrail();
@@ -373,12 +440,9 @@ public class ResourceTreeView extends VLayout {
viewId.getBreadcrumbs().clear();
for (int i = parents.length - 1; i >= 0;
i--) {
TreeNode n = parents[i];
- if (n instanceof
ResourceTreeDatasource.ResourceTreeNode) {
- viewId.getBreadcrumbs().add(new
Breadcrumb(n.getAttribute("id"),
- n.getName() + " ("
+ ((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() +
")", true));
- }
+ adjustBreadcrumb(n, viewId);
}
- viewId.getBreadcrumbs().add(new
Breadcrumb(selectedNode.getAttribute("id"), selectedNode.getName(), true));
+ adjustBreadcrumb(selectedNode, viewId);
CoreGUI.refreshBreadCrumbTrail();
}
}
@@ -435,12 +499,9 @@ public class ResourceTreeView extends VLayout {
viewId.getBreadcrumbs().clear();
for (int i = parents.length - 1; i >= 0;
i--) {
TreeNode n = parents[i];
- if (n instanceof
ResourceTreeDatasource.ResourceTreeNode) {
- viewId.getBreadcrumbs().add(new
Breadcrumb(n.getAttribute("id"),
- n.getName() + " ("
+ ((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() +
")", true));
- }
+ adjustBreadcrumb(n, viewId);
}
- viewId.getBreadcrumbs().add(new
Breadcrumb(selectedNode.getAttribute("id"), selectedNode.getName(), true));
+ adjustBreadcrumb(selectedNode, viewId);
CoreGUI.refreshBreadCrumbTrail();
} else {
@@ -469,30 +530,50 @@ public class ResourceTreeView extends VLayout {
}
+ private void adjustBreadcrumb(TreeNode node, ViewId viewId) {
+ if (node instanceof ResourceTreeDatasource.ResourceTreeNode) {
+
+ Resource nr = ((ResourceTreeDatasource.ResourceTreeNode)
node).getResource();
+ String display = node.getName() + " <span
class=\"subtitle\">" + nr.getResourceType().getName() +
"</span>";
+ String icon = "types/" +
nr.getResourceType().getCategory().getDisplayName() + "_up_16.png";
+
+
+ viewId.getBreadcrumbs().add(new
Breadcrumb(node.getAttribute("id"),
+ display, icon, true));
+
+ } else {
+
+// if (node.getName() != null) {
+// viewId.getBreadcrumbs().add(new
Breadcrumb(node.getAttribute("id"), node.getName(), null, true));
+// }
+ }
+ }
+
+
/*private List<Resource> preload(final List<Resource> lineage) {
- final ArrayList<Resource> list = new ArrayList<Resource>(lineage);
+ final ArrayList<Resource> list = new
ArrayList<Resource>(lineage);
- ResourceGWTServiceAsync resourceService =
ResourceGWTServiceAsync.Util.getInstance();
+ ResourceGWTServiceAsync resourceService =
ResourceGWTServiceAsync.Util.getInstance();
- ResourceCriteria c = new ResourceCriteria();
- c.addFilterParentResourceId(lineage.get(0).getId());
- resourceService.findResourcesByCriteria(CoreGUI.getSessionSubject(), c, new
AsyncCallback<PageList<Resource>>() {
- public void onFailure(Throwable caught) {
- SC.say("SHit");
- }
+ ResourceCriteria c = new ResourceCriteria();
+ c.addFilterParentResourceId(lineage.get(0).getId());
+ resourceService.findResourcesByCriteria(CoreGUI.getSessionSubject(), c,
new AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ SC.say("SHit");
+ }
- public void onSuccess(PageList<Resource> result) {
- SC.say("GotONE");
+ public void onSuccess(PageList<Resource> result) {
+ SC.say("GotONE");
- if (lineage.size() > 1) {
- result.addAll(preload(lineage.subList(1, lineage.size())));
+ if (lineage.size() > 1) {
+ result.addAll(preload(lineage.subList(1, lineage.size())));
+ }
}
- }
- });
+ });
+ }
}
- }
-*/
+ */
public void addResourceSelectListener(ResourceSelectListener listener) {
this.selectListeners.add(listener);
commit 204b30160fa0e13c61380d2285295e7282eda7be
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:51:44 2010 -0400
Properly order graphs
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
index 4076921..d77e08b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
@@ -38,6 +38,8 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.VLayout;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.EnumSet;
import java.util.List;
@@ -95,6 +97,12 @@ public class GraphListView extends VLayout implements
ResourceSelectListener {
}
}
+ Collections.sort(measurementDefinitions, new
Comparator<MeasurementDefinition>() {
+ public int compare(MeasurementDefinition o1,
MeasurementDefinition o2) {
+ return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
+
int[] measDefIdArray = new int[measurementDefinitions.size()];
for (int i = 0; i < measDefIdArray.length; i++) {
measDefIdArray[i] = measurementDefinitions.get(i).getId();
commit ea1cb09f9d8b195b3f4a0e990e366c56fa298331
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:51:21 2010 -0400
Progress on alert editing
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
index d3ae574..0e35a55 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java
@@ -53,7 +53,7 @@ public class AlertDefinitionsView extends VLayout {
table.addTableAction("New", new TableAction() {
public void executeAction(ListGridRecord[] selection) {
- new AlertEditView().displayAsDialog();
+ new AlertEditView(resource).displayAsDialog();
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java
index 2f38c18..f9ed1b2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java
@@ -19,6 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert;
import java.util.ArrayList;
+import java.util.EnumSet;
import java.util.LinkedHashMap;
import com.smartgwt.client.widgets.Canvas;
@@ -34,22 +35,35 @@ import com.smartgwt.client.widgets.form.fields.HeaderItem;
import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.TextAreaItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
+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.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
import
org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/**
* @author Greg Hinkle
*/
public class AlertEditView extends VLayout {
- public AlertEditView() {
+ private Resource resource;
+ private ResourceType resourceType;
+
+ public AlertEditView(Resource resource) {
+ this.resource = resource;
setWidth100();
}
@@ -72,10 +86,16 @@ public class AlertEditView extends VLayout {
protected void onDraw() {
super.onDraw();
- addMember(buildEditForm());
-
- addMember(buildConditionSection(0));
+
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.measurements,
ResourceTypeRepository.MetadataType.operations),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ resourceType = type;
+ addMember(buildEditForm());
+ addMember(buildConditionSection(0));
+ }
+ });
}
@@ -160,11 +180,10 @@ public class AlertEditView extends VLayout {
form.setValuesManager(vm);
form.setNumCols(3);
- form.setColWidths("30","120","*");
+ form.setColWidths("30", "120", "*");
ArrayList<FormItem> items = new ArrayList<FormItem>();
-
RadioGroupItem conditionType = new RadioGroupItem("conditionType" + ci,
"Condition Type");
conditionType.setImageURLPrefix("subsystems/");
conditionType.setImageURLSuffix("_16.png");
@@ -177,6 +196,7 @@ public class AlertEditView extends VLayout {
valueMap.put(AlertConditionCategory.CONTROL.name(),
AlertConditionCategory.CONTROL.getDisplayName());
valueMap.put(AlertConditionCategory.EVENT.name(),
AlertConditionCategory.EVENT.getDisplayName());
conditionType.setValueMap(valueMap);
+ conditionType.setRedrawOnChange(true);
LinkedHashMap<String, String> iconMap = new LinkedHashMap<String,
String>();
@@ -217,6 +237,14 @@ public class AlertEditView extends VLayout {
}*/
+ CanvasItem availCanvas = buildAvailabilitySectionCanvas(vm);
+ availCanvas.setShowIfCondition(new FormItemIfFunction() {
+ public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm)
{
+ return
AlertConditionCategory.AVAILABILITY.name().equals(form.getValue("conditionType"
+ ci));
+ }
+ });
+ items.add(availCanvas);
+
CanvasItem metricCanvas = buildMetricSectionCavans(vm);
metricCanvas.setShowIfCondition(new FormItemIfFunction() {
public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm)
{
@@ -229,29 +257,126 @@ public class AlertEditView extends VLayout {
CanvasItem propertyCanvas = buildInventoryPropertySectionCavans(vm);
propertyCanvas.setShowIfCondition(new FormItemIfFunction() {
public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm)
{
- return
AlertConditionCategory.AVAILABILITY.name().equals(form.getValue("conditionType"
+ ci));
+ return
AlertConditionCategory.TRAIT.name().equals(form.getValue("conditionType" +
ci));
}
});
items.add(propertyCanvas);
+ CanvasItem operationCanvas = buildOperationsSectionCanvas(vm);
+ operationCanvas.setShowIfCondition(new FormItemIfFunction() {
+ public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm)
{
+ return
AlertConditionCategory.CONTROL.name().equals(form.getValue("conditionType" +
ci));
+ }
+ });
+ items.add(operationCanvas);
+
+
form.setItems(items.toArray(new FormItem[items.size()]));
return form;
}
+ private CanvasItem buildAvailabilitySectionCanvas(ValuesManager vm) {
+ DynamicForm form = new DynamicForm();
+ form.setTitleSuffix("");
+ form.setColWidths("10%");
+ form.setValuesManager(vm);
+
+
+ SelectItem metricSelect = new SelectItem("availChange",
"Avaialability Change");
+ metricSelect.setRequired(true);
+ metricSelect.setEmptyDisplayValue("Select...");
+ metricSelect.setValueMap("Goes UP", "Goes DOWN");
+
+
+ form.setItems(metricSelect);
+
+
+ CanvasItem canvasItem = new CanvasItem("metricConditionCanvas");
+ canvasItem.setShowTitle(false);
+ canvasItem.setCanvas(form);
+
+ return canvasItem;
+
+ }
+
+ private CanvasItem buildOperationsSectionCanvas(ValuesManager vm) {
+ final DynamicForm form = new DynamicForm();
+ form.setTitleSuffix("");
+ form.setColWidths("10%");
+ form.setValuesManager(vm);
+
+
+ final SelectItem operationSelect = new SelectItem("operation",
"Operation");
+ operationSelect.setRequired(true);
+ operationSelect.setEmptyDisplayValue("Select...");
+ operationSelect.setShowHint(true);
+
+
+ LinkedHashMap<String, String> operations = new LinkedHashMap<String,
String>();
+ for (OperationDefinition def : resourceType.getOperationDefinitions()) {
+ operations.put(def.getName(), def.getDisplayName());
+ }
+ operationSelect.setValueMap(operations);
+ operationSelect.setRedrawOnChange(true);
+
+ operationSelect.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ for (OperationDefinition def : resourceType.getOperationDefinitions()) {
+
+ if (def.getName().equals(operationSelect.getValue())) {
+ operationSelect.setHint(def.getDescription());
+ }
+ }
+ }
+ });
+
+
+ form.setItems(operationSelect);
+
+ CanvasItem canvasItem = new CanvasItem("operationConditionCanvas");
+ canvasItem.setShowTitle(false);
+ canvasItem.setCanvas(form);
+
+ return canvasItem;
+
+ }
private CanvasItem buildMetricSectionCavans(ValuesManager vm) {
DynamicForm form = new DynamicForm();
form.setTitleSuffix("");
- form.setColWidths("10%");
+ form.setColWidths("10%", "90%");
form.setValuesManager(vm);
- SelectItem metricSelect = new SelectItem("metric",
"Metric");
+ final SelectItem metricSelect = new SelectItem("metric",
"Metric");
metricSelect.setRequired(true);
metricSelect.setEmptyDisplayValue("Select...");
- metricSelect.setValueMap("CPU Usage", "Free Memory",
"Swap Used", "User CPU", "System CPU");
+ metricSelect.setWidth(200);
+
+ LinkedHashMap<String, String> metrics = new LinkedHashMap<String,
String>();
+ for (MeasurementDefinition def : resourceType.getMetricDefinitions()) {
+ if (def.getDataType() == DataType.MEASUREMENT) {
+ metrics.put(def.getName(), def.getDisplayName());
+ }
+ }
+ metricSelect.setValueMap(metrics);
+
+
+ metricSelect.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ for (MeasurementDefinition def : resourceType.getMetricDefinitions()) {
+
+ if (def.getName().equals(metricSelect.getValue())) {
+ metricSelect.setHint(def.getDescription());
+ }
+ }
+ }
+ });
+
+
+
LinkedHashMap valueMap = new LinkedHashMap();
commit d0f40464fe9ca82f2f77b593db4ee29d37bad915
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:50:44 2010 -0400
protect against passed in string ints
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 b2903cc..5f22a2f 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
@@ -98,7 +98,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> {
}
if (request.getCriteria().getValues().get("id") != null) {
-
criteria.addFilterId(request.getCriteria().getAttributeAsInt("id"));
+
criteria.addFilterId(Integer.parseInt(request.getCriteria().getAttribute("id")));
}
if (request.getCriteria().getValues().get("resourceIds") != null) {
commit ac57897a7dfd4619324037626b9afce85ca0436a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:50:11 2010 -0400
use ibuttons for consistent l&f
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 74d9bf7..8f143ae 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
@@ -95,6 +95,7 @@ import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.SectionStack;
import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.menu.IMenuButton;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuButton;
import com.smartgwt.client.widgets.menu.MenuItem;
@@ -426,7 +427,7 @@ public class ConfigurationEditor extends VLayout {
// toolStrip.addMember(resetButton);
toolStrip.addMember(new LayoutSpacer());
- toolStrip.addMember(new MenuButton("Jump to Section", menu));
+ toolStrip.addMember(new IMenuButton("Jump to Section", menu));
layout.addMember(toolStrip);
commit 0065515c79d542cd69b6e2b8f5df83bb7e1032ce
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Thu Jul 15 10:48:46 2010 -0400
fixes for custom query plugin db components
diff --git
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java
index 2c6472e..0c7a5a5 100644
---
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java
+++
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java
@@ -68,7 +68,9 @@ public class CustomTableComponent implements
DatabaseComponent<DatabaseComponent
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
metrics) throws Exception {
String query =
this.context.getPluginConfiguration().getSimpleValue("metricQuery", null);
- Map<String, Double> values =
DatabaseQueryUtility.getNumericQueryValueMap(this, query);
+ query = CustomTableRowDiscoveryComponent.formatMessage(query,
this.context.getPluginConfiguration().getSimpleValue("key",null));
+
+ Map<String, Double> values =
DatabaseQueryUtility.getNumericQueryValues(this, query);
for (MeasurementScheduleRequest request : metrics) {
Double value = values.get(request.getName());
if (value != null) {
diff --git
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java
index 875846c..633c28c 100644
---
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java
+++
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java
@@ -23,9 +23,11 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collections;
import java.util.Set;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.core.util.jdbc.JDBCUtil;
@@ -37,10 +39,10 @@ import org.rhq.core.util.jdbc.JDBCUtil;
*
* @author Greg Hinkle
*/
-public class CustomTableDiscoveryComponent implements
ResourceDiscoveryComponent<DatabaseComponent> {
+public class CustomTableDiscoveryComponent implements
ManualAddFacet<DatabaseComponent>,
ResourceDiscoveryComponent<DatabaseComponent> {
public Set<DiscoveredResourceDetails> discoverResources(
- ResourceDiscoveryContext<DatabaseComponent> resourceDiscoveryContext)
- throws InvalidPluginConfigurationException, Exception {
+ ResourceDiscoveryContext<DatabaseComponent> resourceDiscoveryContext)
+ throws InvalidPluginConfigurationException, Exception {
Statement statement = null;
try {
Connection conn =
resourceDiscoveryContext.getParentResourceComponent().getConnection();
@@ -54,7 +56,7 @@ public class CustomTableDiscoveryComponent implements
ResourceDiscoveryComponent
statement.executeQuery("SELECT COUNT(*) FROM " + table);
DiscoveredResourceDetails details = new
DiscoveredResourceDetails(resourceDiscoveryContext
- .getResourceType(), table, resourceName, null, resourceDescription,
config, null);
+ .getResourceType(), table, resourceName, null, resourceDescription,
config, null);
return Collections.singleton(details);
} catch (SQLException e) {
@@ -63,6 +65,35 @@ public class CustomTableDiscoveryComponent implements
ResourceDiscoveryComponent
JDBCUtil.safeClose(statement);
}
+
+ if (!resourceDiscoveryContext.getPluginConfigurations().isEmpty()) {
+ return
Collections.singleton(discoverResource(resourceDiscoveryContext.getPluginConfigurations().get(0),resourceDiscoveryContext));
+ }
+
+
+
return Collections.emptySet();
}
+
+ public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,
ResourceDiscoveryContext<DatabaseComponent> discoveryContext)
+ throws InvalidPluginConfigurationException {
+
+ Configuration config = pluginConfiguration;
+
+ String table = config.getSimpleValue("table", null);
+ String resourceName = config.getSimpleValue("name", null);
+ String resourceDescription = config.getSimpleValue("description",
null);
+
+ DiscoveredResourceDetails details =
+ new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(),
+ table + resourceName,
+ resourceName,
+ null,
+ resourceDescription,
+ config,
+ null);
+
+ return details;
+ }
}
\ No newline at end of file
diff --git
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java
index 71c003a..aaf2e67 100644
---
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java
+++
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java
@@ -62,9 +62,14 @@ public class CustomTableRowDiscoveryComponent implements
ResourceDiscoveryCompon
while (resultSet.next()) {
config = resourceDiscoveryContext.getDefaultPluginConfiguration();
String key = resultSet.getString(keyColumn);
- config.put(new PropertySimple("Key", key));
- DiscoveredResourceDetails details = new
DiscoveredResourceDetails(resourceDiscoveryContext
- .getResourceType(), key, formatMessage(resourceName, key), null,
formatMessage(resourceDescription,
+ config.put(new PropertySimple("key", key));
+ DiscoveredResourceDetails details =
+ new DiscoveredResourceDetails(
+ resourceDiscoveryContext.getResourceType(),
+ key,
+ formatMessage(resourceName, key),
+ null,
+ formatMessage(resourceDescription,
key), config, null);
found.add(details);
}
diff --git a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
index d032e9f..450dcfe 100644
--- a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
@@ -538,6 +538,23 @@
</service>
+
+ <service name="Query"
+ class="org.rhq.plugins.database.CustomTableComponent"
+
discovery="org.rhq.plugins.database.CustomTableDiscoveryComponent"
+ supportsManualAdd="true">
+
+ <plugin-configuration>
+ <c:simple-property name="table" description="The
table to discover"/>
+ <c:simple-property name="name"/>
+ <c:simple-property name="description"/>
+ <c:simple-property name="metricQuery"
description="The query that will gather metric data"/>
+ </plugin-configuration>
+
+ <metric property="metricColumn"
displayType="summary"/>
+
+ </service>
+
</service>
<service name="User"
discovery="PostgresUserDiscoveryComponent"
class="PostgresUserComponent"
@@ -569,6 +586,11 @@
</resource-configuration>
</service>
+
+
+
+
+
</server>
</plugin>
\ No newline at end of file
commit bcd005aee3303e3cf230eb8e9a0595829f283b54
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 15 10:48:42 2010 -0400
BZ-614529: support search expressions containing ':'
diff --git
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
index 899b07e..0c0f1d5 100644
---
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
+++
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
@@ -171,7 +171,7 @@ LEVEL
;
SYMBOL
- : '!' | '@' | '#' | '$' | '%' | '^'
| '&' | '*' | '-' | '_' | '+' | '|' |
'?' | '/' | ',' | '<' | '>' | '`' |
'~'
+ : '!' | '@' | '#' | '$' | '%' | '^'
| '&' | '*' | '-' | '_' | '+' | '|' |
'?' | '/' | ',' | '<' | '>' | '`' |
'~' | ':'
;
WS
commit cb3347e6582719b3629ab7caba22f420148d3deb
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 23:28:31 2010 -0400
BZ-614693: ignore search terms that attempt to filter using hidden/password
properties
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
index 579184b..3fd7b12 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java
@@ -65,20 +65,26 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator
{
} else if (path.equals("connection")) {
return new SearchFragment( //
SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" //
- + " FROM Resource res " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN
res.resourceType.pluginConfigurationDefinition.propertyDefinitions definition " //
+ " JOIN res.pluginConfiguration.properties property " //
- + " WHERE definition.name = " + quote(param) //
- + " AND " + getJPQLForString("property.value",
op, filter));
+ + " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ + " AND property = simple " // join to simple for filter
by 'stringValue' attribute
+ + " AND definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) {
return new SearchFragment( //
SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" //
- + " FROM Resource res " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN
res.resourceType.resourceConfigurationDefinition.propertyDefinitions definition " //
+ " JOIN res.resourceConfiguration.properties property "
//
- + " WHERE definition.name = " + quote(param) //
- + " AND " + getJPQLForString("property.value",
op, filter));
+ + " WHERE simpleDefinition = definition " // only provide
translations for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD'
" // do not allow searching by hidden/password fields
+ + " AND property = simple " // join to simple for filter
by 'stringValue' attribute
+ + " AND definition.name = " + quote(param) //
+ + " AND " +
getJPQLForString("simple.stringValue", op, filter));
} else {
if (param == null) {
commit ad27f8122efd073586019eedd12bf91eb54a8f73
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 23:27:39 2010 -0400
BZ-614693: suppress search suggestions for hidden/password parameters/values
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index 61faf42..87e10a5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -12,6 +12,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil;
+import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -144,6 +145,10 @@ public abstract class AbstractSearchAssistant implements
SearchAssistant {
return "'" + data + "'";
}
+ protected final String escape(String data) {
+ return QueryUtility.escapeSearchParameter(data);
+ }
+
protected final String getFormatterValueFragment(String data) {
boolean hasWhitespace = false;
for (char next : data.toCharArray()) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index a428edc..cee5ff2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -7,7 +7,6 @@ import java.util.List;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
-import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -64,8 +63,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -75,8 +73,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -85,9 +82,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(
- " AND LOWER(rg.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'",
- filter) //
+ + add(" AND LOWER(rg.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 124c07b..9900ecb 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -9,7 +9,6 @@ import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
-import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -63,23 +62,25 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
} else if (context.equals("connection")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type, Resource res " //"
+ + " FROM ResourceType type, Resource res, PropertyDefinitionSimple
simpleDefinition " //"
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + " AND simpleDefinition = definition " // only suggest names
for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type, Resource res " //
+ + " FROM ResourceType type, Resource res, PropertyDefinitionSimple
simpleDefinition " //"
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + " AND simpleDefinition = definition " // only suggest names
for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -90,8 +91,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(def.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY def.name ");
} else {
@@ -114,8 +114,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -124,8 +123,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -134,8 +132,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(res.name) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -144,29 +141,31 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
} else if (context.equals("connection")) {
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
- + " FROM Resource res, PropertySimple simple " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
- + " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " JOIN
res.resourceType.pluginConfigurationDefinition.propertyDefinitions propertyDefinition
" // suggest values for existing resources only
+ + " WHERE simpleDefinition = propertyDefinition " // only
suggest values for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ + " AND property = simple " // join here so we can project
simple.stringValue
+ + " AND property.name = propertyDefinition.name " //
property/definition are linked via name
+ + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
- + " FROM Resource res, PropertySimple simple " //
+ + " FROM Resource res, PropertySimple simple,
PropertyDefinitionSimple simpleDefinition " //
+ " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
- + " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " JOIN
res.resourceType.resourceConfigurationDefinition.propertyDefinitions propertyDefinition
" // suggest values for existing resources only
+ + " WHERE simpleDefinition = propertyDefinition " // only
suggest values for simple properties
+ + " AND simpleDefinition.type <> 'PASSWORD' "
// do not suggest hidden/password property types
+ + " AND property = simple " // join here so we can project
simple.stringValue
+ + " AND property.name = propertyDefinition.name " //
property/definition are linked via name
+ + " AND LOWER(property.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%"
- + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -176,12 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%"
- + QueryUtility.escapeSearchParameter(param.toLowerCase())
- + "%'" //
+ + " AND LOWER(ms.definition.name) LIKE '%" +
escape(param.toLowerCase()) + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
- + "%'", filter) //
+ + add(" AND LOWER(trait.value) LIKE '%" +
escape(filter.toLowerCase()) + "%'", filter) //
+ " ORDER BY trait.value ");
} else {
commit 92d9c90a19089534aca252ab5292c4c128237c1a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 21:12:52 2010 -0400
BZ-614591: fix inventory sync issues that manifest during specific timings of async
uninventory
part 1 - do not merge inventory report resources that have already been uninventoried
there exists a small window of time after the synchronous part of the uninventory and
before the async
quartz job comes along to perform the actual removal of the resource from the
database, that an inventory
report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to
COMMITTED. if we find,
during an inventory report merge, that the existing resource was already uninventoried
(indicating that
the quartz job has not yet come along to remove this resource from the database) we
should stop all
processing from this node and return immediately. this short-cuts the processing for
the entire sub-tree
under this resource, but that's OK because the in-band uninventory logic will have
marked entire sub-tree
for uninventory atomically. in other words, all of the descendants under a resource
would also be marked
for async uninventory too.
part 2 - async uninventory work should recursively delete resources
this handles the case when the the rare timings in part 1 made it into the system and
the inventory is
current in an inconsistent state. the likely effect is that a resource marked with
UNINVENTORIED status
has a child that is marked as COMMITTED. thus, if we recursively delete resources in
the out-of-band job,
we ensure that synchronization inconsistencies are eliminated and the inventory is
brought back to a
consistent state.
part 3 - async uninventory work should remove resources from their containing groups
even though the group removal occurs in the in-band work, there can be some group
definitions that just
happens to perform its recalculation (either manually or schedules) in the period
after the in-band work
completes but before the async job triggers. since the ExpressionEvaluator that
underlies the bulk of the
dynagroup query generations automatically adds a filter to only manipulate COMMITTED
resource, this work
should be a no-op most of the time. however, in rare circumstances it's possible
for an InventoryReport to
come across the wire and flip the status of resources from UNINVENTORIED back to
COMMITTED. in this case,
this group removal logic needs to be executed again just prior to removing the rest of
the reosurce history.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index cded63b..185562a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -561,8 +561,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
Resource parent = resource;
while (parent != null && existingResource == null) {
parent = parent.getParentResource();
- existingResource =
resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent,
- resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
+ existingResource =
resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent,
+ resource.getResourceKey(), resourceType.getPlugin(),
resourceType.getName());
}
if (existingResource != null) {
@@ -592,15 +592,30 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
private void updatePreviouslyInventoriedResource(Resource resource, Resource
existingResource,
Resource parentResource) throws InvalidInventoryReportException {
+ /*
+ * there exists a small window of time after the synchronous part of the
uninventory and before the async
+ * quartz job comes along to perform the actual removal of the resource from the
database, that an inventory
+ * report can come across the wire and !OVERWROTE! the UNINVENTORIED status back
to COMMITTED. if we find,
+ * during an inventory report merge, that the existing resource was already
uninventoried (indicating that
+ * the quartz job has not yet come along to remove this resource from the
database) we should stop all
+ * processing from this node and return immediately. this short-cuts the
processing for the entire sub-tree
+ * under this resource, but that's OK because the in-band uninventory logic
will have marked entire sub-tree
+ * for uninventory atomically. in other words, all of the descendants under a
resource would also be marked
+ * for async uninventory too.
+ */
+ if (existingResource.getInventoryStatus() == InventoryStatus.UNINVENTORIED) {
+ return;
+ }
+
assert (parentResource == null) || (parentResource.getId() != 0);
-
- ResourceType existingResourceParentType = (existingResource.getParentResource()
!= null)
- ? existingResource.getParentResource().getResourceType() : null;
- ResourceType resourceParentType = (resource.getParentResource() != null)
- ? resource.getParentResource().getResourceType() : null;
+
+ ResourceType existingResourceParentType = (existingResource.getParentResource()
!= null) ? existingResource
+ .getParentResource().getResourceType() : null;
+ ResourceType resourceParentType = (resource.getParentResource() != null) ?
resource.getParentResource()
+ .getResourceType() : null;
Set<ResourceType> validParentTypes =
existingResource.getResourceType().getParentResourceTypes();
- if (validParentTypes != null && !validParentTypes.isEmpty() &&
- !validParentTypes.contains(existingResourceParentType)) {
+ if (validParentTypes != null && !validParentTypes.isEmpty()
+ && !validParentTypes.contains(existingResourceParentType)) {
// The existing Resource has an invalid parent ResourceType. This may be
because its ResourceType was moved
// to a new parent ResourceType, but its new parent was not yet discovered at
the time of the type move. See
// if the Resource reported by the Agent has a valid parent type, and, if so,
update the existing Resource's
@@ -617,10 +632,10 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
existingResource.setParentResource(resource.getParentResource());
} else {
log.debug("Existing Resource " + existingResource + " has
invalid parent type ("
- + existingResourceParentType + ") and so does
plugin-reported Resource " + resource + " ("
- + resourceParentType + ") - valid parent types are [" +
validParentTypes + "].");
+ + existingResourceParentType + ") and so does plugin-reported
Resource " + resource + " ("
+ + resourceParentType + ") - valid parent types are [" +
validParentTypes + "].");
}
- }
+ }
// The below block is for Resources that were created via the RHQ GUI, whose
descriptions will be null.
if (existingResource.getDescription() == null &&
resource.getDescription() != null) {
@@ -654,11 +669,11 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
private boolean initResourceTypes(Resource resource) {
ResourceType resourceType;
try {
- resourceType =
this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(),
resource
- .getResourceType().getName(), resource.getResourceType().getPlugin());
+ resourceType =
this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(),
+ resource.getResourceType().getName(),
resource.getResourceType().getPlugin());
} catch (RuntimeException e) {
log.error("Failed to lookup Resource type [" +
resource.getResourceType() + "] for reported Resource ["
- + resource + "] - this should not have happened.");
+ + resource + "] - this should not have happened.");
return false;
}
if (resourceType == null) {
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 df9b758..be85557 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
@@ -279,14 +279,13 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
int i = 0;
log.debug("== total size : " + toBeDeletedResourceIds.size());
- while (i<toBeDeletedResourceIds.size()) {
+ while (i < toBeDeletedResourceIds.size()) {
int j = i + 1000;
if (j > toBeDeletedResourceIds.size())
j = toBeDeletedResourceIds.size();
- List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j);
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
log.debug("== Bounds " + i + ", " + j);
-
boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete);
if (hasErrors) {
throw new IllegalArgumentException("Could not remove resources from
their containing groups");
@@ -338,7 +337,21 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
throw new IllegalArgumentException("Only the overlord can execute
out-of-band async resource delete method");
}
- boolean hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId);
+ /*
+ * even though the group removal occurs in the in-band work, there can be some
group definitions that just
+ * happens to perform its recalculation (either manually or schedules) in the
period after the in-band work
+ * completes but before the async job triggers. since the ExpressionEvaluator
that underlies the bulk of the
+ * dynagroup query generations automatically adds a filter to only manipulate
COMMITTED resource, this work
+ * should be a no-op most of the time. however, in rare circumstances it's
possible for an InventoryReport to
+ * come across the wire and flip the status of resources from UNINVENTORIED back
to COMMITTED. in this case,
+ * this group removal logic needs to be executed again just prior to removing the
rest of the reosurce history.
+ */
+ boolean hasErrors = uninventoryResourcesBulkDelete(user,
Arrays.asList(resourceId));
+ if (hasErrors) {
+ return; // return early if there were any errors, because we can't remove
the resource yet
+ }
+
+ hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId);
if (hasErrors) {
return; // return early if there were any errors, because we can't remove
the resource yet
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
index 412e61d..b0d183d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java
@@ -26,6 +26,7 @@ import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.enterprise.server.exception.UnscheduleException;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.operation.ResourceOperationSchedule;
@@ -36,39 +37,72 @@ public class AsyncResourceDeleteJob extends AbstractStatefulJob {
private final Log log = LogFactory.getLog(AsyncResourceDeleteJob.class);
- @Override
- public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException {
-
- Subject overlord = LookupUtil.getSubjectManager().getOverlord();
- ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ private class AsyncDeletionStats {
int deletedSuccessfully = 0;
int deletedWithFailure = 0;
- long time = 0;
+ long deletionTime;
+
+ public String toString() {
+ return "Async resource deletion - " + deletedSuccessfully + "
successful, " + deletedWithFailure
+ + " failed, took [" + deletionTime + "] ms";
+ }
+ }
+
+ @Override
+ public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException {
List<Integer> toBeRemovedIds =
resourceManager.findResourcesMarkedForAsyncDeletion(overlord);
+
+ AsyncDeletionStats stats = new AsyncDeletionStats();
for (Integer doomedResourceId : toBeRemovedIds) {
try {
- log.debug("Before asynchronous deletion of resource[id=" +
doomedResourceId + "]");
- long startTime = System.currentTimeMillis();
- unscheduleJobs(overlord, doomedResourceId);
- resourceManager.uninventoryResourceAsyncWork(overlord,
doomedResourceId);
- long endTime = System.currentTimeMillis();
- time += (endTime - startTime);
- log.debug("After asynchronous deletion of resource[id=" +
doomedResourceId + "], took ["
- + (endTime - startTime) + "]ms");
- deletedSuccessfully++;
+ // do not recurse
+ uninventoryResource(overlord, doomedResourceId, stats, false);
} catch (Throwable t) {
- log.debug("Error during asynchronous deletion of resource[id="
+ doomedResourceId + "]", t);
- deletedWithFailure++;
+ log.debug("Simple asynchronous deletion of resource[id=" +
doomedResourceId + "] failed, "
+ + "trying more robust yet expensive removal method, cause:
" + ThrowableUtil.getAllMessages(t));
+ try {
+ // try more robust yet expensive recursive delete
+ uninventoryResource(overlord, doomedResourceId, stats, true);
+ } catch (Throwable tt) {
+ log.debug("Error during asynchronous deletion of
resource[id=" + doomedResourceId + "], cause: "
+ + ThrowableUtil.getAllMessages(tt));
+ stats.deletedWithFailure++;
+ }
}
}
- if (deletedSuccessfully > 0 || deletedWithFailure > 0) {
- log.info("Async resource deletion - " + deletedSuccessfully +
" successful, " + deletedWithFailure
- + " failed, took [" + time + "]ms");
+ if (stats.deletedSuccessfully > 0 || stats.deletedWithFailure > 0) {
+ log.info(stats);
}
}
+ // return true if successful
+ private void uninventoryResource(Subject overlord, Integer doomedResourceId,
AsyncDeletionStats stats,
+ boolean recurse) {
+ if (recurse) {
+ List<Integer> doomedChildrenIds =
resourceManager.findChildrenResourceIds(doomedResourceId, null);
+ for (Integer nextDoomedChildId : doomedChildrenIds) {
+ uninventoryResource(overlord, nextDoomedChildId, stats, recurse);
+ }
+ }
+ log.debug("Before " + (recurse ? "(recursive)" :
"") + " asynchronous deletion of resource[id="
+ + doomedResourceId + "]");
+ long startTime = System.currentTimeMillis();
+
+ unscheduleJobs(overlord, doomedResourceId);
+ resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId);
+ stats.deletedSuccessfully++;
+
+ long endTime = System.currentTimeMillis();
+ log.debug("After " + (recurse ? "(recursive)" : "")
+ " asynchronous deletion of resource[id="
+ + doomedResourceId + "] took [" + (endTime - startTime) +
"]ms");
+
+ stats.deletionTime += (endTime - startTime);
+ }
+
private void unscheduleJobs(Subject overlord, Integer resourceId) {
log.debug("Unscheduling jobs for resource[id=" + resourceId +
"]");
OperationManagerLocal operationManager = LookupUtil.getOperationManager();
commit 5c0c296d0827308330762bab4d4db7b5988c5d59
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 14 21:07:11 2010 -0400
BZ-614688: support searching for values that contain single-quotes
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index cba008f..a428edc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -7,6 +7,7 @@ import java.util.List;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
+import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -63,7 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -73,7 +75,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -82,7 +85,9 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
- + add(" AND LOWER(rg.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(
+ " AND LOWER(rg.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'",
+ filter) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index e6552fc..124c07b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -9,6 +9,7 @@ import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
+import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -66,7 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -76,7 +78,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -87,7 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(def.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(def.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY def.name ");
} else {
@@ -110,7 +114,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -119,7 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -128,7 +134,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, ResourceType type " //
+ " WHERE res.resourceType = type " //
+ add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(res.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(res.name) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -140,9 +147,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, PropertySimple simple " //
+ " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(property.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) {
@@ -151,9 +161,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " FROM Resource res, PropertySimple simple " //
+ " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(property.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(property.stringValue) LIKE '%"
+ + QueryUtility.escapeSearchParameter(filter.toLowerCase()) +
"%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
@@ -163,9 +176,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant
{
+ " JOIN trait.schedule ms " //
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
- + " AND LOWER(ms.definition.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + " AND LOWER(ms.definition.name) LIKE '%"
+ + QueryUtility.escapeSearchParameter(param.toLowerCase())
+ + "%'" //
+ add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
- + add(" AND LOWER(trait.value) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(trait.value) LIKE '%" +
QueryUtility.escapeSearchParameter(filter.toLowerCase())
+ + "%'", filter) //
+ " ORDER BY trait.value ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
index 59f4888..e2d3600 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java
@@ -1,6 +1,7 @@
package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator;
+import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
@@ -13,13 +14,13 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
private String process(ValueFilter filter, String value) {
if (filter == ValueFilter.STARTS_WITH) {
- return "'" + value + "%'";
+ return "'" + QueryUtility.escapeSearchParameter(value) +
"%'";
} else if (filter == ValueFilter.ENDS_WITH) {
- return "'%" + value + "'";
+ return "'%" + QueryUtility.escapeSearchParameter(value) +
"'";
} else if (filter == ValueFilter.INDEX_OF) {
- return "'%" + value + "%'";
+ return "'%" + QueryUtility.escapeSearchParameter(value) +
"%'";
} else if (filter == ValueFilter.EXACT_MATCH) {
- return "'" + value + "'";
+ return "'" + QueryUtility.escapeSearchParameter(value) +
"'";
} else {
throw new IllegalArgumentException("Unsupported ValueFilter: " +
filter);
}
@@ -70,20 +71,21 @@ public abstract class AbstractSearchTranslator implements
SearchTranslator {
Class<? extends Enum<?>> enumClass, boolean useOrdinal) {
if (operator == RHQLComparisonOperator.NULL || //
operator == RHQLComparisonOperator.NOT_NULL) {
- return fragment + operator.getDefaultTranslation();
+ return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation());
} else if (operator == RHQLComparisonOperator.EQUALS || //
operator == RHQLComparisonOperator.EQUALS_STRICT || //
operator == RHQLComparisonOperator.NOT_EQUALS || //
operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) {
- return fragment + operator.getDefaultTranslation() + getEnum(enumClass,
value, useOrdinal);
+ return QueryUtility.escapeSearchParameter(fragment +
operator.getDefaultTranslation()
+ + getEnum(enumClass, value, useOrdinal));
} else {
throw new IllegalArgumentException("Unsupported operator " +
operator);
}
}
- protected String getEnum(Class<? extends Enum<?>> enumClass, String
value, boolean useOrdinal) {
+ private String getEnum(Class<? extends Enum<?>> enumClass, String value,
boolean useOrdinal) {
value = value.toLowerCase();
for (Enum<?> nextEnum : enumClass.getEnumConstants()) {
if (nextEnum.name().toLowerCase().equals(value)) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
index bd9cc8a..8750977 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java
@@ -48,16 +48,17 @@ public class QueryUtility {
private static String doEscapeSearchParameter(String value) {
init();
-
+
// Escape LIKE's wildcard characters with escaped characters so that the
user's input
// will be matched literally
value = value.replace(ESCAPE_CHARACTER, ESCAPED_ESCAPE);
value = value.replace("_", ESCAPED_UNDERSCORE);
value = value.replace("%", ESCAPED_PERCENT);
+ value = value.replace("'", "''");
return value;
- }
-
+ }
+
/**
* Given the settings for the current DatabaseType, properly handle escaping special
SQL characters as
* well as UPCASING the value (standard for rhq filter searches) and wrapping with
SQL wildcard for
commit 2f23d21e0fafb6c03190cfec19cee09af9bfb293
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:41:08 2010 -0400
Tests with the ListGridFieldType.LINK
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 927056b..3dc9f4c 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
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.grid.CellFormatter;
@@ -66,12 +67,15 @@ public class BundlesListView extends Table {
setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60");
- getListGrid().getField("name").setWidth("25%");
- getListGrid().getField("name").setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
- return "<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
- }
- });
+ getListGrid().getField("link").setWidth("25%");
+ getListGrid().getField("link").setType(ListGridFieldType.LINK);
+ getListGrid().getField("link").setTarget("_self");
+
+// getListGrid().getField("name").setCellFormatter(new CellFormatter()
{
+// public String format(Object o, ListGridRecord listGridRecord, int i, int
i1) {
+// return "";//<a href=\"#Bundles/Bundle/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
+// }
+// });
getListGrid().getField("description").setWidth("25%");
getListGrid().getField("latestVersion").setWidth("25%");
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 f20d65e..e3b54ac 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
@@ -22,6 +22,7 @@ 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.fields.DataSourceIntegerField;
+import com.smartgwt.client.data.fields.DataSourceLinkField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -46,8 +47,9 @@ public class BundlesWithLatestVersionDataSource extends
RPCDataSource<BundleWith
idField.setPrimaryKey(true);
addField(idField);
- DataSourceTextField nameField = new DataSourceTextField("name",
"Name");
- addField(nameField);
+ DataSourceLinkField linkField = new DataSourceLinkField("link",
"Name");
+ addField(linkField);
+
DataSourceTextField descriptionField = new
DataSourceTextField("description", "Description");
addField(descriptionField);
@@ -112,6 +114,12 @@ public class BundlesWithLatestVersionDataSource extends
RPCDataSource<BundleWith
record.setAttribute("id", from.getBundleId());
record.setAttribute("name", from.getBundleName());
+
+
+ record.setAttribute("link", "#Bundles/Bundle/" +
from.getBundleId());
+ record.setLinkText(from.getBundleName());
+
+
record.setAttribute("description", from.getBundleDescription());
record.setAttribute("latestVersion", from.getLatestVersion());
record.setAttribute("versionsCount",
Integer.valueOf(from.getVersionsCount().intValue())); // want int, not long
commit db16f69cec6123b2eb60ec6fd5605c8c59338dab
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:39:10 2010 -0400
IE6 XMLHttpRequest workaround for the searchgui
Don't use CoreGUI framework features from the jsf embedded search gui components
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
index 76520b8..5526b3d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
@@ -63,6 +63,12 @@ public class SearchGUI implements EntryPoint {
}
public static void checkLoginStatus() {
+
+ if (detectIe6()) {
+ forceIe6Hacks();
+ }
+
+
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/sessionAccess");
try {
b.setCallback(new RequestCallback() {
@@ -89,8 +95,12 @@ public class SearchGUI implements EntryPoint {
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria,
new AsyncCallback<PageList<Subject>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
load user's subject", caught);
- new LoginView().showLoginDialog();
+ // can't use this until gwt frame is always
present, reserve for futureu
+ //CoreGUI.getErrorHandler().handleError("Failed
to load user's subject", caught);
+ //SC.say("Failed to load user's
subject.");
+ //new LoginView().showLoginDialog();
+
+ System.out.println("Failed to load user's
subject");
}
public void onSuccess(PageList<Subject> result) {
@@ -115,7 +125,12 @@ public class SearchGUI implements EntryPoint {
} catch (RequestException e) {
SC.say("Unable to determine login status, check server status");
e.printStackTrace();
+ } finally {
+ if (detectIe6()) {
+// unforceIe6Hacks();
+ }
}
+
}
public static Subject getSessionSubject() {
@@ -125,4 +140,30 @@ public class SearchGUI implements EntryPoint {
public SearchBar getSearchBar() {
return searchBar;
}
+
+
+
+ /**
+ * Detects IE6.
+ * <p/>
+ * This is a nasty hack; but it's extremely reliable when running with other
+ * js libraries on the same page at the same time as gwt.
+ */
+ public static native boolean detectIe6() /*-{
+ if (typeof $doc.body.style.maxHeight != "undefined")
+ return(false);
+ else
+ return(true);
+}-*/;
+
+ public static native void forceIe6Hacks() /*-{
+ $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest;
+ $wnd.XMLHttpRequest = null;
+}-*/;
+
+ public static native void unforceIe6Hacks() /*-{
+ $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup;
+ $wnd.XMLHttpRequestBackup = null;
+}-*/;
+
}
commit 8b9d621d09dcd9379e53b622222b3fb98dce44d7
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 22:38:08 2010 -0400
Protect against invalid events
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index 60866e0..47dcded 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -110,9 +110,12 @@ public class SearchBar extends SimplePanel {
Event.addNativePreviewHandler(new NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent event) {
- if (event.getNativeEvent().getEventTarget().equals(searchButton)
- && event.getTypeInt() == Event.ONMOUSEDOWN) {
- prepareSearchExecution();
+ if (event.getNativeEvent() != null &&
event.getNativeEvent().getEventTarget() != null) {
+
+ if (event.getNativeEvent().getEventTarget().equals(searchButton)
+ && event.getTypeInt() == Event.ONMOUSEDOWN) {
+ prepareSearchExecution();
+ }
}
}
});
commit 160d7b800caf7639c0ab21bac81bfd21059a0f47
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 17:02:33 2010 -0400
fully qualified image path for other context path usage
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
index 44aaacd..37f553d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java
@@ -35,7 +35,7 @@ public class RPCManager {
Img activityIndicator;
public RPCManager() {
- activityIndicator = new Img("ajax-loader.gif", 16, 16);
+ activityIndicator = new Img("/coregui/images/ajax-loader.gif", 16,
16);
activityIndicator.setZIndex(10000);
activityIndicator.setLeft(10);
activityIndicator.setTop(40);
commit ef05e9a1417faf1dd11dd0dff2dfbbc53aaf8470
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 17:02:00 2010 -0400
Switch menubar border overrides to css !important for bug in IE dom editing
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 bcc4236..9992897 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
@@ -78,24 +78,6 @@ public class MenuBarView extends VLayout {
this.aboutModalWindow = new AboutModalWindow();
- // TODO GH: This is a nasty hack... it injects the css to override the smartgwt
skin
- String css = ".menuButton, .menuButtonOver, .menuButtonDown,
.menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown,
.menuButtonSelectedOver, .menuButtonSelectedDisabled {\n" +
- " border: none;\n" +
- " font-size: 9pt; \n" +
- " font-weight: bold;\n" +
- "}\n" +
- ".menuButtonDown {\n" +
- " background:
url(\"/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_Over_stretch.png\")
repeat-x scroll 0 0 #DDDDDD";
-
- com.google.gwt.dom.client.StyleElement style =
Document.get().createStyleElement();
- style.setPropertyString("language", "text/css");
- style.setInnerText(css);
- Document.get().getBody().appendChild(style);
-
-
-
-
-
HLayout topBar = new HLayout();
topBar.setHeight(28);
topBar.setStyleName("topMenuBar");
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index 40274c1..a00b6ed 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -302,8 +302,8 @@ a:hover {
}
.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected,
.menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled {
- border: none;
- font-weight: bold;
+ border: none !important;
+ font-weight: bold !important;
}
commit 3a9ea20e071e15b17c797c00f06da6a2eb9199b1
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jul 14 16:58:11 2010 -0400
We have to release without user.agent specific builds to have proper multiple browser
support!
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index a7782bf..b65157a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -41,7 +41,7 @@
<!--<set-property name="user.agent"
value="safari"/>-->
<!-- Firefox 3 -->
- <set-property name="user.agent" value="gecko1_8"/>
+ <!--<set-property name="user.agent"
value="gecko1_8"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
commit a3a6c3cbf971f898795f2ed7a18506af42498c2a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 14 21:47:24 2010 -0400
fix so unset checkbox works for textarea fields (for longString props)
(
https://bugzilla.redhat.com/show_bug.cgi?id=609456); call prepareInputsForSubmission() JS
function upon submission of form on update alert sender config page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
index 85077aa..138a5e5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js
@@ -181,7 +181,7 @@ function writeProtectInputs(inputs) {
* @param form a form element
*/
function prepareInputsForSubmission(form) {
- var inputs = Form.getInputs(form);
+ var inputs = Form.getElements(form);
for ( var i = 0; i < inputs.length; i++) {
if (inputs[i].disabled) {
// NOTE: It is vital to enable any disabled inputs, since the browser will exclude
disabled inputs from the
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
index 01725e8..e5b1075 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml
@@ -117,7 +117,7 @@
</rich:panel>
<h:panelGroup id="customContentPanel" rendered="#{not empty
alertNotificationsUIBean.activeNotification}">
- <h:form id="customContentForm">
+ <h:form id="customContentForm"
onsubmit="prepareInputsForSubmission(this)">
<input type="hidden" name="context"
value="#{param.context}"/>
<input type="hidden" name="contextId"
value="#{param.contextId}"/>
<input type="hidden" name="contextSubId"
value="#{param.contextSubId}"/>
@@ -189,4 +189,5 @@
</ui:composition>
-</html>
\ No newline at end of file
+</html>
+
\ No newline at end of file
commit 8ddfc3efc49e9b296f6dfd599c4649b73e2fc6e3
Merge: f1b2a3b... 764922f...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 15:19:33 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit f1b2a3b10a905df46794b1defdd273b282a854e7
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 15:14:25 2010 -0400
[BZ 613918] Further ensure manage_bundle permission is sufficient
to manipulate bundles and view deployments.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
index 5520e0b..4e38e46 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java
@@ -85,8 +85,12 @@ public class BundleResourceDeploymentCriteria extends Criteria {
this.fetchBundleDeployment = fetchBundleDeployment;
}
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then
+ // see his resource deployments. Until we can handle granular authorization checks
on
+ // optionally fetched resource member data, allow a bundle manager to see
+ // resouce deployments to any platform.
/**
- * Requires MANAGE_INVENTORY
+ * Requires MANAGE_INVENTORY or MANAGE_BUNDLE
*
* @param fetchResource
*/
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
index a70919e..5cf8205 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
@@ -695,7 +695,9 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
// Create the mapping between the Bundle's Repo and the BundleFile's
PackageVersion
Repo repo = bundle.getRepo();
- repoManager.addPackageVersionsToRepo(subject, repo.getId(), new int[] {
packageVersion.getId() });
+ // add the packageVersion as overlord, this allows users without MANAGE_INVENTORY
permission to add bundle files
+ repoManager.addPackageVersionsToRepo(subjectManager.getOverlord(), repo.getId(),
new int[] { packageVersion
+ .getId() });
// Classify the Package with the Bundle name in order to distinguish it from the
same package name for
// a different bundle.
@@ -1151,12 +1153,15 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
if (!authorizationManager.isInventoryManager(subject)) {
if (criteria.isInventoryManagerRequired()) {
- throw new PermissionException("Subject [" + subject.getName()
- + "] requires InventoryManager permission for requested query
criteria.");
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could
not then
+ // see his resource deployments. Until we can handle granular
authorization checks on
+ // optionally fetched resource member data, allow a bundle manager to
see
+ // resouce deployments to any platform.
+ if (!authorizationManager.hasGlobalPermission(subject,
Permission.MANAGE_BUNDLE)) {
+ throw new PermissionException("Subject [" +
subject.getName()
+ + "] requires InventoryManager or BundleManager permission
for requested query criteria.");
+ }
}
-
-
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
null,
- subject.getId());
}
CriteriaQueryRunner<BundleResourceDeployment> queryRunner = new
CriteriaQueryRunner<BundleResourceDeployment>(
commit 3a473fbf48a704f79fc250f732a35d5327667d25
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 15:12:45 2010 -0400
remove the previous bundle version field, it wasn't available w/o
another db rt and the info is already in the name/description.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
index d71992e..fd7264d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
@@ -156,13 +156,7 @@ public class ConfirmationStep extends AbstractWizardStep {
prevDescItem.setWrap(false);
prevDescItem.setValue((null != prev.getName()) ? prev.getName() :
"none");
- StaticTextItem prevVersionItem = new StaticTextItem("prevVersion",
"Bundle Version");
- prevVersionItem.setTitleAlign(Alignment.LEFT);
- prevVersionItem.setAlign(Alignment.LEFT);
- prevVersionItem.setWrap(false);
- prevVersionItem.setValue(prev.getBundleVersion().getVersion());
-
- prevForm.setItems(prevNameItem, prevDescItem, prevVersionItem);
+ prevForm.setItems(prevNameItem, prevDescItem);
layout.addMember(prevForm);
Label confirmation = new Label();
commit 51b5d72779664fb9399e8267536b451b6889bb0b
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Wed Jul 14 16:08:50 2010 +0200
Follow the changes to SenderResult
diff --git
a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
index b148a9b..1cf74b5 100644
---
a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
+++
b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
@@ -81,11 +81,11 @@ public class MicroblogSender extends AlertSender {
Status status = twitter.updateStatus(msg);
- result = new SenderResult(ResultState.SUCCESS,"Send notification to
" + txt + ", msg-id: " + status.getId());
+ result = SenderResult.getSimpleSuccess("Send notification to " +
txt + ", msg-id: " + status.getId());
} catch (TwitterException e) {
log.warn("Notification via Microblog failed for " + txt + "
", e);
- result = new SenderResult(ResultState.FAILURE,"Sending failed :" +
e.getMessage());
+ result = SenderResult.getSimpleFailure("Sending failed :" +
e.getMessage());
}
return result;
commit 764922f1e413c95e43f2c040c513851e38b25d62
Merge: d07d19f... 2a967b1...
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Wed Jul 14 15:33:46 2010 +0200
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit d07d19ffc9f3ca23292d4ca1448ac72ca6ed5b35
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Wed Jul 14 15:31:23 2010 +0200
Don't print to stdout, but use a logger.
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 8758b72..7433805 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
@@ -24,19 +24,24 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* @author Greg Hinkle
*/
public class SerialUtility {
+ private static Log log = LogFactory.getLog(SerialUtility.class);
public static <T> T prepare(T value, String message) {
long start = System.currentTimeMillis();
try {
HibernateDetachUtility.nullOutUninitializedFields(value,
HibernateDetachUtility.SerializationType.SERIALIZATION);
-
- System.out.println("SerialUtility.prepare [" + message + "]
Detached in: " + (System.currentTimeMillis() - start) + "ms, Size is: " +
serialSize(value));
+ if (log.isDebugEnabled())
+ log.debug("SerialUtility.prepare [" + message + "] Detached
in: " + (System.currentTimeMillis() - start) +
+ "ms, Size is: " + serialSize(value));
} catch (Exception e) {
e.printStackTrace();
}
@@ -53,7 +58,7 @@ public class SerialUtility {
o.flush();
return baos.size();
} catch (IOException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ e.printStackTrace();
return -1;
}
}
commit 2fa692b5f5aa315b535888968bc0bfb852a8dde9
Merge: f7bc351... 2a967b1...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 14 09:30:54 2010 -0400
Merge branch 'release-3.0.0' into master-jay
commit 2a967b1cb103eaca19b103cc8035d6a430e7ba09
Merge: f40ab04... 2d97df9...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 18:17:40 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit f40ab04c9ff14674930edb296fc0b95a7e577221
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 18:15:28 2010 -0400
Postgres seems to have some different transaction semantics
wrt ddl updates. Make sure to execute schema tasks with
ignoreError=true in their own trans to avoid a failure
marking the whole scheme spec trans for rollback.
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
index 979dcd3..4b7c0a5 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
@@ -19,6 +19,7 @@
package org.rhq.core.db.ant.dbupgrade;
import java.sql.Connection;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@@ -135,6 +136,16 @@ public class SchemaSpec extends Task implements TaskContainer,
Comparable {
log(MSG.getMsg(DbAntI18NResourceKeys.EXECUTING_SCHEMA_SPEC_TASK,
sst.getClass(), getVersion()));
sst.initialize(conn, upgrader);
+ // to be able to ignore a failed ddl update we need to execute that
+ // update in its own trans, because the failure may mark the trans
+ // for rollback. So, commit ant transaction in progress.
+ if (sst.isIgnoreError()) {
+ try {
+ conn.commit();
+ } catch (SQLException e) {
+ log("commit() exception: " + e.toString());
+ }
+ }
sst.execute();
} catch (Exception e) {
String msg =
MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst.getClass()
@@ -142,6 +153,12 @@ public class SchemaSpec extends Task implements TaskContainer,
Comparable {
if (!sst.isIgnoreError()) {
throw new BuildException(msg, e);
} else {
+ // rollback the trans so the next statement starts a new trans
+ try {
+ conn.rollback();
+ } catch (SQLException e2) {
+ log("rollback() exception: " + e2.toString());
+ }
log(msg);
}
}
commit 2d97df9bb2a6e577f7e7b7f24b192426bba5449e
Merge: 4b1dc2d... 64cce78...
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Jul 13 16:31:11 2010 -0400
Merge branch 'release-3.0.0' into spinder-provisioning
commit 64cce78d37296a1d0c5be804687aef4e0394f86b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 16:06:21 2010 -0400
BZ-613918: allow bundle managers without MANAGE_INVENTORY perm to create/delete
bundles
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
index 6a78fe1..a70919e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
@@ -175,7 +175,9 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
Repo repo = new Repo(name);
repo.setCandidate(false);
repo.setSyncSchedule(null);
- repo = repoManager.createRepo(subject, repo);
+
+ // create the repo as overlord, this allows users without MANAGE_INVENTORY
permission to create bundles
+ repo = repoManager.createRepo(subjectManager.getOverlord(), repo);
// add the required PackageType. the PackageType is an attached object which
helps in cascade removal
// of packages in the bundle's repo.
@@ -1227,7 +1229,8 @@ public class BundleManagerBean implements BundleManagerLocal,
BundleManagerRemot
this.entityManager.remove(bundle);
this.entityManager.flush();
- repoManager.deleteRepo(subject, bundleRepo.getId());
+ // delete the repo as overlord, this allows users without MANAGE_INVENTORY
permission to delete bundles
+ repoManager.deleteRepo(subjectManager.getOverlord(), bundleRepo.getId());
}
@RequiredPermission(Permission.MANAGE_BUNDLE)
commit 4b1dc2d5133aa3e56d8460e57eda85b405792487
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Jul 13 15:11:18 2010 -0400
BZ 604792: fix bundle left nav update issue.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index a3be0fa..c9955f3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@ -98,7 +98,6 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
// refresh
System.out.println("Refreshing BundleTopView");
- bundleTreeView.refresh();
bundlesListView.refresh();
} else {
currentNextPath = null;
@@ -116,5 +115,6 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
bundleView.renderView(viewPath.next());
}
}
+ bundleTreeView.refresh();//refresh the tree in all cases.
}
}
commit 9e687dd74bfa3a42db4b719d0dc27ccba107f8cf
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 15:44:57 2010 -0400
ensure the "location" column for various dashboard portlets always renders
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
index 4665c09..27f84c6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
@@ -55,7 +55,7 @@
<c:forEach items="${lastCompletedResource}"
var="obj">
<tr class="ListRow">
<td
class="ListCell"><display:disambiguatedResourceName
resourceName="${obj.original.resourceName}"
disambiguationReport="${obj}" resourceId="${obj.original.resourceId}"
/></td>
- <td
class="ListCell"><display:disambiguatedResourceLineage
parents="${obj.parents}" /></td>
+ <td
class="ListCell"><display:disambiguatedResourceLineage
parents="${obj.parents}" /> </td>
<td class="ListCell"><c:out
value="${obj.original.operationName}"/></td>
<td class="ListCell"><hq:dateFormatter
value="${obj.original.operationStartTime}"/></td>
<td class="ListCell" align="center">
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
index 1a46253..7dffbd2 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
@@ -37,7 +37,7 @@
<display:disambiguatedResourceNameDecorator
resourceName="${obj.original.resourceName}"
resourceId="${obj.original.resourceId}"
disambiguationReport="${obj}"/>
</display:column>
<display:column width="20%"
title="dash.home.TableHeader.Location">
- <display:disambiguatedResourceLineageDecorator
parents="${obj.parents}"/>
+ <display:disambiguatedResourceLineageDecorator
parents="${obj.parents}"/>
</display:column>
<display:column width="10%" property="original.numAlerts"
title="dash.home.TableHeader.Alerts" align="center"/>
<display:column width="10%"
property="original.availabilityType"
title="resource.common.monitor.visibility.CAvailabilityTH"
align="center"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp
index fd69279..bf05184 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp
@@ -31,7 +31,7 @@
<display:disambiguatedResourceNameDecorator
resourceName="${item.original.name}" disambiguationReport="${item}"
resourceId="${item.original.id}"/>
</display:column>
<display:column width="25%"
title="dash.home.TableHeader.Location">
- <display:disambiguatedResourceLineageDecorator
parents="${item.parents}"/>
+ <display:disambiguatedResourceLineageDecorator
parents="${item.parents}"/>
</display:column>
<c:if test="${alerts}">
<display:column width="10%" property="original.alerts"
title="dash.home.TableHeader.Alerts" align="center"/>
commit ddbb4b214fd500b08aecedbc404cb66c3c8a97c6
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 15:44:18 2010 -0400
BZ-613939: fix link for "recent group operation" section from the dashboard
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
index 055e2c9..4665c09 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp
@@ -89,7 +89,7 @@
</tr>
<c:forEach items="${lastCompletedGroup}"
var="obj">
<tr class="ListRow">
- <td class="ListCell"><html:link
page="/rhq/groups/monitor/graphs.xhtml?category=COMPATIBLE&groupId=${obj.groupId}"><c:out
value="${obj.groupName}"/></html:link></td>
+ <td class="ListCell"><html:link
page="/rhq/group/monitor/graphs.xhtml?category=COMPATIBLE&groupId=${obj.groupId}"><c:out
value="${obj.groupName}"/></html:link></td>
<td class="ListCell"><c:out
value="${obj.groupResourceTypeName}"/></td>
<td class="ListCell"><c:out
value="${obj.operationName}"/></td>
<td class="ListCell"><hq:dateFormatter
value="${obj.operationStartTime}"/></td>
commit f7bc3514be4e70b7a86a6fc923bd1d581311a497
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 15:31:45 2010 -0400
uncripple some code that was disabled for 3.0.0.GA
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 a10372f..7dfd9df 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,20 +121,17 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
checkLoginStatus();
-
}
-
public static void checkLoginStatus() {
-// String sessionIdString =
com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion");
-// if (sessionIdString == null) {
+ // String sessionIdString =
com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion");
+ // if (sessionIdString == null) {
if (detectIe6()) {
- forceIe6Hacks();
+ forceIe6Hacks();
}
-
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/sessionAccess");
try {
b.setCallback(new RequestCallback() {
@@ -158,22 +155,22 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
criteria.addFilterId(subjectId);
criteria.fetchRoles(true);
+
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria,
+ new AsyncCallback<PageList<Subject>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to
load user's subject", caught);
+ new LoginView().showLoginDialog();
+ }
-
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new
AsyncCallback<PageList<Subject>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to
load user's subject", caught);
- new LoginView().showLoginDialog();
- }
+ public void onSuccess(PageList<Subject> result) {
- public void onSuccess(PageList<Subject> result) {
+ Subject subject = result.get(0);
+ subject.setSessionId(sessionId);
+ setSessionSubject(subject);
+ System.out.println("Portal-War logged
in");
- Subject subject = result.get(0);
- subject.setSessionId(sessionId);
- setSessionSubject(subject);
- System.out.println("Portal-War logged in");
-
- }
- });
+ }
+ });
} else {
new LoginView().showLoginDialog();
}
@@ -189,12 +186,11 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
e.printStackTrace();
} finally {
if (detectIe6()) {
- unforceIe6Hacks();
- }
+ unforceIe6Hacks();
+ }
}
}
-
private void buildCoreUI() {
// If the core gui is already built (eg. from previous login, just refire event)
if (this.rootCanvas == null) {
@@ -247,7 +243,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
rootCanvas.renderView(currentViewPath);
}
-
+
public static void refresh() {
currentViewPath = new ViewPath(currentPath);
@@ -258,21 +254,6 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
public Canvas createContent(String breadcrumbName) {
Canvas canvas;
- //=============
- // TODO: REMOVE THIS AFTER 3.0 RELEASE - WE ONLY WANT 3.0 TO EXPOSE BUNDLES AND
TAGS
- // THEREAFTER, WE WILL EXPOSE ALL GWT FUNCTIONALITY
- canvas = null;
- if (canvas == null) {
- if (breadcrumbName.equals("Bundles")) {
- return new BundleTopView();
- } else if (breadcrumbName.equals("Tag")) {
- return new TaggedView();
- } else {
- return null;
- }
- }
- //=============
-
if (breadcrumbName.equals("Administration")) {
canvas = new AdministrationView();
} else if (breadcrumbName.equals("Demo")) {
@@ -322,7 +303,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
// s.setSessionId(subject.getSessionId());
CoreGUI.sessionSubject = subject;
CoreGUI.userPreferences = new UserPreferences(subject);
- loadProductInfo();
+ loadProductInfo();
}
public static void setContent(Canvas newContent) {
@@ -356,14 +337,14 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
private static void loadProductInfo() {
GWTServiceLookup.getSystemService().getProductInfo(new
AsyncCallback<ProductInfo>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load product
information.", caught);
- }
+ CoreGUI.getErrorHandler().handleError("Failed to load product
information.", caught);
+ }
- public void onSuccess(ProductInfo result) {
- productInfo = result;
- coreGUI.buildCoreUI();
- }
- });
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ coreGUI.buildCoreUI();
+ }
+ });
}
private class RootCanvas extends VLayout implements BookmarkableView {
@@ -397,7 +378,6 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
}
}
-
/**
* Detects IE6.
* <p/>
@@ -405,20 +385,20 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
* js libraries on the same page at the same time as gwt.
*/
public static native boolean detectIe6() /*-{
- if (typeof $doc.body.style.maxHeight != "undefined")
- return(false);
- else
- return(true);
-}-*/;
+ if (typeof $doc.body.style.maxHeight !=
"undefined")
+ return(false);
+ else
+ return(true);
+ }-*/;
public static native void forceIe6Hacks() /*-{
- $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest;
- $wnd.XMLHttpRequest = null;
-}-*/;
+ $wnd.XMLHttpRequestBackup =
$wnd.XMLHttpRequest;
+ $wnd.XMLHttpRequest = null;
+ }-*/;
public static native void unforceIe6Hacks() /*-{
- $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup;
- $wnd.XMLHttpRequestBackup = null;
-}-*/;
+ $wnd.XMLHttpRequest =
$wnd.XMLHttpRequestBackup;
+ $wnd.XMLHttpRequestBackup = null;
+ }-*/;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index 156e80e..f2c6637 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.bundle.list.BundleView;
import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView;
import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeView;
+import
org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeView;
/**
* @author Greg Hinkle
@@ -66,14 +67,13 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
bundlesSection.addItem(bundleTreeView);
sectionStack.addSection(bundlesSection);
- // Don't show these in 3.0, they are not fully baked
- //SectionStackSection repositoriesSection = new
SectionStackSection("Repositories");
- //ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView();
- //repositoriesSection.addItem(repoTree);
- //sectionStack.addSection(repositoriesSection);
+ SectionStackSection repositoriesSection = new
SectionStackSection("Repositories");
+ ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView();
+ repositoriesSection.addItem(repoTree);
+ sectionStack.addSection(repositoriesSection);
- //SectionStackSection providersSection = new
SectionStackSection("Providers");
- //sectionStack.addSection(providersSection);
+ SectionStackSection providersSection = new
SectionStackSection("Providers");
+ sectionStack.addSection(providersSection);
addMember(sectionStack);
commit fb09fe364d4a9934c2010ac2f4b4b577517a00f3
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 15:30:51 2010 -0400
Merge some db upgrade stuff. Will require a dbsetup to get
to 2.91 if you're at 2.89 in master.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 3dd9747..31e3e0a 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.90</db.schema.version>
+ <db.schema.version>2.91</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 2156d24..7071839 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3057,17 +3057,6 @@
</statement>
</schema-directSQL>
</schemaSpec>
-
- <schemaSpec version="2.89">
- <schema-directSQL>
- <statement desc="Add end time index on call time data to
speed up purges">
- CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE
(end_time)
- </statement>
- <statement desc="Add index on measurement definition numeric
type">
- CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF
(numeric_type)
- </statement>
- </schema-directSQL>
- </schemaSpec>
<!-- rhq 3.0.0.final release at this point. -->
@@ -3122,6 +3111,18 @@
</schema-directSQL>
</schemaSpec>
+
+ <schemaSpec version="2.91">
+ <schema-directSQL>
+ <statement desc="Add end time index on call time data to
speed up purges">
+ CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE
(end_time)
+ </statement>
+ <statement desc="Add index on measurement definition numeric
type">
+ CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF
(numeric_type)
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
+
</dbupgrade>
</target>
</project>
commit 43b89bae5e0c1b0539002644890e3d2132d10f7c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 15:26:01 2010 -0400
BZ-614176: fix for selecting resource/group saved searches from the menu bar
* improve handling around "activiating" default search text and default
savedSearch patterns
* change hidden param name from defaultSavedSearchPattern to
defaultSavedSearchPatternId, to better imply what data is represents
* add the ability to load a default saved search pattern by id to the
SavedSearchManager
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index 2c432d1..60866e0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -45,6 +45,7 @@ import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.TextBox;
+import org.rhq.core.domain.search.SavedSearch;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchGrid;
import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchManager;
@@ -88,7 +89,7 @@ public class SearchBar extends SimplePanel {
private final SavedSearchManager savedSearchManager;
private SearchSubsystem searchSubsystem;
private String defaultSearchText;
- private String defaultSavedSearchPattern;
+ private String defaultSavedSearchPatternId;
private String selectedTab;
private Element searchButton;
@@ -122,8 +123,8 @@ public class SearchBar extends SimplePanel {
String defaultSearchText =
searchBarElement.getAttribute("defaultSearchText");
setDefaultSearchText(defaultSearchText);
- String defaultSavedSearchPattern =
searchBarElement.getAttribute("defaultSavedSearchPattern");
- setDefaultSavedSearchPattern(defaultSavedSearchPattern);
+ String defaultSavedSearchPatternId =
searchBarElement.getAttribute("defaultSavedSearchPatternId");
+ setDefaultSavedSearchPatternId(defaultSavedSearchPatternId);
String tab = searchBarElement.getAttribute("subtab");
if (tab != null) {
@@ -161,6 +162,20 @@ public class SearchBar extends SimplePanel {
setupArrowImage();
setupSavedSearches();
+ //
+ if (defaultSearchText != null) {
+ this.autoCompletePatternField.setText(defaultSearchText);
+ click(searchButton); // execute the search with this default search
expression
+ } else if (defaultSavedSearchPatternId != null) {
+ try {
+ Integer savedSearchId = Integer.valueOf(defaultSavedSearchPatternId);
+ activateSavedSearch(savedSearchId);
+ } catch (Exception e) {
+ this.autoCompletePatternField.setText("'Error selecting saved
search'");
+ click(searchButton); // execute the search, which will help to further
highlight the error
+ }
+ }
+
// presume the enclosing page logic loads results without a button click
}
@@ -191,29 +206,26 @@ public class SearchBar extends SimplePanel {
}
this.defaultSearchText = defaultSearchText;
- this.autoCompletePatternField.setText(defaultSearchText);
- click(searchButton); // execute the search with this default search expression
}
public String getDefaultSearchText() {
return defaultSearchText;
}
- public void setDefaultSavedSearchPattern(String defaultSavedSearchPattern) {
- if (defaultSavedSearchPattern == null ||
defaultSavedSearchPattern.trim().equals("")) {
+ public void setDefaultSavedSearchPatternId(String defaultSavedSearchPatternId) {
+ if (defaultSavedSearchPatternId == null ||
defaultSavedSearchPatternId.trim().equals("")) {
return; // do nothing
}
- this.defaultSavedSearchPattern = defaultSavedSearchPattern;
- activateSavedSearch(defaultSavedSearchPattern);
+ this.defaultSavedSearchPatternId = defaultSavedSearchPatternId;
}
public String getSelectedTab() {
return selectedTab;
}
- public String getDefaultSavedSearchPattern() {
- return defaultSavedSearchPattern;
+ public String getDefaultSavedSearchPatternId() {
+ return defaultSavedSearchPatternId;
}
public String getWelcomeMessage() {
@@ -485,16 +497,29 @@ public class SearchBar extends SimplePanel {
button.click();
}-*/;
+ public void activateSavedSearch(Integer savedSearchId) {
+ SavedSearch savedSearch = savedSearchManager.getSavedSearchById(savedSearchId);
+ if (savedSearch == null) {
+ SearchLogger.debug("activateSavedSearch: no known saved search with id
'" + savedSearchId + "'");
+ return; // no saved search existing with the specified id
+ }
+ activateSavedSearch(savedSearch);
+ }
+
public void activateSavedSearch(String savedSearchName) {
- currentSearch = "";
- String patternValue = savedSearchManager.getPatternByName(savedSearchName);
- if (patternValue == null) {
- SearchLogger.debug("activeSavedSearch: no pattern known for saved search
named '" + savedSearchName + "'");
+ SavedSearch savedSearch =
savedSearchManager.getSavedSearchByName(savedSearchName);
+ if (savedSearch == null) {
+ SearchLogger.debug("activateSavedSearch: no known saved search with name
'" + savedSearchName + "'");
return; // no saved search existing with the specified name
}
- autoCompletePatternField.setValue(patternValue, true);
- patternNameField.setValue(savedSearchName, true);
- SearchLogger.debug("search results change: [" + savedSearchName +
"," + patternValue + "]");
+ activateSavedSearch(savedSearch);
+ }
+
+ public void activateSavedSearch(SavedSearch savedSearch) {
+ currentSearch = "";
+ autoCompletePatternField.setValue(savedSearch.getPattern(), true);
+ patternNameField.setValue(savedSearch.getName(), true);
+ SearchLogger.debug("search results change: [" + savedSearch.getName() +
"," + savedSearch.getPattern() + "]");
turnNameFieldIntoLabel();
savedSearchesPanel.hide();
click(searchButton);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
index 398b4d8..66260e8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
@@ -62,6 +62,15 @@ public class SavedSearchManager {
return savedSearches.get(name);
}
+ public synchronized SavedSearch getSavedSearchById(Integer savedSearchId) {
+ for (SavedSearch next : savedSearches.values()) {
+ if (next.getId().equals(savedSearchId)) {
+ return next;
+ }
+ }
+ return null;
+ }
+
public synchronized void updatePatternByName(final String name, final String pattern)
{
SavedSearch savedSearch = savedSearches.get(name);
if (savedSearch == null) { // created case
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
index 0c7022b..99bf2d1 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
@@ -14,7 +14,7 @@
searchButtonId="#{searchButtonId}"
searchSubsystem="#{searchSubsystem}"
defaultSearchText="#{defaultSearchText}"
- defaultSavedSearchPattern="#{defaultSavedSearchPattern}"
+ defaultSavedSearchPatternId="#{defaultSavedSearchPatternId}"
subtab="#{subtab}"
id="searchBar">
<div class="searchBarBackgroundContainer">
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index a132a39..87bb3ee 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -45,6 +45,7 @@
<ui:param name="searchButtonId"
value="browseGroupsForm:searchButtonJSF" />
<ui:param name="searchSubsystem" value="GROUP"
/>
<ui:param name="defaultSearchText"
value="#{param.search}" />
+ <ui:param name="defaultSavedSearchPatternId"
value="#{param.searchId}" />
<ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index 4bfb91a..c7f43c7 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -45,7 +45,7 @@
<ui:param name="searchButtonId"
value="browseResourcesForm:searchButtonJSF" />
<ui:param name="searchSubsystem"
value="RESOURCE" />
<ui:param name="defaultSearchText"
value="#{param.search}" />
- <ui:param name="defaultSavedSearchPattern"
value="#{param.searchId}" />
+ <ui:param name="defaultSavedSearchPatternId"
value="#{param.searchId}" />
<ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
commit 729deb1e260cd73f7e6bcfcd5d63e1f57ae4a7da
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 15:10:54 2010 -0400
BZ-614165: do not try to parameter-replace UNSET configuration properties
diff --git
a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
index e50b143..1fcb295 100644
---
a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
+++
b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
@@ -72,6 +72,9 @@ public class OperationsSender extends AlertSender {
AlertTokenReplacer replacementEngine = new AlertTokenReplacer(alert,
operation, targetResource);
for (PropertySimple simpleProperty :
replacedParameters.getSimpleProperties().values()) {
String temp = simpleProperty.getStringValue();
+ if (temp == null) {
+ continue; // do not process 'UNSET' properties
+ }
temp = replacementEngine.replaceTokens(temp);
simpleProperty.setStringValue(temp);
}
commit 44e7da0fb7b120e552b47486c8fdb1ac00198e57
Merge: e030743... 726f1ff...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 15:09:32 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 5ce87bc,a7782bf..264fbd6
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@@ -37,10 -38,10 +38,10 @@@
<!-- limit builds to your preferred browser -->
<!-- Safari -->
- <!--<set-property name="user.agent"
value="safari"/>-->
+ <set-property name="user.agent" value="safari"/>
<!-- Firefox 3 -->
- <!-- <set-property name="user.agent"
value="gecko1_8"/>-->
+ <set-property name="user.agent" value="gecko1_8"/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
@@@ -63,11 -64,7 +64,12 @@@
<servlet path="/RoleGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/>
<servlet path="/SearchGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/>
<servlet path="/SubjectGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/>
+ <servlet path="/SystemGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl"/>
<servlet path="/TagGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/>
+ <servlet path="/RemoteInstallGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/>
+ <servlet path="/RepoGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl"/>
+ <servlet path="/ContentGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
+ <servlet path="/DashboardGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/>
+ <servlet path="/EventGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/>
</module>
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index b2903cc,048ba11..2bc3318
---
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,8 -18,6 +18,15 @@@
*/
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.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 java.util.List;
+
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
@@@ -61,17 -67,19 +68,19 @@@ public class ResourceDatasource extend
DataSourceImageField iconField = new DataSourceImageField("icon");
iconField.setImageURLPrefix("types/");
- DataSourceTextField nameDataField = new DataSourceTextField("name",
"Name", 200);
+ DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(),
NAME.title(), 200);
nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new
DataSourceTextField("description", "Description");
- DataSourceTextField descriptionDataField = new
DataSourceTextField(DESCRIPTION.propertyName(),
- DESCRIPTION.title());
++ DataSourceTextField descriptionDataField = new
DataSourceTextField(DESCRIPTION.propertyName(), DESCRIPTION
++ .title());
descriptionDataField.setCanEdit(false);
- DataSourceTextField typeNameDataField = new
DataSourceTextField("typeName", "Type");
- DataSourceTextField pluginNameDataField = new
DataSourceTextField("pluginName", "Plugin");
- DataSourceTextField categoryDataField = new
DataSourceTextField("category", "Category");
+ DataSourceTextField typeNameDataField = new
DataSourceTextField(TYPE.propertyName(), TYPE.title());
+ DataSourceTextField pluginNameDataField = new
DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title());
+ DataSourceTextField categoryDataField = new
DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new
DataSourceImageField("currentAvailability", "Availability", 20);
- DataSourceImageField availabilityDataField = new
DataSourceImageField(AVAILABILITY.propertyName(),
- AVAILABILITY.title(), 20);
++ DataSourceImageField availabilityDataField = new
DataSourceImageField(AVAILABILITY.propertyName(), AVAILABILITY
++ .title(), 20);
availabilityDataField.setCanEdit(false);
@@@ -97,40 -105,28 +106,40 @@@
"parentId")));
}
+ if (request.getCriteria().getValues().get("id") != null) {
+
criteria.addFilterId(request.getCriteria().getAttributeAsInt("id"));
+ }
+
+ if (request.getCriteria().getValues().get("resourceIds") != null) {
- int[] ids =
request.getCriteria().getAttributeAsIntArray("resourceIds");
++ int[] ids =
request.getCriteria().getAttributeAsIntArray("resourceIds");
+ Integer[] oids = new Integer[ids.length];
+ for (int i = 0; i < ids.length; i++) {
+ oids[i] = ids[i++];
+ }
+ criteria.addFilterIds(oids);
+ }
+
- if (request.getCriteria().getValues().get("name") != null) {
- criteria.addFilterName((String)
request.getCriteria().getValues().get("name"));
+ if (request.getCriteria().getValues().get(NAME.propertyName()) != null) {
+ criteria.addFilterName((String)
request.getCriteria().getValues().get(NAME.propertyName()));
}
- if (request.getCriteria().getValues().get("category") != null) {
+ if (request.getCriteria().getValues().get(CATEGORY.propertyName()) != null) {
criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String)
request.getCriteria().getValues()
- .get("category")).toUpperCase()));
+ .get(CATEGORY.propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get("availability") != null) {
+ if (request.getCriteria().getValues().get(AVAILABILITY.propertyName()) != null)
{
criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String)
request.getCriteria().getValues()
- .get("availability")).toUpperCase()));
+ .get(AVAILABILITY.propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get("type") != null) {
- criteria
- .addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get("type"))));
+ if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) {
- criteria
- .addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get(
- TYPE.propertyName()))));
++ criteria.addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get(
++ TYPE.propertyName()))));
}
- if (request.getCriteria().getValues().get("plugin") != null) {
- criteria.addFilterPluginName((String)
request.getCriteria().getValues().get("plugin"));
+ if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) {
+ criteria.addFilterPluginName((String)
request.getCriteria().getValues().get(PLUGIN.propertyName()));
}
if (request.getCriteria().getValues().get("tag") != null) {
diff --cc pom.xml
index dff1c40,7ff85bb..19876d2
--- a/pom.xml
+++ b/pom.xml
@@@ -655,10 -665,10 +666,10 @@@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
- <executions>
+ <executions>
<execution>
<id>read-build-properties</id>
- <phase>process-resources</phase>
+ <phase>process-sources</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
commit e0307434f51f8fd229138c556fc229e2660458f5
Merge: 5d78444... 9ace780...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 14:33:08 2010 -0400
Merge branch 'master' into master-jay
Conflicts:
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
commit 726f1fffdafd289a82b213003e5d6b3a787ee3e9
Merge: ad4bde1... 978b418...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 14:29:25 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit ad4bde1bc7b94a5cf4e814e7e3681cf88f146d18
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 14:27:56 2010 -0400
trivial - fix up some comments
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index b43824d..6cf784d 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -1518,7 +1518,7 @@
<schemaSpec version="2.60.2">
<schema-directSQL>
- <!-- RHN_CHANNEL => RHQ_REPO -->
+ <!-- RHQ_CHANNEL => RHQ_REPO -->
<statement>
ALTER TABLE RHQ_CHANNEL RENAME TO RHQ_REPO
</statement>
@@ -1539,8 +1539,7 @@
<statement targetDBVendor="postgresql">
ALTER TABLE RHQ_REPO
ADD CONSTRAINT RHQ_REPO_PKEY PRIMARY KEY ( ID )
- </statement>
- <!-- RHQ_CHANNEL_CONTENT_SRC_MAP => RHQ_REPO_CONTENT_SRC_MAP
-->
+ </statement>
<statement>
ALTER TABLE RHQ_CHANNEL_CONTENT_SRC_MAP
RENAME TO RHQ_REPO_CONTENT_SRC_MAP
@@ -3010,7 +3009,7 @@
<!-- rhq 3.0.0.final release at this point. -->
- <!-- 2.89 corrects problems in 3.0.0.final *new* instal The problems it
+ <!-- 2.89 corrects problems in 3.0.0.final *new* installs. The problems
it
fixes are not present in an upgraded db. As such, ignore any errors.
-->
<schemaSpec version="2.89">
@@ -3034,10 +3033,9 @@
</schemaSpec>
<!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems
it
- fixes are not present in an new db. As such, ignore any errors.
+ fixes are not present in a new db. As such, ignore any errors.
-->
- <schemaSpec version="2.90">
- <!-- correct problems in rhq-3.0.0.final upgrade installs -->
+ <schemaSpec version="2.90">
<schema-dropSequence ignoreError="true"
name="rhq_tag_id_seq" />
<schema-dropSequence ignoreError="true"
name="rhq_advisory_buglist_seq" />
commit 978b418ff8f86fbaf0b0c1e60fa9a4a3a8734d23
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 13:40:34 2010 -0400
BZ-614087, BZ-614090: fix selection/deletion of saved searches
* was incorrectly using "name (count)" to look up saved search entry instead
of "name"
* improve debug logging a bit
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index eb6a724..2c432d1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -80,7 +80,7 @@ public class SearchBar extends SimplePanel {
private final Image arrowImage = new Image(ARROW_WHITE_URL);
private final PopupPanel savedSearchesPanel = new PopupPanel(true);
- private final SavedSearchGrid savedSearches = new SavedSearchGrid(this);
+ private final SavedSearchGrid savedSearchesGrid = new SavedSearchGrid(this);
private String currentSearch = "";
private long lastNameFieldBlurTime = 0;
@@ -268,9 +268,9 @@ public class SearchBar extends SimplePanel {
}
private void setupSavedSearches() {
- savedSearchesPanel.add(savedSearches);
+ savedSearchesPanel.add(savedSearchesGrid);
savedSearchesPanel.setStyleName("savedSearchesPanel");
- savedSearches.addStyleName("savedSearchesPanel");
+ savedSearchesGrid.addStyleName("savedSearchesPanel");
// panel position will be re-calculated on down-arrow click
savedSearchesPanel.show();
@@ -278,7 +278,7 @@ public class SearchBar extends SimplePanel {
SavedSearchesEventHandler handler = new SavedSearchesEventHandler();
savedSearchesPanel.addCloseHandler(handler);
- savedSearches.setPatternSelectionHandler(handler);
+ savedSearchesGrid.setPatternSelectionHandler(handler);
}
private void turnNameFieldIntoLabel() {
@@ -438,7 +438,7 @@ public class SearchBar extends SimplePanel {
class ArrowImageEventHandler implements ClickHandler {
public void onClick(ClickEvent event) {
- savedSearches.updateModel();
+ savedSearchesGrid.updateModel();
int left = autoCompletePatternField.getAbsoluteLeft();
int top = autoCompletePatternField.getAbsoluteTop() +
autoCompletePatternField.getOffsetHeight();
savedSearchesPanel.setPopupPosition(left, top + 5);
@@ -453,6 +453,8 @@ public class SearchBar extends SimplePanel {
}
public void handleSelection(int rowIndex, int columnIndex, String patternName) {
+ SearchLogger.debug("SavedSearchesEventHandler.handleSelection(" +
rowIndex + "," + columnIndex + ","
+ + patternName + ")");
if (columnIndex == 1) {
savedSearchManager.removePatternByName(patternName);
@@ -471,7 +473,7 @@ public class SearchBar extends SimplePanel {
savedSearchesPanel.hide();
}
- savedSearches.removeRow(rowIndex);
+ savedSearchesGrid.removeRow(rowIndex);
} else {
activateSavedSearch(patternName); // activating the saved search also
clicks the button
}
@@ -487,6 +489,7 @@ public class SearchBar extends SimplePanel {
currentSearch = "";
String patternValue = savedSearchManager.getPatternByName(savedSearchName);
if (patternValue == null) {
+ SearchLogger.debug("activeSavedSearch: no pattern known for saved search
named '" + savedSearchName + "'");
return; // no saved search existing with the specified name
}
autoCompletePatternField.setValue(patternValue, true);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java
index f15dcc9..9ac8bed 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java
@@ -1,7 +1,9 @@
package org.rhq.enterprise.gui.coregui.client.search;
+import com.google.gwt.core.client.GWT;
+
public class SearchLogger {
public static void debug(String message) {
- System.out.println(message);
+ GWT.log("SearchBar: " + message);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index 15aa671..ee7647b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -27,6 +27,7 @@ import com.google.gwt.user.client.ui.Grid;
import org.rhq.core.domain.search.SavedSearch;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
+import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
/**
* @author Joseph Marques
@@ -87,6 +88,7 @@ public class SavedSearchGrid extends Grid {
int startIndex = text.indexOf('>') + 1;
int endIndex = text.toLowerCase().indexOf("</span>",
startIndex);
String patternName = text.substring(startIndex, endIndex);
+ SearchLogger.debug("Selected '" + patternName + " at
row=" + rowIndex + ", col=" + columnIndex);
patternSelectionHandler.handleSelection(rowIndex, columnIndex, patternName);
if (columnIndex == 0) {
onRowOut(tr);
@@ -136,12 +138,11 @@ public class SavedSearchGrid extends Grid {
}
private static String stylize(SavedSearch savedSearch) {
- String header = savedSearch.getName();
- if (savedSearch.getResultCount() != null) {
- header += " (" + savedSearch.getResultCount() + ")";
- }
- return "<span class=\"savedSearchesPanel-top\">" +
header + "</span>" + "<br/>" //
- + "<span class=\"savedSearchesPanel-bottom\">" +
savedSearch.getPattern() + "</span>";
+ String name = savedSearch.getName();
+ String pattern = savedSearch.getPattern();
+ String count = savedSearch.getResultCount() == null ? "" :
String.valueOf(savedSearch.getResultCount());
+ return "<span class=\"savedSearchesPanel-top\">" + name
+ "</span> " + count + "<br/>" //
+ + "<span class=\"savedSearchesPanel-bottom\">" +
pattern + "</span>";
}
private static String trashify() {
commit 31d8a14d352f9caae312b82ae5149d9b808027e7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 13:04:28 2010 -0400
remove main method
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index c6bea22..15aa671 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -155,10 +155,4 @@ public class SavedSearchGrid extends Grid {
public String getSelectedItem() {
return "";
}
-
- public static void main(String[] args) {
- Grid grid = new Grid();
- grid.clear(true);
-
- }
}
commit 753e6988ea79857a00a6d90b0c4b0887fe63fdff
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 13:01:31 2010 -0400
add missing quote for attribute
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 9a0a83e..a132a39 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -54,7 +54,7 @@
actionListener="#{BrowseGroupsUIBean.clearDataModel}"
styleClass="buttonmed"
similarityGroupingId="searchRequest"
- requestDelay=50"
+ requestDelay="50"
ignoreDupResponses="true"
onclick="applySearchFilter(getElementCrossBrowser('patternField').value);">
<s:defaultAction/>
commit 965da8b99fea42c04bc8dc07cb54b405daa13a3d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 12:36:04 2010 -0400
BZ-610228: allow search expression errors to bubble up to the inventory browser
* create new SearchExpressionException runtime exception class
* update RHQL.g grammar file, short-cut and throw SearchExpressionException on error
* allow CriteriaQueryGenerator to directly pass SearchExpressionExceptions up to the
caller
* update the inventory browser layout file to use rich:messages to show ajax-errors
* add inventoryBrowserErrorPanel to list of rerendered objects when invoking
resource/group search
** (Note: 'requestDelay' attribute is required, otherwise msg is sometimes
lost)
* add exception handlers in Browse(Resource|Group)UIBean.fetchDataForPage to add
appropriate faces message on error
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
index 5c3368f..382e5e7 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java
@@ -66,19 +66,25 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean {
}
public PageList<ResourceGroupComposite> fetchPage(PageControl pc) {
- String search = getSearch();
- GroupCategory category = getCategory();
-
- ResourceGroupCriteria criteria = new ResourceGroupCriteria();
- criteria.setPageControl(pc);
- if (search != null && !search.trim().equals("")) {
- criteria.setSearchExpression(search);
+ try {
+ String search = getSearch();
+ GroupCategory category = getCategory();
+
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.setPageControl(pc);
+ if (search != null && !search.trim().equals("")) {
+ criteria.setSearchExpression(search);
+ }
+ criteria.addFilterGroupCategory(category);
+
+ PageList<ResourceGroupComposite> results;
+ results =
groupManager.findResourceGroupCompositesByCriteria(getSubject(), criteria);
+ return results;
+ } catch (Throwable t) {
+ FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed
to fetch results: "
+ + t.getMessage());
+ return new PageList<ResourceGroupComposite>(pc);
}
- criteria.addFilterGroupCategory(category);
-
- PageList<ResourceGroupComposite> results;
- results = groupManager.findResourceGroupCompositesByCriteria(getSubject(),
criteria);
- return results;
}
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
index d499979..be5a302 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java
@@ -76,21 +76,27 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean {
}
public PageList<ResourceComposite> fetchDataForPage(PageControl pc) {
- String search = getSearch();
- ResourceCategory category = getCategory();
-
- ResourceCriteria criteria = new ResourceCriteria();
- criteria.setPageControl(pc);
- criteria.addFilterResourceCategory(category);
- if (search != null && !search.trim().equals("")) {
- criteria.setSearchExpression(search);
+ try {
+ String search = getSearch();
+ ResourceCategory category = getCategory();
+
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.setPageControl(pc);
+ criteria.addFilterResourceCategory(category);
+ if (search != null && !search.trim().equals("")) {
+ criteria.setSearchExpression(search);
+ }
+ // lineage info is now provided by the disambiguation stuff
+ // criteria.fetchParentResource(true);
+
+ PageList<ResourceComposite> results;
+ results = resourceManager.findResourceCompositesByCriteria(getSubject(),
criteria);
+ return results;
+ } catch (Throwable t) {
+ FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed
to fetch results: "
+ + t.getMessage());
+ return new PageList<ResourceComposite>(pc);
}
- // lineage info is now provided by the disambiguation stuff
- // criteria.fetchParentResource(true);
-
- PageList<ResourceComposite> results;
- results = resourceManager.findResourceCompositesByCriteria(getSubject(),
criteria);
- return results;
}
protected IntExtractor<ResourceComposite> getResourceIdExtractor() {
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 399ab6a..9a0a83e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -49,10 +49,13 @@
</ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO"
- reRender="browseGroupsDataTable,
browseGroupsDataTableScroller"
+ reRender="browseGroupsDataTable,
browseGroupsDataTableScroller, inventoryBrowserErrorPanel"
status="commonStatus"
actionListener="#{BrowseGroupsUIBean.clearDataModel}"
styleClass="buttonmed"
+ similarityGroupingId="searchRequest"
+ requestDelay=50"
+ ignoreDupResponses="true"
onclick="applySearchFilter(getElementCrossBrowser('patternField').value);">
<s:defaultAction/>
</a4j:commandButton>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index fc6741e..4bfb91a 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -50,10 +50,13 @@
</ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO"
- reRender="browseResourcesDataTable,
browseResourcesDataTableScroller"
+ reRender="browseResourcesDataTable,
browseResourcesDataTableScroller, inventoryBrowserErrorPanel"
status="commonStatus"
actionListener="#{BrowseResourcesUIBean.clearDataModel}"
styleClass="buttonmed"
+ similarityGroupingId="searchRequest"
+ requestDelay="50"
+ ignoreDupResponses="true"
onclick="applySearchFilter(getElementCrossBrowser('patternField').value);">
<s:defaultAction/>
</a4j:commandButton>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml
index ceb1d3e..0b67eae 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml
@@ -29,13 +29,6 @@
<ui:define name="tabBar">
- <a4j:region>
- <h:form>
- <a4j:poll interval="60000" timeout="5000"
- reRender="browserTabBarPanel"
status="commonStatus" />
- </h:form>
- </a4j:region>
-
<onc:tabBar id="browserTabBarPanel"
selectedTabName="#{selectedTabName}"
<onc:tab name="Resources"
displayName="Resources
#{InventorySummaryUIBean.resourceCount}"
@@ -75,15 +68,16 @@
<p />
- <h:messages showSummary="true"
- showDetail="true"
- infoClass="InfoBlock"
- warnClass="WarnBlock"
- errorClass="ErrorBlock"
- fatalClass="FatalBlock"
- globalOnly="false"
- layout="table"
- width="100%"/>
+ <rich:messages id="inventoryBrowserErrorPanel"
+ showSummary="true"
+ showDetail="true"
+ infoClass="InfoBlock"
+ warnClass="WarnBlock"
+ errorClass="ErrorBlock"
+ fatalClass="FatalBlock"
+ globalOnly="false"
+ layout="table"
+ width="100%"/>
</ui:define>
<ui:define name="content">
diff --git
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
index 0769fd6..899b07e 100644
---
a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
+++
b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g
@@ -72,6 +72,13 @@ tokens {
package org.rhq.enterprise.server.search;
}
+@parser::members {
+ @Override
+ public void reportError(RecognitionException e) {
+ throw new org.rhq.enterprise.server.search.SearchExpressionException("search
pattern error");
+ }
+}
+
/*
* parser rules
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java
new file mode 100644
index 0000000..dc1a91e
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.server.search;
+
+/**
+ * An exception to be ignored by the PagedListDataModel when fetching the page in a
guarded fashion,
+ * so that the first time an exception occurs it is allowed to bubble up to the surface.
This exception
+ * is generated by the antlr-based parser upon capturing a RecognitionException from the
lexer.
+ *
+ * @author Joseph Marques
+ */
+public class SearchExpressionException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public SearchExpressionException() {
+ }
+
+ public SearchExpressionException(String message) {
+ super(message);
+ }
+
+ public SearchExpressionException(Throwable cause) {
+ super(cause);
+ }
+
+ public SearchExpressionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
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 459d7d4..a1b809f 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
@@ -52,6 +52,7 @@ import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.core.server.PersistenceUtility;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.enterprise.server.search.SearchExpressionException;
import org.rhq.enterprise.server.search.execution.SearchTranslationManager;
/**
@@ -533,9 +534,12 @@ public final class CriteriaQueryGenerator {
if (translatedJPQL != null) {
searchExpressionWhereClause = translatedJPQL;
}
+ } catch (SearchExpressionException see) {
+ throw see; // bubble up to the top
} catch (Exception e) {
LOG.error("Could not get JPQL translation for '" +
searchExpression + "': "
+ ThrowableUtil.getAllMessages(e, true));
+ throw new RuntimeException(e);
}
}
commit a52cd12da95dd8433d4d2f9b1df1e1bc1a212c36
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 12:29:17 2010 -0400
cache user preferences uibean in the page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index f767b5a..2c4e779 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -647,6 +647,8 @@ v <rich:menuItem submitMode="none"
<input type="button" value="Close"
onclick="Richfaces.hideModalPanel('aboutPanel');"/>
</rich:modalPanel>
+<a4j:keepAlive beanName="UserPreferencesUIBean"/>
+
</h:form>
commit af7bc88bdaca80ebdbd1fc7efdba2cbb6b529538
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jul 13 12:28:53 2010 -0400
do not propogate faces messages for ajax requests
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java
index f98ea9a..d1fbc83 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java
@@ -30,6 +30,7 @@ import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import org.ajax4jsf.context.AjaxContext;
import org.jetbrains.annotations.Nullable;
import org.jboss.seam.core.Manager;
@@ -50,6 +51,10 @@ public class FacesMessagePropogationPhaseListener implements
PhaseListener {
}
public void beforePhase(PhaseEvent event) {
+ if (AjaxContext.getCurrentInstance().isAjaxRequest()) {
+ return;
+ }
+
PhaseId phaseId = event.getPhaseId();
if (phaseId == PhaseId.RESTORE_VIEW) {
// We want to add the saved messages back to the context immediately after
the view is restored.
@@ -61,6 +66,10 @@ public class FacesMessagePropogationPhaseListener implements
PhaseListener {
}
public void afterPhase(PhaseEvent event) {
+ if (AjaxContext.getCurrentInstance().isAjaxRequest()) {
+ return;
+ }
+
PhaseId phaseId = event.getPhaseId();
if (phaseId == PhaseId.INVOKE_APPLICATION) {
// We want to store the messages in the context after the application has
done its processing.
commit f96d9462ee44c169a720f8deb80e4703dd60d0ad
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Jul 13 17:17:50 2010 +0200
BZ 612189 - reverting the resource keys of apache server and vhost resource types to
the format used in the last released version of JON.
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 edffb23..9c2e448 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
@@ -220,8 +220,18 @@ public class ApacheServerDiscoveryComponent implements
ResourceDiscoveryComponen
name = uri.getHost() + ":" + uri.getPort();
}
+ String serverRoot =
pluginConfig.getSimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT)
+ .getStringValue();
+
+ String key = FileUtils.getCanonicalPath(serverRoot);
+
+ //BZ 612189 - reverting to the serverRoot as the resource key temporarily until
we have the resource
+ //upgrade functionality ready (BZ 592038). Uncommenting the line below will make
the resource key totally unique
+ //(see BZ 593270).
+ //key += "|" + httpdConf;
+
DiscoveredResourceDetails resourceDetails = new
DiscoveredResourceDetails(discoveryContext.getResourceType(),
- httpdConf, name, version, PRODUCT_DESCRIPTION, pluginConfig, processInfo);
+ key, name, version, PRODUCT_DESCRIPTION, pluginConfig, processInfo);
log.debug("Apache Server resource details created: " +
resourceDetails);
return resourceDetails;
}
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 73d6ee5..d97d9fc 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
@@ -71,7 +71,7 @@ import org.rhq.plugins.www.util.WWWUtils;
*/
public class ApacheVirtualHostServiceComponent implements
ResourceComponent<ApacheServerComponent>, MeasurementFacet,
ConfigurationFacet, DeleteResourceFacet, CreateChildResourceFacet {
- private final Log log = LogFactory.getLog(this.getClass());
+ private static final Log log =
LogFactory.getLog(ApacheVirtualHostServiceComponent.class);
public static final String URL_CONFIG_PROP = "url";
public static final String MAIN_SERVER_RESOURCE_KEY = "MainServer";
@@ -473,6 +473,77 @@ 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();
+
+ //figure out the servername and addresses of this virtual host
+ //from the resource key.
+ String vhostServerName = null;
+ String[] vhostAddressStrings = null;
+ int pipeIdx = resourceKey.indexOf('|');
+ if (pipeIdx >= 0) {
+ vhostServerName = resourceKey.substring(0, pipeIdx);
+ }
+ vhostAddressStrings = resourceKey.substring(pipeIdx + 1).split(" ");
+
+ ApacheDirectiveTree tree = parent.loadParser();
+
+ //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])) {
+ HttpdAddressUtility.Address serverAddr =
parent.getAddressUtility().getMainServerSampleAddress(tree, null, 0);
+ if (serverAddr != null) {
+ vhostAddresses.add(serverAddr);
+ }
+ } 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);
+ }
+ }
+ }
+
+ //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 (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;
+ }
+
/**
* @return the index of the virtual host that identifies it in SNMP
* @throws Exception on SNMP error
@@ -494,79 +565,13 @@ public class ApacheVirtualHostServiceComponent implements
ResourceComponent<Apac
names = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_NAME);
ports = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_PORT);
- Iterator<SNMPValue> namesIterator = names.iterator();
- Iterator<SNMPValue> portsIterator = ports.iterator();
-
- //figure out the servername and addresses of this virtual host
- //from the resource key.
- String vhostServerName = null;
- String[] vhostAddressStrings = null;
- String key = resourceContext.getResourceKey();
- int pipeIdx = key.indexOf('|');
- if (pipeIdx >= 0) {
- vhostServerName = key.substring(0, pipeIdx);
- }
- vhostAddressStrings = key.substring(pipeIdx + 1).split(" ");
-
- ApacheDirectiveTree tree = loadParser();
- //convert the vhost addresses into fully qualified ip/port addresses
- List<HttpdAddressUtility.Address> vhostAddresses = new
ArrayList<HttpdAddressUtility.Address>(
- vhostAddressStrings.length);
-
- ApacheServerComponent parent = resourceContext.getParentResourceComponent();
- if (vhostAddressStrings.length == 1 &&
MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
- HttpdAddressUtility.Address serverAddr =
parent.getAddressUtility().getMainServerSampleAddress(tree, null, 0);
- if (serverAddr != null) {
- vhostAddresses.add(serverAddr);
- }
- } 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);
- }
- }
- }
-
- //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 (bestMatch != null) {
- String nameOID = bestMatch.getOID();
- snmpWwwServiceIndex =
Integer.parseInt(nameOID.substring(nameOID.lastIndexOf(".") + 1));
- } else {
- log.warn("Unable to match the Virtual Host [" + key + "]
with any of the SNMP advertised vhosts: " + names + ". It won't be possible
to monitor the Virtual Host.");
- }
+ snmpWwwServiceIndex =
getMatchingWwwServiceIndex(resourceContext.getParentResourceComponent(),
resourceContext.getResourceKey(), names, ports);
}
return snmpWwwServiceIndex;
}
- private int matchRate(List<HttpdAddressUtility.Address> addresses,
HttpdAddressUtility.Address addressToCheck) {
+ private 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;
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 b308dd4..4a32e27 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
@@ -38,6 +38,9 @@ import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
import org.rhq.plugins.apache.util.HttpdAddressUtility.Address;
+import org.rhq.plugins.www.snmp.SNMPException;
+import org.rhq.plugins.www.snmp.SNMPSession;
+import org.rhq.plugins.www.snmp.SNMPValue;
/**
* Discovers VirtualHosts under the Apache server by reading them out from Augeas tree
constructed
@@ -62,10 +65,14 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements
ResourceDisco
Set<DiscoveredResourceDetails> discoveredResources = new
LinkedHashSet<DiscoveredResourceDetails>();
+ //BZ 612189 - prepare for the legacy overrides. We need to revert to the
old-style resource keys until
+ //resource upgrade functionality is ready.
+ SnmpWwwServiceIndexes snmpDiscoveries = getSnmpDiscoveries(context);
+
ApacheServerComponent serverComponent = context.getParentResourceComponent();
ApacheDirectiveTree tree = serverComponent.loadParser();
//first define the root server as one virtual host
- discoverMainServer(context, discoveredResources);
+ discoverMainServer(context, discoveredResources, snmpDiscoveries);
ResourceType resourceType = context.getResourceType();
@@ -146,6 +153,12 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements
ResourceDisco
resourceName = resourceKey;
}
+ //BZ 612189 - remove this once we have resource upgrade
+ if (snmpDiscoveries != null) {
+ String legacyResourceKey = getLegacyResourceKey(context, resourceKey,
snmpDiscoveries);
+ resourceKey = legacyResourceKey != null ? legacyResourceKey :
resourceKey;
+ }
+
discoveredResources.add(new DiscoveredResourceDetails(resourceType,
resourceKey, resourceName, null, null,
pluginConfiguration, null));
}
@@ -155,7 +168,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements
ResourceDisco
private void discoverMainServer(ResourceDiscoveryContext<ApacheServerComponent>
context,
- Set<DiscoveredResourceDetails> discoveredResources) throws Exception {
+ Set<DiscoveredResourceDetails> discoveredResources, SnmpWwwServiceIndexes
snmpDiscoveries) throws Exception {
ResourceType resourceType = context.getResourceType();
Configuration mainServerPluginConfig = context.getDefaultPluginConfiguration();
@@ -185,9 +198,101 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements
ResourceDisco
mainServerPluginConfig.put(rtLogProp);
}
+ String key = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY;
+
+ //BZ 612189 - remove this once we have resource upgrade
+ if (snmpDiscoveries != null) {
+ String legacyKey = getLegacyResourceKey(context, key, snmpDiscoveries);
+ key = legacyKey != null ? legacyKey : key;
+ }
+
DiscoveredResourceDetails mainServer = new
DiscoveredResourceDetails(resourceType,
- ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY, "Main",
null, null,
+ key, "Main", null, null,
mainServerPluginConfig, null);
discoveredResources.add(mainServer);
}
+
+ /**
+ * @deprecated remove this once we have resource upgrade
+ * @param discoveryContext
+ * @param newStyleResourceKey
+ * @param snmpDiscoveries
+ * @return
+ */
+ @Deprecated
+ private String
getLegacyResourceKey(ResourceDiscoveryContext<ApacheServerComponent>
discoveryContext, String newStyleResourceKey, SnmpWwwServiceIndexes snmpDiscoveries) {
+ int snmpWwwServiceIndex =
ApacheVirtualHostServiceComponent.getMatchingWwwServiceIndex(discoveryContext.getParentResourceComponent(),
newStyleResourceKey, snmpDiscoveries.names, snmpDiscoveries.ports);
+
+ if (snmpWwwServiceIndex < 1) {
+ return null;
+ } else {
+ String host = snmpDiscoveries.names.get(snmpWwwServiceIndex - 1).toString();
+ String fullPort = snmpDiscoveries.ports.get(snmpWwwServiceIndex -
1).toString();
+
+ // 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);
+ return host + ":" + port;
+ }
+ }
+
+ /**
+ * @deprecated remove this once we have resource upgrade
+ * @param discoveryContext
+ * @return
+ */
+ @Deprecated
+ private SnmpWwwServiceIndexes
getSnmpDiscoveries(ResourceDiscoveryContext<ApacheServerComponent> discoveryContext)
{
+ try {
+ SNMPSession snmpSession =
discoveryContext.getParentResourceComponent().getSNMPSession();
+ List<SNMPValue> nameValues;
+ List<SNMPValue> portValues;
+ SNMPValue descValue;
+
+ 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);
+ }
+
+ try {
+ // Just get the first one - they are all the same.
+ descValue = snmpSession.getNextValue(SNMPConstants.COLUMN_VHOST_DESC);
+ } catch (SNMPException e) {
+ throw new Exception("Error getting SNMP value: " +
SNMPConstants.COLUMN_VHOST_DESC + ": " + e.getMessage(),
+ e);
+ }
+
+ SnmpWwwServiceIndexes ret = new SnmpWwwServiceIndexes();
+ ret.names = nameValues;
+ ret.ports = portValues;
+ ret.desc = descValue;
+
+ return ret;
+ } catch (Exception e) {
+ log.warn("Error while trying to contact SNMP of the apache server "
+ discoveryContext.getParentResourceContext().getResourceKey());
+ return null;
+ }
+ }
+
+ /**
+ * @deprecated remove this once we have resource upgrade
+ *
+ * @author Lukas Krejci
+ */
+ @Deprecated
+ private static class SnmpWwwServiceIndexes {
+ public List<SNMPValue> names;
+ public List<SNMPValue> ports;
+ public SNMPValue desc;
+ }
}
\ No newline at end of file
commit 282c87996fc5bd73f293086cf730d0be9922e025
Merge: 1d91fa3... 57a0a39...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 13 11:09:29 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 57a0a3942317494496b730708279fae1dbc45347
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Jul 13 12:50:19 2010 +0200
BZ 604032 - Adding a little bit of margin between resource type and resource name in
the disambiguated lists.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
index 6859fe2..e6ad8cc 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css
@@ -2375,6 +2375,7 @@ ul.radio-group .unspecified {
/* Disambiguated resources formatting */
.disambiguated-resource-type {
font-style: italic;
+ margin-right: 0.4em;
}
.disambiguated-resource-plugin {
commit 9ace7803d6e7bc59babd06687a7c51ce3b331e61
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Tue Jul 13 09:46:04 2010 +0200
Add a new simple bundle generator. This obviously has room for improvement.
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
new file mode 100644
index 0000000..465a9eb
--- /dev/null
+++ b/modules/helpers/bundleGen/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>rhq-helpers</artifactId>
+ <groupId>org.rhq.helpers</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>bundleGen</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.rhq.helpers.bundleGen.BundleGen</mainClass>
+ <packageName>org.rhq.helpers.bundleGen</packageName>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <archive>
+ <manifest>
+ <mainClass>org.rhq.helpers.bundleGen.BundleGen</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id> <!-- this is used for inheritance
merges -->
+ <phase>package</phase> <!-- append to the packaging
phase. -->
+ <goals>
+ <goal>attached</goal> <!-- goals == mojos -->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.11</version>
+ </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
new file mode 100644
index 0000000..289b36f
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
@@ -0,0 +1,167 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.helpers.bundleGen;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Writer;
+import java.text.MessageFormat;import java.util.HashMap;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import freemarker.cache.ClassTemplateLoader;
+import freemarker.cache.MultiTemplateLoader;
+import freemarker.cache.TemplateLoader;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.util.stream.StreamUtil;
+
+/**
+ * Main class of a (simple) bundle creator
+ * @author Heiko W. Rupp
+ */
+public class BundleGen {
+
+ private final Log log = LogFactory.getLog(BundleGen.class);
+
+ public static void main(String[] args) throws Exception {
+ BundleGen bg = new BundleGen();
+ bg.run();
+ }
+
+
+ private void run() {
+
+ ResourceBundle resourceBundle = ResourceBundle.getBundle("bundleGen");
+ Props props = new Props();
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
+
+ // Ask the user
+ XmlQuestionsReader xqr = new XmlQuestionsReader("bundleQuestions");
+ try {
+ xqr.readQuestions(br,props);
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ return;
+ }
+
+ String bundleTargetDirectory = "/tmp"; // TODO ask user?
+
+ String tmpDirPath = System.getProperty("java.io.tmpdir");
+ log.debug("Java Tmp dir is " + tmpDirPath);
+
+ String genPath = tmpDirPath + "/" + "bundleGen";
+ File tmpDir = new File(genPath); // TODO path separator
+ if (!tmpDir.exists() && !tmpDir.mkdir()) {
+ log.error(resourceBundle.getString("no.tmp.dir"));
+ System.exit(1);
+ }
+
+ createFile(props,"deployMain","deploy.xml", genPath);
+
+ try {
+ File outFile = new File(genPath,"generatedBundle.zip");
+ FileOutputStream fos = new FileOutputStream(outFile);
+ ZipOutputStream zos = new ZipOutputStream(fos);
+
+ copyToOutputStream(zos,genPath,"deploy.xml");
+ copyToOutputStream(zos,props.getContentDir(),props.getBundleFile());
+ zos.flush();
+ zos.close();
+
+ File targetFile = new File(bundleTargetDirectory + "/" +
"generatedBundle.zip");
+ boolean success = outFile.renameTo(targetFile);
+ if (success)
+
log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"),
targetFile.getAbsolutePath()));
+ else {
+ log.debug("Could not rename file to ["+
targetFile.getAbsolutePath()+"]");
+
log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"),
outFile.getAbsolutePath()));
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace(); // TODO: Customise this generated block
+ }
+
+ }
+
+ /**
+ * Copy a file to the passed Zip Output Stream
+ * @param zos OutputStream for a new Zip file
+ * @param filedir directory of the file to copy
+ * @param fileName name of the file to copy
+ * @throws IOException If anything here goes wrong.
+ */
+ private void copyToOutputStream(ZipOutputStream zos,String filedir, String fileName)
throws IOException {
+ ZipEntry entry = new ZipEntry(fileName);
+ zos.putNextEntry(entry);
+ FileInputStream fis = new FileInputStream(new File(filedir , fileName));
+ StreamUtil.copy(fis,zos,false);
+ zos.flush();
+ log.debug("Added ["+ fileName + "]");
+ fis.close();
+ }
+
+ /**
+ * Apply a freemarker template to generate a file
+ * @param props The properties used to create the respective file
+ * @param template The name of the template without .ftl suffix
+ * @param fileName The name of the file to create
+ * @param directory The name of the directory to create in
+ */
+ public void createFile(Props props, String template, String fileName, String
directory) {
+
+ try {
+ log.info("Trying to generate " + directory + "/" +
fileName);
+ Configuration config = new Configuration();
+
+ ClassTemplateLoader ctl = new ClassTemplateLoader(getClass(), "/");
+ TemplateLoader[] loaders = new TemplateLoader[] { ctl };
+ MultiTemplateLoader mtl = new MultiTemplateLoader(loaders);
+
+ config.setTemplateLoader(mtl);
+
+ Template templ = config.getTemplate(template + ".ftl");
+
+ Writer out = new BufferedWriter(new FileWriter(new File(directory,
fileName)));
+ Map<String, Props> root = new HashMap<String, Props>();
+ root.put("props", props);
+ templ.process(root, out);
+ out.flush();
+ out.close();
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ } catch (TemplateException te) {
+ te.printStackTrace();
+ }
+ }
+}
diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java
new file mode 100644
index 0000000..322ce74
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java
@@ -0,0 +1,97 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.helpers.bundleGen;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * TODO: Document this
+ * @author Heiko W. Rupp
+ */
+public class Props {
+
+ private final Log log = LogFactory.getLog(Props.class);
+
+
+ private String project;
+ private String bundleName;
+ private String bundleVersion;
+ private String bundleDescription;
+ private String bundleFile;
+ private String replacePattern;
+ private String contentDir;
+
+ public String getProject() {
+ return project;
+ }
+
+ public void setProject(String project) {
+ this.project = project;
+ }
+
+ public String getBundleName() {
+ return bundleName;
+ }
+
+ public void setBundleName(String bundleName) {
+ this.bundleName = bundleName;
+ }
+
+ public String getBundleVersion() {
+ return bundleVersion;
+ }
+
+ public void setBundleVersion(String bundleVersion) {
+ this.bundleVersion = bundleVersion;
+ }
+
+ public String getBundleDescription() {
+ return bundleDescription;
+ }
+
+ public void setBundleDescription(String bundleDescription) {
+ this.bundleDescription = bundleDescription;
+ }
+
+ public String getBundleFile() {
+ return bundleFile;
+ }
+
+ public void setBundleFile(String bundleFile) {
+ this.bundleFile = bundleFile;
+ }
+
+ public String getReplacePattern() {
+ return replacePattern;
+ }
+
+ public void setReplacePattern(String replacePattern) {
+ this.replacePattern = replacePattern;
+ }
+
+ public String getContentDir() {
+ return contentDir;
+ }
+
+ public void setContentDir(String contentDir) {
+ this.contentDir = contentDir;
+ }
+}
+
diff --git
a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
new file mode 100644
index 0000000..e47da34
--- /dev/null
+++
b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java
@@ -0,0 +1,200 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.helpers.bundleGen;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.Locale;
+import java.lang.reflect.Method;
+import java.util.ResourceBundle;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Reads questions from an XML file and shows them to the user.
+ * The reader first tries to load a locale based version of the
+ * questions (file.<locale>.xml) if this fails, it falls back
+ * to using a default version (file.xml)
+ *
+ * @author Heiko W. Rupp
+ */
+public class XmlQuestionsReader {
+
+ private final Log log = LogFactory.getLog(XmlQuestionsReader.class);
+ String baseName;
+ ResourceBundle resourceBundle = ResourceBundle.getBundle("bundleGen");
+
+ /**
+ * Create a new XmlQuestionReader
+ * @param fileBaseName the basename of a file - sans .xml suffix!
+ */
+ public XmlQuestionsReader(String fileBaseName) {
+ baseName = fileBaseName;
+ }
+
+ /**
+ * Present the questions to the user and read answers from the provided
<i>reader</i>.
+ * @param reader Buffered Reader to read from. Usually an
InputStreamReader(System.in)
+ * @param props Props object to fill the answers into.
+ * @throws FileNotFoundException if no question file is found
+ * @throws Exception On various other occasions
+ */
+ public void readQuestions(BufferedReader reader, Props props) throws Exception {
+
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Class<? extends XmlQuestionsReader> clazz = getClass();
+ String lang = Locale.getDefault().getLanguage();
+ InputStream input = clazz.getResourceAsStream("/"+baseName +
"_" + lang + ".xml");
+ if (input==null) {
+ log.debug("No localized version of " + baseName + " found,
locale=" + lang);
+ log.debug("Now trying " + baseName);
+ input = clazz.getResourceAsStream("/"+baseName +".xml"
);
+ }
+ if (input == null) {
+ throw new FileNotFoundException("Input file [" + baseName + "]
not found");
+ }
+
+ Document doc = builder.parse(input);
+ Element root = doc.getDocumentElement(); // <questions>
+ NodeList questionNodes = root.getChildNodes();// "question"
+
+ for (int i = 0; i < questionNodes.getLength(); i++ ) {
+ Node node = questionNodes.item(i);
+ if (node instanceof Element) {
+ Element question = (Element)node;
+ String prop = question.getAttribute("prop");
+ String type = question.getAttribute("type");
+ if (type.equals(""))
+ type="string";
+ String aIf = question.getAttribute("if"); // TODO implement
+
+ if (!isValidType(type)) {
+ System.err.println("Type " + type + " is invalid in
" + question );
+ return;
+ }
+ Element text = (Element)
question.getElementsByTagName("text").item(0);
+ NodeList prefillNodes =
question.getElementsByTagName("prefill");
+ String prefill = null;
+ if (prefillNodes.getLength()>0) {
+ prefill = prefillNodes.item(0).getTextContent();
+ }
+ NodeList helpNodes = question.getElementsByTagName("help");
+ String help = null;
+ if (helpNodes.getLength()>0) {
+ help = helpNodes.item(0).getTextContent();
+ }
+
+ boolean isBool = false;
+ System.out.print(text.getTextContent());
+ if ("bool".equals(type)) {
+ isBool = true;
+ System.out.print(resourceBundle.getString("yes.no"));
+ }
+ if (prefill!=null) {
+ System.out.print("[" + prefill + "]");
+ }
+
+ String answer;
+ boolean helpRequested = false;
+ do {
+ helpRequested = false;
+ System.out.print(": ");
+ answer = reader.readLine();
+ if (answer.startsWith("?")) {
+ helpRequested = true;
+ if (help!=null) {
+ System.out.println(help);
+ }
+ else
+
System.out.println(resourceBundle.getString("no.help.available"));
+ }
+
+ } while (helpRequested);
+
+ String setterName = "set" + caps(prop);
+ Method setter;
+ if (isBool)
+ setter = Props.class.getMethod(setterName, Boolean.TYPE);
+ else
+ setter = Props.class.getMethod(setterName, String.class);
+
+ if (isBool) {
+ String yesString = resourceBundle.getString("yes.key");
+ if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString)) {
+ setter.invoke(props, true);
+ }
+ }
+ else if ("string".equals(type)) {
+ // If only return pressed and we have a prefill, use this.
+ if (prefill!= null && answer.length()==0) {
+ setter.invoke(props,prefill);
+ }
+ else {
+ if (!answer.startsWith("\n") &&
!answer.startsWith("\r") && !(answer.length() == 0))
+ setter.invoke(props,answer);
+ }
+ }
+ else {
+ // TODO
+ }
+ }
+
+
+
+
+ }
+ }
+ catch (Exception e) {
+ throw e;
+ }
+
+ }
+
+ /**
+ * Returns true if the passed type is a valid data type of the properties (not for a
single
+ * property).
+ * @param type A type as string
+ * @return true if its valid, false otherwise
+ */
+ private boolean isValidType(String type) {
+
+ if ("bool".equals(type) || "string".equals(type) ||
"resourceCategory".equals(type))
+ return true;
+
+ return false;
+ }
+
+ static String caps(String in) {
+ if (in == null)
+ return null;
+
+ return in.substring(0, 1).toUpperCase(Locale.getDefault()) + in.substring(1);
+ }
+}
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen.properties
b/modules/helpers/bundleGen/src/main/resources/bundleGen.properties
new file mode 100644
index 0000000..4d93074
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/bundleGen.properties
@@ -0,0 +1,5 @@
+no.help.available=Sorry, no help available for this topic
+yes.no=(y/N)
+yes.key=y
+no.tmp.dir=Can't generate tmp dir to write to
+bundle.ready=Your bundle is now ready in [{0}]
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
new file mode 100644
index 0000000..867c63f
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
@@ -0,0 +1,5 @@
+no.help.available=HierfŸr gibt es leider keine Hilfe
+yes.no=(j/N)
+no.tmp.dir=Kann kein temporŠres Verzeichnis zum Schreiben erzeugen
+bundle.ready=Das Bundle ist in [{0}]\\ verfŸgbar
+yes.key=j
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties
b/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties
new file mode 100644
index 0000000..dc6f76e
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties
@@ -0,0 +1,2 @@
+yes.no=(o/N)
+yes.key=o
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
new file mode 100644
index 0000000..94b5c14
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+<!-- DOCTYPE questions SYSTEM "questions.dtd"-->
+<questions>
+ <question prop="project">
+ <text>Please give the project name</text>
+ <prefill>myProject</prefill>
+ </question>
+ <question prop="bundleName">
+ <text>Please give the bundle name</text>
+ </question>
+ <question prop="bundleVersion">
+ <text>Please specify the bundle version</text>
+ <prefill>1.0</prefill>
+ </question>
+ <question prop="bundleDescription">
+ <text>Please describe your bundle</text>
+ </question>
+ <question prop="bundleFile">
+ <text>Please give the name (only) of your bundle content file</text>
+ </question>
+ <question prop="contentDir">
+ <text>Please give the directory (only) of your bundle content
file</text>
+ </question>
+ <question prop="replacePattern">
+ <text>Please give a patten of files to replace templates</text>
+ <help>E.g. *.jsp</help>
+ </question>
+</questions>
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
new file mode 100644
index 0000000..41deb9c
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+<!-- DOCTYPE questions SYSTEM "questions.dtd"-->
+<questions>
+ <question prop="project">
+ <text>Bitte geben Sie den Projektnamen an</text>
+ <prefill>myProject</prefill>
+ </question>
+ <question prop="bundleName">
+ <text>Bitte geben Sie den Namen des Bundles an</text>
+ </question>
+ <question prop="bundleVersion">
+ <text>Bite spezifizieren Sie die Version des Bundles</text>
+ <prefill>1.0</prefill>
+ </question>
+ <question prop="bundleDescription">
+ <text>Bitte beschreiben Sie Ihr Bundle</text>
+ </question>
+ <question prop="bundleFile">
+ <text>Bitte geben Sie (nur) den Namen der Datei mit dem Bundle-Inhalt
an.</text>
+ </question>
+ <question prop="contentDir">
+ <text>Bitte geben Sie (nur) das Verzeichnis mit der Datei mit dem
Bundle-Inhalt an.</text>
+ </question>
+ <question prop="replacePattern">
+ <text>Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen an</text>
+ <help>Z.B. *.jsp</help>
+ </question>
+</questions>
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/deployMain.ftl
b/modules/helpers/bundleGen/src/main/resources/deployMain.ftl
new file mode 100644
index 0000000..21d53f7
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/deployMain.ftl
@@ -0,0 +1,60 @@
+<#--
+/*
+ * 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.
+ */
+-->
+<#-- @ftlvariable name="props"
type="org.rhq.helpers.bundleGen.Props" -->
+<?xml version="1.0"?>
+
+<project name="${props.project}" default="main"
+ xmlns:rhq="antlib:org.rhq.bundle">
+
+ <rhq:bundle name="${props.bundleName}"
+ version="${props.bundleVersion}"
+ description="${props.bundleDescription}">
+
+ <rhq:deployment-unit name="fixedForNow"
+ preinstallTarget="preinstall"
+ postinstallTarget="postinstall">
+
+ <rhq:archive name="${props.bundleFile}">
+ <#if props.replacePattern??>
+ <rhq:replace>
+ <rhq:fileset>
+ <include name="${props.replacePattern}"/>
+ </rhq:fileset>
+ </rhq:replace>
+ </#if>
+ </rhq:archive>
+
+ </rhq:deployment-unit>
+ </rhq:bundle>
+
+ <!-- needed by ant, do not remove -->
+ <target name="main"/>
+
+ <target name="preinstall">
+ <echo>Installing to ${r"${rhq.deploy.dir}"}...</echo>
+ </target>
+
+ <target name="postinstall">
+ <echo>Done installing to ${r"${rhq.deploy.dir}"}.</echo>
+ </target>
+
+
+</project>
\ No newline at end of file
diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd
b/modules/helpers/bundleGen/src/main/resources/questions.dtd
new file mode 100644
index 0000000..aa6ad32
--- /dev/null
+++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd
@@ -0,0 +1,36 @@
+
+<!-- root of all evil -->
+<!ELEMENT questions (question+)>
+
+<!-- one single question -->
+<!ELEMENT question (text, options?, prefill?, help?)>
+
+<!ATTLIST question
+ prop CDATA #REQUIRED
+ type (bool|string) #IMPLIED
+ if (true|false) #IMPLIED
+ strip (start|end|outer|all) #IMPLIED
+>
+
+
+
+<!-- The text to ask -->
+<!ELEMENT text (#PCDATA)>
+
+<!-- The expected return type -->
+<!ELEMENT type (#PCDATA)>
+
+<!-- possible options for the return value -->
+<!ELEMENT options (option+)>
+
+<!-- one single option for the return type -->
+<!ELEMENT option (#PCDATA)>
+
+<!-- rules for prefilling a an answer -->
+<!ELEMENT prefill (#PCDATA)>
+
+<!-- A help text for this specific question that
+ gives more infomation about the feateure.
+ Can span multiple lines -->
+<!ELEMENT help (#PCDATA)>
+
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 154fc0f..8fa853a 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -37,6 +37,7 @@
<!-- plugin generator -->
<module>pluginGen</module>
<module>pluginAnnotations</module>
+ <module>bundleGen</module>
</modules>
commit 1d91fa3e29f338c0f9a30092d48052020f993bd1
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 12 18:22:48 2010 -0400
A bunch of changes to handle discrepencies between
the results of dbsetup and dbupgrade (from 2.3.1).
Unfortunately, these differences went out with
3.0.0.final meaning dbs at 2.88 can still differ in
structure depending on whether they were
new or upgraded.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d536ce6..ccc3b31 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.88</db.schema.version>
+ <db.schema.version>2.90</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml
index bce92a3..68e7635 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml
@@ -33,8 +33,6 @@
<column name="DAMPENING_VALUE_UNITS" type="SMALLINT"/>
<column name="DAMPENING_PERIOD" type="INTEGER"/>
<column name="DAMPENING_PERIOD_UNITS"
type="SMALLINT"/>
-
- <column name="OPERATION_DEF_ID" type="INTEGER"
references="RHQ_OPERATION_DEF(ID)"/>
</table>
<table name="RHQ_ALERT_DAMPEN_EVENT">
@@ -74,7 +72,6 @@
primarykey="true" required="true"
type="INTEGER"/>
<column name="ALERT_DEFINITION_ID" required="false"
type="INTEGER" references="RHQ_ALERT_DEFINITION(ID)"/>
<column name="CTIME" required="true"
type="LONG"/>
- <column name="TRIGGERED_OPERATION" required="false"
type="VARCHAR2" size="255"/>
<column name="RECOVERY_ID" type="INTEGER"
required="true"/>
<!-- required, but 0 effectively means null -->
<column name="WILL_RECOVER" required="true"
default="false" type="BOOLEAN"/>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
index c6cbafd..dec8587 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
@@ -433,7 +433,7 @@
<column name="ID" default="sequence-only"
initial="10001" primarykey="true" required="true"
type="INTEGER"/>
<column name="ADVISORY_ID" type="INTEGER"
required="true" references="RHQ_ADVISORY"/>
<column name="CVE_ID" type="INTEGER"
required="true" references="RHQ_CVE"/>
- <column name="LAST_MODIFIED" type="LONG"
required="false"/>
+ <column name="LAST_MODIFIED" type="LONG"
required="true"/>
<index name="RHQ_ADVISORY_CVE_IDX" unique="true">
<field ref="ADVISORY_ID"/>
@@ -581,7 +581,7 @@
<column name="STATUS" type="VARCHAR2"
required="true" size="16"/>
<column name="CTIME" type="LONG"
required="true"/>
- <index name="RHQ_BUNDLE_RES_DEP_UNIQUE" unique="true">
+ <index name="RHQ_BUNDLE_RES_DEPLOY_IDX" unique="true">
<field ref="BUNDLE_DEPLOYMENT_ID"/>
<field ref="RESOURCE_ID"/>
</index>
@@ -601,8 +601,8 @@
</table>
<table name="RHQ_TAGGING_BUNDLE_MAP">
- <column name="BUNDLE_ID" type="INTEGER"
references="RHQ_BUNDLE"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="BUNDLE_ID" type="INTEGER"
required="true" references="RHQ_BUNDLE"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_BUNDLE_MAP_KEY">
<primaryKey>
<field ref="BUNDLE_ID"/>
@@ -612,8 +612,8 @@
</table>
<table name="RHQ_TAGGING_BUNDLE_VERSION_MAP">
- <column name="BUNDLE_VERSION_ID" type="INTEGER"
references="RHQ_BUNDLE_VERSION"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="BUNDLE_VERSION_ID" type="INTEGER"
required="true" references="RHQ_BUNDLE_VERSION"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_BUNDLE_VER_MAP_KEY">
<primaryKey>
<field ref="BUNDLE_VERSION_ID"/>
@@ -623,8 +623,8 @@
</table>
<table name="RHQ_TAGGING_BUNDLE_DEPLOY_MAP">
- <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER"
references="RHQ_BUNDLE_DEPLOYMENT"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER"
required="true" references="RHQ_BUNDLE_DEPLOYMENT"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_BUNDLE_DEP_MAP_KEY">
<primaryKey>
<field ref="BUNDLE_DEPLOYMENT_ID"/>
@@ -634,8 +634,8 @@
</table>
<table name="RHQ_TAGGING_BUNDLE_DEST_MAP">
- <column name="BUNDLE_DESTINATION_ID" type="INTEGER"
references="RHQ_BUNDLE_DESTINATION"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="BUNDLE_DESTINATION_ID" type="INTEGER"
required="true" references="RHQ_BUNDLE_DESTINATION"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_BUNDLE_DES_MAP_KEY">
<primaryKey>
<field ref="BUNDLE_DESTINATION_ID"/>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index 7c51ef7..da048e1 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -245,8 +245,8 @@
</table>
<table name="RHQ_TAGGING_RESOURCE_MAP">
- <column name="RESOURCE_ID" type="INTEGER"
references="RHQ_RESOURCE"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="RESOURCE_ID" type="INTEGER"
required="true" references="RHQ_RESOURCE"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_RESOURCE_MAP_KEY">
<primaryKey>
<field ref="RESOURCE_ID"/>
@@ -256,8 +256,8 @@
</table>
<table name="RHQ_TAGGING_RES_GROUP_MAP">
- <column name="RESOURCE_GROUP_ID" type="INTEGER"
references="RHQ_RESOURCE_GROUP"/>
- <column name="TAG_ID" type="INTEGER"
references="RHQ_TAGGING"/>
+ <column name="RESOURCE_GROUP_ID" type="INTEGER"
required="true" references="RHQ_RESOURCE_GROUP"/>
+ <column name="TAG_ID" type="INTEGER"
required="true" references="RHQ_TAGGING"/>
<constraint name="RHQ_TAGGING_RES_GROUP_MAP_KEY">
<primaryKey>
<field ref="RESOURCE_GROUP_ID"/>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 7f8f9da..b43824d 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2186,7 +2186,7 @@
<schema-alterColumn table="RHQ_ADVISORY_PACKAGE"
column="LAST_MODIFIED" nullable="false" />
<schema-directSQL>
<statement>
- CREATE UNIQUE INDEX RHQ_ADVISORY_PACKAGE_UQ ON
RHQ_ADVISORY_PACKAGE ( ADVISORY_ID, PACKAGE_VERSION_ID )
+ CREATE UNIQUE INDEX RHQ_ADVISORY_PACKAGE_IDX ON
RHQ_ADVISORY_PACKAGE ( ADVISORY_ID, PACKAGE_VERSION_ID )
</statement>
<statement>
ALTER TABLE RHQ_ADVISORY_PACKAGE
@@ -2227,7 +2227,7 @@
<schema-alterColumn table="RHQ_ADVISORY_CVE"
column="LAST_MODIFIED" nullable="false" />
<schema-directSQL>
<statement>
- CREATE UNIQUE INDEX RHQ_ADVISORY_CVE_UQ ON RHQ_ADVISORY_CVE (
ADVISORY_ID, CVE_ID )
+ CREATE UNIQUE INDEX RHQ_ADVISORY_CVE_IDX ON RHQ_ADVISORY_CVE (
ADVISORY_ID, CVE_ID )
</statement>
<statement>
ALTER TABLE RHQ_ADVISORY_CVE
@@ -2259,7 +2259,7 @@
<schema-alterColumn table="RHQ_ADVISORY_BUGLIST"
column="LAST_MODIFIED" nullable="false" />
<schema-directSQL>
<statement>
- CREATE UNIQUE INDEX RHQ_ADVISORY_BUGLIST_UQ ON
RHQ_ADVISORY_BUGLIST ( ADVISORY_ID, BUG_ID )
+ CREATE UNIQUE INDEX RHQ_ADVISORY_BUG_IDX ON RHQ_ADVISORY_BUGLIST (
ADVISORY_ID, BUG_ID )
</statement>
<statement>
ALTER TABLE RHQ_ADVISORY_BUGLIST
@@ -2621,8 +2621,8 @@
FOREIGN KEY (RESOURCE_ID)
REFERENCES RHQ_RESOURCE (ID)
</statement>
- <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique
constraint on def-resource mapping">
- CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX
+ <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique
constraint on dep-resource mapping">
+ CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_IDX
ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID)
</statement>
</schema-directSQL>
@@ -2695,23 +2695,19 @@
</statement>
</schema-directSQL>
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="ID" nullable="FALSE" />
-
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="CONTEXT" columnType="VARCHAR2" precision="25" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="CONTEXT" columnType="VARCHAR2" precision="25" />
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="CONTEXT" nullable="FALSE" />
-
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="NAME" columnType="VARCHAR2" precision="200" />
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="DESCRIPTION" columnType="VARCHAR2" precision="500"
/>
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="PATTERN" columnType="VARCHAR2" precision="1000"
/>
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="NAME" columnType="VARCHAR2" precision="200" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="DESCRIPTION" columnType="VARCHAR2" precision="500"
/>
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="PATTERN" columnType="VARCHAR2" precision="1000"
/>
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="PATTERN" nullable="FALSE" />
-
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="JPQL_TRANSLATION" columnType="VARCHAR2"
precision="4000" />
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="LAST_COMPUTE_TIME" columnType="LONG" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="JPQL_TRANSLATION" columnType="VARCHAR2"
precision="4000" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="LAST_COMPUTE_TIME" columnType="LONG" />
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="LAST_COMPUTE_TIME" nullable="FALSE" />
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="RESULT_COUNT" columnType="LONG" />
-
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="SUBJECT_ID" columnType="INTEGER" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="RESULT_COUNT" columnType="LONG" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="SUBJECT_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="SUBJECT_ID" nullable="FALSE" />
- <schema-addColumn table="RHQ_SAVED_SEARCH"
column="GLOBAL" columnType="BOOLEAN" />
+ <schema-addColumn table="RHQ_SAVED_SEARCH"
column="GLOBAL" columnType="BOOLEAN" />
<schema-alterColumn table="RHQ_SAVED_SEARCH"
column="GLOBAL" nullable="FALSE" />
<schema-createSequence name="RHQ_SAVED_SEARCH_ID_SEQ"
initial="10001" />
@@ -2785,7 +2781,7 @@
</statement>
<statement>
CREATE UNIQUE INDEX RHQ_ROLE_LDAP_GROUP_IDX
- ON RHQ_ROLE_LDAP_GROUP ( LDAP_GROUP_NAME, ROLE_ID )
+ ON RHQ_ROLE_LDAP_GROUP ( ROLE_ID, LDAP_GROUP_NAME )
</statement>
</schema-directSQL>
</schemaSpec>
@@ -3011,6 +3007,61 @@
</statement>
</schema-directSQL>
</schemaSpec>
+
+ <!-- rhq 3.0.0.final release at this point. -->
+
+ <!-- 2.89 corrects problems in 3.0.0.final *new* instal The problems it
+ fixes are not present in an upgraded db. As such, ignore any errors.
+ -->
+ <schemaSpec version="2.89">
+ <schema-deleteColumn ignoreError="true"
table="RHQ_ALERT" column="TRIGGERED_OPERATION" />
+ <schema-deleteColumn ignoreError="true"
table="RHQ_ALERT_DEFINITION" column="operation_def_id" />
+
+ <schema-alterColumn ignoreError="true"
table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED"
nullable="false" />
+
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_MAP" column="BUNDLE_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="BUNDLE_VERSION_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="BUNDLE_DEPLOYMENT_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="BUNDLE_DESTINATION_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RESOURCE_MAP" column="RESOURCE_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RESOURCE_MAP" column="TAG_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RES_GROUP_MAP" column="RESOURCE_GROUP_ID"
nullable="false" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID"
nullable="false" />
+ </schemaSpec>
+
+ <!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems
it
+ fixes are not present in an new db. As such, ignore any errors.
+ -->
+ <schemaSpec version="2.90">
+ <!-- correct problems in rhq-3.0.0.final upgrade installs -->
+ <schema-dropSequence ignoreError="true"
name="rhq_tag_id_seq" />
+ <schema-dropSequence ignoreError="true"
name="rhq_advisory_buglist_seq" />
+
+ <schema-createSequence ignoreError="true"
name="RHQ_ADVISORY_BUGLIST_ID_SEQ" initial="10001" />
+
+ <schema-alterColumn ignoreError="true"
table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="TRUE"
/>
+
+ <schema-alterColumn ignoreError="true"
table="RHQ_BUNDLE_TYPE" column="RESOURCE_TYPE_ID"
nullable="FALSE" />
+
+ <schema-alterColumn ignoreError="true"
table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME"
nullable="FALSE" />
+
+ <schema-deleteColumn ignoreError="true"
table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" />
+ <schema-alterColumn ignoreError="true"
table="RHQ_SAVED_SEARCH" column="NAME" nullable="FALSE"
/>
+
+ <schema-directSQL ignoreError="true">
+ <statement desc="Creating RHQ_SAVED_SEARCH foreign key
relation to RHQ_SUBJECT">
+ ALTER TABLE RHQ_SAVED_SEARCH
+ ADD CONSTRAINT RHQ_SAVED_SEARCH_SUBJECT_ID_FK
+ FOREIGN KEY (SUBJECT_ID)
+ REFERENCES RHQ_SUBJECT (ID)
+ </statement>
+ </schema-directSQL>
+
+ </schemaSpec>
</dbupgrade>
</target>
</project>
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java
index 24d0c9b..7576617 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java
@@ -36,7 +36,6 @@ import javax.persistence.NamedQuery;
import javax.persistence.PrePersist;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
-import javax.xml.bind.annotation.XmlTransient;
/**
* This is the many-to-many entity that correlates an advisory with a package.
@@ -74,7 +73,7 @@ public class AdvisoryCVE implements Serializable {
@JoinColumn(name = "CVE_ID", referencedColumnName = "ID",
nullable = false)
private CVE cve;
- @Column(name = "LAST_MODIFIED", nullable = true)
+ @Column(name = "LAST_MODIFIED", nullable = false)
private long lastModifiedDate;
protected AdvisoryCVE() {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java
index 96ba158..45cd6e9 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java
@@ -73,7 +73,7 @@ public class SavedSearch implements Serializable {
@Enumerated(EnumType.STRING)
private SearchSubsystem searchSubsystem;
- @Column(name = "NAME")
+ @Column(name = "NAME", nullable = false)
private String name;
@Column(name = "DESCRIPTION")
commit 794a62beffbf33c07f67b35c74aa2fd6e5be988f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 12 18:20:25 2010 -0400
Add ignoreError attribute for schemaSpecTasks to
handle upgrade situations where we can't guarantee
the state of the db we're upgrading.
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
index 53e1b64..979dcd3 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java
@@ -21,11 +21,14 @@ package org.rhq.core.db.ant.dbupgrade;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
+
import mazz.i18n.Msg;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.TaskContainer;
import org.apache.tools.ant.UnknownElement;
+
import org.rhq.core.db.ant.DbAntI18NFactory;
import org.rhq.core.db.ant.DbAntI18NResourceKeys;
@@ -134,8 +137,13 @@ public class SchemaSpec extends Task implements TaskContainer,
Comparable {
sst.initialize(conn, upgrader);
sst.execute();
} catch (Exception e) {
- throw new
BuildException(MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst
- .getClass().getName(), getVersion(), e), e);
+ String msg =
MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst.getClass()
+ .getName(), getVersion(), e);
+ if (!sst.isIgnoreError()) {
+ throw new BuildException(msg, e);
+ } else {
+ log(msg);
+ }
}
}
}
diff --git
a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java
b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java
index 6c04bea..9b97dd2 100644
---
a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java
+++
b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java
@@ -25,9 +25,12 @@ import java.sql.SQLException;
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
+
import mazz.i18n.Msg;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
+
import org.rhq.core.db.DatabaseType;
import org.rhq.core.db.TypeMap;
import org.rhq.core.db.ant.DbAntI18NFactory;
@@ -46,6 +49,8 @@ public abstract class SchemaSpecTask extends Task {
private String targetDBVendor;
private String targetDBVersion;
+ private String ignoreError;
+
// cache all known JDBC SQL data types
private static Map<String, Integer> SQL_TYPES = new HashMap<String,
Integer>();
@@ -104,6 +109,18 @@ public abstract class SchemaSpecTask extends Task {
return targetDBVersion;
}
+ public String getIgnoreError() {
+ return ignoreError;
+ }
+
+ public void setIgnoreError(String ignoreError) {
+ this.ignoreError = ignoreError;
+ }
+
+ public boolean isIgnoreError() {
+ return new Boolean(this.ignoreError);
+ }
+
/**
* Returns <code>true</code> if this task's database is targeted for
this schema spec. Note that if
* {@link #getTargetDBVendor()} is not specified, then any specified {@link
#getTargetDBVersion()} will cause a
commit 1184cb067af37649d5b24f07948ee733e535a5a5
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jul 12 13:10:16 2010 -0400
BZ 605648 - temporarily disable all gwt views except for bundle/tag related ones
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 42f8a2c..e3b76e5 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
@@ -249,6 +249,21 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
public Canvas createContent(String breadcrumbName) {
Canvas canvas;
+ //=============
+ // TODO: REMOVE THIS AFTER 3.0 RELEASE - WE ONLY WANT 3.0 TO EXPOSE BUNDLES AND
TAGS
+ // THEREAFTER, WE WILL EXPOSE ALL GWT FUNCTIONALITY
+ canvas = null;
+ if (canvas == null) {
+ if (breadcrumbName.equals("Bundles")) {
+ return new BundleTopView();
+ } else if (breadcrumbName.equals("Tag")) {
+ return new TaggedView();
+ } else {
+ return null;
+ }
+ }
+ //=============
+
if (breadcrumbName.equals("Administration")) {
canvas = new AdministrationView();
} else if (breadcrumbName.equals("Demo")) {
commit 2977e3e330a48370b66a130a04706367ed4579d4
Merge: 84e58e7... ea19081...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Jul 12 12:31:46 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 84e58e73e12c43a582bc75ef2233a7a33dcb0b72
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Jul 12 11:57:38 2010 -0400
fix logic bug in getURL()
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java
index 22aaccb..839e322 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java
@@ -72,10 +72,11 @@ public class FaceletRedirectionViewHandler extends FaceletViewHandler
{
for (Map.Entry<String, Object> urlParam :
viewToRender.getAttributes().entrySet()) {
if (first) {
results.append('?');
+ first = false;
} else {
results.append('&');
}
- results.append(urlParam.getKey() + "=" + urlParam.getValue());
+
results.append(urlParam.getKey()).append("=").append(urlParam.getValue());
}
return results.toString();
commit ea19081756a4e944a7096ea92454c359ecb29ccc
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jul 12 11:42:19 2010 -0400
fix failing unit test
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
index 704146b..3b658c7 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java
@@ -8,6 +8,7 @@ import java.util.Map;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant;
+import org.rhq.enterprise.server.search.assist.SearchAssistant;
import org.rhq.enterprise.server.search.execution.SearchAssistManager;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -68,6 +69,10 @@ public class TestAutoCompletionManager extends SearchAssistManager {
@Override
protected AbstractSearchAssistant getSearchAssistant() {
return new TestAutoCompletor();
+ }
+ @Override
+ protected SearchAssistant getTabAwareSearchAssistant(String tab) {
+ return new TestAutoCompletor();
}
}
commit 315d9ef72f96c3fc1efeec76129b45f9f4679578
Merge: a01b65d... aa8f1ce...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Jul 12 10:52:17 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit aa8f1ce8dab5c6c4d649cf50cee6e948a89db5f5
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jul 12 10:12:42 2010 -0400
Cache bug fix moved to release branch
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
index 7acfcbe..08911dd 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
@@ -56,6 +56,14 @@ public class SessionAccessServlet extends HttpServlet {
HttpServletResponse response = (HttpServletResponse) resp;
HttpServletRequest request = (HttpServletRequest) req;
+ response.addHeader("Pragma", "no-cache");
+ response.addHeader("Cache-Control", "no-cache");
+ // Stronger according to blog comment below that references HTTP spec
+ response.addHeader("Cache-Control", "no-store");
+ response.addHeader("Cache-Control", "must-revalidate");
+ // some date in the past
+ response.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00
GMT");
+
//if a session does not already exist this call will create one
HttpSession session = request.getSession();
commit c4241e2c4add58fef7fff149a40aeda905e5978e
Merge: 538ebda... 2cb7cea...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jul 12 09:41:45 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 2cb7ceaf443bf4376e1c369c8a66a218f9132805
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 01:37:13 2010 -0400
fix whitespace padding
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index e8f0c5d..c6bea22 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -138,7 +138,7 @@ public class SavedSearchGrid extends Grid {
private static String stylize(SavedSearch savedSearch) {
String header = savedSearch.getName();
if (savedSearch.getResultCount() != null) {
- header += " ( " + savedSearch.getResultCount() + ")";
+ header += " (" + savedSearch.getResultCount() + ")";
}
return "<span class=\"savedSearchesPanel-top\">" +
header + "</span>" + "<br/>" //
+ "<span class=\"savedSearchesPanel-bottom\">" +
savedSearch.getPattern() + "</span>";
commit bebf8612034b07ef1983bcb01fab27ba01f1e792
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 01:23:20 2010 -0400
show result counts for saved searches in the suggestions pop-up
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 12e0619..2e84d69 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -580,6 +580,9 @@ public class SearchAssistManager {
List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
for (SavedSearch next : savedSearchResults) {
String label = next.getName();
+ if (next.getResultCount() != null) {
+ label += " (" + next.getResultCount() + ")";
+ }
String value = next.getPattern();
int index = next.getName().toLowerCase().indexOf(expression);
SearchSuggestion suggestion = new SearchSuggestion(Kind.UserSavedSearch,
label, value, index, expression
commit 3cef84d0c9408492c3fcb8345643d57ed1b9f45f
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 01:08:11 2010 -0400
compute the result counts for the group-specific saved searches
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
index 5b23039..621cd33 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
@@ -27,12 +27,15 @@ import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.SavedSearchCriteria;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.search.SavedSearch;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.search.SavedSearchManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -47,6 +50,7 @@ public class SavedSearchResultCountRecalculationJob extends
AbstractStatefulJob
private SavedSearchManagerLocal savedSearchManager =
LookupUtil.getSavedSearchManager();
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ private ResourceGroupManagerLocal resourceGroupManager =
LookupUtil.getResourceGroupManager();
private Subject overlord = LookupUtil.getSubjectManager().getOverlord();
@@ -62,6 +66,7 @@ public class SavedSearchResultCountRecalculationJob extends
AbstractStatefulJob
continue;
}
try {
+
if (next.getSearchSubsystem() == SearchSubsystem.RESOURCE) {
ResourceCriteria criteria = new ResourceCriteria();
criteria.setSearchExpression(next.getPattern());
@@ -70,12 +75,20 @@ public class SavedSearchResultCountRecalculationJob extends
AbstractStatefulJob
PageList<Resource> results =
resourceManager.findResourcesByCriteria(overlord, criteria);
totalMillis += System.currentTimeMillis();
- // TODO: should recent count be computed at the time of update/save
for this saved search?
- // it would obviate the need for null checking here as well as
in the UI for conditional
- // display of the result count
- if (next.getResultCount() == null || results.getTotalSize() !=
next.getResultCount()) {
- next.setResultCount((long) results.getTotalSize());
- savedSearchManager.updateSavedSearch(overlord, next);
+ if (processResults(next, results)) {
+ updated++;
+ }
+
+ } else if (next.getSearchSubsystem() == SearchSubsystem.GROUP) {
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.setSearchExpression(next.getPattern());
+
+ totalMillis -= System.currentTimeMillis();
+ PageList<ResourceGroup> results =
resourceGroupManager.findResourceGroupsByCriteria(overlord,
+ criteria);
+ totalMillis += System.currentTimeMillis();
+
+ if (processResults(next, results)) {
updated++;
}
}
@@ -93,6 +106,18 @@ public class SavedSearchResultCountRecalculationJob extends
AbstractStatefulJob
}
}
+ private boolean processResults(SavedSearch next, PageList<?> results) {
+ // TODO: should recent count be computed at the time of update/save for this
saved search?
+ // it would obviate the need for null checking here as well as in the UI
for conditional
+ // display of the result count
+ if (next.getResultCount() == null || results.getTotalSize() !=
next.getResultCount()) {
+ next.setResultCount((long) results.getTotalSize());
+ savedSearchManager.updateSavedSearch(overlord, next);
+ return true;
+ }
+ return false;
+ }
+
private List<SavedSearch> getSavedSearchesNeedingRecomputation() {
long fiveMinutesAgo = System.currentTimeMillis() - (5 * 60 * 1000);
commit d655ff54fd5996786d581e8db70afaddb7e3ebd2
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 01:07:33 2010 -0400
display the count of results in the saved searches drop-down
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index a5b0a48..e8f0c5d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -25,6 +25,7 @@ import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Grid;
+import org.rhq.core.domain.search.SavedSearch;
import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
/**
@@ -127,16 +128,20 @@ public class SavedSearchGrid extends Grid {
for (int i = 0; i < names.size(); i++) {
String name = names.get(i);
- String pattern = searchBar.getSavedSearchManager().getPatternByName(name);
- setHTML(i, 0, stylize(name, pattern));
+ SavedSearch savedSearch =
searchBar.getSavedSearchManager().getSavedSearchByName(name);
+ setHTML(i, 0, stylize(savedSearch));
setHTML(i, 1, trashify());
}
setRowFormatter(new SavedSearchRowFormatter());
}
- private static String stylize(String name, String pattern) {
- return "<span class=\"savedSearchesPanel-top\">" + name
+ "</span>" + "<br/>"
- + "<span class=\"savedSearchesPanel-bottom\">" +
pattern + "</span>";
+ private static String stylize(SavedSearch savedSearch) {
+ String header = savedSearch.getName();
+ if (savedSearch.getResultCount() != null) {
+ header += " ( " + savedSearch.getResultCount() + ")";
+ }
+ return "<span class=\"savedSearchesPanel-top\">" +
header + "</span>" + "<br/>" //
+ + "<span class=\"savedSearchesPanel-bottom\">" +
savedSearch.getPattern() + "</span>";
}
private static String trashify() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
index 4981e2b..398b4d8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java
@@ -58,6 +58,10 @@ public class SavedSearchManager {
return savedSearch.getPattern();
}
+ public synchronized SavedSearch getSavedSearchByName(String name) {
+ return savedSearches.get(name);
+ }
+
public synchronized void updatePatternByName(final String name, final String pattern)
{
SavedSearch savedSearch = savedSearches.get(name);
if (savedSearch == null) { // created case
commit 913a7b533b15a0ad5e64659bb722d913641d7d09
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 01:07:10 2010 -0400
BZ-613222: only display saved searches for the current/active search subsystem
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index 3ac3f3f..eb6a724 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -138,6 +138,11 @@ public class SearchBar extends SimplePanel {
public SearchBar() {
System.out.println("Loading SearchBar...");
+ // in the future, will be instantiated directly from a higher-level widget
+ if (existsOnPage()) {
+ loadAdditionalDataFromDivAttributes();
+ }
+
savedSearchManager = new SavedSearchManager(this);
}
@@ -156,10 +161,6 @@ public class SearchBar extends SimplePanel {
setupArrowImage();
setupSavedSearches();
- // in the future, will be instantiated directly from a higher-level widget
- if (existsOnPage()) {
- loadAdditionalDataFromDivAttributes();
- }
// presume the enclosing page logic loads results without a button click
}
commit 47609849bb93035887cec2f1979eb44b70250e3e
Author: Joseph Marques <joseph(a)redhat.com>
Date: Sat Jul 10 00:23:49 2010 -0400
interpret "all" tab as the absence of a category filter
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index fb61df1..3ac3f3f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -125,7 +125,14 @@ public class SearchBar extends SimplePanel {
String defaultSavedSearchPattern =
searchBarElement.getAttribute("defaultSavedSearchPattern");
setDefaultSavedSearchPattern(defaultSavedSearchPattern);
- this.selectedTab = searchBarElement.getAttribute("subtab");
+ String tab = searchBarElement.getAttribute("subtab");
+ if (tab != null) {
+ tab = tab.trim().toLowerCase();
+ if (tab.equals("") || tab.equals("all")) {
+ tab = null;
+ }
+ }
+ this.selectedTab = tab;
}
public SearchBar() {
commit 3dcbafcafe7b2d85d6d9f36e4043d3d6e6dbf77c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 9 17:40:22 2010 -0400
do not recalculate global searches
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
index d42f529..5b23039 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java
@@ -58,6 +58,9 @@ public class SavedSearchResultCountRecalculationJob extends
AbstractStatefulJob
int updated = 0;
long totalMillis = 0;
for (SavedSearch next : staleSavedSearches) {
+ if (next.isGlobal()) {
+ continue;
+ }
try {
if (next.getSearchSubsystem() == SearchSubsystem.RESOURCE) {
ResourceCriteria criteria = new ResourceCriteria();
commit 0cefa02502c348f4007d6f0f3cef0186cb2b194c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Fri Jul 9 17:35:01 2010 -0400
BZ-601354: only offer resource/group suggestions specific to the active sub-tab (if
any)
* this is a one-off fix for the next release only
* this solution needs to be replaced by a generic solution that will filter
suggestions by all known contextual data (i.e., other completed search terms)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
index be00e9c..00b1d73 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
@@ -35,6 +35,9 @@ public interface SearchGWTService extends RemoteService {
/*
* search suggestions
*/
+ List<SearchSuggestion> getTabAwareSuggestions(SearchSubsystem searchSubsystem,
String expression,
+ int caretPosition, String tab);
+
List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String
expression, int caretPosition);
/*
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
index 13e5ec7..fb61df1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java
@@ -89,6 +89,7 @@ public class SearchBar extends SimplePanel {
private SearchSubsystem searchSubsystem;
private String defaultSearchText;
private String defaultSavedSearchPattern;
+ private String selectedTab;
private Element searchButton;
@@ -123,6 +124,8 @@ public class SearchBar extends SimplePanel {
String defaultSavedSearchPattern =
searchBarElement.getAttribute("defaultSavedSearchPattern");
setDefaultSavedSearchPattern(defaultSavedSearchPattern);
+
+ this.selectedTab = searchBarElement.getAttribute("subtab");
}
public SearchBar() {
@@ -197,6 +200,10 @@ public class SearchBar extends SimplePanel {
activateSavedSearch(defaultSavedSearchPattern);
}
+ public String getSelectedTab() {
+ return selectedTab;
+ }
+
public String getDefaultSavedSearchPattern() {
return defaultSavedSearchPattern;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index dd37901..bce49e4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -581,28 +581,28 @@ public class SuggestTextBox_v3 extends Composite implements HasText,
HasAllFocus
String expression = suggestionRequest.getQuery();
int caretPosition = suggestionRequest.getCursorPosition();
- searchService.getSuggestions(searchBar.getSearchSubsystem(), expression,
caretPosition,
- new AsyncCallback<List<SearchSuggestion>>() {
+ searchService.getTabAwareSuggestions(searchBar.getSearchSubsystem(),
expression, caretPosition, searchBar
+ .getSelectedTab(), new
AsyncCallback<List<SearchSuggestion>>() {
- public void onSuccess(List<SearchSuggestion> results) {
- adaptAndHandle(results.toArray(new
SearchSuggestion[results.size()]));
- }
+ public void onSuccess(List<SearchSuggestion> results) {
+ adaptAndHandle(results.toArray(new
SearchSuggestion[results.size()]));
+ }
- public void onFailure(Throwable caught) {
- SearchSuggestion errorInform = new
SearchSuggestion(Kind.InstructionalTextComment, caught
- .getMessage());
- adaptAndHandle(errorInform);
- }
+ public void onFailure(Throwable caught) {
+ SearchSuggestion errorInform = new
SearchSuggestion(Kind.InstructionalTextComment, caught
+ .getMessage());
+ adaptAndHandle(errorInform);
+ }
- private void adaptAndHandle(SearchSuggestion...
searchSuggestionResults) {
- List<SearchSuggestionOracleAdapter> adaptedResults = new
java.util.ArrayList<SearchSuggestionOracleAdapter>();
- for (SearchSuggestion next : searchSuggestionResults) {
- adaptedResults.add(new SearchSuggestionOracleAdapter(next));
- }
- SuggestOracle.Response response = new
SuggestOracle.Response(adaptedResults);
- callback.onSuggestionsReady(request, response);
+ private void adaptAndHandle(SearchSuggestion... searchSuggestionResults)
{
+ List<SearchSuggestionOracleAdapter> adaptedResults = new
java.util.ArrayList<SearchSuggestionOracleAdapter>();
+ for (SearchSuggestion next : searchSuggestionResults) {
+ adaptedResults.add(new SearchSuggestionOracleAdapter(next));
}
- });
+ SuggestOracle.Response response = new
SuggestOracle.Response(adaptedResults);
+ callback.onSuggestionsReady(request, response);
+ }
+ });
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java
index 55b81ce..cff798c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java
@@ -37,6 +37,13 @@ public class SearchGWTServiceImpl extends AbstractGWTServiceImpl
implements Sear
private SavedSearchManagerLocal savedSearchManager =
LookupUtil.getSavedSearchManager();
+ public List<SearchSuggestion> getTabAwareSuggestions(SearchSubsystem
searchSubsystem, String expression,
+ int caretPosition, String tab) {
+ SearchAssistManager searchAssistManager = new
SearchAssistManager(getSessionSubject(), searchSubsystem);
+ List<SearchSuggestion> results =
searchAssistManager.getTabAwareSuggestions(expression, caretPosition, tab);
+ return results;
+ }
+
public List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem,
String expression, int caretPosition) {
SearchAssistManager searchAssistManager = new
SearchAssistManager(getSessionSubject(), searchSubsystem);
List<SearchSuggestion> results =
searchAssistManager.getSuggestions(expression, caretPosition);
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
index 661cf8c..0c7022b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml
@@ -15,6 +15,7 @@
searchSubsystem="#{searchSubsystem}"
defaultSearchText="#{defaultSearchText}"
defaultSavedSearchPattern="#{defaultSavedSearchPattern}"
+ subtab="#{subtab}"
id="searchBar">
<div class="searchBarBackgroundContainer">
<div class="searchBarComponentsContainer">
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 869b9dc..399ab6a 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -45,6 +45,7 @@
<ui:param name="searchButtonId"
value="browseGroupsForm:searchButtonJSF" />
<ui:param name="searchSubsystem" value="GROUP"
/>
<ui:param name="defaultSearchText"
value="#{param.search}" />
+ <ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index 5fd39e5..fc6741e 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -46,6 +46,7 @@
<ui:param name="searchSubsystem"
value="RESOURCE" />
<ui:param name="defaultSearchText"
value="#{param.search}" />
<ui:param name="defaultSavedSearchPattern"
value="#{param.searchId}" />
+ <ui:param name="subtab" value="${param.subtab}"
/>
</ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO"
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
index b948809..61faf42 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java
@@ -95,7 +95,7 @@ public abstract class AbstractSearchAssistant implements SearchAssistant
{
}
protected final String add(String fragment, String parameter) {
- if (!parameter.equals("")) {
+ if (parameter != null && !parameter.equals("")) {
return fragment;
}
return "";
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index 96c10ec..cba008f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -8,7 +8,7 @@ import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
-public class GroupSearchAssistant extends AbstractSearchAssistant {
+public class GroupSearchAssistant extends TabAwareSearchAssistant {
private static final List<String> parameterizedContexts;
private static final List<String> simpleContexts;
@@ -19,6 +19,10 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
"name"));
}
+ public GroupSearchAssistant(String tab) {
+ super(tab);
+ }
+
public SearchSubsystem getSearchSubsystem() {
return SearchSubsystem.GROUP;
}
@@ -58,7 +62,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
@@ -67,7 +72,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ " AND rg.visible = true " //
- + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
@@ -75,7 +81,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
+ " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
- + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase()
+ "%'", filter) //
+ + add(" AND LOWER(rg.groupCategory) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(rg.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY rg.name ");
} else {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index c03c7b5..e6552fc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -10,7 +10,7 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
-public class ResourceSearchAssistant extends AbstractSearchAssistant {
+public class ResourceSearchAssistant extends TabAwareSearchAssistant {
private static final List<String> parameterizedContexts;
private static final List<String> simpleContexts;
@@ -22,6 +22,10 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant {
"name"));
}
+ public ResourceSearchAssistant(String tab) {
+ super(tab);
+ }
+
public SearchSubsystem getSearchSubsystem() {
return SearchSubsystem.RESOURCE;
}
@@ -61,7 +65,8 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant {
+ " FROM ResourceType type, Resource res " //"
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
@@ -70,7 +75,8 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant {
+ " FROM ResourceType type, Resource res " //
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
+ " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
@@ -80,6 +86,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant {
+ " JOIN ms.definition def " //
+ " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ " AND def.dataType = 1 " // trait types
+ + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
+ add(" AND LOWER(def.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY def.name ");
@@ -100,24 +107,28 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
} else if (context.equals("type")) {
return execute("" //
+ "SELECT DISTINCT type.name " //
- + " FROM Resource res " //
- + " JOIN res.resourceType type " //
- + add(" WHERE LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " FROM Resource res, ResourceType type " //
+ + " WHERE res.resourceType = type " //
+ + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
return execute("" //
+ "SELECT DISTINCT type.plugin " //
- + " FROM Resource res " //
- + " JOIN res.resourceType type " //
- + add(" WHERE LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " FROM Resource res, ResourceType type " //
+ + " WHERE res.resourceType = type " //
+ + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
return execute("" //
+ "SELECT DISTINCT res.name " //
- + " FROM Resource res " //
- + add(" WHERE LOWER(res.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " FROM Resource res, ResourceType type " //
+ + " WHERE res.resourceType = type " //
+ + add(" AND LOWER(type.category) = '" + tab +
"'", tab) //
+ + add(" AND LOWER(res.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY res.name ");
} else if (context.equals("alerts")) {
@@ -130,6 +141,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
+ " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
+ " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
+ add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY simple.stringValue ");
@@ -140,6 +152,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
+ " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
+ " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
+ add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY simple.stringValue ");
@@ -151,6 +164,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
+ " WHERE ms.definition.dataType = 1 " //
+ " AND ms.resource = res " // only suggest values that exist
for inventoried resources
+ " AND LOWER(ms.definition.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ + add(" AND LOWER(res.resourceType.category) = '" + tab +
"'", tab) //
+ add(" AND LOWER(trait.value) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY trait.value ");
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
index 05ad883..9caafec 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java
@@ -9,9 +9,19 @@ public class SearchAssistantFactory {
public static SearchAssistant getAssistant(SearchSubsystem searchContext) {
if (searchContext == SearchSubsystem.RESOURCE) {
- return new ResourceSearchAssistant();
+ return new ResourceSearchAssistant(null);
} else if (searchContext == SearchSubsystem.GROUP) {
- return new GroupSearchAssistant();
+ return new GroupSearchAssistant(null);
+ } else {
+ throw new IllegalArgumentException("No SearchAssistant found for
SearchSubsystem[" + searchContext + "]");
+ }
+ }
+
+ public static SearchAssistant getTabAwareAssistant(SearchSubsystem searchContext,
String tab) {
+ if (searchContext == SearchSubsystem.RESOURCE) {
+ return new ResourceSearchAssistant(tab);
+ } else if (searchContext == SearchSubsystem.GROUP) {
+ return new GroupSearchAssistant(tab);
} else {
throw new IllegalArgumentException("No SearchAssistant found for
SearchSubsystem[" + searchContext + "]");
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
new file mode 100644
index 0000000..a68dc60
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java
@@ -0,0 +1,15 @@
+package org.rhq.enterprise.server.search.assist;
+
+public abstract class TabAwareSearchAssistant extends AbstractSearchAssistant {
+ protected String tab;
+
+ public TabAwareSearchAssistant(String tab) {
+ if (tab != null) {
+ tab = tab.trim().toLowerCase();
+ if (tab.equals("")) {
+ tab = null;
+ }
+ }
+ this.tab = tab;
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 34eed0e..12e0619 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -347,6 +347,10 @@ public class SearchAssistManager {
return SearchAssistantFactory.getAssistant(searchSubsystem);
}
+ protected SearchAssistant getTabAwareSearchAssistant(String tab) {
+ return SearchAssistantFactory.getTabAwareAssistant(searchSubsystem, tab);
+ }
+
private List<String> getAllContexts() {
List<String> results = new
ArrayList<String>(getSearchAssistant().getSimpleContexts());
for (String parameterized : getSearchAssistant().getParameterizedContexts()) {
@@ -356,6 +360,10 @@ public class SearchAssistManager {
}
public List<SearchSuggestion> getSuggestions(String expression, int caretPos)
{
+ return getTabAwareSuggestions(expression, caretPos, null);
+ }
+
+ public List<SearchSuggestion> getTabAwareSuggestions(String expression, int
caretPos, String tab) {
List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
if (subject == null) {
@@ -371,8 +379,8 @@ public class SearchAssistManager {
expression = "";
}
- List<SearchSuggestion> simple = getSimpleSuggestions(expression,
caretPos);
- List<SearchSuggestion> advanced = getAdvancedSuggestions(expression,
caretPos);
+ List<SearchSuggestion> simple = getSimpleSuggestions(expression,
caretPos, tab);
+ List<SearchSuggestion> advanced = getAdvancedSuggestions(expression,
caretPos, tab);
List<SearchSuggestion> userSavedSearches =
getUserSavedSearchSuggestions(expression);
//List<SearchSuggestion> globalSavedSearches =
getGlobalSavedSearchSuggestions(expression);
@@ -398,8 +406,8 @@ public class SearchAssistManager {
return results;
}
- public List<SearchSuggestion> getSimpleSuggestions(String expression, int
caretPos) {
- SearchAssistant completor = getSearchAssistant();
+ public List<SearchSuggestion> getSimpleSuggestions(String expression, int
caretPos, String tab) {
+ SearchAssistant completor = getTabAwareSearchAssistant(tab);
debug("getSimpleSuggestions: START");
@@ -424,8 +432,8 @@ public class SearchAssistManager {
return suggestions;
}
- public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos) {
- SearchAssistant completor = getSearchAssistant();
+ public List<SearchSuggestion> getAdvancedSuggestions(String expression, int
caretPos, String tab) {
+ SearchAssistant completor = getTabAwareSearchAssistant(tab);
debug("getAdvancedSuggestions: START");
SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos);
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java
index 0a28dee..3570f56 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java
@@ -37,7 +37,7 @@ public class GenericSearchAssistTest extends AbstractEJB3Test {
count++;
List<SearchSuggestion> results = new
TestAutoCompletionManager().getAdvancedSuggestions(expression,
- expression.length());
+ expression.length(), null);
List<String> expectedResults = Arrays.asList(expected.split("
"));
System.out.println();
commit 0cb1c2429d8315e98d1ca264c51d06877159722e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jul 9 16:07:13 2010 -0400
BZ 601214 - fix classloading issue when a child deep in the hierarchy exists and the
direct parents of two services are the same but the resources actually belong to two
different servers (which is only known by looking higher up in ancestry)
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java
index aadd1f8..12f777f 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java
@@ -23,6 +23,8 @@
package org.rhq.core.pc.plugin;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
import org.rhq.core.clientapi.agent.PluginContainerException;
import org.rhq.core.domain.resource.Resource;
@@ -38,12 +40,8 @@ public class CanonicalResourceKey implements Serializable {
private static final long serialVersionUID = 1L;
- private final String resourceKey;
- private final String resourceTypeName;
- private final String resourcePlugin;
- private final String parentKey;
- private final String parentTypeName;
- private final String parentPlugin;
+ private final KeyTypePlugin resourceKeyTypePlugin;
+ private final List<KeyTypePlugin> ancestorKeyTypePlugins;
public CanonicalResourceKey(Resource resource, Resource parent) throws
PluginContainerException {
if (resource == null) {
@@ -53,92 +51,48 @@ public class CanonicalResourceKey implements Serializable {
throw new PluginContainerException("parent must not be null");
}
- ResourceType resourceType = resource.getResourceType();
- ResourceType parentType = parent.getResourceType();
+ this.resourceKeyTypePlugin = new KeyTypePlugin(resource.getResourceKey(),
resource.getResourceType());
- if (resourceType == null) {
- throw new PluginContainerException("resource type must not be
null");
- }
- if (parentType == null) {
- throw new PluginContainerException("parent type must not be
null");
- }
-
- this.resourceKey = resource.getResourceKey();
- this.resourceTypeName = resourceType.getName();
- this.resourcePlugin = resourceType.getPlugin();
- this.parentKey = parent.getResourceKey();
- this.parentTypeName = parentType.getName();
- this.parentPlugin = parentType.getPlugin();
-
- if (this.resourceKey == null) {
- throw new PluginContainerException("resource key must not be
null");
- }
- if (this.resourceTypeName == null) {
- throw new PluginContainerException("resource type name must not be
null");
- }
- if (this.resourcePlugin == null) {
- throw new PluginContainerException("resource plugin must not be
null");
- }
-
- if (this.parentKey == null) {
- throw new PluginContainerException("parent key must not be null");
- }
- if (this.parentTypeName == null) {
- throw new PluginContainerException("parent type name must not be
null");
- }
- if (this.parentPlugin == null) {
- throw new PluginContainerException("parent plugin must not be
null");
+ this.ancestorKeyTypePlugins = new ArrayList<KeyTypePlugin>(5);
+ while (parent != null) {
+ KeyTypePlugin ktp = new KeyTypePlugin(parent.getResourceKey(),
parent.getResourceType());
+ this.ancestorKeyTypePlugins.add(ktp);
+ parent = parent.getParentResource();
}
}
public String getResourceKey() {
- return this.resourceKey;
+ return this.resourceKeyTypePlugin.key;
}
public String getResourceTypeName() {
- return this.resourceTypeName;
+ return this.resourceKeyTypePlugin.type;
}
public String getResourcePlugin() {
- return this.resourcePlugin;
- }
-
- public String getParentKey() {
- return this.parentKey;
- }
-
- public String getParentTypeName() {
- return this.parentTypeName;
- }
-
- public String getParentPlugin() {
- return this.parentPlugin;
+ return this.resourceKeyTypePlugin.plugin;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
-
builder.append("resourceKey=").append(this.resourceKey).append(",");
-
builder.append("resourceTypeName=").append(this.resourceTypeName).append(",");
-
builder.append("resourcePlugin=").append(this.resourcePlugin).append(",");
-
builder.append("parentKey=").append(this.parentKey).append(",");
-
builder.append("parentTypeName=").append(this.parentTypeName).append(",");
- builder.append("parentPlugin=").append(this.parentPlugin);
+ int ancestor = 0;
+ for (KeyTypePlugin ktp : this.ancestorKeyTypePlugins) {
+
builder.append("ancestor#").append(ancestor++).append("=").append(ktp).append(',');
+ }
+ builder.append("resource=").append(this.resourceKeyTypePlugin);
builder.append("]");
return builder.toString();
}
@Override
public int hashCode() {
- final int prime = 31;
int result = 1;
- result = prime * result + this.resourceKey.hashCode();
- result = prime * result + this.resourceTypeName.hashCode();
- result = prime * result + this.resourcePlugin.hashCode();
- result = prime * result + this.parentKey.hashCode();
- result = prime * result + this.parentTypeName.hashCode();
- result = prime * result + this.parentPlugin.hashCode();
+ result = 31 * result + this.resourceKeyTypePlugin.hashCode();
+ for (KeyTypePlugin ktp : this.ancestorKeyTypePlugins) {
+ result = 31 * result + ktp.hashCode();
+ }
return result;
}
@@ -153,30 +107,76 @@ public class CanonicalResourceKey implements Serializable {
CanonicalResourceKey other = (CanonicalResourceKey) obj;
- if (!this.resourceKey.equals(other.resourceKey)) {
- return false;
- }
-
- if (!this.resourceTypeName.equals(other.resourceTypeName)) {
- return false;
- }
-
- if (!this.resourcePlugin.equals(other.resourcePlugin)) {
+ if (!this.resourceKeyTypePlugin.equals(other.resourceKeyTypePlugin)) {
return false;
}
- if (!this.parentKey.equals(other.parentKey)) {
+ if (!this.ancestorKeyTypePlugins.equals(other.ancestorKeyTypePlugins)) {
return false;
}
- if (!this.parentTypeName.equals(other.parentTypeName)) {
- return false;
- }
+ return true;
+ }
- if (!this.parentPlugin.equals(other.parentPlugin)) {
- return false;
+ private class KeyTypePlugin {
+ public final String key;
+ public final String type;
+ public final String plugin;
+
+ KeyTypePlugin(String key, ResourceType type) throws PluginContainerException {
+ if (key == null) {
+ throw new PluginContainerException("key must not be null");
+ }
+ if (type == null) {
+ throw new PluginContainerException("type must not be null");
+ }
+ if (type.getName() == null) {
+ throw new PluginContainerException("type name must not be
null");
+ }
+ if (type.getPlugin() == null) {
+ throw new PluginContainerException("plugin must not be null");
+ }
+ this.key = key;
+ this.type = type.getName();
+ this.plugin = type.getPlugin();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+
builder.append("[key=").append(key).append(",type=").append(type).append(",plugin=").append(plugin).append(
+ "]");
+ return builder.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = 31 * result + key.hashCode();
+ result = 31 * result + type.hashCode();
+ result = 31 * result + plugin.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof KeyTypePlugin)) {
+ return false;
+ }
+ KeyTypePlugin other = (KeyTypePlugin) obj;
+ if (!this.key.equals(other.key)) {
+ return false;
+ }
+ if (!this.plugin.equals(other.plugin)) {
+ return false;
+ }
+ if (!this.type.equals(other.type)) {
+ return false;
+ }
+ return true;
}
-
- return true;
}
}
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java
new file mode 100644
index 0000000..8e0dc7f
--- /dev/null
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java
@@ -0,0 +1,155 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.pc.plugin;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.agent.PluginContainerException;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceType;
+
+@Test
+public class CanonicalResourceKeyTest {
+ private final String KEY1 = "key1";
+ private final String KEY2 = "key2";
+ private final String KEY3 = "key3";
+ private final String KEY4 = "key4";
+ private final String KEY5 = "key5";
+
+ private ResourceType resourceType1;
+ private ResourceType resourceType2;
+ private ResourceType resourceType3;
+ private ResourceType resourceType4;
+ private ResourceType resourceType5;
+
+ private Resource resource1a;
+ private Resource resource1b;
+ private Resource resource2a;
+ private Resource resource2b;
+ private Resource resource3a;
+ private Resource resource3b;
+ private Resource resource4a;
+ private Resource resource4b;
+ private Resource resource5a;
+ private Resource resource5b;
+
+ private final String KEYA = "keyA";
+ private ResourceType resourceTypeA;
+ private Resource resourceA_1235; // resource whose ancestors's keys are 1,2,3,5
+ private Resource resourceA_1245; // resource whose ancestors's keys are 1,2,4,5
+
+ @BeforeClass
+ public void setup() {
+ this.resourceType1 = new ResourceType("type1", "plugin",
ResourceCategory.SERVER, null);
+ this.resourceType2 = new ResourceType("type2", "plugin",
ResourceCategory.SERVER, null);
+ this.resourceType3 = new ResourceType("type3", "plugin",
ResourceCategory.SERVER, null);
+ this.resourceType4 = new ResourceType("type4", "plugin",
ResourceCategory.SERVER, null);
+ this.resourceType5 = new ResourceType("type5", "plugin",
ResourceCategory.SERVER, null);
+ this.resourceTypeA = new ResourceType("typeA", "plugin",
ResourceCategory.SERVER, null);
+
+ this.resource1a = new Resource(KEY1, KEY1, this.resourceType1);
+ this.resource2a = new Resource(KEY2, KEY2, this.resourceType2);
+ this.resource3a = new Resource(KEY3, KEY3, this.resourceType3);
+ this.resource4a = new Resource(KEY4, KEY4, this.resourceType4);
+ this.resource5a = new Resource(KEY5, KEY5, this.resourceType5);
+
+ this.resource1b = new Resource(KEY1, KEY1, this.resourceType1);
+ this.resource2b = new Resource(KEY2, KEY2, this.resourceType2);
+ this.resource3b = new Resource(KEY3, KEY3, this.resourceType3);
+ this.resource4b = new Resource(KEY4, KEY4, this.resourceType4);
+ this.resource5b = new Resource(KEY5, KEY5, this.resourceType5);
+
+ this.resourceA_1235 = new Resource(KEYA, KEYA, this.resourceTypeA);
+ this.resourceA_1235.setParentResource(resource1a);
+ this.resource1a.setParentResource(resource2a);
+ this.resource2a.setParentResource(resource3a);
+ this.resource3a.setParentResource(resource5a);
+
+ this.resourceA_1245 = new Resource(KEYA, KEYA, this.resourceTypeA);
+ this.resourceA_1245.setParentResource(resource1b);
+ this.resource1b.setParentResource(resource2b);
+ this.resource2b.setParentResource(resource4b);
+ this.resource4b.setParentResource(resource5b);
+ }
+
+ public void testError() {
+ try {
+ new CanonicalResourceKey(null, null);
+ assert false : "should not be allowed to pass null";
+ } catch (PluginContainerException ok) {
+ }
+
+ try {
+ new CanonicalResourceKey(this.resource3b, null);
+ assert false : "should not be allowed to pass null";
+ } catch (PluginContainerException ok) {
+ }
+
+ try {
+ new CanonicalResourceKey(null, this.resource4a);
+ assert false : "should not be allowed to pass null";
+ } catch (PluginContainerException ok) {
+ }
+
+ try {
+ new CanonicalResourceKey(this.resource3b, this.resource4a);
+ } catch (Exception bad) {
+ throw new RuntimeException("should not throw error - both resources are
valid", bad);
+ }
+ }
+
+ public void testSimple() throws Exception {
+ CanonicalResourceKey key1a = new CanonicalResourceKey(this.resource1a,
this.resource1a.getParentResource());
+ assert key1a.equals(key1a);
+ assert key1a.hashCode() == key1a.hashCode();
+
+ CanonicalResourceKey key1a_dup = new CanonicalResourceKey(this.resource1a,
this.resource1a.getParentResource());
+ assert key1a.equals(key1a_dup);
+ assert key1a.hashCode() == key1a_dup.hashCode();
+
+ CanonicalResourceKey key2a = new CanonicalResourceKey(this.resource2a,
this.resource2a.getParentResource());
+ assert !key1a.equals(key2a);
+ assert key1a.hashCode() != key2a.hashCode();
+ }
+
+ public void testAncestorDiff() throws Exception {
+ // this test shows that even if a resource and its direct parent are the same as
another resource/parent pair, that
+ // the equals and hashCode methods will know that the ancestors make each
canonical resource key unique
+ CanonicalResourceKey key1a = new CanonicalResourceKey(this.resourceA_1235,
this.resourceA_1235
+ .getParentResource());
+ assert key1a.equals(key1a);
+ assert key1a.hashCode() == key1a.hashCode();
+
+ CanonicalResourceKey key1a_dup = new CanonicalResourceKey(this.resourceA_1235,
this.resourceA_1235
+ .getParentResource());
+ assert key1a.equals(key1a_dup);
+ assert key1a.hashCode() == key1a_dup.hashCode();
+
+ CanonicalResourceKey key2a = new CanonicalResourceKey(this.resourceA_1245,
this.resourceA_1245
+ .getParentResource());
+ assert !key1a.equals(key2a);
+ assert key1a.hashCode() != key2a.hashCode();
+ }
+}
commit 538ebdae24cd90e127002e9d203386b700b910c8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 9 15:01:34 2010 -0400
[bz 611749] Get the BundleSelector search filter to work more like
our other search filters, namely treating the typed string as a substring
match. It was currently requiring an exact match. This requires using
smartgwt's AdvancedCriteria, as opposed to just Criteria. Note, this
class seems to be fickle, the only way it behaved was to pass the
Criterion in the constructor.
Applied the same change to ResourceSelector and ResourceGroupSelector.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
index 1a32d4b..e1b94f0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
@@ -22,7 +22,10 @@ import java.util.ArrayList;
import java.util.Collection;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.Criterion;
+import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
@@ -78,11 +81,17 @@ public class BundleSelector extends AbstractSelector<Bundle> {
}
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
- Criteria latestCriteria = new Criteria();
- Object search = availableFilterForm.getValue("search");
- Object bundleType = availableFilterForm.getValue("bundleType");
- latestCriteria.setAttribute("name", search);
- latestCriteria.setAttribute("bundleType", bundleType);
+ String search = (String) availableFilterForm.getValue("search");
+ String bundleType = (String)
availableFilterForm.getValue("bundleType");
+ ArrayList<Criterion> criteria = new ArrayList<Criterion>(2);
+ if (null != search) {
+ criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
+ }
+ if (null != bundleType) {
+ criteria.add(new Criterion("bundleType", OperatorId.EQUALS,
bundleType));
+ }
+ AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
+ .size()]));
return latestCriteria;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
index d373ac6..5c3c007 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java
@@ -18,9 +18,13 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import java.util.ArrayList;
import java.util.Collection;
+import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.Criterion;
+import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.SpacerItem;
@@ -28,7 +32,6 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
@@ -60,11 +63,17 @@ public class ResourceGroupSelector extends
AbstractSelector<ResourceGroup> {
}
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
- Criteria latestCriteria = new Criteria();
- Object search = availableFilterForm.getValue("search");
- Object category = availableFilterForm.getValue("groupCategory");
- latestCriteria.setAttribute("name", search);
- latestCriteria.setAttribute("category", category);
+ String search = (String) availableFilterForm.getValue("search");
+ String category = (String)
availableFilterForm.getValue("groupCategory");
+ ArrayList<Criterion> criteria = new ArrayList<Criterion>(2);
+ if (null != search) {
+ criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
+ }
+ if (null != category) {
+ criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ }
+ AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
+ .size()]));
return latestCriteria;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index 015b377..a692a2f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -18,9 +18,13 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import java.util.ArrayList;
import java.util.Collection;
+import com.smartgwt.client.data.AdvancedCriteria;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.Criterion;
+import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.IPickTreeItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
@@ -85,17 +89,27 @@ public class ResourceSelector extends AbstractSelector<Resource>
{
}
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
- Criteria latestCriteria = new Criteria();
- latestCriteria.setAttribute("name",
availableFilterForm.getValue("search"));
-
- // If its a number its a typeId, otherwise a plugin name
- try {
- Integer.parseInt((String) availableFilterForm.getValue("type"));
- latestCriteria.setAttribute("type",
availableFilterForm.getValue("type"));
- } catch (NumberFormatException nfe) {
- latestCriteria.setAttribute("plugin",
availableFilterForm.getValue("type"));
+ String search = (String) availableFilterForm.getValue("search");
+ String type = (String) availableFilterForm.getValue("type");
+ String category = (String) availableFilterForm.getValue("category");
+ ArrayList<Criterion> criteria = new ArrayList<Criterion>(3);
+ if (null != search) {
+ criteria.add(new Criterion("name", OperatorId.CONTAINS, search));
}
- latestCriteria.setAttribute("category",
availableFilterForm.getValue("category"));
+ if (null != type) {
+ // If type is a number its a typeId, otherwise a plugin name
+ try {
+ Integer.parseInt(type);
+ criteria.add(new Criterion("type", OperatorId.EQUALS, type));
+ } catch (NumberFormatException nfe) {
+ criteria.add(new Criterion("plugin", OperatorId.EQUALS,
type));
+ }
+ }
+ if (null != category) {
+ criteria.add(new Criterion("category", OperatorId.EQUALS,
category));
+ }
+ AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND,
criteria.toArray(new Criterion[criteria
+ .size()]));
return latestCriteria;
}
commit 38c428b88f9b3b322bfc6de73efb3750c163cc04
Merge: 7999505... 3d4ecf9...
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Jul 9 09:37:07 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 7999505fd2f2888dfd915e4e6b219ae173bfe6ef
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Jul 9 09:36:16 2010 -0400
Removing unecessary comments that were present only for review
diff --git
a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
index bd9b3c3..8146de9 100644
---
a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
+++
b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
@@ -79,14 +79,6 @@ public class ApacheAugeasMapping implements RhqAugeasMapping {
DirectiveMapping mapping =
ApacheDirectiveRegExpression.getMappingType(propDef.getName());
ConfigurationDefinition def = new
ConfigurationDefinition("temp","");
def.put(propDef);
- // Removing call to create new configuration as this was causing the
TransientObjectException discussed
- // in
https://bugzilla.redhat.com/show_bug.cgi?id=601153. It is not clear
to why this configuration object
- // is created. Since I am not familiar with the augeas code, I need to
consult with Filip on this change.
- //
- // jsanda
-
-// Configuration configuration = new Configuration();
-// configuration.put(config.get(propDef.getName()));
mapping.mapToAugeas(tree, node, config, def);
}
}
commit 3d4ecf9e7243a0641712147102d481709e13fba7
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 9 14:44:21 2010 +0200
BZ 604716,604714 - disable alerts and favorites in the Footer.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index ca88567..559f223 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -70,9 +70,9 @@ public class Footer extends ToolStrip {
addMember(new ToolStripSeparator());
- addMember(new FavoritesButton());
-
- addMember(new AlertsMessage());
+// addMember(new FavoritesButton());
+
+// addMember(new AlertsMessage());
}
commit 5859a837d07167c1ea05ff08b501ab8104b0bf37
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 8 18:56:10 2010 -0400
BZ-610107: ensure search expression for translation into JPQL is whitespace-trimmed
and non-null
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
index 8893977..53f1f87 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
@@ -46,6 +46,11 @@ public class SearchTranslationManager {
}
public void setExpression(String expression) {
+ if (expression == null) {
+ expression = "";
+ } else {
+ expression = expression.trim();
+ }
this.expression = expression;
this.translator = SearchTranslatorFactory.getTranslator(this.context);
commit cf3e4987ebe4bd2d8d9a6d0b00750777885c4edd
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 8 18:55:16 2010 -0400
remove main method used for debugging long ago
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
index e8099dc..8893977 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java
@@ -286,10 +286,4 @@ public class SearchTranslationManager {
return builder.toString();
}
}
-
- public static void main(String[] args) throws Exception {
- SearchTranslationManager manager = new
SearchTranslationManager(SearchSubsystem.RESOURCE);
- manager.setExpression("(name = rhq and category = server) or plugin =
jbossas");
- String jpql = manager.getJPQLSelectStatement();
- }
}
commit 86e7669b628a750989a344e05dfe3e37b884f254
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 8 18:45:57 2010 -0400
BZ-610155: relax suggestion matching, suppress "empty" results
* only suggest plugin configuration param names for inventoried resources
* only suggest resource configuration param names for inventoried resources
* only suggest trait names for inventoried resources
* only suggest type values for inventoried resources
* only suggest plugin values for inventoried resources
* only suggest plugin configuration values for inventoried resources with the specific
plugin configuration param name, case-insensitively (relaxed)
* only suggest resourceplugin configuration values for inventoried resources with the
specific resourceplugin configuration param name, case-insensitively (relaxed)
* only suggest trait values for inventoried resources with the specific trait param
name, case-insensitively (relaxed)
* only suggest type values for visible groups in inventory
* only suggest plugin values for visible groups in inventory
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index 7f46e11..96c10ec 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -55,22 +55,26 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
} else if (context.equals("type")) {
return execute("" //
+ "SELECT DISTINCT type.name " //
- + " FROM ResourceType type " //
- + add(" WHERE LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " FROM ResourceType type, ResourceGroup rg " //
+ + " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ + " AND rg.visible = true " //
+ + add(" AND LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
return execute("" //
+ "SELECT DISTINCT type.plugin " //
- + " FROM ResourceType type " //
- + add(" WHERE LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " FROM ResourceType type, ResourceGroup rg " //
+ + " WHERE rg.resourceType = type " // only suggest names that
exist for visible groups in inventory
+ + " AND rg.visible = true " //
+ + add(" AND LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.plugin ");
} else if (context.equals("name")) {
return execute("" //
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
- + " WHERE rg.visible = true " //
+ + " WHERE rg.visible = true " // only suggest names that exist
for visible groups in inventory
+ add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase()
+ "%'", filter) //
+ " ORDER BY rg.name ");
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index 3be47bc..c03c7b5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -58,26 +58,30 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
} else if (context.equals("connection")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type " //
+ + " FROM ResourceType type, Resource res " //"
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions
definition " //
- + add(" WHERE LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("configuration")) {
return execute("" //
+ "SELECT DISTINCT definition.name " //
- + " FROM ResourceType type " //
+ + " FROM ResourceType type, Resource res " //
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions
definition " //
- + add(" WHERE LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " WHERE res.resourceType = type " // only suggest names that
exist for resources in inventory
+ + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY definition.name ");
} else if (context.equals("trait")) {
return execute("" //
- + "SELECT DISTINCT definition.name " //
- + " FROM MeasurementDefinition definition " //
- + " WHERE definition.dataType = 1 " //
- + add(" AND LOWER(definition.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
- + " ORDER BY definition.name ");
+ + "SELECT DISTINCT def.name " //
+ + " FROM MeasurementSchedule ms, Resource res " //
+ + " JOIN ms.definition def " //
+ + " WHERE ms.resource = res " // only suggest names that exist
for resources in inventory
+ + " AND def.dataType = 1 " // trait types
+ + add(" AND LOWER(def.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " ORDER BY def.name ");
} else {
return Collections.emptyList();
@@ -96,14 +100,16 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
} else if (context.equals("type")) {
return execute("" //
+ "SELECT DISTINCT type.name " //
- + " FROM ResourceType type " //
+ + " FROM Resource res " //
+ + " JOIN res.resourceType type " //
+ add(" WHERE LOWER(type.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.name ");
} else if (context.equals("plugin")) {
return execute("" //
+ "SELECT DISTINCT type.plugin " //
- + " FROM ResourceType type " //
+ + " FROM Resource res " //
+ + " JOIN res.resourceType type " //
+ add(" WHERE LOWER(type.plugin) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY type.plugin ");
@@ -121,9 +127,9 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
+ " FROM Resource res, PropertySimple simple " //
- + " JOIN res.pluginConfiguration.properties property " //
+ + " JOIN res.pluginConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" + param +
"%'" //
+ + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY simple.stringValue ");
@@ -131,18 +137,20 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant
{
return execute("" //
+ "SELECT DISTINCT simple.stringValue " //
+ " FROM Resource res, PropertySimple simple " //
- + " JOIN res.resourceConfiguration.properties property " //
+ + " JOIN res.resourceConfiguration.properties property " //
suggest values for existing resources only
+ " WHERE simple.id = property.id " //
- + " AND LOWER(property.name) LIKE '%" + param +
"%'" //
+ + " AND LOWER(property.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ add(" AND LOWER(property.stringValue) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) {
return execute("" //
- + "SELECT trait.value " //
- + " FROM MeasurementDataTrait trait " //
- + " WHERE trait.schedule.definition.dataType = 1 " //
- + " AND LOWER(trait.schedule.definition.name) LIKE '%" +
param + "%'" //
+ + "SELECT DISTINCT trait.value " //
+ + " FROM MeasurementDataTrait trait, Resource res " //
+ + " JOIN trait.schedule ms " //
+ + " WHERE ms.definition.dataType = 1 " //
+ + " AND ms.resource = res " // only suggest values that exist
for inventoried resources
+ + " AND LOWER(ms.definition.name) LIKE '%" +
param.toLowerCase() + "%'" //
+ add(" AND LOWER(trait.value) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ " ORDER BY trait.value ");
commit a01b65dc8559ee7be3f2914364d201000a75f9c2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Jul 8 17:40:40 2010 -0400
add i18n infrastructure to coregui and i19n about box as an example; expose product
info properties via a server SLSB API that can be used by coregui - the properties are
stored in a properties file, which can easily be replaced in the JON build - this allows
us to display the correct product name, version, and build number in the coregui About box
(fix for
https://bugzilla.redhat.com/show_bug.cgi?id=604679)
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
new file mode 100644
index 0000000..29aa74e
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
@@ -0,0 +1,121 @@
+/*
+ * 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.core.domain.common;
+
+import java.io.Serializable;
+
+/**
+ * Product (i.e. RHQ or JON) information.
+ *
+ * @author Ian Springer
+ */
+public class ProductInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private String shortName;
+ private String name;
+ private String fullName;
+ private String url;
+ private String urlDomain;
+ private String salesEmail;
+ private String supportEmail;
+ private String version;
+ private String buildNumber;
+ private String helpDocRoot;
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public void setShortName(String shortName) {
+ this.shortName = shortName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getUrlDomain() {
+ return urlDomain;
+ }
+
+ public void setUrlDomain(String urlDomain) {
+ this.urlDomain = urlDomain;
+ }
+
+ public String getSalesEmail() {
+ return salesEmail;
+ }
+
+ public void setSalesEmail(String salesEmail) {
+ this.salesEmail = salesEmail;
+ }
+
+ public String getSupportEmail() {
+ return supportEmail;
+ }
+
+ public void setSupportEmail(String supportEmail) {
+ this.supportEmail = supportEmail;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getBuildNumber() {
+ return buildNumber;
+ }
+
+ public void setBuildNumber(String buildNumber) {
+ this.buildNumber = buildNumber;
+ }
+
+ public String getHelpDocRoot() {
+ return helpDocRoot;
+ }
+
+ public void setHelpDocRoot(String helpDocRoot) {
+ this.helpDocRoot = helpDocRoot;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index ca1b68d..acbe21f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -17,23 +17,13 @@
<scm>
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/ente...
-
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
- </developerConnection>
+
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
</scm>
<properties>
<!-- dependency versions -->
<gwt.version>2.0.3</gwt.version>
-
- <product.shortName>RHQ</product.shortName>
- <product.name>RHQ</product.name>
- <product.fullName>RHQ</product.fullName>
- <product.url.domain>rhq-project.org</product.url.domain>
- <product.sales.email>sales(a)rhq-project.org</product.sales.email>
- <product.support.email>info(a)rhq-project.org</product.support.email>
- <product.version>${project.version}</product.version>
-
<
product.help.doc.root>http://support.rhq-project.org/display/RHQ/</...
<!-- If this is too much memory to allocate to your gwt:debug process then
override this property in
in your settings.xml -->
@@ -212,6 +202,28 @@
<plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+
<outputDirectory>${project.build.directory}/generated-sources/gwt</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
@@ -229,23 +241,22 @@
<hostedWebapp>target/hostedwar</hostedWebapp>
<debugSuspend>false</debugSuspend>
<servicePattern>**/gwt/*GWTService.java</servicePattern>
-
+
<i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
</configuration>
+
<executions>
<execution>
-
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
+ <goal>i18n</goal>
</goals>
</execution>
</executions>
</plugin>
-
<plugin>
<artifactId>maven-war-plugin</artifactId>
- <version>2.1-beta-1</version>
<configuration>
<archive>
<manifest>
@@ -268,7 +279,6 @@
<!--
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
<executions>
<execution>
<id>Generate I18N Resource Bundles</id>
@@ -331,7 +341,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
<executions>
<execution>
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index b0e8afa..a7782bf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -4,6 +4,7 @@
<module>
<inherits name='com.google.gwt.user.User'/>
+ <inherits name='com.google.gwt.i18n.I18N'/>
<inherits name='org.rhq.core.RHQDomain'/>
<inherits name='com.smartgwt.SmartGwt' />
@@ -40,7 +41,7 @@
<!--<set-property name="user.agent"
value="safari"/>-->
<!-- Firefox 3 -->
- <!-- <set-property name="user.agent"
value="gecko1_8"/>-->
+ <set-property name="user.agent" value="gecko1_8"/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
@@ -63,6 +64,7 @@
<servlet path="/RoleGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/>
<servlet path="/SearchGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/>
<servlet path="/SubjectGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/>
+ <servlet path="/SystemGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl"/>
<servlet path="/TagGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/>
</module>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 68d34f4..42f8a2c 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
@@ -1,3 +1,21 @@
+/*
+ * 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;
import com.google.gwt.core.client.EntryPoint;
@@ -23,6 +41,7 @@ import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.criteria.SubjectCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
@@ -67,6 +86,10 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
private static CoreGUI coreGUI;
+ private static Messages messages;
+
+ private static ProductInfo productInfo;
+
public void onModuleLoad() {
if (GWT.getHostPageBaseURL().indexOf("/coregui/") == -1) {
System.out.println("Suppressing load of CoreGUI module");
@@ -94,9 +117,11 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
messageCenter = new MessageCenter();
+ messages = GWT.create(Messages.class);
checkLoginStatus();
+
}
@@ -267,13 +292,13 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
}
public static void setSessionSubject(Subject subject) {
- // TODO this breaks because of reattach rules, bizarely even in queries. gonna
switch out to non-subject include apis
+ // TODO this breaks because of reattach rules, bizarrely even in queries. gonna
switch out to non-subject include apis
// Create a minimized session object for validation on requests
// Subject s = new Subject(subject.getName(),subject.getFactive(),
subject.getFsystem());
// s.setSessionId(subject.getSessionId());
CoreGUI.sessionSubject = subject;
CoreGUI.userPreferences = new UserPreferences(subject);
- coreGUI.buildCoreUI();
+ loadProductInfo();
}
public static void setContent(Canvas newContent) {
@@ -296,6 +321,27 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
breadCrumbTrailPane.refresh(currentViewPath);
}
+ public static Messages getMessages() {
+ return messages;
+ }
+
+ public static ProductInfo getProductInfo() {
+ return productInfo;
+ }
+
+ private static void loadProductInfo() {
+ GWTServiceLookup.getSystemService().getProductInfo(new
AsyncCallback<ProductInfo>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load product
information.", caught);
+ }
+
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ coreGUI.buildCoreUI();
+ }
+ });
+ }
+
private class RootCanvas extends VLayout implements BookmarkableView {
ViewId currentViewId;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index d38ea91..7aa6dff 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -28,6 +28,9 @@ 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.VLayout;
+import org.rhq.core.domain.common.ProductInfo;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.Messages;
/**
* The "About RHQ" modal window.
@@ -35,12 +38,13 @@ import com.smartgwt.client.widgets.layout.VLayout;
* @author Ian Springer
*/
public class AboutModalWindow extends Window {
- private static final String TITLE = "About RHQ";
+ private static final Messages MESSAGES = CoreGUI.getMessages();
+ private static final ProductInfo PRODUCT_INFO = CoreGUI.getProductInfo();
public AboutModalWindow() {
- setTitle(TITLE);
+ setTitle(MESSAGES.about_title(PRODUCT_INFO.getFullName()));
setWidth(300);
- setHeight(240);
+ setHeight(255);
setOverflow(Overflow.VISIBLE);
setShowMinimizeButton(false);
setIsModal(true);
@@ -62,23 +66,27 @@ public class AboutModalWindow extends Window {
HTMLFlow htmlFlow = new HTMLFlow();
String html =
"<span class=\"DisplaySubhead\">\n" +
- " <a
href=\"http://rhq-project.org/\"
title=\"RHQ Homepage\" target=\"_blank\">RHQ</a>\n" +
+ " <a href=\"" + PRODUCT_INFO.getUrl() + "\"
title=\"" + PRODUCT_INFO.getFullName() + " "
+ + MESSAGES.about_homepage() + "\"
target=\"_blank\">" + PRODUCT_INFO.getFullName() +
"</a>\n" +
"</span><br/>\n" +
- "<span class=\"DisplayLabel\">Version:
3.0.0-SNAPSHOT</span><br/>\n" +
- "<span class=\"DisplayLabel\">Build Number:
0</span>\n" +
- "<p><a
href=\"http://jboss.org/\"
title=\"JBoss Homepage\">\n" +
- " <img height=\"55\" alt=\"JBoss by Red
Hat\" src=\"/images/jboss_logo.png\">\n" +
+ "<span class=\"DisplayLabel\">" +
MESSAGES.about_version() + " " + PRODUCT_INFO.getVersion()
+ + "</span><br/>\n" +
+ "<span class=\"DisplayLabel\">" +
MESSAGES.about_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
+ + "</span>\n" +
+ "<p><a
href=\"http://jboss.org/\"
title=\"JBoss " + MESSAGES.about_homepage() + "\">\n" +
+ " <img height=\"55\" alt=\"" +
MESSAGES.about_jbossByRedHat() + "\"
src=\"/images/jboss_logo.png\">\n" +
"</a></p>\n" +
- "<div style=\"top-margin: 10px\">All rights
reserved.</div>\n";
+ "<div style=\"top-margin: 10px\">" +
MESSAGES.about_allRightsReserved() + "</div>\n";
htmlFlow.setContents(html);
contentPane.addMember(htmlFlow);
HLayout bottomPanel = new HLayout();
+ bottomPanel.setAlign(VerticalAlignment.BOTTOM);
contentPane.addMember(bottomPanel);
Canvas spacer = new Canvas();
spacer.setWidth("*");
bottomPanel.addMember(spacer);
- Button closeButton = new Button("Close");
+ Button closeButton = new Button(MESSAGES.button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
closeButton.setWidth("60");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index d48dd7a..2e4a26f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -60,6 +60,10 @@ public class GWTServiceLookup {
return secure(SubjectGWTServiceAsync.Util.getInstance());
}
+ public static SystemGWTServiceAsync getSystemService() {
+ return secure(SystemGWTServiceAsync.Util.getInstance());
+ }
+
public static MeasurementDataGWTServiceAsync getMeasurementDataService() {
return secure(MeasurementDataGWTServiceAsync.Util.getInstance());
}
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
new file mode 100644
index 0000000..c6dc504
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
@@ -0,0 +1,29 @@
+/*
+ * 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.gwt;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import org.rhq.core.domain.common.ProductInfo;
+
+/**
+ * @author Ian Springer
+ */
+public interface SystemGWTService extends RemoteService {
+ ProductInfo getProductInfo();
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
index 90469e0..bc0d32d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
@@ -54,7 +54,4 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl
implements Alert
return
SerialUtility.prepare(this.alertDefinitionManager.findAlertDefinitionsByCriteria(getSessionSubject(),
criteria),
"AlertService.findAlertDefinitionsByCriteria");
}
-
-
-
}
\ No newline at end of file
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
new file mode 100644
index 0000000..af12a6a
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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.server.gwt;
+
+import org.rhq.core.domain.common.ProductInfo;
+import org.rhq.enterprise.gui.coregui.client.gwt.SystemGWTService;
+import org.rhq.enterprise.server.system.SystemManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Ian Springer
+ */
+public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements
SystemGWTService {
+ private SystemManagerLocal systemManager = LookupUtil.getSystemManager();
+
+ public ProductInfo getProductInfo() {
+ return this.systemManager.getProductInfo(getSessionSubject());
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..60fe75b
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -0,0 +1,19 @@
+#
+# i18n Messages - English
+###########################
+
+#
+# Standard Button Labels
+#
+button.ok = OK
+button.close = Close
+
+#
+# About Box
+#
+about.title = About {0}
+about.homepage = Homepage
+about.version = Version:
+about.buildNumber = Build Number:
+about.jbossByRedHat = JBoss by Red Hat
+about.allRightsReserved = All Rights Reserved.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index 97b5a3e..c7846b4 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -15,6 +15,10 @@
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl</servlet-class>
</servlet>
<servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
SystemGWTService</servlet-name>
+
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl</servlet-class>
+ </servlet>
+ <servlet>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
ResourceGroupGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl</servlet-class>
</servlet>
@@ -103,6 +107,10 @@
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SubjectGWTService</url-pattern>
</servlet-mapping>
<servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
SystemGWTService</servlet-name>
+
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SystemGWTService</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
ResourceGroupGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGroupGWTService</url-pattern>
</servlet-mapping>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index 783942c..a794cd6 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -31,14 +31,7 @@
<!-- plugin versions -->
<jetty-jspc-maven-plugin.version>7.0.1.v20091125</jetty-jspc-maven-plugin.version>
- <product.shortName>RHQ</product.shortName>
- <product.name>RHQ</product.name>
- <product.fullName>RHQ</product.fullName>
- <product.url.domain>rhq-project.org</product.url.domain>
- <product.sales.email>sales(a)rhq-project.org</product.sales.email>
- <product.support.email>info(a)rhq-project.org</product.support.email>
- <product.version>${project.version}</product.version>
-
<
product.help.doc.root>http://support.rhq-project.org/display/RHQ/</...
+ <!-- Note: The product info properties now live in the RHQ root pom. -->
</properties>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
index 2510400..d72193e 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
+++
b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
@@ -6,9 +6,9 @@ product.name=${product.name}
product.fullName=${product.fullName}
product.version=${product.version}
product.buildNumber=${buildNumber}
-product.url.domain=${product.url.domain}
-product.support.email=${product.support.email}
-product.sales.email=${product.sales.email}
+product.url.domain=${product.urlDomain}
+product.support.email=${product.supportEmail}
+product.sales.email=${product.salesEmail}
header.plan=Plan
header.resource=Inventory
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index 9e2ae2b..f767b5a 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -629,9 +629,9 @@ v <rich:menuItem submitMode="none"
</p>
<p>
- <a
href="http://jboss.org/jopr">
+ <a
href="http://rhq-project.org/">
<h:graphicImage value="/images/logo_icon.png"
style="vertical-align:middle" />
- Jopr Project
+ RHQ Project
</a>
<ui:remove>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 9e7bb24..79fdc38 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -394,6 +394,13 @@
<build>
<finalName>${project.artifactId}</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
<testResources>
<testResource>
<directory>src/test/resources</directory>
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
index cbee6bc..2d766aa 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
@@ -19,6 +19,7 @@
package org.rhq.enterprise.server.core;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Properties;
@@ -34,9 +35,13 @@ import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.system.server.ServerConfig;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.util.ObjectNameFactory;
public class CoreServer extends ServiceMBeanSupport implements CoreServerMBean {
+ private static final String PRODUCT_INFO_PROPERTIES_RESOURCE_PATH =
+ "org/rhq/enterprise/server/core/ProductInfo.properties";
+
private final Log log = LogFactory.getLog(CoreServer.class);
/**
@@ -125,6 +130,35 @@ public class CoreServer extends ServiceMBeanSupport implements
CoreServerMBean {
return serverTempDir;
}
+ public ProductInfo getProductInfo() {
+ ClassLoader classLoader = this.getClass().getClassLoader();
+ InputStream inputStream =
classLoader.getResourceAsStream(PRODUCT_INFO_PROPERTIES_RESOURCE_PATH);
+ if (inputStream == null) {
+ throw new IllegalStateException("Failed to find class loader resource
["
+ + PRODUCT_INFO_PROPERTIES_RESOURCE_PATH + "].");
+ }
+ Properties props = new Properties();
+ try {
+ props.load(inputStream);
+ } catch (IOException e) {
+ throw new IllegalStateException("Failed to load product info properties
from class loader resource ["
+ + PRODUCT_INFO_PROPERTIES_RESOURCE_PATH + "].");
+ }
+ ProductInfo productInfo = new ProductInfo();
+ // TODO: Using reflection below might be nicer.
+ productInfo.setBuildNumber(props.getProperty("buildNumber"));
+ productInfo.setFullName(props.getProperty("fullName"));
+ productInfo.setHelpDocRoot(props.getProperty("helpDocRoot"));
+ productInfo.setName(props.getProperty("name"));
+ productInfo.setSalesEmail(props.getProperty("salesEmail"));
+ productInfo.setShortName(props.getProperty("shortName"));
+ productInfo.setSupportEmail(props.getProperty("supportEmail"));
+ productInfo.setUrlDomain(props.getProperty("urlDomain"));
+ productInfo.setUrl(props.getProperty("url"));
+ productInfo.setVersion(props.getProperty("version"));
+ return productInfo;
+ }
+
private MBeanServer getMBeanServer() {
return MBeanServerLocator.locateJBoss();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java
index 108a0d5..33c105d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java
@@ -25,6 +25,7 @@ import javax.management.ObjectName;
import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.system.ServiceMBean;
+import org.rhq.core.domain.common.ProductInfo;
/**
* An MBean that exposes various core server global attributes (version, uptime, etc.).
@@ -84,4 +85,11 @@ public interface CoreServerMBean extends ServiceMBean {
* @return jboss server home directory
*/
File getJBossServerTempDir();
+
+ /**
+ * Product information - the product name, homepage URL, docs URL, etc.
+ *
+ * @return product information - the product name, homepage URL, docs URL, etc.
+ */
+ ProductInfo getProductInfo();
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 4dc713b..7e4ce9e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -58,6 +58,7 @@ import org.rhq.core.db.DatabaseType;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.common.SystemConfiguration;
import org.rhq.core.server.PersistenceUtility;
import org.rhq.core.util.ObjectNameFactory;
@@ -662,4 +663,10 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
ServerVersion serverVersion = new ServerVersion(version, buildNumber);
return serverVersion;
}
+
+ public ProductInfo getProductInfo(Subject subject) {
+ CoreServerMBean coreServer = LookupUtil.getCoreServer();
+ ProductInfo productInfo = coreServer.getProductInfo();
+ return productInfo;
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
index e339c8b..e044b0a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
@@ -25,6 +25,7 @@ import javax.ejb.Local;
import org.rhq.core.db.DatabaseType;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.server.license.License;
/**
@@ -172,4 +173,6 @@ public interface SystemManagerLocal {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ServerVersion getServerVersion(Subject subject) throws Exception;
+
+ ProductInfo getProductInfo(Subject subject);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java
index 8fa6c5b..cb04a95 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java
@@ -24,6 +24,7 @@ import javax.jws.WebParam;
import javax.jws.WebService;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.common.ProductInfo;
/**
* @author John Mazzitelli
@@ -39,4 +40,8 @@ public interface SystemManagerRemote {
@WebMethod
ServerVersion getServerVersion( //
@WebParam(name = "subject") Subject subject) throws Exception;
+
+ @WebMethod
+ ProductInfo getProductInfo(
+ @WebParam(name = "subject") Subject subject);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
index cab0954..1fd9720 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Set;
import javax.ejb.Stateless;
+import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -46,6 +47,7 @@ import org.rhq.core.domain.bundle.BundleResourceDeployment;
import org.rhq.core.domain.bundle.BundleType;
import org.rhq.core.domain.bundle.BundleVersion;
import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PluginConfigurationUpdate;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
@@ -1008,6 +1010,10 @@ public class WebservicesManagerBean implements WebservicesRemote {
return systemManager.getServerVersion(subject);
}
+ public ProductInfo getProductInfo(@WebParam(name = "subject") Subject
subject) {
+ return systemManager.getProductInfo(subject);
+ }
+
//SYSTEMMANAGER: END ------------------------------------
private void checkParametersPassedIn(Subject subject, Criteria criteria) {
diff --git
a/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties
b/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties
new file mode 100644
index 0000000..f323a0e
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties
@@ -0,0 +1,9 @@
+shortName = ${product.shortName}
+name = ${product.name}
+fullName = ${product.fullName}
+version = ${product.version}
+buildNumber = ${buildNumber}
+url = ${product.url}
+urlDomain = ${product.urlDomain}
+supportEmail = ${product.supportEmail}
+salesEmail = ${product.salesEmail}
diff --git a/pom.xml b/pom.xml
index 4743b2c..7ff85bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,7 +43,16 @@
<!-- set the below prop to true to enable misc extra build output -->
<rhq.debug>false</rhq.debug>
- <findbugs.version>2.3</findbugs.version>
+ <!-- product info -->
+ <product.shortName>RHQ</product.shortName>
+ <product.name>RHQ</product.name>
+ <product.fullName>RHQ</product.fullName>
+ <
product.url>http://rhq-project.org/</product.url>
+ <product.urlDomain>rhq-project.org</product.urlDomain>
+ <product.salesEmail>sales(a)rhq-project.org</product.salesEmail>
+ <product.supportEmail>info(a)rhq-project.org</product.supportEmail>
+ <product.version>${project.version}</product.version>
+
<
product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</pr...
<doUpdate>false</doUpdate>
@@ -65,6 +74,7 @@
<commons-logging.version>1.1.0.jboss</commons-logging.version>
<concurrent.version>1.3.4-jboss-update1</concurrent.version> <!--
oswego-concurrent compatible with 4.2.3.GA -->
+ <findbugs.version>2.3</findbugs.version>
<getopt.version>1.0.13</getopt.version>
<hibernate3.version>3.2.r14201-2</hibernate3.version>
<hibernate-annotations.version>3.2.1.GA</hibernate-annotations.version>
@@ -600,7 +610,7 @@
<goals>
<goal>run</goal>
</goals>
- <phase>generate-resources</phase>
+ <phase>generate-sources</phase>
<configuration>
<tasks>
<tstamp>
@@ -635,7 +645,7 @@
<executions>
<execution>
<id>generate-build-number-properties</id>
- <phase>generate-resources</phase>
+ <phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
@@ -658,7 +668,7 @@
<executions>
<execution>
<id>read-build-properties</id>
- <phase>process-resources</phase>
+ <phase>process-sources</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
commit 5623f6c379c745715c0ae18f878b269713d3a64d
Merge: c582fb4... c229c5c...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 16:51:43 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit c582fb4252fb6e583807287950d2aca8aa365f6e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 16:49:14 2010 -0400
[BZ 612100] Work to better inform the bundle create wizard
user about file upload when in progress. And to protect against
previous/next navigation until the upload completes.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
index 7e3ed51..794a2c1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
@@ -37,13 +37,13 @@ import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
import org.rhq.enterprise.gui.coregui.client.components.upload.BundleFileUploadForm;
import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler;
import
org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class BundleUploadDataStep implements WizardStep {
+public class BundleUploadDataStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard;
private final BundleGWTServiceAsync bundleServer =
GWTServiceLookup.getBundleService();
@@ -89,9 +89,25 @@ public class BundleUploadDataStep implements WizardStep {
}
public boolean nextPage() {
+ wizard.getView().hideMessage();
+
return isFinished();
}
+ public boolean previousPage() {
+ wizard.getView().hideMessage();
+
+ for (BundleFileUploadForm uploadForm : this.uploadForms) {
+ if (uploadForm.isUploadInProgress()) {
+ handleUploadError("[" + uploadForm.getName()
+ + "] Upload is in progress... This can take several minutes for
large files.", false);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
public String getName() {
return "Upload Bundle Files";
}
@@ -107,9 +123,13 @@ public class BundleUploadDataStep implements WizardStep {
boolean needToUpload = false;
for (BundleFileUploadForm uploadForm : this.uploadForms) {
- if (uploadForm.getUploadResult() == null) {
- uploadForm.submitForm();
+ if (uploadForm.isUploadInProgress()) {
+ handleUploadError("[" + uploadForm.getName()
+ + "] Upload is in progress... This can take several minutes for
large files.", false);
+ needToUpload = true;
+ } else if (uploadForm.getUploadResult() == null) {
needToUpload = true;
+ uploadForm.submitForm();
// on certain errors the form may never be submitted, report these errors
outside submit handlers
handleUploadError(uploadForm.getUploadError(), false);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
index bd447ef..27f5a99 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
@@ -42,13 +42,13 @@ import
org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFo
import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler;
import
org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent;
import org.rhq.enterprise.gui.coregui.client.components.upload.TextFileRetrieverForm;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class BundleUploadDistroFileStep implements WizardStep {
+public class BundleUploadDistroFileStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard;
@@ -89,6 +89,12 @@ public class BundleUploadDistroFileStep implements WizardStep {
public boolean nextPage() {
wizard.getView().hideMessage();
+ if (uploadDistroForm.isUploadInProgress()) {
+ handleUploadError("Upload is in progress... This can take several
minutes for large distribution files.",
+ false);
+ return false;
+ }
+
if (wizard.getBundleVersion() == null) {
String selected = radioGroup.getSelected();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
index 3021132..a835f23 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
@@ -42,6 +42,7 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
private Boolean uploadResult;
private String uploadError;
+ private boolean uploadInProgress;
private int bundleVersionId;
private final FormItemIcon iconLoading;
@@ -103,9 +104,20 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
this.uploadError = uploadError;
}
+ public boolean isUploadInProgress() {
+ return uploadInProgress;
+ }
+
@Override
public void submitForm() {
setUploadError(null);
+
+ if (uploadInProgress) {
+ String message = "Can not submit, upload is currently in
progress";
+ setUploadError(message);
+ return;
+ }
+
Object value = bundleUploadItem.getValue();
if (value == null || value.toString().length() == 0) {
String message = "Please select a bundle distribution file to
upload";
@@ -116,6 +128,7 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
} else {
icon.setIcons(iconLoading);
icon.setTooltip("Processing...");
+ uploadInProgress = true;
super.submitForm();
}
}
@@ -167,6 +180,8 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
// make sure this handler is executed first in case the creator has also added a
handler
pushFormHandler(new DynamicFormHandler() {
public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
+ uploadInProgress = false;
+
String results = event.getResults();
bundleVersionId = parseIdFromResponse(results);
if (bundleVersionId > 0) {
@@ -193,6 +208,8 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() {
public void onFormSubmitFailed(FormSubmitFailedEvent event) {
+ uploadInProgress = false;
+
uploadResult = Boolean.FALSE;
String cause = "Bundle Distribution file upload failed, check for
invalid file path.";
icon.setIcons(iconRed);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
index f3d862c..9455302 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
@@ -43,6 +43,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
private Boolean uploadResult;
private String uploadError;
+ private boolean uploadInProgress;
private final BundleVersion bundleVersion;
private final String name;
@@ -60,6 +61,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
this.name = name;
this.showNameLabel = showNameLabel;
this.uploadResult = isAlreadyUploaded; // null if unknown, false if error during
previous upload attempt, true if already uploaded before
+ this.uploadInProgress = false;
setEncoding(Encoding.MULTIPART);
setAction(GWT.getModuleBaseURL() + "/BundleFileUploadServlet");
@@ -118,9 +120,20 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
this.uploadError = uploadError;
}
+ public boolean isUploadInProgress() {
+ return uploadInProgress;
+ }
+
@Override
public void submitForm() {
setUploadError(null);
+
+ if (uploadInProgress) {
+ String message = "Can not submit, upload is currently in
progress";
+ setUploadError(message);
+ return;
+ }
+
Object value = bundleUploadItem.getValue();
if (value == null || value.toString().length() == 0) {
String message = "[" + name + "] Please select a file to
upload";
@@ -131,6 +144,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
} else {
icon.setIcons(iconLoading);
icon.setTooltip("Loading...");
+ uploadInProgress = true;
super.submitForm();
}
}
@@ -190,6 +204,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
// push the form handler so it executes first if the form creator has also added
a handler
pushFormHandler(new DynamicFormHandler() {
public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
+ uploadInProgress = false;
+
String results = event.getResults();
if (!results.contains("Failed to upload bundle file")) {
uploadResult = Boolean.TRUE;
@@ -216,6 +232,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() {
public void onFormSubmitFailed(FormSubmitFailedEvent event) {
+ uploadInProgress = false;
+
uploadResult = Boolean.FALSE;
String cause = "Bundle file [" + name + "] upload failed,
check for invalid file path.";
icon.setIcons(iconRed);
commit cde0a9ace064bdac47754bb31076c6e2cc6255eb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 16:47:00 2010 -0400
As part of the research for BZ 611456 (delete bundle issue) I found that
Bundle had cascade delete (actually cascade all) declared for
bundleVersions. This is not necessary, or desired. Removing all cascade
options on bundleVersions. Unfortunately, I don't think this was the
cause of any deleteBundle issues that may be occurring.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java
index bed3a10..6dd4a02 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java
@@ -101,7 +101,7 @@ public class Bundle implements Serializable {
@OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade =
CascadeType.ALL)
private List<BundleDestination> destinations = new
ArrayList<BundleDestination>();
- @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade =
CascadeType.ALL)
+ @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY)
private List<BundleVersion> bundleVersions = new
ArrayList<BundleVersion>();
@ManyToMany(mappedBy = "bundles", fetch = FetchType.LAZY, cascade =
CascadeType.REMOVE)
commit 12da55901c5a611771cc43dad254fa77bb30664c
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 16:44:07 2010 -0400
Added previousPage() to WizardStep interface. This is analogous to the
existing nextPage() hook. It allows a Step to deny the Previous button
from moving to the previous step. This is not usually needed but in
certain cases the step may have in-progress work, like file upload, that
should be allowed to complete for a consistent user experience.
To make interface changes easier to apply in the future created
AbstractWizardStep and updated all WizardSteps to extend it. Note that
nextPage and previousPage return true by default, in the abstract class.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
index 0959e26..219d58f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java
@@ -25,12 +25,12 @@ import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/**
* @author John Mazzitelli
*/
-public class BundleSummaryStep implements WizardStep {
+public class BundleSummaryStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard;
@@ -87,7 +87,7 @@ public class BundleSummaryStep implements WizardStep {
public boolean nextPage() {
CoreGUI.refresh();
-
+
return true; // this is the last page, we are done
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java
index 79bcc09..b173219 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java
@@ -35,12 +35,12 @@ import
org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFo
import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler;
import
org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent;
import org.rhq.enterprise.gui.coregui.client.components.upload.TextFileRetrieverForm;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-public class BundleUploadRecipeStep implements WizardStep {
+public class BundleUploadRecipeStep extends AbstractWizardStep {
private DynamicCallbackForm form;
private final AbstractBundleCreateWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
index d8bf7ae..c96debc 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java
@@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -38,7 +38,7 @@ import
org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
* @author Jay Shaughnessy
*
*/
-public class DeployStep implements WizardStep {
+public class DeployStep extends AbstractWizardStep {
private VLayout canvas;
private final BundleDeployWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java
index 505948b..38a1f79 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java
@@ -25,9 +25,9 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-public class GetDeploymentConfigStep implements WizardStep {
+public class GetDeploymentConfigStep extends AbstractWizardStep {
private final BundleDeployWizard wizard;
private VLayout editor;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
index 1c00b7d..558d396 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java
@@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -36,7 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
* @author Jay Shaughnessy
*
*/
-public class GetDeploymentInfoStep implements WizardStep {
+public class GetDeploymentInfoStep extends AbstractWizardStep {
private DynamicForm form;
private final BundleDeployWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
index 5f1e6b9..24ca6c7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java
@@ -26,9 +26,9 @@ import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-public class GetDeploymentOptionsStep implements WizardStep {
+public class GetDeploymentOptionsStep extends AbstractWizardStep {
static private final String DEPLOY_LATER = "later";
static private final String DEPLOY_NOW = "now";
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
index 0fab3aa..407e3d9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
@@ -33,13 +33,13 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDestination;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import
org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.SinglePlatformResourceGroupSelector;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class GetDestinationStep implements WizardStep {
+public class GetDestinationStep extends AbstractWizardStep {
private final BundleGWTServiceAsync bundleServer =
GWTServiceLookup.getBundleService();
private final BundleDeployWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
index ee64475..271ca59 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java
@@ -25,10 +25,10 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.bundle.Bundle;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleSelector;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector;
-public class SelectBundleStep implements WizardStep {
+public class SelectBundleStep extends AbstractWizardStep {
private final BundleDeployWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
index c57bb49..a9529af 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java
@@ -34,11 +34,11 @@ import org.rhq.core.domain.criteria.BundleDeploymentCriteria;
import org.rhq.core.domain.criteria.BundleVersionCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-public class SelectBundleVersionStep implements WizardStep {
+public class SelectBundleVersionStep extends AbstractWizardStep {
static private final String LATEST_VERSION = "latest";
static private final String LIVE_VERSION = "live";
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
index d531de7..d71992e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
@@ -30,7 +30,7 @@ import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.core.domain.criteria.BundleDeploymentCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -39,7 +39,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
* @author Jay Shaughnessy
*
*/
-public class ConfirmationStep implements WizardStep {
+public class ConfirmationStep extends AbstractWizardStep {
private VLayout layout;
private boolean nextPage = true;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
index 5608172..0164035 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java
@@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -36,7 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
* @author Jay Shaughnessy
*
*/
-public class GetRevertInfoStep implements WizardStep {
+public class GetRevertInfoStep extends AbstractWizardStep {
private DynamicForm form;
private final BundleRevertWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
index 04bec9f..41566e3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java
@@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -38,7 +38,7 @@ import
org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
* @author Jay Shaughnessy
*
*/
-public class RevertStep implements WizardStep {
+public class RevertStep extends AbstractWizardStep {
private VLayout canvas;
private final BundleRevertWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
new file mode 100644
index 0000000..1fd87f8
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java
@@ -0,0 +1,36 @@
+/*
+ * 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.components.wizard;
+
+import com.smartgwt.client.widgets.Canvas;
+
+public abstract class AbstractWizardStep implements WizardStep {
+
+ abstract public Canvas getCanvas();
+
+ abstract public String getName();
+
+ public boolean nextPage() {
+ return true;
+ }
+
+ public boolean previousPage() {
+ return true;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java
index f9fe66b..c21a564 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java
@@ -29,5 +29,7 @@ public interface WizardStep {
boolean nextPage();
+ boolean previousPage();
+
String getName();
}
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 93fe036..a8ff10b 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
@@ -164,7 +164,11 @@ public class WizardView extends VLayout {
previousButton.setDisabled(true);
previousButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- decrementStep();
+
+ WizardStep step = wizard.getSteps().get(currentStep);
+ if (step.previousPage()) {
+ decrementStep();
+ }
}
});
nextButton = new IButton("Next");
@@ -236,6 +240,9 @@ public class WizardView extends VLayout {
contentLayout.addMember(currentCanvas);
+ // clean any message from a previous step
+ hideMessage();
+
markForRedraw();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
index 002c8f9..96b6017 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java
@@ -28,7 +28,6 @@ import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.ValuesManager;
import com.smartgwt.client.widgets.form.fields.AutoFitTextAreaItem;
-import com.smartgwt.client.widgets.form.fields.BooleanItem;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.IPickTreeItem;
import com.smartgwt.client.widgets.form.fields.TextAreaItem;
@@ -37,20 +36,18 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import
org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
/**
* @author Greg Hinkle
*/
-public class GroupCreateStep implements WizardStep {
-
+public class GroupCreateStep extends AbstractWizardStep {
private DynamicForm form;
public Canvas getCanvas() {
-
if (form == null) {
form = new DynamicForm();
@@ -64,7 +61,7 @@ public class GroupCreateStep implements WizardStep {
TextAreaItem description = new AutoFitTextAreaItem("description",
"Description");
- CheckboxItem recursive = new
CheckboxItem("recursive","Recursive");
+ CheckboxItem recursive = new CheckboxItem("recursive",
"Recursive");
LinkedHashMap<String, Canvas> options = new LinkedHashMap<String,
Canvas>();
@@ -83,7 +80,6 @@ public class GroupCreateStep implements WizardStep {
form2.setFields(typeSelectItem);
options.put("Compatible", form2);
-
RadioGroupWithComponentsItem kind = new
RadioGroupWithComponentsItem("kind", "Group Type", options, form);
kind.setValue("Mixed Resources");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
index 0f5f92c..5f13657 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java
@@ -26,14 +26,13 @@ import java.util.HashSet;
import com.smartgwt.client.widgets.Canvas;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
/**
* @author Greg Hinkle
*/
-public class GroupMembersStep implements WizardStep {
-
+public class GroupMembersStep extends AbstractWizardStep {
private GroupCreateWizard wizard;
private ResourceSelector selector;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java
index 42de0a4..e4c7d53 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java
@@ -25,12 +25,12 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.operation.OperationDefinition;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/**
* @author Greg Hinkle
*/
-public class OperationParametersStep implements WizardStep {
+public class OperationParametersStep extends AbstractWizardStep {
private OperationDefinition definition;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
index c1546a8..0623308 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java
@@ -43,12 +43,12 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.TimeItem;
import com.smartgwt.client.widgets.form.validator.CustomValidator;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/**
* @author Greg Hinkle
*/
-public class OperationSchedulingStep implements WizardStep, ItemChangedHandler {
+public class OperationSchedulingStep extends AbstractWizardStep implements
ItemChangedHandler {
private DynamicForm form;
private ValuesManager valuesManager;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java
index 0d466d3..3ff18c6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java
@@ -23,12 +23,12 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/**
* @author Greg Hinkle
*/
-public class ConfigurationStep implements WizardStep {
+public class ConfigurationStep extends AbstractWizardStep {
private ConfigurationEditor editor;
ResourceFactoryCreateWizard wizard;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
index d619c3a..14ec617 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java
@@ -28,12 +28,12 @@ import com.smartgwt.client.widgets.form.fields.TextItem;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/**
* @author Greg Hinkle
*/
-public class ConfigurationTemplateStep implements WizardStep {
+public class ConfigurationTemplateStep extends AbstractWizardStep {
private DynamicForm form;
private ResourceFactoryCreateWizard wizard;
commit c229c5caa1bcde75fd61f2340721d22c7d0c8779
Merge: 6fefb92... 8e0e245...
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 8 15:10:18 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 6fefb92216811c6a727e5bff0eb6de6872d0d2be
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 8 15:07:56 2010 -0400
[BZ 604744] Correcting property name for resource category field
The Resource property names and their corresponding display names used in and by
ResourceDataSource were hard coded in several places. I introdcued a new enum,
ResourceDataSourceField which encapsulates the property names and their display
names.
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
new file mode 100644
index 0000000..358021d
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.inventory.resource;
+
+public enum ResourceDataSourceField {
+
+ NAME("name", "Name"),
+
+ DESCRIPTION("description", "Description"),
+
+ TYPE("resourceType.name", "Type"),
+
+ PLUGIN("pluginName", "Plugin"),
+
+ CATEGORY("resourceType.category", "Category"),
+
+ AVAILABILITY("currentAvailability", "Availability");
+
+ /**
+ * Corresponds to a property name of Resource
+ */
+ private String propertyName;
+
+ /**
+ * The display name for the field or proeprty
+ */
+ private String title;
+
+ private ResourceDataSourceField(String propertyName, String title) {
+ this.propertyName = propertyName;
+ this.title = title;
+ }
+
+ public String propertyName() {
+ return propertyName;
+ }
+
+ public String title() {
+ return title;
+ }
+
+}
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 ec47c75..048ba11 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,8 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import java.util.List;
-
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
@@ -30,7 +28,6 @@ import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.Resource;
@@ -43,6 +40,15 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.List;
+
+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.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;
+
/**
* @author Greg Hinkle
*/
@@ -61,17 +67,19 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
DataSourceImageField iconField = new DataSourceImageField("icon");
iconField.setImageURLPrefix("types/");
- DataSourceTextField nameDataField = new DataSourceTextField("name",
"Name", 200);
+ DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(),
NAME.title(), 200);
nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new
DataSourceTextField("description", "Description");
+ DataSourceTextField descriptionDataField = new
DataSourceTextField(DESCRIPTION.propertyName(),
+ DESCRIPTION.title());
descriptionDataField.setCanEdit(false);
- DataSourceTextField typeNameDataField = new
DataSourceTextField("typeName", "Type");
- DataSourceTextField pluginNameDataField = new
DataSourceTextField("pluginName", "Plugin");
- DataSourceTextField categoryDataField = new
DataSourceTextField("category", "Category");
+ DataSourceTextField typeNameDataField = new
DataSourceTextField(TYPE.propertyName(), TYPE.title());
+ DataSourceTextField pluginNameDataField = new
DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title());
+ DataSourceTextField categoryDataField = new
DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new
DataSourceImageField("currentAvailability", "Availability", 20);
+ DataSourceImageField availabilityDataField = new
DataSourceImageField(AVAILABILITY.propertyName(),
+ AVAILABILITY.title(), 20);
availabilityDataField.setCanEdit(false);
@@ -97,27 +105,28 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
"parentId")));
}
- if (request.getCriteria().getValues().get("name") != null) {
- criteria.addFilterName((String)
request.getCriteria().getValues().get("name"));
+ if (request.getCriteria().getValues().get(NAME.propertyName()) != null) {
+ criteria.addFilterName((String)
request.getCriteria().getValues().get(NAME.propertyName()));
}
- if (request.getCriteria().getValues().get("category") != null) {
+ if (request.getCriteria().getValues().get(CATEGORY.propertyName()) != null) {
criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String)
request.getCriteria().getValues()
- .get("category")).toUpperCase()));
+ .get(CATEGORY.propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get("availability") != null) {
+ if (request.getCriteria().getValues().get(AVAILABILITY.propertyName()) != null)
{
criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String)
request.getCriteria().getValues()
- .get("availability")).toUpperCase()));
+ .get(AVAILABILITY.propertyName())).toUpperCase()));
}
- if (request.getCriteria().getValues().get("type") != null) {
+ if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) {
criteria
- .addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get("type"))));
+ .addFilterResourceTypeId(Integer.parseInt(((String)
request.getCriteria().getValues().get(
+ TYPE.propertyName()))));
}
- if (request.getCriteria().getValues().get("plugin") != null) {
- criteria.addFilterPluginName((String)
request.getCriteria().getValues().get("plugin"));
+ if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) {
+ criteria.addFilterPluginName((String)
request.getCriteria().getValues().get(PLUGIN.propertyName()));
}
if (request.getCriteria().getValues().get("tag") != null) {
@@ -191,11 +200,11 @@ public class ResourceDatasource extends
RPCDataSource<Resource> {
ListGridRecord record = new ListGridRecord();
record.setAttribute("resource", from);
record.setAttribute("id", from.getId());
- record.setAttribute("name", from.getName());
- record.setAttribute("description", from.getDescription());
- record.setAttribute("typeName", from.getResourceType().getName());
- record.setAttribute("pluginName", from.getResourceType().getPlugin());
- record.setAttribute("category",
from.getResourceType().getCategory().getDisplayName());
+ record.setAttribute(NAME.propertyName(), from.getName());
+ record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
+ record.setAttribute(TYPE.propertyName(), from.getResourceType().getName());
+ record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
+ record.setAttribute(CATEGORY.propertyName(),
from.getResourceType().getCategory().getDisplayName());
record.setAttribute("icon",
from.getResourceType().getCategory().getDisplayName() + "_"
+ (from.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP
? "up" : "down") + "_16.png");
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 c08c42f..77f326b 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
@@ -39,6 +39,13 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+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.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;
+
/**
* @author Greg Hinkle
*/
@@ -98,19 +105,19 @@ public class ResourceSearchView extends Table {
ListGridField idField = new ListGridField("id", "Id", 55);
idField.setType(ListGridFieldType.INTEGER);
ListGridField iconField = new ListGridField("icon","", 40);
- ListGridField nameField = new ListGridField("name", "Name",
250);
+ ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(),
250);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
return "<a href=\"#Resource/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
}
});
- ListGridField descriptionField = new ListGridField("description",
"Description");
- ListGridField typeNameField = new ListGridField("typeName",
"Type", 130);
- ListGridField pluginNameField = new ListGridField("pluginName",
"Plugin", 100);
- ListGridField categoryField = new ListGridField("category",
"Category", 60);
+ ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(),
DESCRIPTION.title());
+ ListGridField typeNameField = new ListGridField(TYPE.propertyName(),
TYPE.title(), 130);
+ ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(),
PLUGIN.title(), 100);
+ ListGridField categoryField = new ListGridField(CATEGORY.propertyName(),
CATEGORY.title(), 60);
- ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
+ ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(),
AVAILABILITY.title(), 55);
availabilityField.setAlign(Alignment.CENTER);
getListGrid().setFields(idField, iconField, nameField, descriptionField,
typeNameField, pluginNameField,
categoryField, availabilityField);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
index 6dfdf36..0923c4d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
@@ -51,6 +51,13 @@ import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
+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.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;
+
/**
* @author Greg Hinkle
*/
@@ -107,12 +114,12 @@ public class SearchBarPane extends HLayout {
comboBox.setOptionDataSource(new ResourceDatasource());
- ListGridField nameField = new ListGridField("name", "Name",
250);
- ListGridField descriptionField = new ListGridField("description",
"Description");
- ListGridField typeNameField = new ListGridField("resourceType.name",
"Type", 130);
- ListGridField pluginNameField = new ListGridField("pluginName",
"Plugin", 100);
- ListGridField categoryField = new ListGridField("category",
"Category", 60);
- ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
+ ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(),
250);
+ ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(),
DESCRIPTION.title());
+ ListGridField typeNameField = new ListGridField(TYPE.propertyName(),
TYPE.title(), 130);
+ ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(),
PLUGIN.title(), 100);
+ ListGridField categoryField = new ListGridField(CATEGORY.propertyName(),
CATEGORY.title(), 60);
+ ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(),
AVAILABILITY.title(), 55);
availabilityField.setAlign(Alignment.CENTER);
comboBox.setPickListFields(nameField, descriptionField, typeNameField,
pluginNameField, categoryField, availabilityField);
commit 8e0e245599ff900c815ae60bf10d767c021dc2a5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 8 14:16:40 2010 -0400
BZ-612612: only suggest names for visible groups
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index 8ad4dd5..7f46e11 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -70,7 +70,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant {
return execute("" //
+ "SELECT DISTINCT rg.name " //
+ " FROM ResourceGroup rg " //
- + add(" WHERE LOWER(rg.name) LIKE '%" +
filter.toLowerCase() + "%'", filter) //
+ + " WHERE rg.visible = true " //
+ + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase()
+ "%'", filter) //
+ " ORDER BY rg.name ");
} else {
commit 868926d6448140a0c0be38b70cc9110da18cca74
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Jul 8 13:03:32 2010 -0400
removed obsolete auto-complete / search suggestion components
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java
deleted file mode 100644
index cbdd17b..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java
+++ /dev/null
@@ -1,158 +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.search.suggest;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.OptionElement;
-import com.google.gwt.dom.client.SelectElement;
-import com.google.gwt.user.client.ui.ListBox;
-
-import org.rhq.core.domain.search.SearchSuggestion;
-import org.rhq.core.domain.search.SearchSuggestion.Kind;
-
-public class SuggestResultsListBox extends ListBox {
- public static final String FOOTER_MESSAGE = "Start typing for more simple text
matches";
-
- private List<SearchSuggestion> searchSuggestions = new
ArrayList<SearchSuggestion>();
-
- private final List<String> OPERATORS = Arrays.asList("!==",
"!=", "==", "=");
-
- public void setErrorMessage(String error) {
- this.searchSuggestions.clear();
- this.searchSuggestions.add(new SearchSuggestion(Kind.InstructionalTextComment,
error));
- }
-
- public void setSearchSuggestions(List<SearchSuggestion> searchSuggestions) {
- this.searchSuggestions.clear();
- this.searchSuggestions.addAll(searchSuggestions);
- }
-
- public int render(int maxSuggestions, int maxResultsShown) {
- clear();
- int addedResults = 0;
-
- if (searchSuggestions.size() == 0) {
- appendFooter(FOOTER_MESSAGE);
- addedResults++;
- }
-
- for (SearchSuggestion next : searchSuggestions) {
- if (addedResults == maxSuggestions) {
- break;
- }
-
- appendSuggestItem(next);
- addedResults++;
- }
-
- setVisibleItemCount(Math.max(2, Math.min(maxResultsShown, addedResults)));
-
- return addedResults;
- }
-
- private void appendFooter(String message) {
- SelectElement select = getElement().cast();
- OptionElement option = Document.get().createOptionElement();
-
- String style = "float: left; margin-left: 2px; font-style: italic; color:
gray;";
- String footer = "<span style=\"" + style +
"\">" + message + "</span>";
-
- style = "clear: both;";
- String floatClear = "<br style=\"" + style + "\"
/>";
-
- option.setDisabled(true);
- option.setValue(FOOTER_MESSAGE);
- option.setInnerHTML(footer + floatClear);
- select.add(option, null);
- }
-
- private void appendSuggestItem(SearchSuggestion item) {
- String className = "suggestData ";
- String prefix = "";
-
- if (item.getKind() == SearchSuggestion.Kind.Simple) {
- className += "suggestDataSimple";
- prefix = "text";
- } else if (item.getKind() == SearchSuggestion.Kind.Advanced) {
- className += "suggestDataAdvanced";
- prefix = "query";
- } else if (item.getKind() == SearchSuggestion.Kind.GlobalSavedSearch
- || item.getKind() == SearchSuggestion.Kind.UserSavedSearch) {
- className += "suggestDataSavedSearch";
- prefix = "saved";
- } else {
- }
-
- SelectElement select = getElement().cast();
- OptionElement option = Document.get().createOptionElement();
- option.setValue(item.getValue());
- String style = "font-variant: small-caps; font-weight: bold; font-size:
11px; float: left; margin-left: 2px; width: 50px;";
- int marginOffset = 20;
- if (className.endsWith("suggestDataSavedSearch")) {
- style += " color: green;";
- marginOffset += 2;
- } else {
- style += " color: gray;";
- if (className.endsWith("suggestDataSimple")) {
- marginOffset += 8;
- }
- }
- String decoratedPrefix = decorate(prefix, style);
- String highlightedSuggestion = colorOperator(decorate(item.getLabel(),
"background-color: yellow;", item
- .getStartIndex(), item.getEndIndex()));
- //String decoratedSuffix = decorate(highlightedSuggestion, "float: left;
margin-left: " + marginOffset + "px;");
- String decoratedSuffix = decorate(highlightedSuggestion, "float: left;
");
- String floatClear = "<br style=\"clear: both;\" />";
-
- String innerHTML = decoratedPrefix + decoratedSuffix + floatClear;
- option.setInnerHTML(innerHTML);
- select.add(option, null);
- }
-
- // TODO: fixing coloring strategy
- private String colorOperator(String data) {
- for (String operator : OPERATORS) {
- int index = -1;
- while ((index = data.indexOf(operator, index + 1)) != -1) {
- if ((index - 5 >= 0) && data.substring(index - 5,
index).equals("style") == false) {
- break;
- }
- }
- if (index != -1) {
- return decorate(data, "color: blue;", index, index +
operator.length());
- }
- }
- return data;
- }
-
- private String decorate(String data, String style) {
- return decorate(data, style, 0, data.length());
- }
-
- private String decorate(String data, String style, int startIndex, int endIndex) {
- String before = data.substring(0, startIndex);
- String highlight = data.substring(startIndex, endIndex);
- String after = data.substring(endIndex);
- return before + "<span style=\"" + style +
"\">" + highlight + "</span>" + after;
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java
deleted file mode 100644
index 4e75b52..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java
+++ /dev/null
@@ -1,301 +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.search.suggest;
-
-import java.util.List;
-
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.TextBox;
-
-import org.rhq.core.domain.search.SearchSuggestion;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
-
-public class SuggestTextBox extends TextBox {
-
- protected PopupPanel choicesPopup = new PopupPanel(true);
- protected ScrollPanel choicesScrollPanel = new ScrollPanel();
- protected SuggestResultsListBox choices = new SuggestResultsListBox();
-
- private SearchBar searchBar;
-
- private SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService();
-
- public SuggestTextBox(SearchBar searchBar) {
- super();
- this.searchBar = searchBar;
- setupTextBox();
- setupChoicesPopup();
- setupChoicesListBox();
- }
-
- public void setupTextBox() {
- getElement().setAttribute("autocomplete", "off"); //
we're producing completion suggestions, not the browser
- SuggestTextBoxEventHandler handler = new SuggestTextBoxEventHandler();
- this.addKeyUpHandler(handler);
- this.addFocusHandler(handler);
- }
-
- public void setupChoicesPopup() {
- choicesPopup.removeStyleName("gwt-PopupPanel");
- choicesPopup.addStyleName("suggestPanel");
- choicesPopup.add(choices);
- }
-
- public PopupPanel getSuggestionComponent() {
- return choicesPopup;
- }
-
- public void setupChoicesListBox() {
- choices.addStyleName("suggestPanel");
-
- SuggestionResultsListBoxEventHandler handler = new
SuggestionResultsListBoxEventHandler();
- choices.addChangeHandler(handler);
- choices.addClickHandler(handler);
- }
-
- public void hideInitialSuggestions() {
- show();
- hide();
- }
-
- public boolean isSuggestionListShowing() {
- return isDisplayed();
- }
-
- public boolean isItemSelected() {
- return (choices.getSelectedIndex() != -1);
- }
-
- protected void complete() {
- if (choices.getItemCount() > 0 && choices.getSelectedIndex() != -1) {
- String currentText = this.getText().toLowerCase();
- String completion = choices.getValue(choices.getSelectedIndex());
-
- int cursorPosition = this.getCursorPos();
- int previousWhitespaceIndex = cursorPosition;
- if (cursorPosition != 0) {
- while (--previousWhitespaceIndex > 0) {
- if (this.getText().charAt(previousWhitespaceIndex) == ' ') {
- previousWhitespaceIndex++; // put index right after found
whitespace
- break;
- }
- }
- }
- String before = this.getText().substring(0, previousWhitespaceIndex);
- String after = this.getText().substring(cursorPosition);
- this.setValue(before + completion + after);
-
- // TODO: this algo screws up when it does the indexOf search on just a single
char from currentText
- // use case is "availability=dow<enter>" -- is this
still true, now that we're completing longer things for advanced search?
-
- if (currentText.equals(this.getText().toLowerCase())) {
- this.setValue(currentText + completion, true);
- }
- }
-
- choices.clear();
- hide();
-
- // if this is a saved search pattern completion, execute that search immediately
- System.out.println("just completed to '" + this.getValue() +
"'");
- String patternValue =
searchBar.getSavedSearchManager().getPatternByName(this.getValue());
- if (patternValue != null) {
- searchBar.prepareSearchExecution();
- } else {
- // send a 'fake' key, this will rerender PopupPanel with the new
completion list
- handleKeyCode(0);
- }
- }
-
- private void hide() {
- choicesPopup.hide();
- }
-
- private void show() {
- choicesPopup.show();
- }
-
- private boolean isDisplayed() {
- return choicesPopup.isShowing();
- }
-
- public void hidePopup() {
- handleKeyCode(KeyCodes.KEY_ESCAPE);
- }
-
- class SuggestTextBoxEventHandler implements KeyUpHandler, FocusHandler {
- public void onKeyUp(KeyUpEvent event) {
- int keyCode = event.getNativeKeyCode();
- handleKeyCode(keyCode);
-
- if (keyCode == KeyCodes.KEY_TAB) {
- event.stopPropagation();
- event.preventDefault();
- }
- }
-
- public void onFocus(FocusEvent event) {
- if (getText().equals(searchBar.getWelcomeMessage())) {
- setText("");
- }
- // send a 'fake' key, this will rerender PopupPanel with the new
completion list
- handleKeyCode(1);
- }
- }
-
- class SuggestionResultsListBoxEventHandler implements ChangeHandler, ClickHandler {
- public void onChange(ChangeEvent event) {
- complete();
- }
-
- public void onClick(ClickEvent event) {
- complete();
- }
- }
-
- protected void handleKeyCode(int keyCode) {
- if (keyCode == KeyCodes.KEY_TAB) {
- this.setValue(this.getValue() + " ");
- this.setCursorPos(this.getValue().length());
- this.setFocus(true);
- return;
- }
-
- if (keyCode == KeyCodes.KEY_DOWN) {
- int selectedIndex = choices.getSelectedIndex();
- selectedIndex++;
- if (selectedIndex >= choices.getItemCount()) {
- selectedIndex = 0;
- }
- String value = choices.getValue(selectedIndex);
- if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) {
- if (choices.getItemCount() == 1) {
- selectedIndex = -1; // do not allow the disabled row to be selected
via KEY_DOWN
- } else {
- selectedIndex++;
- }
- }
- choices.setSelectedIndex(selectedIndex);
- return;
- }
-
- if (keyCode == KeyCodes.KEY_UP) {
- int selectedIndex = choices.getSelectedIndex();
- selectedIndex--;
- if (selectedIndex < 0) {
- selectedIndex = choices.getItemCount() - 1;
- }
- String value = choices.getValue(selectedIndex);
- if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) {
- if (choices.getItemCount() == 1) {
- selectedIndex = -1; // do not allow the disabled row to be selected
via KEY_UP
- } else {
- selectedIndex = choices.getItemCount() - 1;
- }
- }
- choices.setSelectedIndex(selectedIndex);
- return;
- }
-
- if (keyCode == KeyCodes.KEY_ENTER) {
- int selectedIndex = choices.getSelectedIndex();
- if (selectedIndex != -1) {
- complete();
- }
- return;
- }
-
- if (keyCode == KeyCodes.KEY_ESCAPE) {
- choices.clear();
- hide();
- return;
- }
-
- hide();
- String text = this.getText();
-
- searchService.getSuggestions( //
- searchBar.getSearchSubsystem(), //
- text, //
- this.getCursorPos(), //
- new SearchSuggestionCallback(keyCode));
- }
-
- class SearchSuggestionCallback implements
AsyncCallback<List<SearchSuggestion>> {
-
- private int keyCode;
-
- public SearchSuggestionCallback(int keyCode) {
- this.keyCode = keyCode;
- }
-
- public void onFailure(Throwable caught) {
- choices.setErrorMessage(caught.getMessage());
- commonHandler();
- }
-
- public void onSuccess(List<SearchSuggestion> result) {
- choices.setSearchSuggestions(result);
- commonHandler();
- }
-
- private void commonHandler() {
- int suggestionCount = choices.render(100, 15);
- if (suggestionCount == 0) {
- return;
- }
-
- choicesPopup.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() +
getOffsetHeight() + 5);
- show();
-
- if (keyCode == 0) {
- /*
- if (choices.getItemCount() > 0) {
- String value = choices.getValue(0);
- if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) {
- if (choices.getItemCount() > 1) {
- choices.setSelectedIndex(1);
- } else {
- choices.setSelectedIndex(-1); // nothing is selected
if FOOTER_MESSAGE is the only suggestion
- }
- } else {
- choices.setSelectedIndex(0);
- }
- }
- */
-
- setFocus(true);
- }
- }
-
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java
deleted file mode 100644
index b5a7c79..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java
+++ /dev/null
@@ -1,166 +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.search.suggest;
-
-import java.util.List;
-
-import com.google.gwt.event.logical.shared.SelectionEvent;
-import com.google.gwt.event.logical.shared.SelectionHandler;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.SuggestOracle;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
-
-import org.rhq.core.domain.search.SearchSuggestion;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
-
-public class SuggestTextBox_v2 extends TextBox {
-
- private final SearchBar searchBar;
- private final SearchSuggestOracle searchSuggestionOracle;
- private final SuggestBox suggestBox;
-
- public SuggestTextBox_v2(SearchBar searchBar) {
- super();
- getElement().setAttribute("autocomplete", "off"); //
we're producing completion suggestions, not the browser
- this.searchBar = searchBar;
- this.searchSuggestionOracle = new SearchSuggestOracle();
- this.suggestBox = new SuggestBox(searchSuggestionOracle, this);
-
- this.suggestBox.setWidth("785px");
- this.suggestBox.setLimit(15);
- this.suggestBox.setAutoSelectEnabled(false);
- this.suggestBox.setAnimationEnabled(true);
-
- initHandlers();
- }
-
- private void initHandlers() {
- this.suggestBox.addSelectionHandler(new SelectionHandler<Suggestion>() {
-
- public void onSelection(SelectionEvent<Suggestion> event) {
-
- //event.stopPropagation();
- //event.preventDefault();
- complete(event.getSelectedItem().getReplacementString(),
getCursorPos());
- //Suggestion suggestion = event.getSelectedItem();
- //searchBar.executeSearch();
- }
- });
- }
-
- public void hidePopup() {
- this.suggestBox.hideSuggestionList();
- }
-
- public boolean isSuggestionListShowing() {
- return this.suggestBox.isSuggestionListShowing();
- }
-
- public SuggestBox getSuggestionBox() {
- return this.suggestBox;
- }
-
- class SearchSuggestOracle extends SuggestOracle {
- private SearchGWTServiceAsync searchService =
GWTServiceLookup.getSearchService();
-
- @Override
- public boolean isDisplayStringHTML() {
- return true;
- }
-
- @Override
- public void requestDefaultSuggestions(Request request, Callback callback) {
- requestSuggestions(request, callback);
- }
-
- @Override
- public void requestSuggestions(final Request request, final Callback callback) {
- String expression = getText();
- int caretPosition = getCursorPos(); // hack, but it wasn't passed in the
request
-
- searchService.getSuggestions(searchBar.getSearchSubsystem(), expression,
caretPosition,
- new AsyncCallback<List<SearchSuggestion>>() {
-
- public void onSuccess(List<SearchSuggestion> results) {
- List<SearchSuggestionOracleAdapter> adaptedResults = new
java.util.ArrayList<SearchSuggestionOracleAdapter>();
- for (SearchSuggestion next : results) {
- adaptedResults.add(new SearchSuggestionOracleAdapter(next));
- }
- SuggestOracle.Response response = new
SuggestOracle.Response(adaptedResults);
- callback.onSuggestionsReady(request, response);
- }
-
- public void onFailure(Throwable caught) {
- System.out.println("Uh oh");
- }
- });
- }
- }
-
- protected void complete(String completion, int cursorPosition) {
- String currentText = getText().toLowerCase();
- int previousWhitespaceIndex = cursorPosition;
- if (cursorPosition != 0) {
- while (--previousWhitespaceIndex > 0) {
- if (getText().charAt(previousWhitespaceIndex) == ' ') {
- previousWhitespaceIndex++; // put index right after found whitespace
- break;
- }
- }
- }
- String before = getText().substring(0, previousWhitespaceIndex);
- String after = getText().substring(cursorPosition);
- setValue(before + completion + after);
-
- // TODO: this algo screws up when it does the indexOf search on just a single
char from currentText
- // use case is "availability=dow<enter>" -- is this still
true, now that we're completing longer things for advanced search?
-
- if (currentText.equals(getText().toLowerCase())) {
- setValue(currentText + completion, true);
- }
-
- String patternValue =
searchBar.getSavedSearchManager().getPatternByName(getValue());
- if (patternValue != null) {
- searchBar.prepareSearchExecution();
- } else {
- suggestBox.showSuggestionList();
- }
- }
-
- class SearchSuggestionOracleAdapter implements SuggestOracle.Suggestion {
- private final SearchSuggestion suggestion;
-
- public SearchSuggestionOracleAdapter(SearchSuggestion suggestion) {
- this.suggestion = suggestion;
- }
-
- public String getDisplayString() {
- return suggestion.getLabel();
- }
-
- public String getReplacementString() {
- return suggestion.getValue();
- }
-
- }
-}
commit 6ea7eac1aeb78764764d0191da0a76348db997ad
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 7 19:50:53 2010 -0400
disallow creation of global saved searches, which will minimize upgrade burden later
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
index 8e8c45c..c8cf5f4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
@@ -98,10 +98,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal
/* local
private void validateManipulatePermission(Subject subject, SavedSearch savedSearch)
{
if (savedSearch.isGlobal()) {
- if (!authorizationManager.isInventoryManager(subject)) {
- throw new PermissionException("Only inventory managers can
manipulate global saved searches");
- }
- // note: inventory managers can modify any saved search pattern, not just
their own
+ throw new UnsupportedOperationException("Global saved searches are not
yet supported");
} else {
if (subject.getId() != savedSearch.getSubjectId() &&
!authorizationManager.isInventoryManager(subject)) {
throw new PermissionException("Users without inventory manager
permission "
commit 32cbf5aa0d5b872911801a7a25a48b6d68411d0c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 7 19:50:04 2010 -0400
fix typo in exception message
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
index 32aa7cd..8e8c45c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java
@@ -114,7 +114,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal
/* local
if (!savedSearch.isGlobal()) {
if (subject.getId() != savedSearch.getSubjectId() &&
!authorizationManager.isInventoryManager(subject)) {
throw new PermissionException("Users without inventory manager
permission "
- + "can only view their own or global saved saved
searches");
+ + "can only view their own saved searches");
}
}
}
commit 5b9121ecd59d46395ab8ee389fca4be62a27dbc5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 7 19:47:36 2010 -0400
prevnet global saved searches from appearing in the menu bar
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java
index 8fa9e9f..146c663 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java
@@ -160,9 +160,7 @@ public class UserPreferencesUIBean {
if (savedSearches == null) {
SavedSearchCriteria criteria = new SavedSearchCriteria();
criteria.addFilterSubjectId(getSubject().getId());
- criteria.addFilterGlobal(true);
- criteria.setFiltersOptional(true); // get this user's searches as well as
global ones
- criteria.addSortGlobal(PageOrdering.DESC); // globals, then user-specified
+ criteria.addFilterGlobal(false);
criteria.addSortName(PageOrdering.ASC); // each sublist is alphabetical
savedSearches = savedSearchManager.findSavedSearchesByCriteria(getSubject(),
criteria);
commit 01445ef3c09a6429fb6ce4ba97f64dd2fc60a098
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 8 13:12:34 2010 -0400
BZ 612358 - when uploading recipe and then uploading bundle files, need to make the
bundle files wiht the same version as the bundle
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
index f3d862c..ab2c539 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
@@ -149,7 +149,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
nameField.setValue(this.name);
HiddenItem versionField = new HiddenItem("version");
- versionField.setValue("1.0");
+ versionField.setValue(this.bundleVersion.getVersion());
setNumCols(7);
commit a9b4cf49b9fb2ba40ec4eae3bd116c389fc58bf8
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 8 12:52:25 2010 -0400
[BZ 604744] Correcting list field property name for sorting
The dropdown field name for the resource type name was set to typeName which is
incorect.
It should be resourceType.name.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
index 40c6154..6dfdf36 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
@@ -109,7 +109,7 @@ public class SearchBarPane extends HLayout {
ListGridField nameField = new ListGridField("name", "Name",
250);
ListGridField descriptionField = new ListGridField("description",
"Description");
- ListGridField typeNameField = new ListGridField("typeName",
"Type", 130);
+ ListGridField typeNameField = new ListGridField("resourceType.name",
"Type", 130);
ListGridField pluginNameField = new ListGridField("pluginName",
"Plugin", 100);
ListGridField categoryField = new ListGridField("category",
"Category", 60);
ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
commit bb1a0ea1e49cb73e9d92a5aa01399489a10bd4e6
Merge: 54f92b5... 074d5c2...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 10:57:44 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 54f92b5688e0922d6c3e00af7a410cdbe8e54650
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jul 8 10:50:50 2010 -0400
[BZ 611411] Fix a different failure message scenario for this
bundle create wizard bz.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
index 50f1a15..7e3ed51 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
@@ -41,6 +41,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
public class BundleUploadDataStep implements WizardStep {
@@ -109,6 +110,8 @@ public class BundleUploadDataStep implements WizardStep {
if (uploadForm.getUploadResult() == null) {
uploadForm.submitForm();
needToUpload = true;
+ // on certain errors the form may never be submitted, report these errors
outside submit handlers
+ handleUploadError(uploadForm.getUploadError(), false);
}
}
if (needToUpload) {
@@ -173,13 +176,7 @@ public class BundleUploadDataStep implements WizardStep {
} else {
allFilesStatus.put(uploadForm.getName(), Boolean.FALSE);
String errorMessage = uploadForm.getUploadError();
- if (null != errorMessage) {
- wizard.getView().showMessage(errorMessage);
- } else {
- errorMessage = "";
- }
- CoreGUI.getMessageCenter().notify(
- new Message("Failed to upload bundle file",
results, Message.Severity.Error));
+ handleUploadError(errorMessage, true);
}
}
});
@@ -198,4 +195,18 @@ public class BundleUploadDataStep implements WizardStep {
return;
}
+
+ private void handleUploadError(String errorMessage, boolean sendToMessageCenter) {
+ if (null != errorMessage) {
+ wizard.getView().showMessage(errorMessage);
+ } else {
+ errorMessage = "";
+ }
+
+ if (sendToMessageCenter) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Failed to upload bundle distribution file. " +
errorMessage, Severity.Error));
+ }
+ }
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
index 3245b61..bd447ef 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
@@ -96,6 +96,8 @@ public class BundleUploadDistroFileStep implements WizardStep {
processUrl();
} else if ("Upload".equals(selected)) {
uploadDistroForm.submitForm();
+ // on certain errors the form may never be submitted, report these errors
outside submit handlers
+ handleUploadError(uploadDistroForm.getUploadError(), false);
} else if ("Recipe".equals(selected)) {
processRecipe();
} else {
@@ -238,13 +240,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
});
} else {
String errorMessage = uploadDistroForm.getUploadError();
- if (null != errorMessage) {
- wizard.getView().showMessage(errorMessage);
- } else {
- errorMessage = "";
- }
- CoreGUI.getMessageCenter().notify(
- new Message("Failed to upload bundle distribution file. " +
errorMessage, Severity.Error));
+ handleUploadError(errorMessage, true);
wizard.setBundleVersion(null);
setButtonsDisableMode(false);
}
@@ -277,4 +273,17 @@ public class BundleUploadDistroFileStep implements WizardStep {
wizard.getView().getCancelButton().setDisabled(disabled);
wizard.getView().getNextButton().setDisabled(disabled);
}
+
+ private void handleUploadError(String errorMessage, boolean sendToMessageCenter) {
+ if (null != errorMessage) {
+ wizard.getView().showMessage(errorMessage);
+ } else {
+ errorMessage = "";
+ }
+
+ if (sendToMessageCenter) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Failed to upload bundle distribution file. " +
errorMessage, Severity.Error));
+ }
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
index 652259d..3021132 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
@@ -105,10 +105,14 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
@Override
public void submitForm() {
+ setUploadError(null);
Object value = bundleUploadItem.getValue();
if (value == null || value.toString().length() == 0) {
+ String message = "Please select a bundle distribution file to
upload";
icon.setIcons(iconRed);
- icon.setTooltip("Please select a bundle distribution file to
upload");
+ icon.setTooltip(message);
+ setUploadError(message);
+ // note - don't even submit this definitite failure
} else {
icon.setIcons(iconLoading);
icon.setTooltip("Processing...");
@@ -147,8 +151,10 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
icon.setIcons(iconGreen);
icon.setTooltip("Bundle distribution file has already been
uploaded");
} else {
+ String message = "Bundle distribution file upload has previously
failed";
icon.setIcons(iconRed);
- icon.setTooltip("Bundle distribution file upload has previously
failed");
+ icon.setTooltip(message);
+ setUploadError(message);
}
} else {
icon.setIcons((FormItemIcon) null);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
index 4a502ce..f3d862c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
@@ -120,10 +120,14 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
@Override
public void submitForm() {
+ setUploadError(null);
Object value = bundleUploadItem.getValue();
if (value == null || value.toString().length() == 0) {
+ String message = "[" + name + "] Please select a file to
upload";
icon.setIcons(iconRed);
- icon.setTooltip("Please select a file to upload");
+ icon.setTooltip(message);
+ setUploadError(message);
+ // note - don't even submit this definitite failure
} else {
icon.setIcons(iconLoading);
icon.setTooltip("Loading...");
@@ -170,8 +174,10 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
icon.setIcons(iconGreen);
icon.setTooltip("Bundle file has already been uploaded");
} else {
+ String message = "Bundle file upload has previously failed";
icon.setIcons(iconRed);
- icon.setTooltip("Bundle file upload has previously failed");
+ icon.setTooltip(message);
+ setUploadError(message);
}
} else {
icon.setIcons(iconGrey);
commit 8f15e8631991e517dd9e044fd6371d3eed4675ae
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jul 8 15:19:10 2010 +0200
Catch Exception from Augeas when the wanted file is not available and just return an
empty set.
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 04d4faf..def1097 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
@@ -60,12 +60,16 @@ public class AugeasConfigurationDiscoveryComponent<T extends
ResourceComponent>
pluginConfig.put(includeProps);
pluginConfig.put(excludeProps);
- checkFiles(pluginConfig);
-
- DiscoveredResourceDetails resource = createResourceDetails(discoveryContext,
pluginConfig);
- discoveredResources.add(resource);
- log.debug("Discovered " + discoveryContext.getResourceType().getName()
+ " Resource with key ["
- + resource.getResourceKey() + "].");
+ try {
+ checkFiles(pluginConfig);
+
+ DiscoveredResourceDetails resource = createResourceDetails(discoveryContext,
pluginConfig);
+ discoveredResources.add(resource);
+ log.debug("Discovered " +
discoveryContext.getResourceType().getName() + " Resource with key ["
+ + resource.getResourceKey() + "].");
+ } catch (IllegalStateException e) { // Thrown by augeas if it can not read a
file
+ log.warn("Discovery failed: " + e.getMessage());
+ }
return discoveredResources;
}
commit c7d5f87938f085f90d0cefacf693c1ebd7f6da2b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jul 8 15:17:25 2010 +0200
Return UP until we know why context has no process info
diff --git
a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
index 53f437b..c0f060f 100644
---
a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
+++
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
@@ -40,7 +40,8 @@ public class HadoopServiceComponent extends JMXServerComponent
implements JMXCom
* @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
*/
public AvailabilityType getAvailability() {
- return context.getNativeProcess().isRunning() ? AvailabilityType.UP:
AvailabilityType.DOWN;
+ return AvailabilityType.UP; // Return UP until we know why context has no process
info TODO
+ //return context.getNativeProcess().isRunning() ? AvailabilityType.UP:
AvailabilityType.DOWN;
}
commit 074d5c218e4f9e3bceb91963ad6c4daa6e4982aa
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 7 18:55:22 2010 -0400
fix so user with Bundle perm can view Content>Bundles menu item but so user with
Inventory perm and not Bundle perm cannot (fix for
https://bugzilla.redhat.com/show_bug.cgi?id=611760)
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
index 9f6ffd0..a1f3145 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,7 @@ public class GlobalPermissionsUIBean {
private boolean security;
private boolean inventory;
private boolean settings;
+ private boolean bundle;
private boolean isSuperuser;
private boolean isDebugMode;
private boolean isExperimental;
@@ -44,6 +45,7 @@ public class GlobalPermissionsUIBean {
security = globalPermissions.contains(Permission.MANAGE_SECURITY);
inventory = globalPermissions.contains(Permission.MANAGE_INVENTORY);
settings = globalPermissions.contains(Permission.MANAGE_SETTINGS);
+ bundle = globalPermissions.contains(Permission.MANAGE_BUNDLE);
isSuperuser = LookupUtil.getAuthorizationManager().isSystemSuperuser(user);
}
@@ -75,4 +77,8 @@ public class GlobalPermissionsUIBean {
public boolean isSettings() {
return settings;
}
+
+ public boolean isBundle() {
+ return bundle;
+ }
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index f7bbaa9..9e2ae2b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -345,14 +345,17 @@
</rich:menuGroup>
<ui:remove>***** Administration > CONTENT *****</ui:remove>
- <rich:menuGroup value="Content"
rendered="#{GlobalPermissionsUIBean.inventory}">
- <rich:menuItem submitMode="none" onclick="window.location =
'/coregui/CoreGUI.html#Bundles'">
+ <rich:menuGroup value="Content"
rendered="#{GlobalPermissionsUIBean.inventory ||
GlobalPermissionsUIBean.bundle}">
+ <rich:menuItem submitMode="none" onclick="window.location =
'/coregui/CoreGUI.html#Bundles'"
+ rendered="#{GlobalPermissionsUIBean.bundle}">
<h:outputText value="Bundles"/>
</rich:menuItem>
- <rich:menuItem submitMode="none" onclick="window.location =
'/rhq/content/listContentProviders.xhtml'">
+ <rich:menuItem submitMode="none" onclick="window.location =
'/rhq/content/listContentProviders.xhtml'"
+ rendered="#{GlobalPermissionsUIBean.inventory}">
<h:outputText value="Content Sources"/>
</rich:menuItem>
- <rich:menuItem submitMode="none" onclick="window.location =
'/rhq/content/listRepos.xhtml'">
+ <rich:menuItem submitMode="none" onclick="window.location =
'/rhq/content/listRepos.xhtml'"
+ rendered="#{GlobalPermissionsUIBean.inventory}">
<h:outputText value="Repositories"/>
</rich:menuItem>
</rich:menuGroup>
@@ -684,5 +687,4 @@ v <rich:menuItem submitMode="none"
</a4j:region>
-
-</a4j:region>
\ No newline at end of file
+</a4j:region>
commit b53a1e1018cc90346cc85e4bfaadc096a0910ca4
Merge: 578a960... f1f81a2...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 7 17:20:32 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 578a960805bd4e636762438b7badf04f247d2528
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 7 17:15:20 2010 -0400
copy new Server/Service icons into coregui war too; remove redundant Service icons
from images/resources dir in coregui war, since they already exist in the images/types
dir
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png
deleted file mode 100644
index d09143b..0000000
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png and
/dev/null differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png
deleted file mode 100644
index 24b1d98..0000000
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png and
/dev/null differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png
deleted file mode 100644
index bbebc5c..0000000
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png and
/dev/null differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png
deleted file mode 100644
index 7df5599..0000000
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png and
/dev/null differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
index 69a4d9f..df7487f 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
index 132e4ce..73b5f6b 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
index d09143b..a31229b 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
index 24b1d98..fc8583f 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
index bbebc5c..a925aaf 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
index 7df5599..6c37504 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png differ
commit f1f81a2b0a25042926403220d90ddf3fadf61a7e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 17:00:37 2010 -0400
[BZ 611468] Add message to create wizard.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
index 634825d..3245b61 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
@@ -99,6 +99,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
} else if ("Recipe".equals(selected)) {
processRecipe();
} else {
+ wizard.getView().showMessage("You must choose one option for
creating your Bundle!");
return false;
}
return false;
commit 19a824a9bc31cdec8f31229398eb82af2a387c5e
Merge: 91c9d1f... 4f6a2f0...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 15:32:44 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 4f6a2f047da289a6fb0bd96db847102b91bbb50f
Merge: 825d685... d21faf4...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 15:32:14 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 91c9d1fb7849b9966f60a2cdeb8bca1903e3389c
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 15:30:30 2010 -0400
[BZ 612121, 612115, 608732, 611436, 611411, 604710, 601175]
A bunch of related fixes regarding the bundle wizards. Added new message
bar for wizards to report messages independent of the message center and
used it to improve messaging for wizard users. Fixed issue with
step# tracking. Added somore more protection in wizard navigation.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
index 2d767d3..50f1a15 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java
@@ -106,7 +106,7 @@ public class BundleUploadDataStep implements WizardStep {
boolean needToUpload = false;
for (BundleFileUploadForm uploadForm : this.uploadForms) {
- if (uploadForm.getUploadResults() == null) {
+ if (uploadForm.getUploadResult() == null) {
uploadForm.submitForm();
needToUpload = true;
}
@@ -172,6 +172,12 @@ public class BundleUploadDataStep implements WizardStep {
allFilesStatus.put(uploadForm.getName(), Boolean.TRUE);
} else {
allFilesStatus.put(uploadForm.getName(), Boolean.FALSE);
+ String errorMessage = uploadForm.getUploadError();
+ if (null != errorMessage) {
+ wizard.getView().showMessage(errorMessage);
+ } else {
+ errorMessage = "";
+ }
CoreGUI.getMessageCenter().notify(
new Message("Failed to upload bundle file",
results, Message.Severity.Error));
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
index 496268b..634825d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
@@ -73,6 +73,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
radioGroup = new
RadioGroupWithComponentsItem("bundleDistroRadioGroup", "Bundle
Distribution", radioItems,
mainCanvasForm);
radioGroup.setShowTitle(false);
+
mainCanvasForm.setItems(radioGroup);
}
@@ -86,6 +87,8 @@ public class BundleUploadDistroFileStep implements WizardStep {
}
public boolean nextPage() {
+ wizard.getView().hideMessage();
+
if (wizard.getBundleVersion() == null) {
String selected = radioGroup.getSelected();
@@ -199,6 +202,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
}
public void onFailure(Throwable caught) {
+ wizard.getView().showMessage(caught.getMessage());
CoreGUI.getErrorHandler().handleError("Failed to create
bundle", caught);
wizard.setBundleVersion(null);
setButtonsDisableMode(false);
@@ -207,7 +211,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
}
private void processUpload() {
- if (Boolean.TRUE.equals(uploadDistroForm.getUploadResults())) {
+ if (Boolean.TRUE.equals(uploadDistroForm.getUploadResult())) {
int bvId = uploadDistroForm.getBundleVersionId();
BundleVersionCriteria criteria = new BundleVersionCriteria();
criteria.addFilterId(bvId);
@@ -225,13 +229,21 @@ public class BundleUploadDistroFileStep implements WizardStep {
}
public void onFailure(Throwable caught) {
+ wizard.getView().showMessage(caught.getMessage());
CoreGUI.getErrorHandler().handleError("Failed to create
bundle", caught);
wizard.setBundleVersion(null);
setButtonsDisableMode(false);
}
});
} else {
- CoreGUI.getMessageCenter().notify(new Message("Failed to upload bundle
distribution file", Severity.Error));
+ String errorMessage = uploadDistroForm.getUploadError();
+ if (null != errorMessage) {
+ wizard.getView().showMessage(errorMessage);
+ } else {
+ errorMessage = "";
+ }
+ CoreGUI.getMessageCenter().notify(
+ new Message("Failed to upload bundle distribution file. " +
errorMessage, Severity.Error));
wizard.setBundleVersion(null);
setButtonsDisableMode(false);
}
@@ -251,6 +263,7 @@ public class BundleUploadDistroFileStep implements WizardStep {
}
public void onFailure(Throwable caught) {
+ wizard.getView().showMessage(caught.getMessage());
CoreGUI.getErrorHandler().handleError("Failed to create
bundle", caught);
wizard.setBundleVersion(null);
wizard.setRecipe("");
@@ -262,6 +275,5 @@ public class BundleUploadDistroFileStep implements WizardStep {
private void setButtonsDisableMode(boolean disabled) {
wizard.getView().getCancelButton().setDisabled(disabled);
wizard.getView().getNextButton().setDisabled(disabled);
- wizard.getView().getPreviousButton().setDisabled(disabled);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
index 5643bd3..0fab3aa 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java
@@ -174,9 +174,9 @@ public class GetDestinationStep implements WizardStep {
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to create destination. (Note, for an existing
destination deploy from the Destination view) : "
- + caught.getMessage(), caught);
+ String message = "Failed to create destination, it may already
exist. (Note, for an existing destination deploy from the Destination view)";
+ wizard.getView().showMessage(message);
+ CoreGUI.getErrorHandler().handleError(message + ": " +
caught.getMessage(), caught);
createInProgress = false;
wizard.getView().decrementStep();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
index 47be5ce..d531de7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java
@@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Jay Shaughnessy
@@ -41,6 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
public class ConfirmationStep implements WizardStep {
private VLayout layout;
+ private boolean nextPage = true;
private final BundleRevertWizard wizard;
private final BundleGWTServiceAsync bundleServer =
GWTServiceLookup.getBundleService();
@@ -65,23 +67,31 @@ public class ConfirmationStep implements WizardStep {
new AsyncCallback<PageList<BundleDeployment>>() {
public void onSuccess(PageList<BundleDeployment>
liveDeployments) {
if (1 != liveDeployments.size()) {
- throw new IllegalArgumentException("No live deployment
found for destination ["
- + wizard.getDestination() + "]");
+ nextPage = false;
+ String message = "No live deployment found for
destination [" + wizard.getDestination()
+ + "]";
+ wizard.getView().showMessage(message);
+ CoreGUI.getMessageCenter().notify(new Message(message,
Message.Severity.Warning));
}
wizard.setLiveDeployment(liveDeployments.get(0));
wizard.setPreviousDeployment(wizard.getLiveDeployment().getReplacedBundleDeployment());
if (null == wizard.getPreviousDeployment()) {
- throw new IllegalArgumentException("Live deployment
[" + wizard.getLiveDeployment()
+ nextPage = false;
+ String message = "Live deployment [" +
wizard.getLiveDeployment()
+ "] can not be reverted. There is no prior
deployment for the destination ["
- + wizard.getDestination() + "]");
+ + wizard.getDestination() + "]";
+ wizard.getView().showMessage(message);
+ CoreGUI.getMessageCenter().notify(new Message(message,
Message.Severity.Warning));
}
setLayout();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to find live deployment, can not revert: "
+ caught.getMessage(), caught);
+ nextPage = false;
+ String message = "Failed to find live deployment, can not
revert: " + caught.getMessage();
+ wizard.getView().showMessage(message);
+ CoreGUI.getErrorHandler().handleError(message, caught);
}
});
}
@@ -165,6 +175,6 @@ public class ConfirmationStep implements WizardStep {
}
public boolean nextPage() {
- return true;
+ return nextPage;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
index 9df0a6d..652259d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java
@@ -40,7 +40,8 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
private ButtonItem uploadButton;
private StaticTextItem icon;
- private Boolean uploadResults;
+ private Boolean uploadResult;
+ private String uploadError;
private int bundleVersionId;
private final FormItemIcon iconLoading;
@@ -87,8 +88,19 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
* Returns null if this upload form has not be submitted yet (see {@link
#submitForm()}).
* @return status of the upload request
*/
- public Boolean getUploadResults() {
- return uploadResults;
+ public Boolean getUploadResult() {
+ return uploadResult;
+ }
+
+ /**
+ * @return Error text if {@link #getUploadResult()} returns false, otherwise null
+ */
+ public String getUploadError() {
+ return uploadError;
+ }
+
+ private void setUploadError(String uploadError) {
+ this.uploadError = uploadError;
}
@Override
@@ -130,8 +142,8 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
icon = new StaticTextItem("icon");
icon.setStartRow(false);
icon.setShowTitle(false);
- if (uploadResults != null) {
- if (uploadResults.booleanValue()) {
+ if (uploadResult != null) {
+ if (uploadResult.booleanValue()) {
icon.setIcons(iconGreen);
icon.setTooltip("Bundle distribution file has already been
uploaded");
} else {
@@ -146,13 +158,13 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
setItems(sessionIdField, bundleUploadItem, uploadButton, icon);
- // make sure this handler is executed first
+ // make sure this handler is executed first in case the creator has also added a
handler
pushFormHandler(new DynamicFormHandler() {
public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
String results = event.getResults();
bundleVersionId = parseIdFromResponse(results);
if (bundleVersionId > 0) {
- uploadResults = Boolean.TRUE;
+ uploadResult = Boolean.TRUE;
icon.setIcons(iconGreen);
icon.setTooltip("Uploaded bundle distribution file
successfully");
CoreGUI.getMessageCenter().notify(
@@ -160,9 +172,11 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
icon.hide();
icon.show();
} else {
- uploadResults = Boolean.FALSE;
+ uploadResult = Boolean.FALSE;
+ String cause = parseCauseFromResponse(results);
icon.setIcons(iconRed);
- icon.setTooltip("Bundle distribution file upload failed");
+ icon.setTooltip(cause);
+ setUploadError(cause);
CoreGUI.getMessageCenter().notify(
new Message("Bundle distribution file upload failed",
results, Severity.Error));
icon.hide();
@@ -173,11 +187,12 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() {
public void onFormSubmitFailed(FormSubmitFailedEvent event) {
- uploadResults = Boolean.FALSE;
+ uploadResult = Boolean.FALSE;
+ String cause = "Bundle Distribution file upload failed, check for
invalid file path.";
icon.setIcons(iconRed);
- icon.setTooltip("File upload failed");
- CoreGUI.getMessageCenter().notify(
- new Message("Bundle distribution file upload request
failed", Severity.Error));
+ icon.setTooltip(cause);
+ setUploadError(cause);
+ CoreGUI.getMessageCenter().notify(new Message(cause, Severity.Error));
icon.hide();
icon.show();
}
@@ -204,4 +219,11 @@ public class BundleDistributionFileUploadForm extends
DynamicCallbackForm {
}
return id;
}
-}
+
+ private String parseCauseFromResponse(String results) {
+ int i = (null == results) ? -1 : results.indexOf("\tat ");
+ String cause = (-1 == i) ? results : results.substring(0, i);
+ return cause;
+ }
+
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
index b0617f0..4a502ce 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java
@@ -41,7 +41,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
private ButtonItem uploadButton;
private StaticTextItem icon;
- private Boolean uploadResults;
+ private Boolean uploadResult;
+ private String uploadError;
private final BundleVersion bundleVersion;
private final String name;
@@ -58,7 +59,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
this.bundleVersion = bundleVersion;
this.name = name;
this.showNameLabel = showNameLabel;
- this.uploadResults = isAlreadyUploaded; // null if unknown, false if error during
previous upload attempt, true if already uploaded before
+ this.uploadResult = isAlreadyUploaded; // null if unknown, false if error during
previous upload attempt, true if already uploaded before
setEncoding(Encoding.MULTIPART);
setAction(GWT.getModuleBaseURL() + "/BundleFileUploadServlet");
@@ -102,8 +103,19 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
* Returns null if this upload form has not be submitted yet (see {@link
#submitForm()}).
* @return status of the upload request
*/
- public Boolean getUploadResults() {
- return uploadResults;
+ public Boolean getUploadResult() {
+ return uploadResult;
+ }
+
+ /**
+ * @return Error text if {@link #getUploadResult()} returns false, otherwise null
+ */
+ public String getUploadError() {
+ return uploadError;
+ }
+
+ private void setUploadError(String uploadError) {
+ this.uploadError = uploadError;
}
@Override
@@ -153,8 +165,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
icon = new StaticTextItem("icon");
icon.setStartRow(false);
icon.setShowTitle(false);
- if (uploadResults != null) {
- if (uploadResults.booleanValue()) {
+ if (uploadResult != null) {
+ if (uploadResult.booleanValue()) {
icon.setIcons(iconGreen);
icon.setTooltip("Bundle file has already been uploaded");
} else {
@@ -169,11 +181,12 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
setItems(sessionIdField, bundleVersionIdField, nameField, versionField,
bundleUploadItem, uploadButton, icon);
- addFormHandler(new DynamicFormHandler() {
+ // push the form handler so it executes first if the form creator has also added
a handler
+ pushFormHandler(new DynamicFormHandler() {
public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
String results = event.getResults();
if (!results.contains("Failed to upload bundle file")) {
- uploadResults = Boolean.TRUE;
+ uploadResult = Boolean.TRUE;
icon.setIcons(iconGreen);
icon.setTooltip("Uploaded bundle file successfully");
CoreGUI.getMessageCenter().notify(
@@ -181,11 +194,14 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
icon.hide();
icon.show();
} else {
- uploadResults = Boolean.FALSE;
+ uploadResult = Boolean.FALSE;
+ String cause = "[" + name + "] " +
parseCauseFromResponse(results);
icon.setIcons(iconRed);
- icon.setTooltip("Bundle file upload failed");
- CoreGUI.getMessageCenter()
- .notify(new Message("Bundle file upload failed",
results, Severity.Error));
+ icon.setTooltip(cause);
+ setUploadError(cause);
+ icon.setTooltip(cause);
+ CoreGUI.getMessageCenter().notify(
+ new Message("Bundle file [" + name + "] upload
failed", results, Severity.Error));
icon.hide();
icon.show();
}
@@ -194,13 +210,22 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() {
public void onFormSubmitFailed(FormSubmitFailedEvent event) {
- uploadResults = Boolean.FALSE;
+ uploadResult = Boolean.FALSE;
+ String cause = "Bundle file [" + name + "] upload failed,
check for invalid file path.";
icon.setIcons(iconRed);
- icon.setTooltip("Bundle file upload failed");
- CoreGUI.getMessageCenter().notify(new Message("Bundle file upload
request failed", Severity.Error));
+ icon.setTooltip(cause);
+ setUploadError(cause);
+ CoreGUI.getMessageCenter().notify(new Message(cause, Severity.Error));
icon.hide();
icon.show();
}
});
}
+
+ private String parseCauseFromResponse(String results) {
+ int i = (null == results) ? -1 : results.indexOf("\tat ");
+ String cause = (-1 == i) ? results : results.substring(0, i);
+ return cause;
+ }
+
}
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 fbce82f..93fe036 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
@@ -51,6 +51,10 @@ public class WizardView extends VLayout {
Label stepTitleLabel;
HLayout contentLayout;
+
+ HLayout messageBar;
+ HTMLFlow messageLabel;
+
ToolStrip buttonBar;
IButton cancelButton;
@@ -101,6 +105,18 @@ public class WizardView extends VLayout {
addMember(contentLayout);
+ messageBar = new HLayout();
+ messageBar.setHeight(20);
+ messageBar.setPadding(2);
+ messageBar.setBackgroundColor("#F0F0F0");
+ messageLabel = new HTMLFlow();
+ messageLabel.setWidth("*");
+ messageLabel.setLeft(20);
+ messageBar.addMember(messageLabel);
+ messageBar.setVisible(false);
+
+ addMember(messageBar);
+
buttonBar = new ToolStrip();
buttonBar.setPadding(5);
buttonBar.setWidth100();
@@ -122,6 +138,19 @@ public class WizardView extends VLayout {
+ (wizard.getSubtitle() != null ? wizard.getSubtitle() : ""));
}
+ public void showMessage(String message) {
+ if (null == message) {
+ hideMessage();
+ } else {
+ this.messageLabel.setContents("<span
style='color:red'>" + message + "</span>");
+ this.messageBar.show();
+ }
+ }
+
+ public void hideMessage() {
+ this.messageBar.hide();
+ }
+
private void setupButtons() {
cancelButton = new IButton("Cancel");
cancelButton.setDisabled(false);
@@ -157,16 +186,21 @@ public class WizardView extends VLayout {
}
private void setStep(int stepIndex) {
- currentStep = stepIndex;
-
- List<WizardStep> wizardSteps = wizard.getSteps();
+ if (stepIndex < 0) {
+ this.previousButton.setDisabled(true);
+ return;
+ }
// determine if we are "finished" - that is, going past our last step
- if (currentStep >= wizardSteps.size()) {
+ List<WizardStep> wizardSteps = wizard.getSteps();
+ if (stepIndex >= wizardSteps.size()) {
closeDialog();
return;
}
+ // a valid step, continue
+ currentStep = stepIndex;
+
stepLabel.setContents("Step " + (stepIndex + 1) + " of " +
wizardSteps.size());
WizardStep step = wizardSteps.get(currentStep);
commit 6c6d945b5a7e65d85d80aabdc858df8f565ce25d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 15:25:35 2010 -0400
[BZ 608732] Remove unnecessary stack sections from bundle view. Note,
these may need to be uncommented after a merge to Master.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index 546a7fa..a3be0fa 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@ -31,7 +31,6 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.bundle.list.BundleView;
import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView;
import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeView;
-import
org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeView;
/**
* @author Greg Hinkle
@@ -65,13 +64,14 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
bundlesSection.addItem(bundleTreeView);
sectionStack.addSection(bundlesSection);
- SectionStackSection repositoriesSection = new
SectionStackSection("Repositories");
- ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView();
- repositoriesSection.addItem(repoTree);
- sectionStack.addSection(repositoriesSection);
+ // Don't show these in 3.0, they are not fully baked
+ //SectionStackSection repositoriesSection = new
SectionStackSection("Repositories");
+ //ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView();
+ //repositoriesSection.addItem(repoTree);
+ //sectionStack.addSection(repositoriesSection);
- SectionStackSection providersSection = new
SectionStackSection("Providers");
- sectionStack.addSection(providersSection);
+ //SectionStackSection providersSection = new
SectionStackSection("Providers");
+ //sectionStack.addSection(providersSection);
addMember(sectionStack);
@@ -79,7 +79,6 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
contentCanvas.setWidth100();
contentCanvas.setHeight100();
addMember(contentCanvas);
-
}
public void setContent(Canvas newContent) {
@@ -90,12 +89,10 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
contentCanvas.markForRedraw();
}
-
public void renderView(ViewPath viewPath) {
bundleTreeView.selectPath(viewPath);
-
if (viewPath.isEnd()) {
if (currentNextPath == null && bundlesListView != null) {
// refresh
commit 2a6a0bca7da20148600d3137f15e84ab8dead75c
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 7 15:23:58 2010 -0400
Turn the generic AbstractBundleWizard into AbstractWizard, impementing
Wizard, and let all Wizards extend.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java
deleted file mode 100644
index 7bacb3b..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java
+++ /dev/null
@@ -1,87 +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.bundle;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.smartgwt.client.widgets.IButton;
-
-import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView;
-
-public abstract class AbstractBundleWizard implements Wizard {
-
- private ArrayList<WizardStep> steps;
- private WizardView view;
- private String windowTitle = "";
- private String title = "";
- private String subtitle = "";
-
- public String getWindowTitle() {
- return windowTitle;
- }
-
- public void setWindowTitle(String windowTitle) {
- this.windowTitle = windowTitle;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getSubtitle() {
- return subtitle;
- }
-
- public void setSubtitle(String subtitle) {
- this.subtitle = subtitle;
- if (this.view != null) {
- this.view.refreshTitleLabelContents();
- }
- }
-
- public List<WizardStep> getSteps() {
- return steps;
- }
-
- public void setSteps(ArrayList<WizardStep> steps) {
- this.steps = steps;
- }
-
- public List<IButton> getCustomButtons(int step) {
- return Collections.emptyList();
- }
-
- public void startBundleWizard() {
- view = new WizardView(this);
- view.displayDialog();
- }
-
- public WizardView getView() {
- return view;
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java
index eac3c65..b0ddff7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java
@@ -24,13 +24,13 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.bundle.BundleVersion;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public abstract class AbstractBundleCreateWizard extends AbstractBundleWizard {
+public abstract class AbstractBundleCreateWizard extends AbstractWizard {
// the things we build up in the wizard
private String recipe;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java
index 88b67be..a0728af 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java
@@ -22,13 +22,13 @@ import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.core.domain.bundle.BundleDestination;
import org.rhq.core.domain.bundle.BundleVersion;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
/**
* @author Jay Shaughnessy
*
*/
-public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard {
+public abstract class AbstractBundleDeployWizard extends AbstractWizard {
// the things we build up in the wizard
private Integer bundleId;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java
index 9d01d2c..cf69400 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java
@@ -20,13 +20,13 @@ package org.rhq.enterprise.gui.coregui.client.bundle.revert;
import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.core.domain.bundle.BundleDestination;
-import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
/**
* @author Jay Shaughnessy
*
*/
-public abstract class AbstractBundleRevertWizard extends AbstractBundleWizard {
+public abstract class AbstractBundleRevertWizard extends AbstractWizard {
// the things we build up in the wizard
private BundleDestination destination;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java
new file mode 100644
index 0000000..9c8e513
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java
@@ -0,0 +1,82 @@
+/*
+ * 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.components.wizard;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.smartgwt.client.widgets.IButton;
+
+public abstract class AbstractWizard implements Wizard {
+
+ private ArrayList<WizardStep> steps;
+ private WizardView view;
+ private String windowTitle = "";
+ private String title = "";
+ private String subtitle = "";
+
+ public String getWindowTitle() {
+ return windowTitle;
+ }
+
+ public void setWindowTitle(String windowTitle) {
+ this.windowTitle = windowTitle;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getSubtitle() {
+ return subtitle;
+ }
+
+ public void setSubtitle(String subtitle) {
+ this.subtitle = subtitle;
+ if (view != null) {
+ view.refreshTitleLabelContents();
+ }
+ }
+
+ public List<WizardStep> getSteps() {
+ return steps;
+ }
+
+ public void setSteps(ArrayList<WizardStep> steps) {
+ this.steps = steps;
+ }
+
+ public List<IButton> getCustomButtons(int step) {
+ return Collections.emptyList();
+ }
+
+ public void startBundleWizard() {
+ view = new WizardView(this);
+ view.displayDialog();
+ }
+
+ public WizardView getView() {
+ return view;
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
index 27ad608..4c8b074 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java
@@ -30,28 +30,26 @@ import com.smartgwt.client.widgets.IButton;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
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.gwt.ResourceGroupGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
-public class GroupCreateWizard implements Wizard {
-
- private ArrayList<WizardStep> steps;
+public class GroupCreateWizard extends AbstractWizard {
private GroupCreateStep createStep;
private GroupMembersStep memberStep;
public GroupCreateWizard() {
- steps = new ArrayList<WizardStep>();
+ ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
steps.add(createStep = new GroupCreateStep());
steps.add(memberStep = new GroupMembersStep(this));
+ setSteps(steps);
}
public String getWindowTitle() {
@@ -63,15 +61,11 @@ public class GroupCreateWizard implements Wizard {
}
public String getSubtitle() {
- return null; // TODO: Implement this method.
- }
-
- public List<WizardStep> getSteps() {
- return steps;
+ return null; // TODO: Implement this method.
}
public List<IButton> getCustomButtons(int step) {
- return null; // TODO: Implement this method.
+ return null; // TODO: Implement this method.
}
public void cancel() {
@@ -83,17 +77,17 @@ public class GroupCreateWizard implements Wizard {
ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
groupService.createResourceGroup(createStep.getGroup(),
memberStep.getSelectedResourceIds(),
- new AsyncCallback<ResourceGroup>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to create
resource group",caught);
- }
-
- public void onSuccess(ResourceGroup result) {
- CoreGUI.getMessageCenter().notify(new Message("Saved new
group " + result.getName(), Message.Severity.Info));
- // TODO: Implement this method.
- }
- });
-
+ new AsyncCallback<ResourceGroup>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to create resource
group", caught);
+ }
+
+ public void onSuccess(ResourceGroup result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Saved new group " + result.getName(),
Message.Severity.Info));
+ // TODO: Implement this method.
+ }
+ });
return true;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java
index 3fd8517..5d0be9d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java
@@ -32,7 +32,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -42,7 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
-public class OperationCreateWizard implements Wizard {
+public class OperationCreateWizard extends AbstractWizard {
private Resource resource;
private OperationDefinition operationDefinition;
@@ -50,7 +50,6 @@ public class OperationCreateWizard implements Wizard {
private OperationParametersStep parametersStep;
private OperationSchedulingStep schedulingStep;
- private ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
private WizardView view;
private IButton executeNowButton;
@@ -66,8 +65,10 @@ public class OperationCreateWizard implements Wizard {
parametersStep = new OperationParametersStep(operationDefinition);
schedulingStep = new OperationSchedulingStep();
+ ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
steps.add(parametersStep);
steps.add(schedulingStep);
+ setSteps(steps);
executeNowButton = new IButton("Execute Immediately");
executeNowButton.setAutoFit(true);
@@ -100,10 +101,6 @@ public class OperationCreateWizard implements Wizard {
return operationDefinition.getDescription();
}
- public List<WizardStep> getSteps() {
- return steps;
- }
-
public List<IButton> getCustomButtons(int step) {
switch (step) {
case 0:
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
index b84a44e..bad2058 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
@@ -33,7 +33,7 @@ import
org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard;
+import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -43,7 +43,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
-public class ResourceFactoryCreateWizard implements Wizard {
+public class ResourceFactoryCreateWizard extends AbstractWizard {
private ConfigurationDefinition configurationDefinition;
private Resource parentResource;
@@ -54,10 +54,8 @@ public class ResourceFactoryCreateWizard implements Wizard {
private ConfigurationTemplateStep configurationTemplateStep;
private ConfigurationStep configurationStep;
- private ArrayList<WizardStep> steps;
-
-
- public ResourceFactoryCreateWizard(Resource parentResource, ResourceType createType,
ConfigurationDefinition configurationDefinition) {
+ public ResourceFactoryCreateWizard(Resource parentResource, ResourceType createType,
+ ConfigurationDefinition configurationDefinition) {
this.parentResource = parentResource;
this.createType = createType;
this.configurationDefinition = configurationDefinition;
@@ -66,14 +64,15 @@ public class ResourceFactoryCreateWizard implements Wizard {
assert createType != null;
assert configurationDefinition != null;
-
- steps = new ArrayList<WizardStep>();
+ ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
configurationTemplateStep = new ConfigurationTemplateStep(this);
steps.add(configurationTemplateStep);
configurationStep = new ConfigurationStep(this);
steps.add(configurationStep);
+
+ setSteps(steps);
}
public String getWindowTitle() {
@@ -88,25 +87,20 @@ public class ResourceFactoryCreateWizard implements Wizard {
return null;
}
- public List<WizardStep> getSteps() {
- return steps;
- }
-
public List<IButton> getCustomButtons(int step) {
switch (step) {
- case 1:
- IButton createButton = new IButton("Create");
- createButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- execute();
- }
- });
- return Collections.singletonList(createButton);
+ case 1:
+ IButton createButton = new IButton("Create");
+ createButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ execute();
+ }
+ });
+ return Collections.singletonList(createButton);
}
return null;
}
-
private void execute() {
int parentReourceId = parentResource.getId();
@@ -114,26 +108,22 @@ public class ResourceFactoryCreateWizard implements Wizard {
String newResourceName = configurationTemplateStep.getResourceName();
Configuration newConfiguration = configurationStep.getConfiguration();
- GWTServiceLookup.getResourceService().createResource(
- parentReourceId,
- createTypeId,
- newResourceName,
- newConfiguration,
- new AsyncCallback<Void>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to create new
resource", caught);
- view.closeDialog();
- }
-
- public void onSuccess(Void result) {
- CoreGUI.getMessageCenter().notify(new Message("Submitted
request to create new resource [" +
- configurationTemplateStep.getResourceName() +
"]", Message.Severity.Info));
- view.closeDialog();
- }
- });
+ GWTServiceLookup.getResourceService().createResource(parentReourceId,
createTypeId, newResourceName,
+ newConfiguration, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to create new
resource", caught);
+ view.closeDialog();
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Submitted request to create new resource
["
+ + configurationTemplateStep.getResourceName() +
"]", Message.Severity.Info));
+ view.closeDialog();
+ }
+ });
}
-
public void display() {
view = new WizardView(this);
view.displayDialog();
@@ -141,13 +131,14 @@ public class ResourceFactoryCreateWizard implements Wizard {
public static void showCreateWizard(final Resource parentResource, ResourceType
childType) {
ResourceTypeRepository.Cache.getInstance().getResourceTypes(childType.getId(),
-
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- ResourceFactoryCreateWizard wizard = new
ResourceFactoryCreateWizard(parentResource, type,
type.getResourceConfigurationDefinition());
- wizard.display();
- }
- });
+
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ ResourceFactoryCreateWizard wizard = new
ResourceFactoryCreateWizard(parentResource, type, type
+ .getResourceConfigurationDefinition());
+ wizard.display();
+ }
+ });
}
public ConfigurationDefinition getConfigurationDefinition() {
@@ -165,7 +156,7 @@ public class ResourceFactoryCreateWizard implements Wizard {
public ResourceType getCreateType() {
return createType;
}
-
+
public void cancel() {
// TODO: revert back to original state
}
commit d21faf4fa9f16b2d42647be24dae28366d0eb309
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Jul 7 13:55:45 2010 -0400
Jeremy Perry: here are some replacement icons for servers and services that should
give them the appropriate visual weight in the tree.
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png
index 78f04e5..df7487f 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png
index 202dfe1..db4f195 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png
index 6a5286f..73b5f6b 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png
index 9240927..a31229b 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png
index bdc8532..fc8583f 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png
index 771ccff..3b860dc 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png
and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png
index 5356ae7..7ee9347 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png
and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png
differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png
index 0ef05e9..a925aaf 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png differ
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png
index 6babc43..6c37504 100644
Binary files
a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png and
b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png differ
commit 43130d136b9d8b4fc94d65dc6db5ab9a2912149e
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Jul 7 13:33:34 2010 -0400
[BZ 598951] Increasing log level to WARN when java_home cannot be determined
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index d85680b..8ef756d 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -257,7 +257,7 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR);
if (javaHome == null && log.isDebugEnabled()) {
- log.debug("Unable to determine the JAVA_HOME environment variable
for the JBoss AS process - "
+ log.warn("Unable to determine the JAVA_HOME environment variable for
the JBoss AS process - "
+ " the Agent is probably running as a user that does not have
access to the AS process's "
+ " environment.");
}
commit 26adb1fce95b0b5248053f03432d71cb0aeb73da
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jul 7 15:40:03 2010 +0200
BZ 612127 - if not augeas found, directly return.
diff --git
a/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java
b/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java
index 5fc3b4f..67da318 100644
---
a/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java
+++
b/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java
@@ -42,6 +42,9 @@ public class SambaShareDiscoveryComponent implements
ResourceDiscoveryComponent<
SambaServerComponent serverComponent =
discoveryContext.getParentResourceComponent();
Augeas augeas = serverComponent.getAugeas();
+ if (augeas==null) {
+ return details; // No augeas no results
+ }
augeas.load();
List<String> matches =
augeas.match("/files/etc/samba/smb.conf/target[. != 'global']");
@@ -60,7 +63,7 @@ public class SambaShareDiscoveryComponent implements
ResourceDiscoveryComponent<
);
details.add(detail);
}
-
+
return details;
}
}
commit e4d6c11a314727a504e1877d5b3aad3b718880b0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jul 7 15:39:22 2010 +0200
(Re-)enable plugins that were commented out for jdk5
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index f5bfd9a..c75e471 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -9,11 +9,11 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version><!-- TODO adjust RHQ version
-->
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
- <artifactId>Hadoop-plugin</artifactId>
+ <artifactId>hadoop-plugin</artifactId>
<packaging>jar</packaging>
<name>RHQ Hadoop Plugin</name>
@@ -21,7 +21,6 @@
<properties>
<scm.module.path>TODO</scm.module.path>
- <rhq.version>3.0.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see
above too -->
</properties>
<build>
@@ -124,29 +123,6 @@
</profiles>
- <repositories>
- <repository>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>jboss</id>
- <name>JBoss Repository</name>
- <
url>http://repository.jboss.org/maven2/</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>http://repository.jboss.org/maven2/</url>
- </pluginRepository>
- </pluginRepositories>
-
<dependencies>
<dependency>
@@ -157,25 +133,25 @@
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-domain</artifactId>
- <version>${rhq.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-plugin-api</artifactId>
- <version>${rhq.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-native-system</artifactId>
- <version>${rhq.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-jmx-plugin</artifactId>
- <version>${rhq.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 4859ad7..4d439cf 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -153,30 +153,6 @@
</modules>
</profile>
-<!--
- <profile>
- <id>jdk6-only-plugins</id>
- <activation>
- <jdk>[1.6,)</jdk>
- </activation>
- <modules>
- <module>script2</module>
- </modules>
- </profile>
-
- <profile>
- <id>jdk6-linux-plugins</id>
- <activation>
- <jdk>[1.6,)</jdk>
- </activation>
- <modules>
- <module>virt</module>
- <module>kickstart</module>
- <module>byteman</module>
- </modules>
-
- </profile>
--->
<profile>
<id>misc-plugins</id>
@@ -187,17 +163,24 @@
</activation>
<modules>
+ <module>byteman</module>
+
<module>iis</module>
<module>database</module>
<module>postgres</module>
+ <module>hadoop</module>
<module>hudson</module>
<!-- error in code generation (see RHQ-1225)
<module>jira</module> -->
<module>mysql</module>
<!-- non-public dependency <module>onewire</module>
-->
<module>oracle</module>
<module>perftest</module>
+ <module>script2</module>
<module>snmptrapd</module>
<module>twitter</module>
+ <module>virt</module>
+ <module>kickstart</module>
+
</modules>
</profile>
commit f93270225480f305648868fbb006d12a2a7e32ae
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Jul 7 00:05:14 2010 -0400
BZ-599515: by default, do not show auto-backing-cluster results in group browser
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
index eee833e..67a66a9 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java
@@ -55,6 +55,7 @@ public class ResourceGroupCriteria extends TaggedCriteria {
private Integer filterExplicitResourceTypeId; // requires overrides
private String filterExplicitResourceTypeName; // requires overrides
private Integer filterGroupDefinitionId; // requires overrides
+ private Boolean filterVisible = true; /* only show visible groups by default */
private boolean fetchExplicitResources;
private boolean fetchImplicitResources;
@@ -109,6 +110,7 @@ public class ResourceGroupCriteria extends TaggedCriteria {
filterOverrides.put("groupDefinitionId", "groupDefinition.id =
?");
sortOverrides.put("resourceTypeName", "resourceType.name");
+
}
@Override
@@ -190,6 +192,10 @@ public class ResourceGroupCriteria extends TaggedCriteria {
this.filterGroupDefinitionId = filterGroupDefinitionId;
}
+ public void addFilterVisible(Boolean filterVisible) {
+ this.filterVisible = filterVisible;
+ }
+
public void fetchExplicitResources(boolean fetchExplicitResources) {
this.fetchExplicitResources = fetchExplicitResources;
}
commit 308cd90c3151705727d172864a6262073043c151
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jul 6 16:38:36 2010 -0400
[BZ 601153] Modifying configu update logic to avoid TransientObjectException
During the resource config update code, the parent reference of a Property was
getting
set to a new (i.e., transient) Configuration object. Because of the delete_orphan
cascade
style on the Property map, this was resulting in a TransientObjectException.
Also updating exception handling logic in
ApacheServerComponent.updateResourceConfiguration
to capture the augeas error message if present in the config update report.
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 0e98116..c1f6323 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
@@ -319,6 +319,7 @@ public class ApacheServerComponent implements
AugeasRHQComponent<PlatformCompone
report.setStatus(ConfigurationUpdateStatus.FAILURE);
return;
}
+ Configuration originalConfig = report.getConfiguration().deepCopy(true);
AugeasTree tree = null;
try {
tree = getAugeasTree();
@@ -334,11 +335,20 @@ public class ApacheServerComponent implements
AugeasRHQComponent<PlatformCompone
finishConfigurationUpdate(report);
} catch (Exception e) {
- if (tree != null)
+ if (tree != null) {
log.error("Augeas failed to save configuration " +
tree.summarizeAugeasError());
+ e = new AugeasException("Failed to save configuration: " +
tree.summarizeAugeasError() + " ", e);
+ }
else
log.error("Augeas failed to save configuration", e);
report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ if (!originalConfig.equals(report.getConfiguration())) {
+ log.error("Configuration has changed");
+ }
+ else {
+ log.error("Configuratio has not changed");
+ }
}
}
diff --git
a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
index dc335c5..bd9b3c3 100644
---
a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
+++
b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java
@@ -79,8 +79,14 @@ public class ApacheAugeasMapping implements RhqAugeasMapping {
DirectiveMapping mapping =
ApacheDirectiveRegExpression.getMappingType(propDef.getName());
ConfigurationDefinition def = new
ConfigurationDefinition("temp","");
def.put(propDef);
- Configuration configuration = new Configuration();
- configuration.put(config.get(propDef.getName()));
+ // Removing call to create new configuration as this was causing the
TransientObjectException discussed
+ // in
https://bugzilla.redhat.com/show_bug.cgi?id=601153. It is not clear
to why this configuration object
+ // is created. Since I am not familiar with the augeas code, I need to
consult with Filip on this change.
+ //
+ // jsanda
+
+// Configuration configuration = new Configuration();
+// configuration.put(config.get(propDef.getName()));
mapping.mapToAugeas(tree, node, config, def);
}
}
commit 825d68560c8fbc81def6bc40a6e4e404f847103c
Merge: 256cf8b... 536749f...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 6 13:16:53 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 536749fa7c8ef554b5f0eef885d92fd41bb48a7b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jul 6 13:01:34 2010 -0400
fix malformed XML
diff --git a/release.sh b/release.sh
index 4c416bb..9cb9e06 100644
--- a/release.sh
+++ b/release.sh
@@ -298,16 +298,17 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}"
</properties>
</profile>
- <!-- This is used by the deploy plugin to publish release artifacts to the
jboss.org Nexus repo. -->
- <servers>
- <server>
- <id>jboss-releases-repository</id>
- <username>$JBOSS_ORG_USERNAME</username>
- <password>$JBOSS_ORG_PASSWORD</password>
- </server>
- </servers>
-
</profiles>
+
+ <!-- This is used by the deploy plugin to publish release artifacts to the
jboss.org Nexus repo. -->
+ <servers>
+ <server>
+ <id>jboss-releases-repository</id>
+ <username>$JBOSS_ORG_USERNAME</username>
+ <password>$JBOSS_ORG_PASSWORD</password>
+ </server>
+ </servers>
+
</settings>
EOF
commit 256cf8b832b594448500ee436a9056874c1a2b4e
Merge: bbf184a... d6c8240...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 6 11:32:30 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit d6c82407c5f3571145febcfc1e6cebd669a289bb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 6 17:08:11 2010 +0200
Fix typos
diff --git a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
index 74404a9..34a4e71 100644
--- a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
@@ -309,10 +309,10 @@
<!-- used to perftest measurement collection -->
<server name="server-d" class="PerfTestComponent"
discovery="PerfTestDiscoveryComponent" description="Test Server
D">
<service name="service-d-metrics" class="PerfTestComponent"
discovery="PerfTestDiscoveryComponent" description="Nested Service D With
Metrics">
- <metric property="metric000" defaultOn="true"
displayType="summary"defaultInterval="540000"/>
- <metric property="metric001" defaultOn="true"
displayType="summary"defaultInterval="600000"/>
- <metric property="metric002" defaultOn="true"
displayType="summary"defaultInterval="720000"/>
- <metric property="metric003" defaultOn="true"
displayType="summary"defaultInterval="600000"/>
+ <metric property="metric000" defaultOn="true"
displayType="summary" defaultInterval="540000"/>
+ <metric property="metric001" defaultOn="true"
displayType="summary" defaultInterval="600000"/>
+ <metric property="metric002" defaultOn="true"
displayType="summary" defaultInterval="720000"/>
+ <metric property="metric003" defaultOn="true"
displayType="summary" defaultInterval="600000"/>
<metric property="metric004" defaultOn="true"
displayType="summary" defaultInterval="600000"/>
<metric displayName="CallTime" property="calltime"
defaultOn="true" dataType="calltime"
defaultInterval="1200000" units="milliseconds"/>
<event name="PerfTestEventType" description="a test event
type"/>
commit 5c7d99dc0c844bcb77dec9ab24ef086e3748cdd3
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 6 17:07:28 2010 +0200
Deliver less call time data, enable events. Put some variance in schedules for metrics
to not have all always fire at the same time.
diff --git a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
index 880c3c3..74404a9 100644
--- a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml
@@ -309,12 +309,13 @@
<!-- used to perftest measurement collection -->
<server name="server-d" class="PerfTestComponent"
discovery="PerfTestDiscoveryComponent" description="Test Server
D">
<service name="service-d-metrics" class="PerfTestComponent"
discovery="PerfTestDiscoveryComponent" description="Nested Service D With
Metrics">
- <metric property="metric000" defaultOn="true"
displayType="summary"/>
- <metric property="metric001" defaultOn="true"
displayType="summary"/>
- <metric property="metric002" defaultOn="true"
displayType="summary"/>
- <metric property="metric003" defaultOn="true"
displayType="summary"/>
- <metric property="metric004" defaultOn="true"
displayType="summary"/>
- <metric displayName="CallTime" property="calltime"
defaultOn="true" dataType="calltime" defaultInterval="60000"
units="milliseconds"/>
+ <metric property="metric000" defaultOn="true"
displayType="summary"defaultInterval="540000"/>
+ <metric property="metric001" defaultOn="true"
displayType="summary"defaultInterval="600000"/>
+ <metric property="metric002" defaultOn="true"
displayType="summary"defaultInterval="720000"/>
+ <metric property="metric003" defaultOn="true"
displayType="summary"defaultInterval="600000"/>
+ <metric property="metric004" defaultOn="true"
displayType="summary" defaultInterval="600000"/>
+ <metric displayName="CallTime" property="calltime"
defaultOn="true" dataType="calltime"
defaultInterval="1200000" units="milliseconds"/>
+ <event name="PerfTestEventType" description="a test event
type"/>
</service>
</server>
commit 5a4cc93421258718ebc10736616968ede431b4d4
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Jul 6 09:58:59 2010 -0400
BZ 602486 - add back JDK6 API usage
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
index fa81429..c8111fc 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
@@ -245,8 +245,6 @@ public class Deployer {
public DeploymentDiskUsage estimateDiskUsage() throws Exception {
final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage();
- /*
- OH TO BE ABLE TO USE A MODERN JDK - THIS NEEDS JDK6
File partition = this.deploymentData.getDestinationDir();
long usableSpace = partition.getUsableSpace();
while (usableSpace == 0L && partition != null) {
@@ -257,8 +255,6 @@ public class Deployer {
}
diskUsage.setMaxDiskUsable(usableSpace);
- */
- diskUsage.setMaxDiskUsable(Long.MAX_VALUE);
Set<File> zipFiles = this.deploymentData.getZipFiles();
for (File zipFile : zipFiles) {
commit d91539eebdae138120ffe907101ddf90907797fb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 6 15:55:05 2010 +0200
BZ610179
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 7fe7a5e..df9b758 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
@@ -276,9 +276,22 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
toBeDeletedQuery.setParameter("resourceId", resourceId);
List<Integer> toBeDeletedResourceIds = toBeDeletedQuery.getResultList();
- boolean hasErrors = uninventoryResourcesBulkDelete(overlord,
toBeDeletedResourceIds);
- if (hasErrors) {
- throw new IllegalArgumentException("Could not remove resources from
their containing groups");
+ int i = 0;
+ log.debug("== total size : " + toBeDeletedResourceIds.size());
+
+ while (i<toBeDeletedResourceIds.size()) {
+ int j = i + 1000;
+ if (j > toBeDeletedResourceIds.size())
+ j = toBeDeletedResourceIds.size();
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j);
+ log.debug("== Bounds " + i + ", " + j);
+
+
+ boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete);
+ if (hasErrors) {
+ throw new IllegalArgumentException("Could not remove resources from
their containing groups");
+ }
+ i = j;
}
Query markDeletedQuery =
entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
@@ -379,12 +392,12 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
DeleteResourceHistory.QUERY_DELETE_BY_RESOURCES, //
CreateResourceHistory.QUERY_DELETE_BY_RESOURCES, //
ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0, // orphan parent
list or maps (execute only on non selfRefCascade dbs)
- ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the
raw configs for the config
+ ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the
raw configs for the config
ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the
config objects
ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_3, // then the history
objects wrapping those configs
PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0, // orphan parent list
or maps (execute only on non selfRefCascade dbs)
PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the
raw configs for the config
- PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the
config objects
+ PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the
config objects
PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_3, // then the history
objects wrapping those configs
AlertConditionLog.QUERY_DELETE_BY_RESOURCES, // Don't
AlertNotificationLog.QUERY_DELETE_BY_RESOURCES, // alter
@@ -400,18 +413,21 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
boolean supportsCascade =
DatabaseTypeFactory.getDefaultDatabaseType().supportsSelfReferringCascade();
boolean hasErrors = false;
+ boolean debugEnabled = log.isDebugEnabled();
for (String namedQueryToExecute : namedQueriesToExecute) {
// execute all in new transactions, continuing on error, but recording
whether errors occurred
// If the db vendor can not support our self-referring cascade delete data
model then we may have
// to leave some config prop rows orphaned. Only execute the selected queries
if you *do*
- // want to avoid self-referring cascade delete (and leave orphans)
+ // want to avoid self-referring cascade delete (and leave orphans)
if (supportsCascade && ( //
namedQueryToExecute.equals(ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0) || //
namedQueryToExecute.equals(PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0))) {
continue;
}
+ if (debugEnabled)
+ log.debug("uninv, running query: " + namedQueryToExecute);
hasErrors |= resourceManager.bulkNamedQueryDeleteInNewTransaction(overlord,
namedQueryToExecute,
resourceIds);
}
commit a01f5013b4e816807ae846c452ca8292791eaae9
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 6 15:54:51 2010 +0200
BZ 611432 - Re-enable sorting on columns
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index ea8017a..5fd39e5 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -132,7 +132,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="r.name">
+ <onc:sortableColumnHeader sort="name">
<h:outputText styleClass="headerText"
value="Resource" />
</onc:sortableColumnHeader>
</f:facet>
@@ -161,7 +161,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="r.description">
+ <onc:sortableColumnHeader sort="description">
<h:outputText styleClass="headerText"
value="Description" />
</onc:sortableColumnHeader>
</f:facet>
commit bbf184a265d8d376813fa9a1db930aa78fec130e
Merge: 7112476... b63d69a...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jul 6 09:53:44 2010 -0400
Merge branch 'release-3.0.0' of
ssh://git.fedorahosted.org/git/rhq/rhq into
release-3.0.0
commit 3d0764e5454f846a3c46113bff12d6b754f86770
Merge: 3a47315... 24133e9...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 18:27:03 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts:
modules/plugins/augeas/pom.xml
diff --cc modules/plugins/augeas/pom.xml
index 3e17750,4a78b61..41d0744
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@@ -35,7 -35,7 +35,11 @@@
<version>${project.version}</version>
</dependency>
++<<<<<<< HEAD
+ <dependency>
++=======
+ <dependency>
++>>>>>>> 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
commit b63d69a0cf50e2ea78877c0e17573680eac672cc
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 18:01:35 2010 -0400
when in production mode, provide a way to specifiy
jboss.org credentials, which can be
used to publish the release Maven artifacts to the JBoss Nexus repo
diff --git a/release.sh b/release.sh
index 57b39b0..4c416bb 100644
--- a/release.sh
+++ b/release.sh
@@ -51,6 +51,12 @@ if [ "$MODE" != "test" ] && [
"$MODE" != "production" ]; then
usage "Invalid mode: $MODE (valid modes are 'test' or
'production')"
fi
+if [ "$MODE" = "production" ]; then
+ if [ -z "$JBOSS_ORG_USERNAME" ] || [ -z "$JBOSS_ORG_PASSWORD" ];
then
+ usage "In production mode,
jboss.org credentials must be specified via the
JBOSS_ORG_USERNAME and JBOSS_ORG_PASSWORD environment variables."
+ fi
+fi
+
# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
@@ -232,6 +238,7 @@ echo
"MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOU
echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE"
echo "MAVEN_ARGS=$MAVEN_ARGS"
echo "MAVEN_RELEASE_PERFORM_GOAL=$MAVEN_RELEASE_PERFORM_GOAL"
+echo "JBOSS_ORG_USERNAME=$JBOSS_ORG_USERNAME"
echo "============================= Program Versions
================================"
git --version
echo
@@ -290,6 +297,15 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}"
<rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups>
</properties>
</profile>
+
+ <!-- This is used by the deploy plugin to publish release artifacts to the
jboss.org Nexus repo. -->
+ <servers>
+ <server>
+ <id>jboss-releases-repository</id>
+ <username>$JBOSS_ORG_USERNAME</username>
+ <password>$JBOSS_ORG_PASSWORD</password>
+ </server>
+ </servers>
</profiles>
</settings>
commit 432ec5890beba9755463d8a80d147102f4419fbc
Author: hudson auto <wnstb(a)yahoo.com>
Date: Fri Jul 2 17:40:40 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 2671e28..eda9133 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index d120b90..bc7965b 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 13db879..2cf950b 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index cdabe07..ee81a94 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 6ef6ac7..d177f9e 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 2b8b625..a51f92b 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 2b434aa..d536ce6 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 01ef215..e0ced84 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b85d13d..0911918 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 8656c25..d47d4c8 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 750882c..e1ce7ef 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index ed9231b..2e58102 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index f8105ac..7739177 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 89a85a0..eeb7e81 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 832b459..7aad64c 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index fa1d7dd..bc41dc5 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index bdcf31f..d9f1c1c 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 701e10f..8942239 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index cfac808..8b9da9c 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index dbb2cc2..611eb9d 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 785e68a..798a8ca 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index fa3c7b6..df05645 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index b0c4e49..ca1b68d 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index c2f18f1..1beadca 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 9ddc2fc..0c529ba 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index 479addc..783942c 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index f0e1f72..aa880be 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 0862d3f..3b0dbb8 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index d263224..05187c7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 73f0410..e86ef41 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 5a27ebc..910b617 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 81bddb1..2ea73ee 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 9df1977..2c98817 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index d0e93e0..3fd11e8 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index c05e6ac..bf15866 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index bd29a47..9e7bb24 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index 1ff43d1..dd5bc18 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 0300716..c0973f3 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index efeaf27..a62fee8 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3e64d1e..3193539 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 8822723..e69bfbc 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index c01583f..ca33bb7 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 3b7a1f0..af75153 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index f5d767a..09839b8 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 1f961af..73f405e 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 01f152d..4c44f10 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index ad1ebe1..0033d1b 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 8ff5673..61965f2 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 323c494..7451668 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index d39c53c..0ac61d3 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index a88dedc..5a78451 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 9e452fe..2b16f4a 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 955aecf..e4ab9b2 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index b61f522..a6cba32 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 8c4f861..9c7cc74 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index 610d859..ebdd3da 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 722b73c..06c8981 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index 568f2a2..aa278b8 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index b36db80..0cc2084 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 21b1441..14738d0 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index 95d11be..d056f74 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index c2cf269..28dc9b1 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 67674b3..a0721a9 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index bf6199e..5d327ee 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index e59e4db..c37598e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index da8381d..cc160c9 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 8a5e218..b4f9208 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index c3c3731..915106a 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index dd10246..d920440 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 44b5116..d5aaad5 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index c91d8c2..30889f7 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index 0150062..b79645d 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index a517e50..f7cf265 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 745c5e2..acb08ef 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index d7d0846..7dd0fde 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index dd44b03..65fa7b8 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 5bfe8b6..853c020 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index 2fc226a..a0ade77 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index a0e18ef..b9ed2b3 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index 3f3337e..b3846fa 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index c3f4ee7..443e524 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 25c1871..ac9885a 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index ffd328e..d0c9053 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index d305b4e..06ae2ae 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index ca08b54..1acdb0f 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index db31afb..39c75da 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 0be644f..97b83b0 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 7394bfc..85d6105 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index f42212b..283ab6a 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 4edf4e7..5a4466c 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 706efa2..a190dcd 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index c253427..8f4e675 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index a846fac..0d41574 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d9e5a9e..7719b14 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 34e530a..2d9d715 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index a5997d7..3579496 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 50d3587..41df1b8 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 1c5410a..205d5b0 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 51ed887..e299efa 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index 018da41..b3d5e87 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 3065373..bc96ae3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 3bdbac9..2235687 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 4a405c3..4743b2c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 59e9341c367e24ad78e7dafd683887080ee758dd
Author: hudson auto <wnstb(a)yahoo.com>
Date: Fri Jul 2 17:39:43 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index eda9133..2671e28 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index bc7965b..d120b90 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 2cf950b..13db879 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index ee81a94..cdabe07 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index d177f9e..6ef6ac7 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index a51f92b..2b8b625 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d536ce6..2b434aa 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..01ef215 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 0911918..b85d13d 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d47d4c8..8656c25 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e1ce7ef..750882c 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 2e58102..ed9231b 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 7739177..f8105ac 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index eeb7e81..89a85a0 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7aad64c..832b459 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index bc41dc5..fa1d7dd 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index d9f1c1c..bdcf31f 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 8942239..701e10f 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 8b9da9c..cfac808 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 611eb9d..dbb2cc2 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 798a8ca..785e68a 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index df05645..fa3c7b6 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index ca1b68d..b0c4e49 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index 1beadca..c2f18f1 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 0c529ba..9ddc2fc 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index 783942c..479addc 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index aa880be..f0e1f72 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3b0dbb8..0862d3f 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 05187c7..d263224 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index e86ef41..73f0410 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 910b617..5a27ebc 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 2ea73ee..81bddb1 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 2c98817..9df1977 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 3fd11e8..d0e93e0 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index bf15866..c05e6ac 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 9e7bb24..bd29a47 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index dd5bc18..1ff43d1 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c0973f3..0300716 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index a62fee8..efeaf27 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3193539..3e64d1e 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index e69bfbc..8822723 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index ca33bb7..c01583f 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index af75153..3b7a1f0 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 09839b8..f5d767a 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 73f405e..1f961af 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 4c44f10..01f152d 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 0033d1b..ad1ebe1 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 61965f2..8ff5673 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 7451668..323c494 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 0ac61d3..d39c53c 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 5a78451..a88dedc 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 2b16f4a..9e452fe 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index e4ab9b2..955aecf 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index a6cba32..b61f522 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9c7cc74..8c4f861 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index ebdd3da..610d859 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 06c8981..722b73c 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index aa278b8..568f2a2 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 0cc2084..b36db80 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 14738d0..21b1441 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index d056f74..95d11be 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 28dc9b1..c2cf269 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index a0721a9..67674b3 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 5d327ee..bf6199e 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c37598e..e59e4db 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index cc160c9..da8381d 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index b4f9208..8a5e218 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 915106a..c3c3731 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index d920440..dd10246 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d5aaad5..44b5116 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 30889f7..c91d8c2 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index b79645d..0150062 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f7cf265..a517e50 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index acb08ef..745c5e2 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 7dd0fde..d7d0846 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 65fa7b8..dd44b03 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 853c020..5bfe8b6 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a0ade77..2fc226a 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b9ed2b3..a0e18ef 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index b3846fa..3f3337e 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 443e524..c3f4ee7 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ac9885a..25c1871 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d0c9053..ffd328e 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 06ae2ae..d305b4e 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 1acdb0f..ca08b54 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 39c75da..db31afb 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 97b83b0..0be644f 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 85d6105..7394bfc 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 283ab6a..f42212b 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 5a4466c..4edf4e7 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index a190dcd..706efa2 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8f4e675..c253427 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 0d41574..a846fac 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 7719b14..d9e5a9e 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 2d9d715..34e530a 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3579496..a5997d7 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 41df1b8..50d3587 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 205d5b0..1c5410a 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index e299efa..51ed887 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index b3d5e87..018da41 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index bc96ae3..3065373 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 2235687..3bdbac9 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index 4743b2c..4a405c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit ce0c0771ce63d760fa45e6c4d925b0bf081048da
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 16:28:10 2010 -0400
temporarily update to not purge local repo in production mode
diff --git a/release.sh b/release.sh
index 6cb69da..57b39b0 100644
--- a/release.sh
+++ b/release.sh
@@ -247,7 +247,7 @@ echo
if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
if [ "$MODE" = "production" ]; then
echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a
production build..."
- rm -rf "$MAVEN_LOCAL_REPO_DIR"
+ #rm -rf "$MAVEN_LOCAL_REPO_DIR"
else
OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
if [ -n "$OUTPUT" ]; then
commit 5113a3868b3db0304ee21cb36b6f70290afda9a2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 16:25:34 2010 -0400
upgrade all i18nlog versions throughout poms and ant scripts from 1.0.9 to 1.0.10;
update ManagedComponentUtils.getSinglestoneManagedComponent to return null, rather than
throwing an IllegalStateException, if no components of the specified type are found
diff --git a/modules/core/native-system/ant-run.xml
b/modules/core/native-system/ant-run.xml
index 3856bcd..b1a23fd 100644
--- a/modules/core/native-system/ant-run.xml
+++ b/modules/core/native-system/ant-run.xml
@@ -14,7 +14,7 @@ Ant Script that builds a test jar to run SIGAR bug replication code.
<property name="sigar.version" value="1.6.5.132"/>
<fileset dir="${settings.localRepository}"
id="jar.fileset">
- <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" />
+ <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" />
<include name="log4j/log4j/1.2.14/log4j-1.2.14.jar" />
<include name="org/testng/testng/5.1/testng-5.1-jdk15.jar" />
<include
name="commons-logging/commons-logging/1.1/commons-logging-1.1.jar" />
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 16e0cd0..57ec329 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -34,7 +34,7 @@ Ant Script that provides ways to package the Agent.
<fileset dir="${settings.localRepository}"
id="run.classpath.fileset">
<include
name="javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" />
- <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" />
+ <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" />
<include name="log4j/log4j/1.2.14/log4j-1.2.14.jar" />
<include
name="jline/jline/${jline.version}/jline-${jline.version}.jar" />
<include
name="commons-logging/commons-logging/1.1.0.jboss/commons-logging-1.1.0.jboss.jar"
/>
diff --git a/modules/enterprise/remoting/ant-run.xml
b/modules/enterprise/remoting/ant-run.xml
index 3e5fb44..163a01e 100644
--- a/modules/enterprise/remoting/ant-run.xml
+++ b/modules/enterprise/remoting/ant-run.xml
@@ -35,7 +35,7 @@ ANT Script that provides ways to package the agent.
<!-- include our own thirdparty libraries -->
<fileset dir="${settings.localRepository}"
id="run.classpath.fileset">
- <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" />
+ <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" />
<include
name="commons-logging/commons-logging/1.1.0.jboss/commons-logging-1.1.0.jboss.jar"
/>
<include
name="gnu-getopt/getopt/${getopt.version}/getopt-${getopt.version}.jar" />
<include
name="org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar" />
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 33966bd..05187c7 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -20,7 +20,6 @@
<properties>
<scm.module.path>modules/enterprise/remoting/</scm.module.path>
- <i18nlog.version>1.0.9</i18nlog.version>
<log4j.version>1.2.14</log4j.version>
<persistence-api.version>1.0</persistence-api.version>
<hibernate-all.version>1.0.0.Alpha9</hibernate-all.version>
diff --git a/modules/enterprise/remoting/cli/src/etc/build.xml
b/modules/enterprise/remoting/cli/src/etc/build.xml
index f7f8483..6775709 100644
--- a/modules/enterprise/remoting/cli/src/etc/build.xml
+++ b/modules/enterprise/remoting/cli/src/etc/build.xml
@@ -21,7 +21,7 @@
<!--location for Gnu-Getopt dependency -->
<property name="i18-jar"
- location="${repo}/i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar"/>
+ location="${repo}/i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar"/>
<property name="jbossws"
location="C:/installers/Jboss/jbossws-native-3.1.2.GA.zip"/>
@@ -33,7 +33,7 @@
<pathelement location="${runLocation}/getopt-1.0.13.jar"/>
<pathelement location="${runLocation}/remoting.jar"/>
<pathelement location="${runLocation}/jline-0.9.94.jar"/>
- <pathelement location="${runLocation}/i18nlog-1.0.9.jar"/>
+ <pathelement location="${runLocation}/i18nlog-1.0.10.jar"/>
<pathelement location="${runLocation}/jbossws-native-3.1.2.GA.zip"/>
<!-- <pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/> -->
@@ -54,7 +54,7 @@
<!-- Copy all necessary jars to that location too -->
<copy tofile="${runLocation}/jline-0.9.94.jar"
file="${jline-jar}"/>
<copy tofile="${runLocation}/getopt-1.0.13.jar"
file="${gnu-jar}"/>
- <copy tofile="${runLocation}/i18nlog-1.0.9.jar"
file="${i18-jar}"/>
+ <copy tofile="${runLocation}/i18nlog-1.0.10.jar"
file="${i18-jar}"/>
<copy tofile="${runLocation}/jbossws-native-3.1.2.GA.zip"
file="${jbossws}"/>
<copy tofile="${runLocation}/toRun.txt"
file="${basedir}/toRun.txt"/>
<!-- <copy todir="${runLocation}">
@@ -83,4 +83,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 605267f..e86ef41 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -21,7 +21,6 @@
<properties>
<scm.module.path>modules/enterprise/remoting/</scm.module.path>
- <i18nlog.version>1.0.9</i18nlog.version>
<log4j.version>1.2.14</log4j.version>
<persistence-api.version>1.0</persistence-api.version>
<hibernate-all.version>1.0.0.Alpha9</hibernate-all.version>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
index 2039f89..3b74a61 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
@@ -38,31 +38,7 @@
<version>${project.version}</version>
<scope>provided</scope> <!-- provided by the
server/plugin-container -->
</dependency>
-
-
- <!-- uncomment the one of the three logging systems your plugin uses: log4j,
commons-logging or i18nlog -->
- <!-- all three are provided to your plugin by the server/plugin-container
-->
- <!--
- <dependency> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <version>1.2.14</version>
- <scope>provided</scope> </dependency>
- -->
-
- <!--
- <dependency> <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId> <version>1.1</version>
- <scope>provided</scope> </dependency>
- -->
-
- <!--
- <dependency> <groupId>i18nlog</groupId>
<artifactId>i18nlog</artifactId> <version>1.0.9</version>
</dependency>
- -->
-
- <!-- Define any third-party dependencies your plugin has here. -->
- <!--
- <dependency>
<groupId>group-id-of-dependency-goes-here</groupId>
- <artifactId>artifact-id-of-dependency-goes-here</artifactId>
<version>version-of-dependency-goes-here</version>
- </dependency>
- -->
-
+
</dependencies>
<build>
@@ -154,3 +130,4 @@
</profiles>
</project>
+
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java
index 177e3bb..b928584 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java
@@ -1,6 +1,6 @@
/*
* Jopr Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -39,6 +39,7 @@ import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.SimpleValue;
+import org.jetbrains.annotations.Nullable;
/**
* A collection of utility methods for working with Profile Service {@link
ManagedComponent}s.
@@ -49,6 +50,7 @@ public class ManagedComponentUtils
{
private static final Comparator<ComponentType> COMPONENT_TYPE_COMPARATOR = new
ComponentTypeComparator();
+ @Nullable
public static ManagedComponent getManagedComponent(ManagementView managementView,
ComponentType componentType,
String componentName)
{
@@ -61,22 +63,26 @@ public class ManagedComponentUtils
return null;
}
+ @Nullable
public static ManagedComponent getSingletonManagedComponent(ManagementView
managementView,
ComponentType
componentType)
{
Set<ManagedComponent> components = getManagedComponents(managementView,
componentType);
- if (components.size() != 1)
+ if (components.size() > 1)
+ {
throw new IllegalStateException("Found more than one component of type
" + componentType + ": "
+ components);
+ }
@SuppressWarnings({"UnnecessaryLocalVariable"})
- ManagedComponent component = components.iterator().next();
+ ManagedComponent component = (components.size() == 1) ?
components.iterator().next() : null;
return component;
}
public static Serializable getSimplePropertyValue(ManagedComponent component, String
propertyName)
throws PropertyNotFoundException {
ManagedProperty property = component.getProperty(propertyName);
- if (property == null) {
+ if (property == null)
+ {
throw new PropertyNotFoundException("Property named '" +
propertyName + "' not found for ManagedComponent ["
+ component + "].");
}
diff --git a/pom.xml b/pom.xml
index 95b0dc6..4743b2c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,7 @@
<hibernate3.version>3.2.r14201-2</hibernate3.version>
<hibernate-annotations.version>3.2.1.GA</hibernate-annotations.version>
<hibernate-entitymanager.version>3.2.1.GA</hibernate-entitymanager.version>
+ <i18nlog.version>1.0.10</i18nlog.version>
<jaxb-api.version>2.1</jaxb-api.version>
<jaxb-impl.version>2.1.6</jaxb-impl.version>
<jsf-api.version>1.2_14</jsf-api.version>
@@ -411,7 +412,7 @@
<dependency>
<groupId>i18nlog</groupId>
<artifactId>i18nlog</artifactId>
- <version>1.0.10</version>
+ <version>${i18nlog.version}</version>
</dependency>
<!-- for the JAXB annotations -->
commit 774ff1338b154d6771e46d0554811bb09af74e63
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 15:19:28 2010 -0400
oops, fix typo
diff --git a/release.sh b/release.sh
index 544deae..6cb69da 100644
--- a/release.sh
+++ b/release.sh
@@ -171,7 +171,7 @@ fi
PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors
-Penterprise,dist,release"
-if [ "$MODE" = "production" ]; then
+if [ "$MODE" = "test" ]; then
MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
fi
if [ "$RELEASE_TYPE" = "enterprise" ]; then
commit 45f823eebd3b01e6475790b6d009aa587c366883
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jul 2 15:18:46 2010 -0400
various tweaks to prepare for RHQ 3.0 production release build
diff --git a/release.sh b/release.sh
index da56c27..544deae 100644
--- a/release.sh
+++ b/release.sh
@@ -171,6 +171,9 @@ fi
PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors
-Penterprise,dist,release"
+if [ "$MODE" = "production" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true"
+fi
if [ "$RELEASE_TYPE" = "enterprise" ]; then
MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
fi
@@ -181,12 +184,12 @@ if [ -n "$RELEASE_ADDITIONAL_MAVEN_ARGS" ]; then
MAVEN_ARGS="$MAVEN_ARGS $RELEASE_ADDITIONAL_MAVEN_ARGS"
fi
if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
- MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="12"
+ MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6"
fi
if [ "$MODE" = "production" ]; then
MAVEN_RELEASE_PERFORM_GOAL="deploy"
-else
+else
MAVEN_RELEASE_PERFORM_GOAL="install"
fi
@@ -240,14 +243,20 @@ echo
# Clean the Maven local repo if it hasn't been purged recently.
-# TODO: Uncomment this.
-#if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
-# OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
-# if [ -n "$OUTPUT" ]; then
-# echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean
build..."
-# rm -rf "$MAVEN_LOCAL_REPO_DIR"
-# fi
-#fi
+
+if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
+ if [ "$MODE" = "production" ]; then
+ echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a
production build..."
+ rm -rf "$MAVEN_LOCAL_REPO_DIR"
+ else
+ OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
+ if [ -n "$OUTPUT" ]; then
+ echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more
than $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean
build..."
+ rm -rf "$MAVEN_LOCAL_REPO_DIR"
+ fi
+ fi
+
+fi
mkdir -p "$MAVEN_LOCAL_REPO_DIR"
@@ -367,7 +376,9 @@ if [ -n "$EXISTING_REMOTE_TAG" ] && [
"$MODE" = "test" ]; then
[ "$?" -ne 0 ] && abort "Failed to delete remote tag
($RELEASE_TAG)."
fi
+
# See if the specified tag already exists locally - if so, delete it (even if in
production mode).
+
EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"`
if [ -n "$EXISTING_LOCAL_TAG" ]; then
echo "A local tag named $RELEASE_TAG already exists - deleting it..."
@@ -386,6 +397,7 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs.
+
echo "Cleaning up snapshot jars produced by test build from module target
dirs..."
mvn clean $MAVEN_ARGS
[ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced
by test build from module target dirs. Please see above Maven output for details, fix any
issues, then try again."
commit 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 10:59:32 2010 -0400
LT commit
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 30df9ef..45526f7 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -1,104 +1,104 @@
-<%@ page language="java" %>
-<%@ page errorPage="/common/Error.jsp" %>
-
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"
%>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-html-el"
prefix="html" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-logic"
prefix="logic" %>
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
-<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
-
-<script src="<html:rewrite page="/js/"/>functions.js"
type="text/javascript"></script>
-<link rel=stylesheet href="<html:rewrite
page="/css/"/>win.css" type="text/css">
-
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="MINUTES_LABEL" var="CONST_MINUTES" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="HOURS_LABEL" var="CONST_HOURS" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="DAYS_LABEL" var="CONST_DAYS" />
-
-<!-- BASE SERVER CONFIG TITLE -->
-<tiles:insert definition=".header.tab">
- <tiles:put name="tabKey"
value="admin.settings.BaseConfigTab"/>
-</tiles:insert>
-<!-- / -->
-
-<!-- BASE SERVER CONFIG CONTENTS -->
-<table width="100%" cellpadding="0" cellspacing="0"
border="0">
- <tr>
- <td width="45%" class="BlockLabel"><fmt:message
key="admin.settings.BaseURL"/></td>
- <td width="55%" class="BlockContent"><html:text
size="31" property="baseUrl" /></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
- <td class="BlockContent">
- <table width="100%" cellpadding="0"
cellspacing="0" border="0">
- <tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <td class="ErrorField">
- <html:text size="2"
property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="ErrorField" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message
key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <td class="BlockContent">
- <html:text size="2"
property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="BlockContent" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message
key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesNotPresent>
- </tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="ErrorField" colspan="2">
- <span class="ErrorFieldContent"> <html:errors
property="agentMaxQuietTimeAllowedVal"/></span>
- </td>
- </tr>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="BlockContent" colspan="2">
- </td>
- </tr>
-</logic:messagesNotPresent>
- </table>
- </td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.settings.EnableAgentAutoUpdate"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4"
border="0">
- <tr>
- <td align="left"><html:radio
property="enableAgentAutoUpdate" value="true"/><fmt:message
key="yesno.true"/></td>
- <td align="left"><html:radio
property="enableAgentAutoUpdate" value="false"/><fmt:message
key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-
-<hq:authorization permission="superuser">
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.settings.EnableDebugMode"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4"
border="0">
- <tr>
- <td align="left"><html:radio
property="enableDebugMode" value="true"/><fmt:message
key="yesno.true"/></td>
- <td align="left"><html:radio
property="enableDebugMode" value="false"/><fmt:message
key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-</hq:authorization>
-
-</table>
+<%@ page language="java" %>
+<%@ page errorPage="/common/Error.jsp" %>
+
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"
%>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-html-el"
prefix="html" %>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles" %>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-logic"
prefix="logic" %>
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
+<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
+
+<script src="<html:rewrite page="/js/"/>functions.js"
type="text/javascript"></script>
+<link rel=stylesheet href="<html:rewrite
page="/css/"/>win.css" type="text/css">
+
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="MINUTES_LABEL" var="CONST_MINUTES" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="HOURS_LABEL" var="CONST_HOURS" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="DAYS_LABEL" var="CONST_DAYS" />
+
+<!-- BASE SERVER CONFIG TITLE -->
+<tiles:insert definition=".header.tab">
+ <tiles:put name="tabKey"
value="admin.settings.BaseConfigTab"/>
+</tiles:insert>
+<!-- / -->
+
+<!-- BASE SERVER CONFIG CONTENTS -->
+<table width="100%" cellpadding="0" cellspacing="0"
border="0">
+ <tr>
+ <td width="45%" class="BlockLabel"><fmt:message
key="admin.settings.BaseURL"/></td>
+ <td width="55%" class="BlockContent"><html:text
size="31" property="baseUrl" /></td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message
key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
+ <td class="BlockContent">
+ <table width="100%" cellpadding="0"
cellspacing="0" border="0">
+ <tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="ErrorField">
+ <html:text size="2"
property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="ErrorField" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message
key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="BlockContent">
+ <html:text size="2"
property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="BlockContent" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message
key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesNotPresent>
+ </tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="ErrorField" colspan="2">
+ <span class="ErrorFieldContent"> <html:errors
property="agentMaxQuietTimeAllowedVal"/></span>
+ </td>
+ </tr>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="BlockContent" colspan="2">
+ </td>
+ </tr>
+</logic:messagesNotPresent>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message
key="admin.settings.EnableAgentAutoUpdate"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4"
border="0">
+ <tr>
+ <td align="left"><html:radio
property="enableAgentAutoUpdate" value="true"/><fmt:message
key="yesno.true"/></td>
+ <td align="left"><html:radio
property="enableAgentAutoUpdate" value="false"/><fmt:message
key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message
key="admin.settings.EnableDebugMode"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4"
border="0">
+ <tr>
+ <td align="left"><html:radio
property="enableDebugMode" value="true"/><fmt:message
key="yesno.true"/></td>
+ <td align="left"><html:radio
property="enableDebugMode" value="false"/><fmt:message
key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+
+</table>
commit 5d78444b46b3f07276c8ffd43a9675bdd35060ed
Merge: 48c686d... 7112476...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 10:58:51 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts:
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
diff --cc modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 4d9ef75,7f8f9da..68cf92c
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@@ -3002,75 -3002,15 +3002,77 @@@
</schemaSpec>
<schemaSpec version="2.88">
-
+ <!-- the customizable dashboard storage system -->
+
+ <schema-createSequence name="RHQ_DASHBOARD_ID_SEQ"
initial="10001"/>
+ <schema-directSQL>
+ <statement desc="Creating table RHQ_DASHBOARD">
+ CREATE TABLE RHQ_DASHBOARD ( ID INTEGER PRIMARY KEY )
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="ID" nullable="FALSE"/>
- <schema-addColumn table="RHQ_DASHBOARD"
column="NAME" columnType="VARCHAR2" precision="200"/>
++ <schema-addColumn table="RHQ_DASHBOARD"
column="NAME" columnType="VARCHAR2" precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="NAME" nullable="FALSE"/>
- <schema-addColumn table="RHQ_DASHBOARD"
column="SUBJECT_ID" columnType="INTEGER"/>
- <schema-addColumn table="RHQ_DASHBOARD"
column="SHARED" columnType="BOOLEAN"/>
++ <schema-addColumn table="RHQ_DASHBOARD"
column="SUBJECT_ID" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD"
column="SHARED" columnType="BOOLEAN"/>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="SHARED" nullable="FALSE"/>
- <schema-addColumn table="RHQ_DASHBOARD"
column="CONFIGURATION_ID" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD"
column="CONFIGURATION_ID" columnType="INTEGER"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD
- ADD CONSTRAINT RHQ_DASH_CFG_ID_FK
++ ADD CONSTRAINT RHQ_DASHBOARD_CONFIG_ID_FK
+ FOREIGN KEY ( CONFIGURATION_ID )
+ REFERENCES RHQ_CONFIG ( ID )
+ </statement>
+ </schema-directSQL>
+
-
+ <schema-createSequence name="RHQ_DASHBOARD_PORTLET_ID_SEQ"
initial="10001"/>
+ <schema-directSQL>
+ <statement desc="Creating table
RHQ_DASHBOARD_PORTLET">
+ CREATE TABLE RHQ_DASHBOARD_PORTLET ( ID INTEGER PRIMARY KEY )
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="ID" nullable="FALSE"/>
+
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="NAME" columnType="VARCHAR2" precision="200"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="NAME" columnType="VARCHAR2" precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="NAME" nullable="FALSE"/>
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="PORTLET_KEY" columnType="VARCHAR2"
- precision="200"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="PORTLET_KEY" columnType="VARCHAR2"
++
precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="PORTLET_KEY" nullable="FALSE"/>
-
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL" columnType="INTEGER"/>
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL_INDEX" columnType="INTEGER"/>
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="HEIGHT" columnType="INTEGER"/>
-
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="CONFIGURATION_ID" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL_INDEX" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="HEIGHT" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="CONFIGURATION_ID" columnType="INTEGER"/>
++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" columnType="INTEGER"/>
++ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" nullable="FALSE"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD_PORTLET
- ADD CONSTRAINT RHQ_DASH_PT_CFG_ID_FK
++ ADD CONSTRAINT RHQ_DP_CONFIGURATION_ID_FK
+ FOREIGN KEY ( CONFIGURATION_ID )
+ REFERENCES RHQ_CONFIG ( ID )
+ </statement>
+ </schema-directSQL>
-
-
- <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" columnType="INTEGER"/>
- <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" nullable="FALSE"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD_PORTLET
- ADD CONSTRAINT RHQ_DASH_PT_DASH_ID_FK
++ ADD CONSTRAINT RHQ_DP_DASHBOARD_ID_FK
+ FOREIGN KEY ( DASHBOARD_ID )
+ REFERENCES RHQ_DASHBOARD ( ID )
+ </statement>
- </schema-directSQL>
-
++ </schema-directSQL>
+ </schemaSpec>
+
-
++ <schemaSpec version="2.89">
+ <schema-directSQL>
+ <statement desc="Add end time index on call time data to
speed up purges">
+ CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE
(end_time)
+ </statement>
+ <statement desc="Add index on measurement definition numeric
type">
+ CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF
(numeric_type)
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
commit 48c686df1ec30c8fe8a47397082107e2bfcc6d46
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 10:31:14 2010 -0400
LT commit
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
index aefb351..e4511fd 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
@@ -1,422 +1,422 @@
-/*
-* Jopr Management Platform
-* Copyright (C) 2005-2009 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, version 2, as
-* published by the Free Software Foundation, and/or the GNU Lesser
-* General Public License, version 2.1, also as published by the Free
-* Software Foundation.
-*
-* 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 and the GNU Lesser General Public License
-* for more details.
-*
-* You should have received a copy of the GNU General Public License
-* and the GNU Lesser General Public License along with this program;
-* if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-package org.rhq.plugins.jbossas5;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-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.jboss.deployers.spi.management.ManagementView;
-import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.managed.api.ComponentType;
-import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedDeployment;
-import org.jboss.managed.api.ManagedOperation;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.api.RunState;
-import org.jboss.metatype.api.values.ArrayValue;
-import org.jboss.metatype.api.values.CollectionValue;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.EnumValue;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.remoting.CannotConnectException;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
-import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
-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.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jbossas5.util.ConversionUtils;
-import org.rhq.plugins.jbossas5.util.DeploymentUtils;
-import org.rhq.plugins.jbossas5.util.ManagedComponentUtils;
-import org.rhq.plugins.jbossas5.util.ResourceTypeUtils;
-import org.rhq.plugins.jbossas5.util.ResourceComponentUtils;
-import org.rhq.plugins.jbossas5.util.DebugUtils;
-
-/**
- * Service ResourceComponent for all {@link ManagedComponent}s in a Profile.
- *
- * @author Ian Springer
- * @author Jason Dobies
- * @author Mark Spritzler
- */
-public class ManagedComponentComponent extends AbstractManagedComponent implements
ConfigurationFacet,
- DeleteResourceFacet, OperationFacet, MeasurementFacet {
- public static interface Config {
- String COMPONENT_TYPE = "componentType";
- String COMPONENT_SUBTYPE = "componentSubtype";
- String COMPONENT_NAME = "componentName";
- String TEMPLATE_NAME = "templateName";
- String COMPONENT_NAME_PROPERTY = "componentNameProperty";
- }
-
- protected static final char PREFIX_DELIMITER = '|';
-
- private final Log log = LogFactory.getLog(this.getClass());
-
- private String componentName;
- private ComponentType componentType;
-
- // ResourceComponent Implementation --------------------------------------------
-
- public AvailabilityType getAvailability() {
- RunState runState;
- try {
- runState = getManagedComponent().getRunState();
- } catch (CannotConnectException e) {
- return AvailabilityType.DOWN;
- }
- return (runState == RunState.RUNNING) ? AvailabilityType.UP :
AvailabilityType.DOWN;
- }
-
- public void start(ResourceContext<ProfileServiceComponent> resourceContext)
throws Exception {
- super.start(resourceContext);
- this.componentType =
ConversionUtils.getComponentType(getResourceContext().getResourceType());
- Configuration pluginConfig = resourceContext.getPluginConfiguration();
- this.componentName =
pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue();
- log.trace("Started ResourceComponent for " + getResourceDescription() +
", managing " + this.componentType
- + " component '" + this.componentName + "'.");
- }
-
- public void stop() {
- return;
- }
-
- // ConfigurationComponent Implementation
--------------------------------------------
-
- public Configuration loadResourceConfiguration()
- {
- Configuration resourceConfig;
- try
- {
- Map<String, ManagedProperty> managedProperties =
getManagedComponent().getProperties();
- Map<String, PropertySimple> customProps =
-
ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration());
- if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- resourceConfig =
ConversionUtils.convertManagedObjectToConfiguration(managedProperties,
- customProps, getResourceContext().getResourceType());
- }
- catch (Exception e)
- {
- RunState runState = getManagedComponent().getRunState();
- if (runState == RunState.RUNNING) {
- this.log.error("Failed to load configuration for " +
getResourceDescription() + ".", e);
- } else {
- this.log.debug("Failed to load configuration for " +
getResourceDescription()
- + ", but managed component is not in the RUNNING
state.", e);
- }
- throw new RuntimeException(ThrowableUtil.getAllMessages(e));
- }
- return resourceConfig;
- }
-
- public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
- {
- Configuration resourceConfig = configurationUpdateReport.getConfiguration();
- Configuration pluginConfig = getResourceContext().getPluginConfiguration();
- try
- {
- ManagedComponent managedComponent = getManagedComponent();
- Map<String, ManagedProperty> managedProperties =
managedComponent.getProperties();
- Map<String, PropertySimple> customProps =
ResourceComponentUtils.getCustomProperties(pluginConfig);
- if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE
UPDATE:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- ConversionUtils.convertConfigurationToManagedProperties(managedProperties,
resourceConfig,
- getResourceContext().getResourceType(), customProps);
- if (this.log.isDebugEnabled()) this.log.debug("*** AFTER
UPDATE:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- updateComponent(managedComponent);
- configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
- }
- catch (Exception e)
- {
- this.log.error("Failed to update configuration for " +
getResourceDescription() + ".", e);
- configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
- configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e));
- }
- }
-
- // DeleteResourceFacet Implementation --------------------------------------------
-
- public void deleteResource() throws Exception {
- DeploymentManager deploymentManager = getConnection().getDeploymentManager();
- if (!deploymentManager.isRedeploySupported())
- throw new UnsupportedOperationException("Deletion of " +
getResourceContext().getResourceType().getName()
- + " Resources is not currently supported.");
- ManagedComponent managedComponent = getManagedComponent();
- log.debug("Removing " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
- ManagementView managementView = getConnection().getManagementView();
- managementView.removeComponent(managedComponent);
- ManagedDeployment parentDeployment = managedComponent.getDeployment();
- log.debug("Redeploying parent deployment '" +
parentDeployment.getName()
- + "' in order to complete removal of component " +
toString(managedComponent) + "...");
- DeploymentProgress progress =
deploymentManager.redeploy(parentDeployment.getName());
- DeploymentStatus redeployStatus = DeploymentUtils.run(progress);
- if (redeployStatus.isFailed()) {
- log.error("Failed to redeploy parent deployment '" +
parentDeployment.getName()
- + "during removal of component " + toString(managedComponent)
- + " - removal may not persist when the app server is
restarted.", redeployStatus.getFailure());
- }
- managementView.load();
- }
-
- // OperationFacet Implementation --------------------------------------------
-
- public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
- OperationDefinition operationDefinition = getOperationDefinition(name);
- ManagedOperation managedOperation = getManagedOperation(operationDefinition);
- // Convert parameters into MetaValue array.
- MetaValue[] parameterMetaValues =
ConversionUtils.convertOperationsParametersToMetaValues(managedOperation,
- parameters, operationDefinition);
- // invoke() takes a varargs, so we need to pass an empty array, rather than
null.
- MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues);
- OperationResult result = new OperationResult();
- // Convert result MetaValue to corresponding Property type.
- ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue,
result.getComplexResults(),
- operationDefinition);
- return result;
- }
-
- // MeasurementFacet Implementation --------------------------------------------
-
- public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
metrics) throws Exception {
- ManagedComponent managedComponent = getManagedComponent();
- RunState runState = managedComponent.getRunState();
- for (MeasurementScheduleRequest request : metrics) {
- try {
- if (request.getName().equals("runState")) {
- report.addData(new MeasurementDataTrait(request, runState.name()));
- } else {
- Object value = getSimpleValue(managedComponent, request);
- addValueToMeasurementReport(report, request, value);
- }
- } catch (Exception e) {
- if (runState == RunState.RUNNING) {
- log.error("Failed to collect metric for " + request, e);
- } else {
- log.debug("Failed to collect metric for " + request
- + ", but managed component is not in the RUNNING
state.", e);
- }
- }
- }
- }
-
- protected void updateComponent(ManagedComponent managedComponent) throws Exception {
- log.trace("Updating " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
- ManagementView managementView = getConnection().getManagementView();
- managementView.updateComponent(managedComponent);
- managementView.load();
- }
-
- // ------------------------------------------------------------------------------
-
- /**
- * The name of the measurement schedule request (i.e. the metric name) can be in one
of two forms:
- * <p/>
- * [prefix'|']simplePropertyName (e.g. "maxTime" or
"ThreadPool|currentThreadCount")
- * [prefix'|']compositePropertyName'.'key (e.g.
"consumerCount" or "messageStatistics.count")
- *
- * @param managedComponent a managed component
- * @param request a measurement schedule request
- * @return the metric value
- */
- @Nullable
- protected Object getSimpleValue(ManagedComponent managedComponent,
MeasurementScheduleRequest request) {
- String metricName = request.getName();
- int pipeIndex = metricName.indexOf(PREFIX_DELIMITER);
- // Remove the prefix if there is one (e.g.
"ThreadPool|currentThreadCount" -> "currentThreadCount").
- String compositePropName = (pipeIndex == -1) ? metricName :
metricName.substring(pipeIndex + 1);
- int dotIndex = compositePropName.indexOf('.');
- String metricPropName = (dotIndex == -1) ? compositePropName :
compositePropName.substring(0, dotIndex);
- ManagedProperty metricProp = managedComponent.getProperty(metricPropName);
- if (metricProp == null) {
- return null;
- }
- MetaValue metaValue;
- if (dotIndex == -1) {
- metaValue = metricProp.getValue();
- } else {
- CompositeValue compositeValue = (CompositeValue) metricProp.getValue();
- String key = compositePropName.substring(dotIndex + 1);
- metaValue = compositeValue.get(key);
- }
- return getInnerValue(metaValue);
- }
-
- // TODO: Move this to a utility class.
- @Nullable
- private static Object getInnerValue(MetaValue metaValue) {
- if (metaValue == null) {
- return null;
- }
- Object value;
- if (metaValue.getMetaType().isSimple()) {
- SimpleValue simpleValue = (SimpleValue) metaValue;
- value = simpleValue.getValue();
- } else if (metaValue.getMetaType().isEnum()) {
- EnumValue enumValue = (EnumValue) metaValue;
- value = enumValue.getValue();
- } else if (metaValue.getMetaType().isArray()) {
- ArrayValue arrayValue = (ArrayValue) metaValue;
- value = arrayValue.getValue();
- } else if (metaValue.getMetaType().isCollection()) {
- CollectionValue collectionValue = (CollectionValue) metaValue;
- List list = new ArrayList();
- for (MetaValue element : collectionValue.getElements()) {
- list.add(getInnerValue(element));
- }
- value = list;
- } else {
- value = metaValue.toString();
- }
- return value;
- }
-
- protected void addValueToMeasurementReport(MeasurementReport report,
MeasurementScheduleRequest request,
- Object value) {
- if (value == null) {
- return;
- }
- String stringValue = toString(value);
-
- DataType dataType = request.getDataType();
- switch (dataType) {
- case MEASUREMENT:
- try {
- MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request,
Double.valueOf(stringValue));
- report.addData(dataNumeric);
- } catch (NumberFormatException e) {
- log.error("Profile service did not return a numeric value as
expected for metric [" + request.getName()
- + "] - value returned was " + value + ".", e);
- }
- break;
- case TRAIT:
- MeasurementDataTrait dataTrait = new MeasurementDataTrait(request,
stringValue);
- report.addData(dataTrait);
- break;
- default:
- throw new IllegalStateException("Unsupported measurement data type:
" + dataType);
- }
- }
-
- protected ComponentType getComponentType() {
- return componentType;
- }
-
- protected String getComponentName() {
- return componentName;
- }
-
- protected ManagedComponent getManagedComponent() {
- ManagedComponent managedComponent;
- try {
- ManagementView managementView = getConnection().getManagementView();
- managedComponent = ManagedComponentUtils.getManagedComponent(managementView,
this.componentType,
- this.componentName);
- } catch (Exception e) {
- throw new RuntimeException("Failed to load [" + this.componentType
+ "] ManagedComponent ["
- + this.componentName + "].", e);
- }
- if (managedComponent == null)
- throw new IllegalStateException("Failed to find [" +
this.componentType + "] ManagedComponent named ["
- + this.componentName + "].");
- log.trace("Retrieved " + toString(managedComponent) + ".");
- return managedComponent;
- }
-
- @NotNull
- private OperationDefinition getOperationDefinition(String operationName) {
- ResourceType resourceType = getResourceContext().getResourceType();
- OperationDefinition operationDefinition =
ResourceTypeUtils.getOperationDefinition(resourceType, operationName);
- if (operationDefinition == null)
- throw new IllegalStateException("Operation named '" +
operationName
- + "' is not defined for Resource type '" +
resourceType.getName() + "' in the '"
- + resourceType.getPlugin() + "' plugin's
descriptor.");
- return operationDefinition;
- }
-
- @NotNull
- private ManagedOperation getManagedOperation(OperationDefinition operationDefinition)
{
- ManagedComponent managedComponent = getManagedComponent();
- Set<ManagedOperation> operations = managedComponent.getOperations();
- for (ManagedOperation operation : operations) {
- ConfigurationDefinition paramsConfigDef =
operationDefinition.getParametersConfigurationDefinition();
- int paramCount = (paramsConfigDef != null) ?
paramsConfigDef.getPropertyDefinitions().size() : 0;
- if (operation.getName().equals(operationDefinition.getName())
- && (operation.getParameters().length == paramCount))
- return operation;
- }
- throw new IllegalStateException("ManagedOperation named '" +
operationDefinition.getName()
- + "' not found on ManagedComponent [" + getManagedComponent() +
"].");
- }
-
- private static String toString(ManagedComponent managedComponent) {
- Map<String, ManagedProperty> properties =
managedComponent.getProperties();
- return managedComponent.getClass().getSimpleName() + "@" +
System.identityHashCode(managedComponent) + "["
- + "type=" + managedComponent.getType() + ", name=" +
managedComponent.getName() + ", properties="
- + properties.getClass().getSimpleName() + "@" +
System.identityHashCode(properties) + "]";
- }
-
- private static String toString(@NotNull Object value) {
- if (value.getClass().isArray()) {
- StringBuilder buffer = new StringBuilder();
- int lastIndex = Array.getLength(value) - 1;
- for (int i = 0; i < Array.getLength(value); i++) {
- buffer.append(String.valueOf(Array.get(value, i)));
- if (i == lastIndex) {
- break;
- }
- buffer.append(", ");
- }
- return buffer.toString();
- } else {
- return value.toString();
- }
- }
-}
+/*
+* Jopr Management Platform
+* Copyright (C) 2005-2009 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, version 2, as
+* published by the Free Software Foundation, and/or the GNU Lesser
+* General Public License, version 2.1, also as published by the Free
+* Software Foundation.
+*
+* 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 and the GNU Lesser General Public License
+* for more details.
+*
+* You should have received a copy of the GNU General Public License
+* and the GNU Lesser General Public License along with this program;
+* if not, write to the Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+package org.rhq.plugins.jbossas5;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+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.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.RunState;
+import org.jboss.metatype.api.values.ArrayValue;
+import org.jboss.metatype.api.values.CollectionValue;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.remoting.CannotConnectException;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+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.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jbossas5.util.ConversionUtils;
+import org.rhq.plugins.jbossas5.util.DeploymentUtils;
+import org.rhq.plugins.jbossas5.util.ManagedComponentUtils;
+import org.rhq.plugins.jbossas5.util.ResourceTypeUtils;
+import org.rhq.plugins.jbossas5.util.ResourceComponentUtils;
+import org.rhq.plugins.jbossas5.util.DebugUtils;
+
+/**
+ * Service ResourceComponent for all {@link ManagedComponent}s in a Profile.
+ *
+ * @author Ian Springer
+ * @author Jason Dobies
+ * @author Mark Spritzler
+ */
+public class ManagedComponentComponent extends AbstractManagedComponent implements
ConfigurationFacet,
+ DeleteResourceFacet, OperationFacet, MeasurementFacet {
+ public static interface Config {
+ String COMPONENT_TYPE = "componentType";
+ String COMPONENT_SUBTYPE = "componentSubtype";
+ String COMPONENT_NAME = "componentName";
+ String TEMPLATE_NAME = "templateName";
+ String COMPONENT_NAME_PROPERTY = "componentNameProperty";
+ }
+
+ protected static final char PREFIX_DELIMITER = '|';
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ private String componentName;
+ private ComponentType componentType;
+
+ // ResourceComponent Implementation --------------------------------------------
+
+ public AvailabilityType getAvailability() {
+ RunState runState;
+ try {
+ runState = getManagedComponent().getRunState();
+ } catch (CannotConnectException e) {
+ return AvailabilityType.DOWN;
+ }
+ return (runState == RunState.RUNNING) ? AvailabilityType.UP :
AvailabilityType.DOWN;
+ }
+
+ public void start(ResourceContext<ProfileServiceComponent> resourceContext)
throws Exception {
+ super.start(resourceContext);
+ this.componentType =
ConversionUtils.getComponentType(getResourceContext().getResourceType());
+ Configuration pluginConfig = resourceContext.getPluginConfiguration();
+ this.componentName =
pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue();
+ log.trace("Started ResourceComponent for " + getResourceDescription() +
", managing " + this.componentType
+ + " component '" + this.componentName + "'.");
+ }
+
+ public void stop() {
+ return;
+ }
+
+ // ConfigurationComponent Implementation
--------------------------------------------
+
+ public Configuration loadResourceConfiguration()
+ {
+ Configuration resourceConfig;
+ try
+ {
+ Map<String, ManagedProperty> managedProperties =
getManagedComponent().getProperties();
+ Map<String, PropertySimple> customProps =
+
ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration());
+ if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ resourceConfig =
ConversionUtils.convertManagedObjectToConfiguration(managedProperties,
+ customProps, getResourceContext().getResourceType());
+ }
+ catch (Exception e)
+ {
+ RunState runState = getManagedComponent().getRunState();
+ if (runState == RunState.RUNNING) {
+ this.log.error("Failed to load configuration for " +
getResourceDescription() + ".", e);
+ } else {
+ this.log.debug("Failed to load configuration for " +
getResourceDescription()
+ + ", but managed component is not in the RUNNING
state.", e);
+ }
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
+ return resourceConfig;
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
+ {
+ Configuration resourceConfig = configurationUpdateReport.getConfiguration();
+ Configuration pluginConfig = getResourceContext().getPluginConfiguration();
+ try
+ {
+ ManagedComponent managedComponent = getManagedComponent();
+ Map<String, ManagedProperty> managedProperties =
managedComponent.getProperties();
+ Map<String, PropertySimple> customProps =
ResourceComponentUtils.getCustomProperties(pluginConfig);
+ if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE
UPDATE:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ ConversionUtils.convertConfigurationToManagedProperties(managedProperties,
resourceConfig,
+ getResourceContext().getResourceType(), customProps);
+ if (this.log.isDebugEnabled()) this.log.debug("*** AFTER
UPDATE:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ updateComponent(managedComponent);
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ }
+ catch (Exception e)
+ {
+ this.log.error("Failed to update configuration for " +
getResourceDescription() + ".", e);
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e));
+ }
+ }
+
+ // DeleteResourceFacet Implementation --------------------------------------------
+
+ public void deleteResource() throws Exception {
+ DeploymentManager deploymentManager = getConnection().getDeploymentManager();
+ if (!deploymentManager.isRedeploySupported())
+ throw new UnsupportedOperationException("Deletion of " +
getResourceContext().getResourceType().getName()
+ + " Resources is not currently supported.");
+ ManagedComponent managedComponent = getManagedComponent();
+ log.debug("Removing " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
+ ManagementView managementView = getConnection().getManagementView();
+ managementView.removeComponent(managedComponent);
+ ManagedDeployment parentDeployment = managedComponent.getDeployment();
+ log.debug("Redeploying parent deployment '" +
parentDeployment.getName()
+ + "' in order to complete removal of component " +
toString(managedComponent) + "...");
+ DeploymentProgress progress =
deploymentManager.redeploy(parentDeployment.getName());
+ DeploymentStatus redeployStatus = DeploymentUtils.run(progress);
+ if (redeployStatus.isFailed()) {
+ log.error("Failed to redeploy parent deployment '" +
parentDeployment.getName()
+ + "during removal of component " + toString(managedComponent)
+ + " - removal may not persist when the app server is
restarted.", redeployStatus.getFailure());
+ }
+ managementView.load();
+ }
+
+ // OperationFacet Implementation --------------------------------------------
+
+ public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
+ OperationDefinition operationDefinition = getOperationDefinition(name);
+ ManagedOperation managedOperation = getManagedOperation(operationDefinition);
+ // Convert parameters into MetaValue array.
+ MetaValue[] parameterMetaValues =
ConversionUtils.convertOperationsParametersToMetaValues(managedOperation,
+ parameters, operationDefinition);
+ // invoke() takes a varargs, so we need to pass an empty array, rather than
null.
+ MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues);
+ OperationResult result = new OperationResult();
+ // Convert result MetaValue to corresponding Property type.
+ ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue,
result.getComplexResults(),
+ operationDefinition);
+ return result;
+ }
+
+ // MeasurementFacet Implementation --------------------------------------------
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
metrics) throws Exception {
+ ManagedComponent managedComponent = getManagedComponent();
+ RunState runState = managedComponent.getRunState();
+ for (MeasurementScheduleRequest request : metrics) {
+ try {
+ if (request.getName().equals("runState")) {
+ report.addData(new MeasurementDataTrait(request, runState.name()));
+ } else {
+ Object value = getSimpleValue(managedComponent, request);
+ addValueToMeasurementReport(report, request, value);
+ }
+ } catch (Exception e) {
+ if (runState == RunState.RUNNING) {
+ log.error("Failed to collect metric for " + request, e);
+ } else {
+ log.debug("Failed to collect metric for " + request
+ + ", but managed component is not in the RUNNING
state.", e);
+ }
+ }
+ }
+ }
+
+ protected void updateComponent(ManagedComponent managedComponent) throws Exception {
+ log.trace("Updating " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
+ ManagementView managementView = getConnection().getManagementView();
+ managementView.updateComponent(managedComponent);
+ managementView.load();
+ }
+
+ // ------------------------------------------------------------------------------
+
+ /**
+ * The name of the measurement schedule request (i.e. the metric name) can be in one
of two forms:
+ * <p/>
+ * [prefix'|']simplePropertyName (e.g. "maxTime" or
"ThreadPool|currentThreadCount")
+ * [prefix'|']compositePropertyName'.'key (e.g.
"consumerCount" or "messageStatistics.count")
+ *
+ * @param managedComponent a managed component
+ * @param request a measurement schedule request
+ * @return the metric value
+ */
+ @Nullable
+ protected Object getSimpleValue(ManagedComponent managedComponent,
MeasurementScheduleRequest request) {
+ String metricName = request.getName();
+ int pipeIndex = metricName.indexOf(PREFIX_DELIMITER);
+ // Remove the prefix if there is one (e.g.
"ThreadPool|currentThreadCount" -> "currentThreadCount").
+ String compositePropName = (pipeIndex == -1) ? metricName :
metricName.substring(pipeIndex + 1);
+ int dotIndex = compositePropName.indexOf('.');
+ String metricPropName = (dotIndex == -1) ? compositePropName :
compositePropName.substring(0, dotIndex);
+ ManagedProperty metricProp = managedComponent.getProperty(metricPropName);
+ if (metricProp == null) {
+ return null;
+ }
+ MetaValue metaValue;
+ if (dotIndex == -1) {
+ metaValue = metricProp.getValue();
+ } else {
+ CompositeValue compositeValue = (CompositeValue) metricProp.getValue();
+ String key = compositePropName.substring(dotIndex + 1);
+ metaValue = compositeValue.get(key);
+ }
+ return getInnerValue(metaValue);
+ }
+
+ // TODO: Move this to a utility class.
+ @Nullable
+ private static Object getInnerValue(MetaValue metaValue) {
+ if (metaValue == null) {
+ return null;
+ }
+ Object value;
+ if (metaValue.getMetaType().isSimple()) {
+ SimpleValue simpleValue = (SimpleValue) metaValue;
+ value = simpleValue.getValue();
+ } else if (metaValue.getMetaType().isEnum()) {
+ EnumValue enumValue = (EnumValue) metaValue;
+ value = enumValue.getValue();
+ } else if (metaValue.getMetaType().isArray()) {
+ ArrayValue arrayValue = (ArrayValue) metaValue;
+ value = arrayValue.getValue();
+ } else if (metaValue.getMetaType().isCollection()) {
+ CollectionValue collectionValue = (CollectionValue) metaValue;
+ List list = new ArrayList();
+ for (MetaValue element : collectionValue.getElements()) {
+ list.add(getInnerValue(element));
+ }
+ value = list;
+ } else {
+ value = metaValue.toString();
+ }
+ return value;
+ }
+
+ protected void addValueToMeasurementReport(MeasurementReport report,
MeasurementScheduleRequest request,
+ Object value) {
+ if (value == null) {
+ return;
+ }
+ String stringValue = toString(value);
+
+ DataType dataType = request.getDataType();
+ switch (dataType) {
+ case MEASUREMENT:
+ try {
+ MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request,
Double.valueOf(stringValue));
+ report.addData(dataNumeric);
+ } catch (NumberFormatException e) {
+ log.error("Profile service did not return a numeric value as
expected for metric [" + request.getName()
+ + "] - value returned was " + value + ".", e);
+ }
+ break;
+ case TRAIT:
+ MeasurementDataTrait dataTrait = new MeasurementDataTrait(request,
stringValue);
+ report.addData(dataTrait);
+ break;
+ default:
+ throw new IllegalStateException("Unsupported measurement data type:
" + dataType);
+ }
+ }
+
+ protected ComponentType getComponentType() {
+ return componentType;
+ }
+
+ protected String getComponentName() {
+ return componentName;
+ }
+
+ protected ManagedComponent getManagedComponent() {
+ ManagedComponent managedComponent;
+ try {
+ ManagementView managementView = getConnection().getManagementView();
+ managedComponent = ManagedComponentUtils.getManagedComponent(managementView,
this.componentType,
+ this.componentName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to load [" + this.componentType
+ "] ManagedComponent ["
+ + this.componentName + "].", e);
+ }
+ if (managedComponent == null)
+ throw new IllegalStateException("Failed to find [" +
this.componentType + "] ManagedComponent named ["
+ + this.componentName + "].");
+ log.trace("Retrieved " + toString(managedComponent) + ".");
+ return managedComponent;
+ }
+
+ @NotNull
+ private OperationDefinition getOperationDefinition(String operationName) {
+ ResourceType resourceType = getResourceContext().getResourceType();
+ OperationDefinition operationDefinition =
ResourceTypeUtils.getOperationDefinition(resourceType, operationName);
+ if (operationDefinition == null)
+ throw new IllegalStateException("Operation named '" +
operationName
+ + "' is not defined for Resource type '" +
resourceType.getName() + "' in the '"
+ + resourceType.getPlugin() + "' plugin's
descriptor.");
+ return operationDefinition;
+ }
+
+ @NotNull
+ private ManagedOperation getManagedOperation(OperationDefinition operationDefinition)
{
+ ManagedComponent managedComponent = getManagedComponent();
+ Set<ManagedOperation> operations = managedComponent.getOperations();
+ for (ManagedOperation operation : operations) {
+ ConfigurationDefinition paramsConfigDef =
operationDefinition.getParametersConfigurationDefinition();
+ int paramCount = (paramsConfigDef != null) ?
paramsConfigDef.getPropertyDefinitions().size() : 0;
+ if (operation.getName().equals(operationDefinition.getName())
+ && (operation.getParameters().length == paramCount))
+ return operation;
+ }
+ throw new IllegalStateException("ManagedOperation named '" +
operationDefinition.getName()
+ + "' not found on ManagedComponent [" + getManagedComponent() +
"].");
+ }
+
+ private static String toString(ManagedComponent managedComponent) {
+ Map<String, ManagedProperty> properties =
managedComponent.getProperties();
+ return managedComponent.getClass().getSimpleName() + "@" +
System.identityHashCode(managedComponent) + "["
+ + "type=" + managedComponent.getType() + ", name=" +
managedComponent.getName() + ", properties="
+ + properties.getClass().getSimpleName() + "@" +
System.identityHashCode(properties) + "]";
+ }
+
+ private static String toString(@NotNull Object value) {
+ if (value.getClass().isArray()) {
+ StringBuilder buffer = new StringBuilder();
+ int lastIndex = Array.getLength(value) - 1;
+ for (int i = 0; i < Array.getLength(value); i++) {
+ buffer.append(String.valueOf(Array.get(value, i)));
+ if (i == lastIndex) {
+ break;
+ }
+ buffer.append(", ");
+ }
+ return buffer.toString();
+ } else {
+ return value.toString();
+ }
+ }
+}
commit 711247621f3acd4eeaa8800395ed838166bea9c4
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 10:30:32 2010 -0400
fix jdoc
diff --git
a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
index 0aa7f26..2e1ae41 100644
--- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
+++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
@@ -122,7 +122,8 @@ public class MBeanResourceComponent<T extends JMXComponent>
implements Measureme
* is not yet loaded. This might still return <code>null</code> if the
MBean could
* not be loaded.
*
- * @return the loaded MBean or <code>null</code> if it could not be
loaded
+ * @return the loaded MBean
+ * @throws IllegalStateException if it could not be loaded
*
* @see #loadBean()
*/
commit 4f9387122640a9df8cbb8448b74ad086f9eaf7c9
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 10:06:26 2010 -0400
Throwing an exception here generated WARN level messages in the Agent log
when in reality this is a valid (connection property) setting. This can
be confusing to users. So, change to INFO logging and a null return.
Also clarified possible return values for this call in ConfigurationFacet
jdoc.
diff --git
a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java
b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java
index 93042e3..02b58a2 100644
---
a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java
+++
b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java
@@ -1,25 +1,25 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.pluginapi.configuration;
import org.rhq.core.domain.configuration.Configuration;
@@ -37,7 +37,8 @@ public interface ConfigurationFacet extends ConfigurationFacetSupport {
* settings for the managed resource itself, not to be confused with the
<i>plugin configuration</i> which is used
* by the plugin code to connect to the managed resource.
*
- * @return the current configuration of the managed resource
+ * @return the current configuration of the managed resource. can return null if
resource configuration is
+ * implemented but disabled (perhaps via a plugin config setting).
*
* @throws Exception if failed to obtain the current configuration from the resource
*/
diff --git
a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java
b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java
index 2a80f43..85b6ee6 100644
---
a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java
+++
b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java
@@ -44,12 +44,14 @@ public class JavaUtilLoggingResourceComponent extends
MBeanResourceComponent {
public Configuration loadResourceConfiguration() {
if (getResourceContext().getPluginContainerDeployment() ==
PluginContainerDeployment.AGENT) {
- PropertySimple configManagementEnabled =
getResourceContext().getPluginConfiguration().getSimple("configManagementEnabled");
+ PropertySimple configManagementEnabled =
getResourceContext().getPluginConfiguration().getSimple(
+ "configManagementEnabled");
if (configManagementEnabled == null ||
!configManagementEnabled.getBooleanValue()) {
- throw new RuntimeException("Configuration management is currently
disabled for the "
- + getResourceContext().getResourceType() + " Resource with
key ["
- + getResourceContext().getResourceKey()
- + "] - it can be enabled in the Resource's Inventory
> Connection tab.");
+ log.info("Configuration management is currently disabled for the
"
+ + getResourceContext().getResourceType() + " Resource with key
["
+ + getResourceContext().getResourceKey()
+ + "] - it can be enabled in the Resource's Inventory >
Connection tab.");
+ return null;
}
}
commit 07217f26a8368f4b9554b3253aea142fe7193f33
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jul 2 09:59:37 2010 -0400
LT commit
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
index aefb351..e4511fd 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
@@ -1,422 +1,422 @@
-/*
-* Jopr Management Platform
-* Copyright (C) 2005-2009 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, version 2, as
-* published by the Free Software Foundation, and/or the GNU Lesser
-* General Public License, version 2.1, also as published by the Free
-* Software Foundation.
-*
-* 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 and the GNU Lesser General Public License
-* for more details.
-*
-* You should have received a copy of the GNU General Public License
-* and the GNU Lesser General Public License along with this program;
-* if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-package org.rhq.plugins.jbossas5;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-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.jboss.deployers.spi.management.ManagementView;
-import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.managed.api.ComponentType;
-import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedDeployment;
-import org.jboss.managed.api.ManagedOperation;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.api.RunState;
-import org.jboss.metatype.api.values.ArrayValue;
-import org.jboss.metatype.api.values.CollectionValue;
-import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.EnumValue;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.remoting.CannotConnectException;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
-import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
-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.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jbossas5.util.ConversionUtils;
-import org.rhq.plugins.jbossas5.util.DeploymentUtils;
-import org.rhq.plugins.jbossas5.util.ManagedComponentUtils;
-import org.rhq.plugins.jbossas5.util.ResourceTypeUtils;
-import org.rhq.plugins.jbossas5.util.ResourceComponentUtils;
-import org.rhq.plugins.jbossas5.util.DebugUtils;
-
-/**
- * Service ResourceComponent for all {@link ManagedComponent}s in a Profile.
- *
- * @author Ian Springer
- * @author Jason Dobies
- * @author Mark Spritzler
- */
-public class ManagedComponentComponent extends AbstractManagedComponent implements
ConfigurationFacet,
- DeleteResourceFacet, OperationFacet, MeasurementFacet {
- public static interface Config {
- String COMPONENT_TYPE = "componentType";
- String COMPONENT_SUBTYPE = "componentSubtype";
- String COMPONENT_NAME = "componentName";
- String TEMPLATE_NAME = "templateName";
- String COMPONENT_NAME_PROPERTY = "componentNameProperty";
- }
-
- protected static final char PREFIX_DELIMITER = '|';
-
- private final Log log = LogFactory.getLog(this.getClass());
-
- private String componentName;
- private ComponentType componentType;
-
- // ResourceComponent Implementation --------------------------------------------
-
- public AvailabilityType getAvailability() {
- RunState runState;
- try {
- runState = getManagedComponent().getRunState();
- } catch (CannotConnectException e) {
- return AvailabilityType.DOWN;
- }
- return (runState == RunState.RUNNING) ? AvailabilityType.UP :
AvailabilityType.DOWN;
- }
-
- public void start(ResourceContext<ProfileServiceComponent> resourceContext)
throws Exception {
- super.start(resourceContext);
- this.componentType =
ConversionUtils.getComponentType(getResourceContext().getResourceType());
- Configuration pluginConfig = resourceContext.getPluginConfiguration();
- this.componentName =
pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue();
- log.trace("Started ResourceComponent for " + getResourceDescription() +
", managing " + this.componentType
- + " component '" + this.componentName + "'.");
- }
-
- public void stop() {
- return;
- }
-
- // ConfigurationComponent Implementation
--------------------------------------------
-
- public Configuration loadResourceConfiguration()
- {
- Configuration resourceConfig;
- try
- {
- Map<String, ManagedProperty> managedProperties =
getManagedComponent().getProperties();
- Map<String, PropertySimple> customProps =
-
ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration());
- if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- resourceConfig =
ConversionUtils.convertManagedObjectToConfiguration(managedProperties,
- customProps, getResourceContext().getResourceType());
- }
- catch (Exception e)
- {
- RunState runState = getManagedComponent().getRunState();
- if (runState == RunState.RUNNING) {
- this.log.error("Failed to load configuration for " +
getResourceDescription() + ".", e);
- } else {
- this.log.debug("Failed to load configuration for " +
getResourceDescription()
- + ", but managed component is not in the RUNNING
state.", e);
- }
- throw new RuntimeException(ThrowableUtil.getAllMessages(e));
- }
- return resourceConfig;
- }
-
- public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
- {
- Configuration resourceConfig = configurationUpdateReport.getConfiguration();
- Configuration pluginConfig = getResourceContext().getPluginConfiguration();
- try
- {
- ManagedComponent managedComponent = getManagedComponent();
- Map<String, ManagedProperty> managedProperties =
managedComponent.getProperties();
- Map<String, PropertySimple> customProps =
ResourceComponentUtils.getCustomProperties(pluginConfig);
- if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE
UPDATE:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- ConversionUtils.convertConfigurationToManagedProperties(managedProperties,
resourceConfig,
- getResourceContext().getResourceType(), customProps);
- if (this.log.isDebugEnabled()) this.log.debug("*** AFTER
UPDATE:\n"
- + DebugUtils.convertPropertiesToString(managedProperties));
- updateComponent(managedComponent);
- configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
- }
- catch (Exception e)
- {
- this.log.error("Failed to update configuration for " +
getResourceDescription() + ".", e);
- configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
- configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e));
- }
- }
-
- // DeleteResourceFacet Implementation --------------------------------------------
-
- public void deleteResource() throws Exception {
- DeploymentManager deploymentManager = getConnection().getDeploymentManager();
- if (!deploymentManager.isRedeploySupported())
- throw new UnsupportedOperationException("Deletion of " +
getResourceContext().getResourceType().getName()
- + " Resources is not currently supported.");
- ManagedComponent managedComponent = getManagedComponent();
- log.debug("Removing " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
- ManagementView managementView = getConnection().getManagementView();
- managementView.removeComponent(managedComponent);
- ManagedDeployment parentDeployment = managedComponent.getDeployment();
- log.debug("Redeploying parent deployment '" +
parentDeployment.getName()
- + "' in order to complete removal of component " +
toString(managedComponent) + "...");
- DeploymentProgress progress =
deploymentManager.redeploy(parentDeployment.getName());
- DeploymentStatus redeployStatus = DeploymentUtils.run(progress);
- if (redeployStatus.isFailed()) {
- log.error("Failed to redeploy parent deployment '" +
parentDeployment.getName()
- + "during removal of component " + toString(managedComponent)
- + " - removal may not persist when the app server is
restarted.", redeployStatus.getFailure());
- }
- managementView.load();
- }
-
- // OperationFacet Implementation --------------------------------------------
-
- public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
- OperationDefinition operationDefinition = getOperationDefinition(name);
- ManagedOperation managedOperation = getManagedOperation(operationDefinition);
- // Convert parameters into MetaValue array.
- MetaValue[] parameterMetaValues =
ConversionUtils.convertOperationsParametersToMetaValues(managedOperation,
- parameters, operationDefinition);
- // invoke() takes a varargs, so we need to pass an empty array, rather than
null.
- MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues);
- OperationResult result = new OperationResult();
- // Convert result MetaValue to corresponding Property type.
- ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue,
result.getComplexResults(),
- operationDefinition);
- return result;
- }
-
- // MeasurementFacet Implementation --------------------------------------------
-
- public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
metrics) throws Exception {
- ManagedComponent managedComponent = getManagedComponent();
- RunState runState = managedComponent.getRunState();
- for (MeasurementScheduleRequest request : metrics) {
- try {
- if (request.getName().equals("runState")) {
- report.addData(new MeasurementDataTrait(request, runState.name()));
- } else {
- Object value = getSimpleValue(managedComponent, request);
- addValueToMeasurementReport(report, request, value);
- }
- } catch (Exception e) {
- if (runState == RunState.RUNNING) {
- log.error("Failed to collect metric for " + request, e);
- } else {
- log.debug("Failed to collect metric for " + request
- + ", but managed component is not in the RUNNING
state.", e);
- }
- }
- }
- }
-
- protected void updateComponent(ManagedComponent managedComponent) throws Exception {
- log.trace("Updating " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
- ManagementView managementView = getConnection().getManagementView();
- managementView.updateComponent(managedComponent);
- managementView.load();
- }
-
- // ------------------------------------------------------------------------------
-
- /**
- * The name of the measurement schedule request (i.e. the metric name) can be in one
of two forms:
- * <p/>
- * [prefix'|']simplePropertyName (e.g. "maxTime" or
"ThreadPool|currentThreadCount")
- * [prefix'|']compositePropertyName'.'key (e.g.
"consumerCount" or "messageStatistics.count")
- *
- * @param managedComponent a managed component
- * @param request a measurement schedule request
- * @return the metric value
- */
- @Nullable
- protected Object getSimpleValue(ManagedComponent managedComponent,
MeasurementScheduleRequest request) {
- String metricName = request.getName();
- int pipeIndex = metricName.indexOf(PREFIX_DELIMITER);
- // Remove the prefix if there is one (e.g.
"ThreadPool|currentThreadCount" -> "currentThreadCount").
- String compositePropName = (pipeIndex == -1) ? metricName :
metricName.substring(pipeIndex + 1);
- int dotIndex = compositePropName.indexOf('.');
- String metricPropName = (dotIndex == -1) ? compositePropName :
compositePropName.substring(0, dotIndex);
- ManagedProperty metricProp = managedComponent.getProperty(metricPropName);
- if (metricProp == null) {
- return null;
- }
- MetaValue metaValue;
- if (dotIndex == -1) {
- metaValue = metricProp.getValue();
- } else {
- CompositeValue compositeValue = (CompositeValue) metricProp.getValue();
- String key = compositePropName.substring(dotIndex + 1);
- metaValue = compositeValue.get(key);
- }
- return getInnerValue(metaValue);
- }
-
- // TODO: Move this to a utility class.
- @Nullable
- private static Object getInnerValue(MetaValue metaValue) {
- if (metaValue == null) {
- return null;
- }
- Object value;
- if (metaValue.getMetaType().isSimple()) {
- SimpleValue simpleValue = (SimpleValue) metaValue;
- value = simpleValue.getValue();
- } else if (metaValue.getMetaType().isEnum()) {
- EnumValue enumValue = (EnumValue) metaValue;
- value = enumValue.getValue();
- } else if (metaValue.getMetaType().isArray()) {
- ArrayValue arrayValue = (ArrayValue) metaValue;
- value = arrayValue.getValue();
- } else if (metaValue.getMetaType().isCollection()) {
- CollectionValue collectionValue = (CollectionValue) metaValue;
- List list = new ArrayList();
- for (MetaValue element : collectionValue.getElements()) {
- list.add(getInnerValue(element));
- }
- value = list;
- } else {
- value = metaValue.toString();
- }
- return value;
- }
-
- protected void addValueToMeasurementReport(MeasurementReport report,
MeasurementScheduleRequest request,
- Object value) {
- if (value == null) {
- return;
- }
- String stringValue = toString(value);
-
- DataType dataType = request.getDataType();
- switch (dataType) {
- case MEASUREMENT:
- try {
- MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request,
Double.valueOf(stringValue));
- report.addData(dataNumeric);
- } catch (NumberFormatException e) {
- log.error("Profile service did not return a numeric value as
expected for metric [" + request.getName()
- + "] - value returned was " + value + ".", e);
- }
- break;
- case TRAIT:
- MeasurementDataTrait dataTrait = new MeasurementDataTrait(request,
stringValue);
- report.addData(dataTrait);
- break;
- default:
- throw new IllegalStateException("Unsupported measurement data type:
" + dataType);
- }
- }
-
- protected ComponentType getComponentType() {
- return componentType;
- }
-
- protected String getComponentName() {
- return componentName;
- }
-
- protected ManagedComponent getManagedComponent() {
- ManagedComponent managedComponent;
- try {
- ManagementView managementView = getConnection().getManagementView();
- managedComponent = ManagedComponentUtils.getManagedComponent(managementView,
this.componentType,
- this.componentName);
- } catch (Exception e) {
- throw new RuntimeException("Failed to load [" + this.componentType
+ "] ManagedComponent ["
- + this.componentName + "].", e);
- }
- if (managedComponent == null)
- throw new IllegalStateException("Failed to find [" +
this.componentType + "] ManagedComponent named ["
- + this.componentName + "].");
- log.trace("Retrieved " + toString(managedComponent) + ".");
- return managedComponent;
- }
-
- @NotNull
- private OperationDefinition getOperationDefinition(String operationName) {
- ResourceType resourceType = getResourceContext().getResourceType();
- OperationDefinition operationDefinition =
ResourceTypeUtils.getOperationDefinition(resourceType, operationName);
- if (operationDefinition == null)
- throw new IllegalStateException("Operation named '" +
operationName
- + "' is not defined for Resource type '" +
resourceType.getName() + "' in the '"
- + resourceType.getPlugin() + "' plugin's
descriptor.");
- return operationDefinition;
- }
-
- @NotNull
- private ManagedOperation getManagedOperation(OperationDefinition operationDefinition)
{
- ManagedComponent managedComponent = getManagedComponent();
- Set<ManagedOperation> operations = managedComponent.getOperations();
- for (ManagedOperation operation : operations) {
- ConfigurationDefinition paramsConfigDef =
operationDefinition.getParametersConfigurationDefinition();
- int paramCount = (paramsConfigDef != null) ?
paramsConfigDef.getPropertyDefinitions().size() : 0;
- if (operation.getName().equals(operationDefinition.getName())
- && (operation.getParameters().length == paramCount))
- return operation;
- }
- throw new IllegalStateException("ManagedOperation named '" +
operationDefinition.getName()
- + "' not found on ManagedComponent [" + getManagedComponent() +
"].");
- }
-
- private static String toString(ManagedComponent managedComponent) {
- Map<String, ManagedProperty> properties =
managedComponent.getProperties();
- return managedComponent.getClass().getSimpleName() + "@" +
System.identityHashCode(managedComponent) + "["
- + "type=" + managedComponent.getType() + ", name=" +
managedComponent.getName() + ", properties="
- + properties.getClass().getSimpleName() + "@" +
System.identityHashCode(properties) + "]";
- }
-
- private static String toString(@NotNull Object value) {
- if (value.getClass().isArray()) {
- StringBuilder buffer = new StringBuilder();
- int lastIndex = Array.getLength(value) - 1;
- for (int i = 0; i < Array.getLength(value); i++) {
- buffer.append(String.valueOf(Array.get(value, i)));
- if (i == lastIndex) {
- break;
- }
- buffer.append(", ");
- }
- return buffer.toString();
- } else {
- return value.toString();
- }
- }
-}
+/*
+* Jopr Management Platform
+* Copyright (C) 2005-2009 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, version 2, as
+* published by the Free Software Foundation, and/or the GNU Lesser
+* General Public License, version 2.1, also as published by the Free
+* Software Foundation.
+*
+* 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 and the GNU Lesser General Public License
+* for more details.
+*
+* You should have received a copy of the GNU General Public License
+* and the GNU Lesser General Public License along with this program;
+* if not, write to the Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+package org.rhq.plugins.jbossas5;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+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.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.RunState;
+import org.jboss.metatype.api.values.ArrayValue;
+import org.jboss.metatype.api.values.CollectionValue;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.remoting.CannotConnectException;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+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.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jbossas5.util.ConversionUtils;
+import org.rhq.plugins.jbossas5.util.DeploymentUtils;
+import org.rhq.plugins.jbossas5.util.ManagedComponentUtils;
+import org.rhq.plugins.jbossas5.util.ResourceTypeUtils;
+import org.rhq.plugins.jbossas5.util.ResourceComponentUtils;
+import org.rhq.plugins.jbossas5.util.DebugUtils;
+
+/**
+ * Service ResourceComponent for all {@link ManagedComponent}s in a Profile.
+ *
+ * @author Ian Springer
+ * @author Jason Dobies
+ * @author Mark Spritzler
+ */
+public class ManagedComponentComponent extends AbstractManagedComponent implements
ConfigurationFacet,
+ DeleteResourceFacet, OperationFacet, MeasurementFacet {
+ public static interface Config {
+ String COMPONENT_TYPE = "componentType";
+ String COMPONENT_SUBTYPE = "componentSubtype";
+ String COMPONENT_NAME = "componentName";
+ String TEMPLATE_NAME = "templateName";
+ String COMPONENT_NAME_PROPERTY = "componentNameProperty";
+ }
+
+ protected static final char PREFIX_DELIMITER = '|';
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ private String componentName;
+ private ComponentType componentType;
+
+ // ResourceComponent Implementation --------------------------------------------
+
+ public AvailabilityType getAvailability() {
+ RunState runState;
+ try {
+ runState = getManagedComponent().getRunState();
+ } catch (CannotConnectException e) {
+ return AvailabilityType.DOWN;
+ }
+ return (runState == RunState.RUNNING) ? AvailabilityType.UP :
AvailabilityType.DOWN;
+ }
+
+ public void start(ResourceContext<ProfileServiceComponent> resourceContext)
throws Exception {
+ super.start(resourceContext);
+ this.componentType =
ConversionUtils.getComponentType(getResourceContext().getResourceType());
+ Configuration pluginConfig = resourceContext.getPluginConfiguration();
+ this.componentName =
pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue();
+ log.trace("Started ResourceComponent for " + getResourceDescription() +
", managing " + this.componentType
+ + " component '" + this.componentName + "'.");
+ }
+
+ public void stop() {
+ return;
+ }
+
+ // ConfigurationComponent Implementation
--------------------------------------------
+
+ public Configuration loadResourceConfiguration()
+ {
+ Configuration resourceConfig;
+ try
+ {
+ Map<String, ManagedProperty> managedProperties =
getManagedComponent().getProperties();
+ Map<String, PropertySimple> customProps =
+
ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration());
+ if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ resourceConfig =
ConversionUtils.convertManagedObjectToConfiguration(managedProperties,
+ customProps, getResourceContext().getResourceType());
+ }
+ catch (Exception e)
+ {
+ RunState runState = getManagedComponent().getRunState();
+ if (runState == RunState.RUNNING) {
+ this.log.error("Failed to load configuration for " +
getResourceDescription() + ".", e);
+ } else {
+ this.log.debug("Failed to load configuration for " +
getResourceDescription()
+ + ", but managed component is not in the RUNNING
state.", e);
+ }
+ throw new RuntimeException(ThrowableUtil.getAllMessages(e));
+ }
+ return resourceConfig;
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
+ {
+ Configuration resourceConfig = configurationUpdateReport.getConfiguration();
+ Configuration pluginConfig = getResourceContext().getPluginConfiguration();
+ try
+ {
+ ManagedComponent managedComponent = getManagedComponent();
+ Map<String, ManagedProperty> managedProperties =
managedComponent.getProperties();
+ Map<String, PropertySimple> customProps =
ResourceComponentUtils.getCustomProperties(pluginConfig);
+ if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE
UPDATE:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ ConversionUtils.convertConfigurationToManagedProperties(managedProperties,
resourceConfig,
+ getResourceContext().getResourceType(), customProps);
+ if (this.log.isDebugEnabled()) this.log.debug("*** AFTER
UPDATE:\n"
+ + DebugUtils.convertPropertiesToString(managedProperties));
+ updateComponent(managedComponent);
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ }
+ catch (Exception e)
+ {
+ this.log.error("Failed to update configuration for " +
getResourceDescription() + ".", e);
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e));
+ }
+ }
+
+ // DeleteResourceFacet Implementation --------------------------------------------
+
+ public void deleteResource() throws Exception {
+ DeploymentManager deploymentManager = getConnection().getDeploymentManager();
+ if (!deploymentManager.isRedeploySupported())
+ throw new UnsupportedOperationException("Deletion of " +
getResourceContext().getResourceType().getName()
+ + " Resources is not currently supported.");
+ ManagedComponent managedComponent = getManagedComponent();
+ log.debug("Removing " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
+ ManagementView managementView = getConnection().getManagementView();
+ managementView.removeComponent(managedComponent);
+ ManagedDeployment parentDeployment = managedComponent.getDeployment();
+ log.debug("Redeploying parent deployment '" +
parentDeployment.getName()
+ + "' in order to complete removal of component " +
toString(managedComponent) + "...");
+ DeploymentProgress progress =
deploymentManager.redeploy(parentDeployment.getName());
+ DeploymentStatus redeployStatus = DeploymentUtils.run(progress);
+ if (redeployStatus.isFailed()) {
+ log.error("Failed to redeploy parent deployment '" +
parentDeployment.getName()
+ + "during removal of component " + toString(managedComponent)
+ + " - removal may not persist when the app server is
restarted.", redeployStatus.getFailure());
+ }
+ managementView.load();
+ }
+
+ // OperationFacet Implementation --------------------------------------------
+
+ public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
+ OperationDefinition operationDefinition = getOperationDefinition(name);
+ ManagedOperation managedOperation = getManagedOperation(operationDefinition);
+ // Convert parameters into MetaValue array.
+ MetaValue[] parameterMetaValues =
ConversionUtils.convertOperationsParametersToMetaValues(managedOperation,
+ parameters, operationDefinition);
+ // invoke() takes a varargs, so we need to pass an empty array, rather than
null.
+ MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues);
+ OperationResult result = new OperationResult();
+ // Convert result MetaValue to corresponding Property type.
+ ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue,
result.getComplexResults(),
+ operationDefinition);
+ return result;
+ }
+
+ // MeasurementFacet Implementation --------------------------------------------
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
metrics) throws Exception {
+ ManagedComponent managedComponent = getManagedComponent();
+ RunState runState = managedComponent.getRunState();
+ for (MeasurementScheduleRequest request : metrics) {
+ try {
+ if (request.getName().equals("runState")) {
+ report.addData(new MeasurementDataTrait(request, runState.name()));
+ } else {
+ Object value = getSimpleValue(managedComponent, request);
+ addValueToMeasurementReport(report, request, value);
+ }
+ } catch (Exception e) {
+ if (runState == RunState.RUNNING) {
+ log.error("Failed to collect metric for " + request, e);
+ } else {
+ log.debug("Failed to collect metric for " + request
+ + ", but managed component is not in the RUNNING
state.", e);
+ }
+ }
+ }
+ }
+
+ protected void updateComponent(ManagedComponent managedComponent) throws Exception {
+ log.trace("Updating " + getResourceDescription() + " with
component " + toString(managedComponent) + "...");
+ ManagementView managementView = getConnection().getManagementView();
+ managementView.updateComponent(managedComponent);
+ managementView.load();
+ }
+
+ // ------------------------------------------------------------------------------
+
+ /**
+ * The name of the measurement schedule request (i.e. the metric name) can be in one
of two forms:
+ * <p/>
+ * [prefix'|']simplePropertyName (e.g. "maxTime" or
"ThreadPool|currentThreadCount")
+ * [prefix'|']compositePropertyName'.'key (e.g.
"consumerCount" or "messageStatistics.count")
+ *
+ * @param managedComponent a managed component
+ * @param request a measurement schedule request
+ * @return the metric value
+ */
+ @Nullable
+ protected Object getSimpleValue(ManagedComponent managedComponent,
MeasurementScheduleRequest request) {
+ String metricName = request.getName();
+ int pipeIndex = metricName.indexOf(PREFIX_DELIMITER);
+ // Remove the prefix if there is one (e.g.
"ThreadPool|currentThreadCount" -> "currentThreadCount").
+ String compositePropName = (pipeIndex == -1) ? metricName :
metricName.substring(pipeIndex + 1);
+ int dotIndex = compositePropName.indexOf('.');
+ String metricPropName = (dotIndex == -1) ? compositePropName :
compositePropName.substring(0, dotIndex);
+ ManagedProperty metricProp = managedComponent.getProperty(metricPropName);
+ if (metricProp == null) {
+ return null;
+ }
+ MetaValue metaValue;
+ if (dotIndex == -1) {
+ metaValue = metricProp.getValue();
+ } else {
+ CompositeValue compositeValue = (CompositeValue) metricProp.getValue();
+ String key = compositePropName.substring(dotIndex + 1);
+ metaValue = compositeValue.get(key);
+ }
+ return getInnerValue(metaValue);
+ }
+
+ // TODO: Move this to a utility class.
+ @Nullable
+ private static Object getInnerValue(MetaValue metaValue) {
+ if (metaValue == null) {
+ return null;
+ }
+ Object value;
+ if (metaValue.getMetaType().isSimple()) {
+ SimpleValue simpleValue = (SimpleValue) metaValue;
+ value = simpleValue.getValue();
+ } else if (metaValue.getMetaType().isEnum()) {
+ EnumValue enumValue = (EnumValue) metaValue;
+ value = enumValue.getValue();
+ } else if (metaValue.getMetaType().isArray()) {
+ ArrayValue arrayValue = (ArrayValue) metaValue;
+ value = arrayValue.getValue();
+ } else if (metaValue.getMetaType().isCollection()) {
+ CollectionValue collectionValue = (CollectionValue) metaValue;
+ List list = new ArrayList();
+ for (MetaValue element : collectionValue.getElements()) {
+ list.add(getInnerValue(element));
+ }
+ value = list;
+ } else {
+ value = metaValue.toString();
+ }
+ return value;
+ }
+
+ protected void addValueToMeasurementReport(MeasurementReport report,
MeasurementScheduleRequest request,
+ Object value) {
+ if (value == null) {
+ return;
+ }
+ String stringValue = toString(value);
+
+ DataType dataType = request.getDataType();
+ switch (dataType) {
+ case MEASUREMENT:
+ try {
+ MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request,
Double.valueOf(stringValue));
+ report.addData(dataNumeric);
+ } catch (NumberFormatException e) {
+ log.error("Profile service did not return a numeric value as
expected for metric [" + request.getName()
+ + "] - value returned was " + value + ".", e);
+ }
+ break;
+ case TRAIT:
+ MeasurementDataTrait dataTrait = new MeasurementDataTrait(request,
stringValue);
+ report.addData(dataTrait);
+ break;
+ default:
+ throw new IllegalStateException("Unsupported measurement data type:
" + dataType);
+ }
+ }
+
+ protected ComponentType getComponentType() {
+ return componentType;
+ }
+
+ protected String getComponentName() {
+ return componentName;
+ }
+
+ protected ManagedComponent getManagedComponent() {
+ ManagedComponent managedComponent;
+ try {
+ ManagementView managementView = getConnection().getManagementView();
+ managedComponent = ManagedComponentUtils.getManagedComponent(managementView,
this.componentType,
+ this.componentName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to load [" + this.componentType
+ "] ManagedComponent ["
+ + this.componentName + "].", e);
+ }
+ if (managedComponent == null)
+ throw new IllegalStateException("Failed to find [" +
this.componentType + "] ManagedComponent named ["
+ + this.componentName + "].");
+ log.trace("Retrieved " + toString(managedComponent) + ".");
+ return managedComponent;
+ }
+
+ @NotNull
+ private OperationDefinition getOperationDefinition(String operationName) {
+ ResourceType resourceType = getResourceContext().getResourceType();
+ OperationDefinition operationDefinition =
ResourceTypeUtils.getOperationDefinition(resourceType, operationName);
+ if (operationDefinition == null)
+ throw new IllegalStateException("Operation named '" +
operationName
+ + "' is not defined for Resource type '" +
resourceType.getName() + "' in the '"
+ + resourceType.getPlugin() + "' plugin's
descriptor.");
+ return operationDefinition;
+ }
+
+ @NotNull
+ private ManagedOperation getManagedOperation(OperationDefinition operationDefinition)
{
+ ManagedComponent managedComponent = getManagedComponent();
+ Set<ManagedOperation> operations = managedComponent.getOperations();
+ for (ManagedOperation operation : operations) {
+ ConfigurationDefinition paramsConfigDef =
operationDefinition.getParametersConfigurationDefinition();
+ int paramCount = (paramsConfigDef != null) ?
paramsConfigDef.getPropertyDefinitions().size() : 0;
+ if (operation.getName().equals(operationDefinition.getName())
+ && (operation.getParameters().length == paramCount))
+ return operation;
+ }
+ throw new IllegalStateException("ManagedOperation named '" +
operationDefinition.getName()
+ + "' not found on ManagedComponent [" + getManagedComponent() +
"].");
+ }
+
+ private static String toString(ManagedComponent managedComponent) {
+ Map<String, ManagedProperty> properties =
managedComponent.getProperties();
+ return managedComponent.getClass().getSimpleName() + "@" +
System.identityHashCode(managedComponent) + "["
+ + "type=" + managedComponent.getType() + ", name=" +
managedComponent.getName() + ", properties="
+ + properties.getClass().getSimpleName() + "@" +
System.identityHashCode(properties) + "]";
+ }
+
+ private static String toString(@NotNull Object value) {
+ if (value.getClass().isArray()) {
+ StringBuilder buffer = new StringBuilder();
+ int lastIndex = Array.getLength(value) - 1;
+ for (int i = 0; i < Array.getLength(value); i++) {
+ buffer.append(String.valueOf(Array.get(value, i)));
+ if (i == lastIndex) {
+ break;
+ }
+ buffer.append(", ");
+ }
+ return buffer.toString();
+ } else {
+ return value.toString();
+ }
+ }
+}
commit ac60d6c7453e2916c886e1a33244793f2d6c80f2
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 28 17:47:32 2010 -0400
minor tweaks
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 c6e5a9d..e2f61cd 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
@@ -85,7 +85,11 @@ public class LinkManager {
public static String getHubAllResourcesLink() {
- return "/rhq/inventory/browseResources.xhtml?subtab=all";
+ if (GWT) {
+ return "#Inventory";
+ } else {
+ return "/rhq/inventory/browseResources.xhtml?subtab=all";
+ }
}
public static String getHubPlatformsLink() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 37b0880..4444d39 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -192,7 +192,7 @@ public class DashboardsView extends VLayout implements
BookmarkableView {
Dashboard dashboard = new Dashboard();
dashboard.setName("Default Dashboard");
dashboard.setColumns(2);
- dashboard.setColumnWidths("30%", "70%");
+ dashboard.setColumnWidths("32%", "68%");
dashboard.getConfiguration().put(new
PropertySimple(Dashboard.CFG_BACKGROUND,"#F1F2F3"));
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
index 6cb001b..377e4c1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
@@ -19,6 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts;
import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.form.DynamicForm;
@@ -39,6 +40,8 @@ public class RecentAlertsPortlet extends AlertsView implements Portlet
{
public RecentAlertsPortlet() {
setShowHeader(false);
setShowFooter(false);
+
+ setOverflow(Overflow.HIDDEN);
}
public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
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 92b63ce..ac109f8 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
@@ -104,6 +104,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.setSortField("name");
treeGrid.setShowHeader(false);
+ treeGrid.setLeaveScrollbarGap(false);
contextMenu = new Menu();
MenuItem item = new MenuItem("Expand node");
commit 1a4ed22af76aeafaed8d6da78f5094a6a204f416
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 28 17:47:16 2010 -0400
Limit messages in message center
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java
index 1c4f012..afce657 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java
@@ -30,8 +30,13 @@ public class MessageCenter {
private ArrayList<MessageListener> listeners = new
ArrayList<MessageListener>();
+ private static final int MAX_MESSAGES = 100;
+
public void notify(Message message) {
this.messages.add(message);
+ if (messages.size() > MAX_MESSAGES) {
+ messages.removeFirst();
+ }
for (MessageListener listener : listeners) {
listener.onMessage(message);
}
commit 127b5e8334335b54d0d4d05ca7c49ef50d63dea8
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 28 17:47:01 2010 -0400
Dashboard portlet refreshability
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
index f381773..395d0c9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
@@ -36,6 +36,7 @@ import com.smartgwt.client.widgets.events.DragResizeStopEvent;
import com.smartgwt.client.widgets.events.DragResizeStopHandler;
import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
/**
* @author Greg Hinkle
@@ -68,6 +69,16 @@ public class PortletWindow extends Window {
}
};
+ private ClickHandler refreshHandler = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ if (PortletWindow.this.view instanceof Table) {
+ ((Table)PortletWindow.this.view).refresh();
+ } else {
+ ((Canvas)PortletWindow.this.view).redraw();
+ }
+ }
+ };
+
public PortletWindow(DashboardView dashboardView, DashboardPortlet dashboardPortlet)
{
this.dashboardView = dashboardView;
@@ -83,6 +94,7 @@ public class PortletWindow extends Window {
setHeaderControls(
HeaderControls.MINIMIZE_BUTTON,
HeaderControls.HEADER_LABEL,
+ new HeaderControl(HeaderControl.REFRESH, refreshHandler),
new HeaderControl(HeaderControl.SETTINGS, settingsHandler),
new HeaderControl(HeaderControl.HELP, helpHandler),
HeaderControls.CLOSE_BUTTON
commit 4a9189b9840407668338243ac1decd4fc7449eca
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 28 17:45:07 2010 -0400
Deal with the no-favorites yet case
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 99fc8f6..9c5f3fe 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
@@ -61,7 +61,11 @@ public class FavoriteResourcesPortlet extends ResourceSearchView
implements Port
Criteria criteria = new Criteria();
- criteria.addCriteria("resourceIds", favArray );
+ if (favoriteIds.isEmpty()) {
+ criteria.addCriteria("id",-1);
+ } else {
+ criteria.addCriteria("resourceIds", favArray );
+ }
refresh(criteria);
@@ -84,7 +88,7 @@ public class FavoriteResourcesPortlet extends ResourceSearchView
implements Port
getListGrid().setViewState(state);
}
-
+
}
public Canvas getHelpCanvas() {
commit 6c1b4651fdedbfb0900f2440c17e0887f0d6ba61
Merge: dcf8ac0... 6f4eb03...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jun 25 16:28:53 2010 -0400
Merge branch 'release-3.0.0' into master-jay
commit 3a473156682b44a9f20c4b53c1235af3bfe4a7a0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Jun 25 11:55:38 2010 -0400
upgrade JNA from 3.2.2 to 3.2.5; fix bug in augeas plugin pom where augeas.jar v0.0.1,
rather than v0.0.2, was being included in the plugin jar's lib dir
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 72d9cc4..3e17750 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -17,6 +17,10 @@
<name>RHQ Augeas Plugin</name>
<description>An abstract plugin for configuring resources via
Augeas</description>
+ <properties>
+ <augeas.version>0.0.2</augeas.version>
+ </properties>
+
<dependencies>
<dependency>
@@ -30,11 +34,13 @@
<artifactId>rhq-platform-plugin</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
+
+ <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
+
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
@@ -45,7 +51,7 @@
<dependency>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>0.0.2</version>
+ <version>${augeas.version}</version>
</dependency>
<dependency>
@@ -60,7 +66,6 @@
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
<executions>
<execution>
<id>copy-plugin-libs</id>
@@ -74,13 +79,13 @@
<artifactItem>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
- <version>3.2.2</version>
+ <version>${jna.version}</version>
</artifactItem>
<artifactItem>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>0.0.1</version>
+ <version>${augeas.version}</version>
</artifactItem>
</artifactItems>
@@ -123,7 +128,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
<executions>
<execution>
@@ -180,7 +184,6 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
<executions>
<execution>
<id>copy-commons-io-jar</id>
diff --git a/pom.xml b/pom.xml
index dff1c40..b2e8a34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,7 @@
<jline.version>0.9.94</jline.version>
<sigar.version>1.6.5.132</sigar.version>
<quartz.version>1.6.5</quartz.version>
- <jna.version>3.2.2</jna.version>
+ <jna.version>3.2.5</jna.version>
<twitter4j.version>2.1.2</twitter4j.version>
<!--
@@ -879,9 +879,9 @@
</repository>
<repository>
- <id>jboss-thirdparty-uploads</id>
- <name>JBoss Third-Party Uploads</name>
-
<
url>https://repository.jboss.org/nexus/content/repositories/thirdparty...
+ <id>jboss-public-repo-group</id>
+ <name>JBoss Public Repository Group</name>
+ <
url>http://repository.jboss.org/nexus/content/groups/public/</url>
<!-- Explicitly disable snapshots, so Maven won't try to
check for updates for snapshot internal (rhq-*) deps. -->
<snapshots>
commit dcf8ac047e9ea8748524275c3d63c0a4c8c750b2
Merge: cc784e9... 065156e...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jun 24 22:17:42 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit cc784e9496490e0125448b5297b1ac6d82a61843
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Jun 24 22:14:13 2010 +0200
Fix last compile error.
diff --git
a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java
b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java
index 8c7da3a..9f7bfc4 100644
--- a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java
+++ b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java
@@ -19,6 +19,7 @@
package org.rhq.plugins.twitter;
import java.util.List;
+import java.util.Properties;
import java.util.Set;
import twitter4j.Paging;
@@ -27,6 +28,8 @@ import twitter4j.QueryResult;
import twitter4j.Status;
import twitter4j.Tweet;
import twitter4j.Twitter;
+import twitter4j.TwitterFactory;
+import twitter4j.conf.PropertyConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -61,10 +64,9 @@ public class FeedComponent implements
ResourceComponent<TwitterComponent>, Measu
private boolean isSearch = false;
private String keyword;
private TwitterEventPoller eventPoller;
- private String serverUrl;
- private String searchBase;
+ private TwitterFactory tFactory;
- /**
+ /**
* Return availability of this resource
* @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
*/
@@ -86,13 +88,23 @@ public class FeedComponent implements
ResourceComponent<TwitterComponent>, Measu
isSearch = true;
keyword = conf.getSimpleValue("keyword","Jopr"); // Jopr is
fallback .. just in case
- serverUrl = context.getParentResourceComponent().getServerUrl();
- searchBase = context.getParentResourceComponent().getSearchUrl();
+ String serverUrl = context.getParentResourceComponent().getServerUrl();
+ String searchBase = context.getParentResourceComponent().getSearchUrl();
eventContext = context.getEventContext();
eventPoller = new TwitterEventPoller(TOPIC_EVENT);
eventContext.registerEventPoller(eventPoller, 63);
+ Properties props = new Properties();
+ props.put(PropertyConfiguration.SOURCE,"Jopr");
+ props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr");
+ props.put(PropertyConfiguration.SEARCH_BASE_URL, searchBase);
+ props.put(PropertyConfiguration.REST_BASE_URL, serverUrl);
+ twitter4j.conf.Configuration tconf = new PropertyConfiguration(props);
+
+ tFactory = new TwitterFactory(tconf);
+
+
}
@@ -116,12 +128,11 @@ public class FeedComponent implements
ResourceComponent<TwitterComponent>, Measu
for (MeasurementScheduleRequest req : metrics) {
if (req.getName().equals("tweetCount")) {
- Twitter twitter = new Twitter(serverUrl);
+ Twitter twitter = tFactory.getInstance();
Paging paging = new Paging();
MeasurementDataNumeric res;
if (isSearch) {
- twitter.setSearchBaseURL(searchBase);
Query q = new Query(keyword);
q.setSinceId(lastId);
if (lastId == NOT_YET_SET)
commit 065156e845f4d1db1c52c46ec1b643539f792eca
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 24 16:06:24 2010 -0400
provide a new "gc" agent prompt command that lets you examine the
heap/non-heap stats and lets you free up some memory/invoke the garbage collector
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index ce49fc4..b5d1223 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -107,6 +107,7 @@ import org.rhq.enterprise.agent.promptcmd.DownloadPromptCommand;
import org.rhq.enterprise.agent.promptcmd.DumpSpoolPromptCommand;
import org.rhq.enterprise.agent.promptcmd.ExitPromptCommand;
import org.rhq.enterprise.agent.promptcmd.FailoverPromptCommand;
+import org.rhq.enterprise.agent.promptcmd.GCPromptCommand;
import org.rhq.enterprise.agent.promptcmd.GetConfigPromptCommand;
import org.rhq.enterprise.agent.promptcmd.HelpPromptCommand;
import org.rhq.enterprise.agent.promptcmd.IdentifyPromptCommand;
@@ -2958,7 +2959,7 @@ public class AgentMain {
new AvailabilityPromptCommand(), new PiqlPromptCommand(), new
IdentifyPromptCommand(),
new LogPromptCommand(), new TimerPromptCommand(), new PingPromptCommand(),
new DownloadPromptCommand(),
new DumpSpoolPromptCommand(), new SenderPromptCommand(), new
FailoverPromptCommand(),
- new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand()
};
+ new UpdatePromptCommand(), new DebugPromptCommand(), new
SleepPromptCommand(), new GCPromptCommand() };
// hold the conflicts
StringBuilder conflicts = new StringBuilder();
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index d520904..7967b47 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -1619,6 +1619,31 @@ public interface AgentI18NResourceKeys {
@I18NMessage("days")
String UNITS_DAYS = "units.days";
+ @I18NMessage("gc")
+ String GC = "PromptCommand.gc";
+
+ @I18NMessage("gc [--dump] [--free] [--verbose={true|false}]")
+ String GC_SYNTAX = "PromptCommand.gc.syntax";
+
+ @I18NMessage("Helps free up memory by invoking the garbage collector")
+ String GC_HELP = "PromptCommand.gc.help";
+
+ @I18NMessage("Provides an interface to the garbage collector and memory
subsystem.\\n\\\n"
+ + "\\ -d, --dump : prints out information on current memory
usage\\n\\\n"
+ + "\\ -f, --free : attempts to free up memory and invokes the garbage
collector\\n\\\n"
+ + "\\ -v, --verbose={true|false} : enables/disables verbose gc
messages")
+ String GC_DETAILED_HELP = "PromptCommand.gc.detailed-help";
+
+ @I18NMessage("Invoking the garbage collector")
+ String GC_INVOKE = "PromptCommand.gc.invoke";
+
+ @I18NMessage("{0} ({1}):\\n\\\n" //
+ + "\\ init={2}\\n\\\n" //
+ + "\\ max={3}\\n\\\n" //
+ + "\\ used={4} ({5,number,##}% of committed)\\n\\\n" //
+ + "\\ commit={6} ({7,number,##}% of max)")
+ String GC_MEM_USAGE = "PromptCommand.gc.mem-usage";
+
@I18NMessage("native")
String NATIVE = "PromptCommand.native";
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java
new file mode 100644
index 0000000..1f2de30
--- /dev/null
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java
@@ -0,0 +1,213 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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.agent.promptcmd;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.beans.Introspector;
+import java.io.PrintWriter;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryType;
+import java.lang.management.MemoryUsage;
+import java.util.List;
+
+import mazz.i18n.Msg;
+
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.enterprise.agent.AgentMain;
+import org.rhq.enterprise.agent.i18n.AgentI18NFactory;
+import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys;
+
+/**
+ * Provides a way to help the agent clean up memory.
+ *
+ * @author John Mazzitelli
+ */
+public class GCPromptCommand implements AgentPromptCommand {
+ private static final Msg MSG = AgentI18NFactory.getMsg();
+
+ /**
+ * @see AgentPromptCommand#getPromptCommandString()
+ */
+ public String getPromptCommandString() {
+ return MSG.getMsg(AgentI18NResourceKeys.GC);
+ }
+
+ /**
+ * @see AgentPromptCommand#execute(AgentMain, String[])
+ */
+ public boolean execute(AgentMain agent, String[] args) {
+ processArguments(agent, args);
+ return true;
+ }
+
+ /**
+ * @see AgentPromptCommand#getSyntax()
+ */
+ public String getSyntax() {
+ return MSG.getMsg(AgentI18NResourceKeys.GC_SYNTAX);
+ }
+
+ /**
+ * @see AgentPromptCommand#getHelp()
+ */
+ public String getHelp() {
+ return MSG.getMsg(AgentI18NResourceKeys.GC_HELP);
+ }
+
+ /**
+ * @see AgentPromptCommand#getDetailedHelp()
+ */
+ public String getDetailedHelp() {
+ return MSG.getMsg(AgentI18NResourceKeys.GC_DETAILED_HELP);
+ }
+
+ private void processArguments(AgentMain agent, String[] args) {
+ PrintWriter out = agent.getOut();
+
+ String sopts = "dfv:";
+ LongOpt[] lopts = { new LongOpt("verbose", LongOpt.REQUIRED_ARGUMENT,
null, 'v'),
+ new LongOpt("dump", LongOpt.NO_ARGUMENT, null, 'd'), new
LongOpt("free", LongOpt.NO_ARGUMENT, null, 'f') };
+
+ Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
+ int code;
+ Boolean verbose = null;
+ Boolean free = null;
+ Boolean dump = null;
+
+ while ((code = getopt.getopt()) != -1) {
+ switch (code) {
+ case ':':
+ case '?':
+ case 1: {
+ out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL,
getSyntax()));
+ break;
+ }
+
+ case 'v': {
+ String verboseOpt = getopt.getOptarg();
+ verbose = Boolean.valueOf(Boolean.parseBoolean(verboseOpt));
+ break;
+ }
+
+ case 'd': {
+ dump = Boolean.TRUE;
+ break;
+ }
+
+ case 'f': {
+ free = Boolean.TRUE;
+ break;
+ }
+ }
+ }
+
+ if ((getopt.getOptind() + 1) < args.length) {
+ out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL,
getSyntax()));
+ }
+
+ if (Boolean.TRUE.equals(dump)) {
+ printCurrentMemoryUsage(out);
+ }
+
+ if (verbose != null) {
+ setVerbosity(verbose.booleanValue());
+ }
+
+ if (Boolean.TRUE.equals(free)) {
+ freeMemory(out);
+ }
+
+ return;
+ }
+
+ private void setVerbosity(boolean verbose) {
+ final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean();
+ memoryMxBean.setVerbose(verbose);
+ }
+
+ private void freeMemory(PrintWriter out) {
+ final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean();
+
+ printGlobalMemoryUsage(out, memoryMxBean);
+
+ // free up some global static caches
+ Introspector.flushCaches();
+ LogFactory.releaseAll();
+
+ // invoke the garbage collector
+ out.println(MSG.getMsg(AgentI18NResourceKeys.GC_INVOKE));
+ memoryMxBean.gc();
+
+ printGlobalMemoryUsage(out, memoryMxBean);
+ return;
+ }
+
+ private void printCurrentMemoryUsage(PrintWriter out) {
+ final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean();
+ printGlobalMemoryUsage(out, memoryMxBean);
+
+ List<MemoryPoolMXBean> poolMxBeans =
ManagementFactory.getMemoryPoolMXBeans();
+ if (poolMxBeans != null) {
+ for (MemoryPoolMXBean bean : poolMxBeans) {
+ if (bean.isValid()) {
+ String name = bean.getName();
+ MemoryType type = bean.getType();
+ MemoryUsage usage = bean.getUsage();
+ printMemoryUsage(out, name, type, usage);
+ }
+ }
+ }
+
+ return;
+ }
+
+ private void printGlobalMemoryUsage(PrintWriter out, final MemoryMXBean memoryMxBean)
{
+ printMemoryUsage(out, "GLOBAL", MemoryType.HEAP,
memoryMxBean.getHeapMemoryUsage());
+ printMemoryUsage(out, "GLOBAL", MemoryType.NON_HEAP,
memoryMxBean.getNonHeapMemoryUsage());
+ }
+
+ private void printMemoryUsage(PrintWriter out, String name, MemoryType type,
MemoryUsage memUsage) {
+ long init = memUsage.getInit();
+ long max = memUsage.getMax();
+ long used = memUsage.getUsed();
+ long committed = memUsage.getCommitted();
+
+ String typeStr;
+ switch (type) {
+ case HEAP:
+ typeStr = "Heap";
+ break;
+ case NON_HEAP:
+ typeStr = "Non-heap";
+ break;
+ default:
+ typeStr = "?";
+ }
+
+ double usedPercentage = (used * 100.0) / committed;
+ double committedPercentage = (committed * 100.0) / max;
+ out.println(MSG.getMsg(AgentI18NResourceKeys.GC_MEM_USAGE, name, typeStr, init,
max, used, usedPercentage,
+ committed, committedPercentage));
+ }
+}
\ No newline at end of file
commit 7449c09e21af72826ac3d765612bb28bee9be16b
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Tue Jun 15 19:19:25 2010 +0200
Update to new twitter4j methods.
diff --git
a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
index b13763e..b148a9b 100644
---
a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
+++
b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java
@@ -18,9 +18,13 @@
*/
package org.rhq.enterprise.server.plugins.alertMicroblog;
+import java.util.Properties;
+
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
+import twitter4j.TwitterFactory;
+import twitter4j.conf.PropertyConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,9 +52,16 @@ public class MicroblogSender extends AlertSender {
String baseUrl =
preferences.getSimpleValue("microblogServerUrl","http://tw...;
if (!baseUrl.endsWith("/"))
baseUrl = baseUrl +"/";
- Twitter twitter = new Twitter(user,password,baseUrl);
+ Properties props = new Properties();
+ props.put(PropertyConfiguration.SOURCE,"Jopr");
+ props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr");
+ props.put(PropertyConfiguration.REST_BASE_URL,baseUrl);
+ twitter4j.conf.Configuration tconf = new PropertyConfiguration(props);
+
+ TwitterFactory tFactory = new TwitterFactory(tconf);
+
+ Twitter twitter = tFactory.getInstance(user,password);
AlertManagerLocal alertManager = LookupUtil.getAlertManager();
- twitter.setSource("Jopr");
StringBuilder b = new StringBuilder("Alert ");
b.append(alert.getId()).append(":'"); // Alert id
b.append(alert.getAlertDefinition().getResource().getName());
diff --git
a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/TwitterComponent.java
b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/TwitterComponent.java
index d3c4d9e..eab4634 100644
--- a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/TwitterComponent.java
+++ b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/TwitterComponent.java
@@ -21,11 +21,14 @@ package org.rhq.plugins.twitter;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.List;
+import java.util.Properties;
import java.util.Set;
import twitter4j.Paging;
import twitter4j.Status;
import twitter4j.Twitter;
+import twitter4j.TwitterFactory;
+import twitter4j.conf.PropertyConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -63,6 +66,7 @@ public class TwitterComponent implements ResourceComponent,
OperationFacet, Meas
private String password;
private String serverUrl;
private String searchBaseUrl;
+ private TwitterFactory tFactory;
private TwitterEventPoller eventPoller;
private long lastId = NOT_YET_SET;
private static final String HTTP_TWITTER_COM = "http://twitter.com/";
@@ -111,6 +115,15 @@ public class TwitterComponent implements ResourceComponent,
OperationFacet, Meas
eventContext = context.getEventContext();
eventPoller = new TwitterEventPoller(TWIT_EVENT);
eventContext.registerEventPoller(eventPoller, 53);
+ Properties props = new Properties();
+ props.put(PropertyConfiguration.SOURCE,"Jopr");
+ props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr");
+ props.put(PropertyConfiguration.SEARCH_BASE_URL,searchBaseUrl);
+ props.put(PropertyConfiguration.REST_BASE_URL,serverUrl);
+ twitter4j.conf.Configuration tconf = new PropertyConfiguration(props);
+
+ tFactory = new TwitterFactory(tconf);
+
}
@@ -132,7 +145,9 @@ public class TwitterComponent implements ResourceComponent,
OperationFacet, Meas
for (MeasurementScheduleRequest req : metrics) {
if (req.getName().equals("tweetCount")) {
- Twitter twitter = new Twitter(username,password,serverUrl);
+
+ Twitter twitter = tFactory.getInstance(username,password); // TODO server
url?
+// Twitter twitter = new Twitter(username,password,serverUrl);
Paging paging = new Paging();
if (lastId == NOT_YET_SET) {
paging.setSinceId(1);
@@ -155,7 +170,7 @@ public class TwitterComponent implements ResourceComponent,
OperationFacet, Meas
lastId = statuses.get(0).getId(); // This is always newest first
}
else if (req.getName().equals("followerCount")) {
- Twitter twitter = new Twitter(username,password,serverUrl);
+ Twitter twitter = tFactory.getInstance(username,password); // TODO server
url?
int count = twitter.getFollowersIDs().getIDs().length;
MeasurementDataNumeric res;
res = new MeasurementDataNumeric(req,(double)count);
@@ -181,9 +196,7 @@ public class TwitterComponent implements ResourceComponent,
OperationFacet, Meas
String message = configuration.getSimpleValue("message",null);
- Twitter twitter = new Twitter(username,password,serverUrl);
- twitter.setSource("Jopr");
- twitter.setUserAgent("Jopr");
+ Twitter twitter = tFactory.getInstance(username,password);
Status status = twitter.updateStatus(message);
OperationResult result = new OperationResult("Posted " +
status.getText());
commit 9367e471e8faeea2cb0c49521939c48d03c10d2d
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Tue Jun 15 07:57:47 2010 +0200
Update twitter4j version to prepare for OAuth changes.
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index c3f248c..48bcca6 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -26,9 +26,9 @@
<dependencies>
<dependency>
- <groupId>net.homeip.yusuke</groupId>
- <artifactId>twitter4j</artifactId>
- <version>2.0.9</version>
+ <groupId>org.twitter4j</groupId>
+ <artifactId>twitter4j-core</artifactId>
+ <version>${twitter4j.version}</version>
</dependency>
</dependencies>
@@ -135,9 +135,9 @@
<configuration>
<artifactItems>
<artifactItem>
-
<groupId>net.homeip.yusuke</groupId>
-
<artifactId>twitter4j</artifactId>
- <version>2.0.9</version>
+ <groupId>org.twitter4j</groupId>
+
<artifactId>twitter4j-core</artifactId>
+
<version>${twitter4j.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
@@ -170,9 +170,9 @@
<configuration>
<artifactItems>
<artifactItem>
-
<groupId>net.homeip.yusuke</groupId>
-
<artifactId>twitter4j</artifactId>
- <version>2.0.9</version>
+ <groupId>org.twitter4j</groupId>
+
<artifactId>twitter4j-core</artifactId>
+
<version>${twitter4j.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 9adaca6..c27ee72 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -116,9 +116,9 @@
<configuration>
<artifactItems>
<artifactItem>
- <groupId>net.homeip.yusuke</groupId>
- <artifactId>twitter4j</artifactId>
- <version>2.0.8</version>
+ <groupId>org.twitter4j</groupId>
+ <artifactId>twitter4j-core</artifactId>
+ <version>${twitter4j.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
@@ -160,9 +160,9 @@
</dependency>
<dependency>
- <groupId>net.homeip.yusuke</groupId>
- <artifactId>twitter4j</artifactId>
- <version>2.0.9</version>
+ <groupId>org.twitter4j</groupId>
+ <artifactId>twitter4j-core</artifactId>
+ <version>${twitter4j.version}</version>
</dependency>
</dependencies>
diff --git a/pom.xml b/pom.xml
index e000770..dff1c40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,10 +83,11 @@
<sigar.version>1.6.5.132</sigar.version>
<quartz.version>1.6.5</quartz.version>
<jna.version>3.2.2</jna.version>
+ <twitter4j.version>2.1.2</twitter4j.version>
<!--
defaults for datasource used by integration tests -
- these may be overridden in ~/.m2/settings.xml
+ these may be overridden in ~/.m2/settings.xml
-->
<rhq.test.ds.db-name>rhq</rhq.test.ds.db-name>
<rhq.test.ds.connection-url>jdbc:postgresql://127.0.0.1:5432/${rhq.test.ds.db-name}</rhq.test.ds.connection-url>
@@ -106,7 +107,7 @@
<!--
defaults for datasource used by the dev container build (see dev docs on the
'dev' profile) -
- these may be overridden in ~/.m2/settings.xml
+ these may be overridden in ~/.m2/settings.xml
-->
<rhq.dev.ds.db-name>rhqdev</rhq.dev.ds.db-name>
<rhq.dev.ds.connection-url>jdbc:postgresql://127.0.0.1:5432/${rhq.dev.ds.db-name}</rhq.dev.ds.connection-url>
@@ -654,7 +655,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
- <executions>
+ <executions>
<execution>
<id>read-build-properties</id>
<phase>process-resources</phase>
@@ -674,7 +675,7 @@
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
- <!-- As of v2.4 of this plugin, the default delimiters are @*@ -
+ <!-- As of v2.4 of this plugin, the default delimiters are @*@ -
we want the old default of ${*} instead. -->
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
commit fcdfd9b5921cdfd04901827b2735b25181d13027
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jun 14 14:26:16 2010 +0200
First cut of a Hadoop plugin.
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
new file mode 100644
index 0000000..f5bfd9a
--- /dev/null
+++ b/modules/plugins/hadoop/pom.xml
@@ -0,0 +1,185 @@
+<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>3.0.0-SNAPSHOT</version><!-- TODO adjust RHQ version
-->
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>Hadoop-plugin</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ Hadoop Plugin</name>
+ <description>Monitor Hadoop clusters</description>
+
+ <properties>
+ <scm.module.path>TODO</scm.module.path>
+ <rhq.version>3.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>http://repository.jboss.org/maven2/</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>http://repository.jboss.org/maven2/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</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>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-jmx-plugin</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/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java
new file mode 100644
index 0000000..a568de9
--- /dev/null
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopComponent.java
@@ -0,0 +1,47 @@
+/*
+ * 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.plugins.hadoop;
+
+import com.google.gwt.user.client.ui.ResizeComposite;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+/**
+ * // TODO: Document this
+ * @author Heiko W. Rupp
+ */
+public class HadoopComponent implements ResourceComponent{
+
+// private final Log log = LogFactory.getLog(HadoopComponent.class);
+
+ public void start(ResourceContext resourceContext) throws
InvalidPluginConfigurationException, Exception {
+ // TODO: Customise this generated block
+ }
+
+ public void stop() {
+ // TODO: Customise this generated block
+ }
+
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP; // TODO: Customise this generated block
+ }
+}
diff --git
a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopDiscovery.java
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopDiscovery.java
new file mode 100644
index 0000000..de8613a
--- /dev/null
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopDiscovery.java
@@ -0,0 +1,64 @@
+/*
+ * 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.plugins.hadoop;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discover a hadoop subsystem. When one of the hadoop server processes
+ * is present, this class discovers a Hadoop 'subsystem' that holds all the
+ * children in the resource tree.
+ *
+ * @author Heiko W. Rupp
+ */
+public class HadoopDiscovery implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory.getLog(HadoopDiscovery.class);
+
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext resourceDiscoveryContext) throws
InvalidPluginConfigurationException, Exception {
+
+ Set<DiscoveredResourceDetails> result = new
HashSet<DiscoveredResourceDetails>(1);
+
+ if (resourceDiscoveryContext.getAutoDiscoveredProcesses().size()>0) {
+ // Found some Hadoop processes
+
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ resourceDiscoveryContext.getResourceType(),
+ "Hadoop|", // TODO add path
+ "Hadoop",
+ null, // get from core jar
+ "Hadoop Framework",
+ resourceDiscoveryContext.getDefaultPluginConfiguration(),
+ null // ProcessInfo
+ );
+ result.add(detail);
+ }
+ return result;
+ }
+}
diff --git
a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
new file mode 100644
index 0000000..53f437b
--- /dev/null
+++
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java
@@ -0,0 +1,135 @@
+
+package org.rhq.plugins.hadoop;
+
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+import org.mc4j.ems.connection.bean.attribute.EmsAttribute;
+
+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;
+import org.rhq.core.pluginapi.operation.OperationContext;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.JMXServerComponent;
+
+public class HadoopServiceComponent extends JMXServerComponent implements JMXComponent,
ResourceComponent
+, MeasurementFacet
+, OperationFacet
+{
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ private ResourceContext context;
+
+
+
+
+ /**
+ * Return availability of this resource
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability()
+ */
+ public AvailabilityType getAvailability() {
+ return context.getNativeProcess().isRunning() ? AvailabilityType.UP:
AvailabilityType.DOWN;
+ }
+
+
+ /**
+ * 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, Exception {
+
+ Configuration conf = context.getPluginConfiguration();
+ this.context = context;
+ super.start(context);
+ log.info("Started " + context.getResourceKey());
+
+ }
+
+
+ /**
+ * Tear down the resource connection
+ * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
+ */
+ public void stop() {
+ super.stop();
+
+ }
+
+ @Override
+ public EmsConnection getEmsConnection() {
+ EmsConnection conn = super.getEmsConnection(); // TODO: Customise this
generated block
+ log.info("EmsConnection is " + conn.toString());
+ return conn;
+
+ }
+
+ /**
+ * Gather measurement data
+ * @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) {
+ String property=req.getName();
+ String props[] = property.split("\\|");
+
+ EmsConnection conn = getEmsConnection();
+ EmsBean bean = conn.getBean(props[0]);
+ if (bean != null) {
+ bean.refreshAttributes();
+ EmsAttribute att = bean.getAttribute(props[1]);
+ if (att!=null) {
+ Long val = (Long) att.getValue(); // TODO check for real type
+
+ MeasurementDataNumeric res = new MeasurementDataNumeric(req,
Double.valueOf(val));
+ report.addData(res);
+ }
+ else
+ log.warn("Attribute " + props[1] + " not
found");
+ }
+ else
+ log.warn("MBean " + props[0] +" not found");
+ }
+ }
+
+
+
+ public void startOperationFacet(OperationContext context) {
+
+ }
+
+
+ /**
+ * Invokes the passed operation on the managed resource
+ * @param name Name of the operation
+ * @param params The method parameters
+ * @return An operation result
+ * @see org.rhq.core.pluginapi.operation.OperationFacet
+ */
+ public OperationResult invokeOperation(String name, Configuration params) throws
Exception {
+
+ OperationResult res = new OperationResult();
+ if ("dummyOperation".equals(name)) {
+ // TODO implement me
+
+ }
+ return res;
+ }
+
+
+
+
+
+}
diff --git
a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceDiscovery.java
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceDiscovery.java
new file mode 100644
index 0000000..bcc9af8
--- /dev/null
+++
b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceDiscovery.java
@@ -0,0 +1,135 @@
+/*
+ * 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.plugins.hadoop;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.support.metadata.InternalVMTypeDescriptor;
+import org.mc4j.ems.connection.support.metadata.J2SE5ConnectionTypeDescriptor;
+import org.mc4j.ems.connection.support.metadata.LocalVMTypeDescriptor;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ProcessScanResult;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXDiscoveryComponent;
+
+/**
+ * Discover individual hadoop processes
+ * @author Heiko W. Rupp
+ */
+public class HadoopServiceDiscovery implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory.getLog(HadoopServiceDiscovery.class);
+ private static final String HADOOP_VERSION_MATCH =
".*hadoop-([0-9\\.]+)-core.jar.*";
+ private Pattern hadoopPattern = Pattern.compile(HADOOP_VERSION_MATCH);
+
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext resourceDiscoveryContext) throws
InvalidPluginConfigurationException, Exception {
+
+ Set<DiscoveredResourceDetails> details = new
HashSet<DiscoveredResourceDetails>();
+
+ @SuppressWarnings("unchecked")
+ List<ProcessScanResult> parentProcessScans =
resourceDiscoveryContext.getParentResourceContext().getNativeProcessesForType();
+ ResourceType resourceType = resourceDiscoveryContext.getResourceType();
+ String rtName = resourceType.getName();
+
+ for (ProcessScanResult psr : parentProcessScans) {
+
+
+ if (psr.getProcessScan().getName().equals(rtName)) {
+
+ String[] commandLineArgs = psr.getProcessInfo().getCommandLine();
+ String version = getVersion(commandLineArgs);
+ String javaClazz = getClazzFromCommandLine(commandLineArgs);
+
+ Configuration pluginConfiguration =
resourceDiscoveryContext.getDefaultPluginConfiguration();
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ resourceType, // ResourceType
+
rtName+":"+psr.getProcessInfo().getCurrentWorkingDirectory(), // ResourceKey
+ rtName, // resource name
+ version, // Version
+ "Hadoop " + rtName + " ( "+
psr.getProcessInfo().getCurrentWorkingDirectory() +" )", // description
+ pluginConfiguration,
+ psr.getProcessInfo() // process info
+ );
+
+
+ /*
+ * We'll connect to the discovered VM on the local host, so set the
jmx connection
+ * properties accordingly. This may only work on JDK6+, but then JDK5 is
deprecated
+ * anyway.
+ */
+ pluginConfiguration.put(new
PropertySimple(JMXDiscoveryComponent.COMMAND_LINE_CONFIG_PROPERTY,
+ javaClazz));
+ pluginConfiguration.put(new
PropertySimple(JMXDiscoveryComponent.CONNECTION_TYPE,
+ LocalVMTypeDescriptor.class.getName()));
+
+ log.info("Discovered " + detail);
+ details.add(detail);
+ }
+ }
+
+ return details;
+ }
+
+ /**
+ * Get the full class name of the java class that 'jps -l' would list
+ * @param commandLineArgs Command line args for the java executable
+ * @return full class name for the server class
+ */
+ private String getClazzFromCommandLine(String[] commandLineArgs) {
+ for (String line : commandLineArgs) {
+ if (line.startsWith("org.apache.hadoop."))
+ return line;
+ }
+ return "-not found-";
+ }
+
+ /**
+ * Get hadoop version
+ * from command line by looking at haoop-core-xx-core.jar
+ * @param commandLine Command line args for the java executable
+ * @return hdoop version string or null if it can not be determined
+ */
+ private String getVersion(String[] commandLine) {
+
+ for (String line : commandLine) {
+ Matcher m = hadoopPattern.matcher(line);
+ if (m.matches()) {
+ String result = m.group(1);
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+
+}
diff --git a/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
new file mode 100644
index 0000000..8f1f506
--- /dev/null
+++ b/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<plugin name="hadoop"
+ displayName="hadoopPlugin"
+ description="Monitor Hadoop Clusters"
+ package="org.rhq.plugins.hadoop"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="JMX" useClasses="true"/>
+
+ <server name="Hadoop" discovery="HadoopDiscovery"
class="HadoopComponent">
+
+
+ <process-scan name="TaskTracker"
query="process|basename|match=^java.*,arg|org.apache.hadoop.mapred.TaskTracker|match=.*"/>
+ <process-scan name="JobTracker"
query="process|basename|match=^java.*,arg|org.apache.hadoop.mapred.JobTracker|match=.*"/>
+ <process-scan name="NameNode"
query="process|basename|match=^java.*,arg|org.apache.hadoop.hdfs.server.namenode.NameNode|match=.*"/>
+ <process-scan name="SecondaryNameNode"
query="process|basename|match=^java.*,arg|org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode|match=.*"/>
+ <process-scan name="DataNode"
query="process|basename|match=^java.*,arg|org.apache.hadoop.hdfs.server.datanode.DataNode|match=.*"/>
+
+
+
+ <service name="TaskTracker"
discovery="HadoopServiceDiscovery" class="HadoopServiceComponent"
+
+
+ </service>
+
+ <service name="JobTracker"
discovery="HadoopServiceDiscovery" class="HadoopServiceComponent"
+
+
<plugin-configuration>
+ <c:simple-property name="baseObjectName"
defaultValue="hadoop:service=JobTracker"/>
+ </plugin-configuration>
+ </service>
+
+ <service name="NameNode"
discovery="HadoopServiceDiscovery" class="HadoopServiceComponent">
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|CapacityTotal"
displayName="CapacityTotal"
+ units="bytes" description="DFS Configured
capacitiy"/>
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|CapacityUsed"
displayName="CapacityUsed"
+ units="bytes" description="DFS used"
displayType="summary"/>
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|CapacityRemaining"
displayName="CapacityRemaining"
+ units="bytes" description="DFS remaining"/>
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|BlocksTotal"
displayName="BlocksTotal"
+ units="none"/>
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|FilesTotal"
displayName="FilesTotal"
+ units="none"/>
+ <metric
property="hadoop:service=NameNode,name=FSNamesystemState|PendingReplicationBlocks"
displayName="PendingReplicationBlocks"
+ units="none"/>
+
+ <metric
property="hadoop:service=NameNode,name=NameNodeActivity|FilesCreated"
displayName="FilesCreated"
+ units="none"/>
+ </service>
+
+ <service name="SecondaryNameNode"
discovery="HadoopServiceDiscovery" class="HadoopServiceComponent"
+
+ </service>
+
+
+ <service name="DataNode"
discovery="HadoopServiceDiscovery" class="HadoopServiceComponent">
+
+ <metric property="DataNodeActivity*|bytes_written"/>
+ <metric property="FSDatasetState*|Remaining"/>
+ <metric property="FSDatasetState*|Capacity"/>
+ <metric property="FSDatasetState*|StorageInfo"
dataType="trait" displayType="summary"/>
+ <metric property="RpcActivitForPort*|NumOpenConnections"/>
+
+ </service>
+ </server>
+
+
+</plugin>
\ No newline at end of file
commit 8e37d409d6fdd411c188e5be519b72a26085c21e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 24 13:18:04 2010 -0400
clean commons logging factory cache to help free memory on shutdown
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
index 8970404..d6546a2 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java
@@ -336,6 +336,7 @@ public class PluginContainer implements ContainerService {
*/
private void cleanMemory() {
Introspector.flushCaches();
+ LogFactory.releaseAll();
System.gc();
}
commit 4c7c3f7bcf1530946cb5a4503b221d2e5327e13b
Merge: e26c467... f37dc28...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jun 23 21:27:05 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
index 4721467,b97f419..ad0c449
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
@@@ -32,20 -32,21 +32,19 @@@ import com.smartgwt.client.widgets.tool
* @author Greg Hinkle
* @author Ian Springer
*/
- public class BreadcrumbTrailPane extends HTMLPane {
-
+ public class BreadcrumbTrailPane extends ToolStrip {
-
public BreadcrumbTrailPane() {
+ super();
setHeight(28);
- setBackgroundColor("#E6E3E3");
-
setBackgroundImage("[skin]images/SectionHeader/header_opened_stretch.png");
//ToolStrip/background.png");
- setBackgroundRepeat(BkgndRepeat.REPEAT_X);
- // setPadding(5);
+ setAlign(VerticalAlignment.CENTER);
+ setWidth100();
+ setMembersMargin(15);
setOverflow(Overflow.CLIP_V);
- }
+ }
-
public void refresh(ViewPath viewPath) {
try {
@@@ -54,23 -61,23 +59,21 @@@
- StringBuilder content = new StringBuilder();
- content.append("<div class=\"BreadCrumb\">");
for (ViewId viewId : viewPath.getViewPath()) {
- if (!viewId.getBreadcrumbs().isEmpty()) {
- if (!first) {
- path.append("/");
- content.append("<img
src=\"images/header/breadcrumb_space.png\" style=\"vertical-align:
middle;\" width=\"28\" height=\"28\"/>");
- } else {
- first = false;
- }
-
+ if (!first && !viewId.getBreadcrumbs().isEmpty()) {
+ addMember(getSpacer());
+ }
+
+ if (!first) {
+ path.append("/");
+ } else {
+ first = false;
}
-
boolean firstBC = true;
for (Breadcrumb breadcrumb : viewId.getBreadcrumbs()) {
- // path.append(breadcrumb.getName());
if (!firstBC) {
- content.append("<img
src=\"images/header/breadcrumb_space.png\" style=\"vertical-align:
middle;\" width=\"28\" height=\"28\"/>");
+ addMember(getSpacer());
} else {
firstBC = false;
}
@@@ -89,21 -91,39 +87,42 @@@
- content.append("\n");
}
path.append(viewId.getPath());
}
- content.append("</div>");
- setContents(content.toString());
+ addMember(new LayoutSpacer());
-
++
} catch (Throwable t) {
System.err.println("Failed to refresh bread crumb HTML - cause: "
+ t);
}
String title = "RHQ";
if (!viewPath.getViewPath().isEmpty()) {
-- title += ": " +
viewPath.getViewPath().get(viewPath.getViewPath().size()-1).getBreadcrumbs().get(0).getDisplayName();
++ title += ": "
++ + viewPath.getViewPath().get(viewPath.getViewPath().size() -
1).getBreadcrumbs().get(0)
++ .getDisplayName();
}
Window.setTitle(title);
redraw();
}
+
+ private Label getCrumb(String text, String url) {
+ Label l = new Label("<a href=\"#" + url +
"\">" + text + "</a>");
+ l.setValign(VerticalAlignment.CENTER);
+ l.setWrap(false);
+ l.setAutoWidth();
+ return l;
+ }
++
+ private Label getCrumb(String text) {
+ Label l = new Label(text);
+ l.setValign(VerticalAlignment.CENTER);
+ l.setWrap(false);
+ l.setAutoFit(true);
+ return l;
+ }
+
+ private Img getSpacer() {
- return new Img("header/breadcrumb_space.png",28,28);
++ return new Img("header/breadcrumb_space.png", 28, 28);
+ }
}
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index ef24e7a,546a7fa..d9d1250
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@@ -46,9 -43,9 +44,10 @@@ public class BundleTopView extends HLay
private ViewId currentNextPath;
private BundleView bundleView;
+ private BundlesListView bundlesListView;
public BundleTopView() {
+ setOverflow(Overflow.AUTO);
setWidth100();
setHeight100();
}
diff --cc
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index f75b7e2,3e733fd..9d61cfd
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@@ -574,11 -560,6 +562,10 @@@ public final class LookupUtil
return lookupLocal(TagManagerBean.class);
}
+ public static DashboardManagerLocal getDashboardManagerLocal() {
+ return lookupLocal(DashboardManagerBean.class);
- }
-
++ }
+
public static CoreServerMBean getCoreServer() {
MBeanServer jBossMBeanServer = MBeanServerLocator.locateJBoss();
CoreServerMBean jonServer = (CoreServerMBean)
MBeanProxyExt.create(CoreServerMBean.class,
diff --cc release.sh
index 32bd549,e9ed4ce..e9ed4ce
mode 100644,100755..100644
--- a/release.sh
+++ b/release.sh
commit e26c4678aa2263bdfd24727aa0dc2fb2ce75961b
Merge: d889202... 9a12da1...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 21 15:40:23 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
modules/enterprise/server/plugins/alert-email/pom.xml
modules/enterprise/server/plugins/alert-irc/pom.xml
modules/enterprise/server/plugins/alert-microblog/pom.xml
modules/enterprise/server/plugins/alert-mobicents/pom.xml
modules/enterprise/server/plugins/alert-operations/pom.xml
modules/enterprise/server/plugins/alert-roles/pom.xml
modules/enterprise/server/plugins/alert-snmp/pom.xml
modules/enterprise/server/plugins/alert-subject/pom.xml
modules/enterprise/server/plugins/cobbler/pom.xml
modules/helpers/pluginAnnotations/pom.xml
modules/helpers/pluginGen/pom.xml
modules/plugins/hudson/pom.xml
release.sh
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index 48776a3,761449a..d4a4731
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@@ -18,9 -18,12 +18,14 @@@
*/
package org.rhq.enterprise.gui.coregui.client.gwt;
- import org.rhq.core.domain.auth.Subject;
+ import java.util.List;
+ import java.util.Set;
+
+ import com.google.gwt.user.client.rpc.RemoteService;
+ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
@@@ -48,15 -42,9 +46,13 @@@ public interface MeasurementDataGWTServ
Set<MeasurementData> findLiveData(int resourceId, int[] definitionIds);
- List<List<MeasurementDataNumericHighLowComposite>>
findDataForResource(int resourceId,
- int[] definitionIds, long beginTime, long endTime, int numPoints);
-
-
- PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId,
long start, long end, PageControl pageControl);
+ List<List<MeasurementDataNumericHighLowComposite>>
findDataForResource(int resourceId, int[] definitionIds,
+ long beginTime, long endTime, int numPoints);
+ PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId,
long start, long end,
+ PageControl pageControl);
+
+ public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
+
+ public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
-
}
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index d2c9cae,0712c75..5749dc4
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@@ -18,9 -18,9 +18,11 @@@
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
- import org.rhq.core.domain.auth.Subject;
+ import java.util.List;
+ import java.util.Set;
+
+import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
@@@ -34,62 -32,35 +36,52 @@@ import org.rhq.enterprise.gui.coregui.c
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
- import java.util.List;
- import java.util.Set;
-
/**
* @author Greg Hinkle
*/
public class MeasurementDataGWTServiceImpl extends AbstractGWTServiceImpl implements
MeasurementDataGWTService {
++ private static final long serialVersionUID = 1L;
++
private MeasurementDataManagerLocal dataManager =
LookupUtil.getMeasurementDataManager();
private CallTimeDataManagerLocal callTimeDataManager =
LookupUtil.getCallTimeDataManager();
+ private MeasurementScheduleManagerLocal scheduleManager =
LookupUtil.getMeasurementScheduleManager();
+ private MeasurementDefinitionManagerLocal definitionManager =
LookupUtil.getMeasurementDefinitionManager();
+
-
public List<MeasurementDataTrait> findCurrentTraitsForResource(int resourceId,
DisplayType displayType) {
- return SerialUtility.prepare(
- dataManager.findCurrentTraitsForResource(getSessionSubject(),
resourceId, displayType),
- "MeasurementDataService.findCurrentTraitsForResource");
+ return
SerialUtility.prepare(dataManager.findCurrentTraitsForResource(getSessionSubject(),
resourceId,
+ displayType),
"MeasurementDataService.findCurrentTraitsForResource");
}
-
public Set<MeasurementData> findLiveData(int resourceId, int[] definitionIds)
{
- return SerialUtility.prepare(
- dataManager.findLiveData(getSessionSubject(), resourceId,
definitionIds),
- "MeasurementDataService.findLiveData");
+ return SerialUtility.prepare(dataManager.findLiveData(getSessionSubject(),
resourceId, definitionIds),
+ "MeasurementDataService.findLiveData");
}
-
- public List<List<MeasurementDataNumericHighLowComposite>>
findDataForResource(int resourceId, int[] definitionIds, long beginTime, long endTime, int
numPoints) {
- return SerialUtility.prepare(
- dataManager.findDataForResource(
- getSessionSubject(), resourceId, definitionIds, beginTime,
endTime, numPoints),
- "MeasurementDataService.findDataForResource");
+ public List<List<MeasurementDataNumericHighLowComposite>>
findDataForResource(int resourceId, int[] definitionIds,
+ long beginTime, long endTime, int numPoints) {
+ return
SerialUtility.prepare(dataManager.findDataForResource(getSessionSubject(), resourceId,
definitionIds,
+ beginTime, endTime, numPoints),
"MeasurementDataService.findDataForResource");
}
- public PageList<CallTimeDataComposite> findCallTimeDataForResource(int
scheduleId, long start, long end, PageControl pageControl) {
- return SerialUtility.prepare(
- callTimeDataManager.findCallTimeDataForResource(getSessionSubject(),
scheduleId, start, end, pageControl),
- "MeasurementDataService.findCallTimeDataForResource");
+ public PageList<CallTimeDataComposite> findCallTimeDataForResource(int
scheduleId, long start, long end,
+ PageControl pageControl) {
+ return
SerialUtility.prepare(callTimeDataManager.findCallTimeDataForResource(getSessionSubject(),
scheduleId,
+ start, end, pageControl),
"MeasurementDataService.findCallTimeDataForResource");
}
+
-
+ public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria) {
- return SerialUtility.prepare(
-
definitionManager.findMeasurementDefinitionsByCriteria(getSessionSubject(), criteria),
-
"MeasurementDataService.findMeasurementDefinintionsByCriteria");
++ return
SerialUtility.prepare(definitionManager.findMeasurementDefinitionsByCriteria(getSessionSubject(),
++ criteria),
"MeasurementDataService.findMeasurementDefinintionsByCriteria");
+ }
+
+ public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria) {
- return SerialUtility.prepare(
- scheduleManager.findSchedulesByCriteria(getSessionSubject(), criteria),
- "MeasurementDataService.findMeasurementSchedulesByCriteria");
++ return
SerialUtility.prepare(scheduleManager.findSchedulesByCriteria(getSessionSubject(),
criteria),
++ "MeasurementDataService.findMeasurementSchedulesByCriteria");
+ }
}
diff --cc release.sh
index 186fe1b,32bd549..32bd549
mode 100755,100755..100644
--- a/release.sh
+++ b/release.sh
commit d889202845b428795c5a40a7f180bd890818238a
Merge: df088ae... 80edbde...
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:47:49 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts:
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
diff --cc
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index 6dbf695,d4164f8..7cd7fdd
---
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
@@@ -182,20 -174,13 +174,17 @@@ public class ResourceGWTServiceImpl ext
// ConfigurationUtility.normalizeConfiguration(pluginConfig,
pluginConfigDefinition);
}
-
- resourceFactoryManager.createResource(getSessionSubject(),
- parentResourceId, newResourceTypeId, newResourceName, pluginConfig,
newResourceConfiguration);
+ resourceFactoryManager.createResource(getSessionSubject(), parentResourceId,
newResourceTypeId,
+ newResourceName, pluginConfig, newResourceConfiguration);
}
-
-
public Map<Resource, List<Resource>>
getQueuedPlatformsAndServers(HashSet<InventoryStatus> statuses, PageControl pc) {
- return
SerialUtility.prepare(discoveryBoss.getQueuedPlatformsAndServers(getSessionSubject(),
EnumSet
- .copyOf(statuses), pc),
"ResoruceService.getQueuedPlatformsAndServers");
+ return SerialUtility.prepare(
+ discoveryBoss.getQueuedPlatformsAndServers(
+ getSessionSubject(),
+ EnumSet.copyOf(statuses),
+ pc),
+ "ResourceService.getQueuedPlatformsAndServers");
}
public void importResources(Integer[] resourceIds) {
commit df088ae4184f2af42b9e47b9182595fbeff0af41
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:35:08 2010 -0400
Migrated more icons from portal-war
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/DEBUG_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/DEBUG_16.png
new file mode 100644
index 0000000..c52bd6e
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/DEBUG_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/ERROR_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/ERROR_16.png
new file mode 100644
index 0000000..8182778
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/ERROR_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/FATAL_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/FATAL_16.png
new file mode 100644
index 0000000..7211593
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/FATAL_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/INFO_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/INFO_16.png
new file mode 100644
index 0000000..bfca8ca
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/INFO_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
new file mode 100644
index 0000000..f766722
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_16.png
new file mode 100644
index 0000000..d7fb74d
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_16.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_24.png
new file mode 100644
index 0000000..19fcc4a
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_down_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_16.png
new file mode 100644
index 0000000..8d898fd
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_24.png
new file mode 100644
index 0000000..ef195ef
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_up_24.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_warning_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_warning_24.png
new file mode 100644
index 0000000..7026b71
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Cluster_warning_24.png
differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_16.png
new file mode 100644
index 0000000..b3cbd5d
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_24.png
new file mode 100644
index 0000000..9df7528
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_down_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_16.png
new file mode 100644
index 0000000..e982a0e
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_24.png
new file mode 100644
index 0000000..a4fd9c5
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_up_24.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_warning_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_warning_24.png
new file mode 100644
index 0000000..e24e4bf
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Group_warning_24.png differ
commit 21e9f51c713180fa85863e74689688571f67547f
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:34:15 2010 -0400
UI cleanup and tweaks
new table header hiding
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
index 76e104c..4721467 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java
@@ -70,7 +70,7 @@ public class BreadcrumbTrailPane extends HTMLPane {
// path.append(breadcrumb.getName());
if (!firstBC) {
- content.append(" > ");
+ content.append("<img
src=\"images/header/breadcrumb_space.png\" style=\"vertical-align:
middle;\" width=\"28\" height=\"28\"/>");
} else {
firstBC = false;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index ca88567..0cc21e5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -113,6 +113,7 @@ public class Footer extends ToolStrip {
public void refresh() {
AlertCriteria alertCriteria = new AlertCriteria();
+ alertCriteria.setPaging(1,1);
// last eight hours
alertCriteria.addFilterStartTime(System.currentTimeMillis() - (1000L * 60 *
60 * 8));
@@ -134,7 +135,7 @@ public class Footer extends ToolStrip {
} else {
- setContents(alerts.size() + " recent alerts");
+ setContents(alerts.getTotalSize() + " recent alerts");
setIcon("subsystems/alert/Alert_HIGH_16.png");
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
index adf12c5..9240e83 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java
@@ -55,7 +55,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
* @author Ian Springer
* @author Heiko W. Rupp
*/
-public class AlertsView extends VLayout {
+public class AlertsView extends Table {
private static final String TITLE = "Alerts";
private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{
@@ -65,7 +65,6 @@ public class AlertsView extends VLayout {
private static final String DELETE_CONFIRM_MESSAGE = "Are you sure you want to
delete the selected alert(s)?";
- private Table table;
private AlertDataSource dataSource;
private HTMLFlow detailsContent;
private DynamicForm detailsTable;
@@ -83,6 +82,11 @@ public class AlertsView extends VLayout {
}
public AlertsView(Criteria criteria, String[] excludedFieldNames) {
+ super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames);
+
+ this.dataSource = new AlertDataSource();
+
+ setDataSource(this.dataSource);
this.criteria = criteria;
this.excludedFieldNames = excludedFieldNames;
showDetails = false;
@@ -92,79 +96,62 @@ public class AlertsView extends VLayout {
@Override
protected void onInit() {
super.onInit();
- setWidth100();
- setHeight100();
- setMembersMargin(20);
- }
- @Override
- protected void onDraw() {
- super.onDraw();
-
- if (table == null) {
- this.table = new Table(TITLE, criteria, SORT_SPECIFIERS,
excludedFieldNames);
-
-
- // Add the list table as the top half of the view.
- //Criteria criteria = new Criteria(AlertCriteria.);
- this.table.setHeight("50%");
- ListGrid listGrid = this.table.getListGrid();
- this.dataSource = new AlertDataSource();
- this.table.setDataSource(this.dataSource);
- listGrid.getField("name").setWidth("15%");
- listGrid.getField("conditionText").setWidth("30%");
- listGrid.getField("conditionValue").setWidth("10%");
- listGrid.getField("resourceName").setWidth("20%");
+ // Add the list table as the top half of the view.
+ //Criteria criteria = new Criteria(AlertCriteria.);
+ ListGrid listGrid = getListGrid();
+ listGrid.getField("name").setWidth("15%");
+ listGrid.getField("conditionText").setWidth("30%");
+ listGrid.getField("conditionValue").setWidth("10%");
+ listGrid.getField("resourceName").setWidth("20%");
// listGrid.getField("recoveryInfo").setWidth("20%");
- listGrid.getField("priority").setWidth("7%");
- listGrid.getField("ctime").setWidth("13%");
- listGrid.getField("ack").setWidth("5%");
+ listGrid.getField("priority").setWidth("7%");
+ listGrid.getField("ctime").setWidth("13%");
+ listGrid.getField("ack").setWidth("5%");
- listGrid.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>";
- }
- });
+ listGrid.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>";
+ }
+ });
- this.table.addTableAction("Delete", Table.SelectionEnablement.ANY,
DELETE_CONFIRM_MESSAGE, new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- AlertsView.this.dataSource.deleteAlerts(AlertsView.this);
- }
- });
- this.table.addTableAction("Acknowledge",
Table.SelectionEnablement.ANY, null, new TableAction() {
- public void executeAction(ListGridRecord[] selection) {
- AlertsView.this.dataSource.acknowledgeAlerts(AlertsView.this);
+ addTableAction("Delete", Table.SelectionEnablement.ANY,
DELETE_CONFIRM_MESSAGE, new TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ AlertsView.this.dataSource.deleteAlerts(AlertsView.this);
+ }
+ });
+ addTableAction("Acknowledge", Table.SelectionEnablement.ANY, null, new
TableAction() {
+ public void executeAction(ListGridRecord[] selection) {
+ AlertsView.this.dataSource.acknowledgeAlerts(AlertsView.this);
+ }
+ });
+
+ if (showDetails) {
+ listGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
+ public void onSelectionChanged(SelectionEvent event) {
+ ListGridRecord[] selectedRecords =
AlertsView.this.getListGrid().getSelection();
+ String contents;
+ if (selectedRecords.length == 1) {
+ ListGridRecord record = selectedRecords[0];
+
+ // Clean out existing details and provide new ones
+ for (int i = 1; i <= getChildren().length; i++)
+ getChildren()[1].destroy();
+
+ addMember(getDetailsTabSet(record));
+
+ } else {
+ // Clean out existing details and show the "nothing selected
message"
+ for (int i = 1; i <= getChildren().length; i++)
+ getChildren()[1].destroy();
+ addMember(getNoAlertSelectedMessage());
+ }
}
});
-
- if (showDetails) {
- listGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
- public void onSelectionChanged(SelectionEvent event) {
- ListGridRecord[] selectedRecords =
AlertsView.this.table.getListGrid().getSelection();
- String contents;
- if (selectedRecords.length == 1) {
- ListGridRecord record = selectedRecords[0];
-
- // Clean out existing details and provide new ones
- for (int i = 1; i <= getChildren().length; i++)
- getChildren()[1].destroy();
-
- addMember(getDetailsTabSet(record));
-
- } else {
- // Clean out existing details and show the "nothing
selected message"
- for (int i = 1; i <= getChildren().length; i++)
- getChildren()[1].destroy();
- addMember(getNoAlertSelectedMessage());
- }
- }
- });
- }
-
- addMember(this.table);
}
+
// // Add the details panel as the bottom half of the view.
// // Default is the "nothing selected" message
// addMember(getNoAlertSelectedMessage());
@@ -296,18 +283,14 @@ public class AlertsView extends VLayout {
return null;
}
- ListGrid getListGrid() {
- return this.table.getListGrid();
- }
-
public void refresh() {
- this.table.getListGrid().invalidateCache();
+ this.getListGrid().invalidateCache();
//this.table.getListGrid().markForRedraw();
}
public void refresh(Criteria criteria) {
- this.table.refresh(criteria);
+ this.refresh(criteria);
//this.table.getListGrid().markForRedraw();
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
index 84a2a1f..ef24e7a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.bundle;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VisibilityMode;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.HLayout;
@@ -47,6 +48,7 @@ public class BundleTopView extends HLayout implements BookmarkableView
{
private BundleView bundleView;
public BundleTopView() {
+ setOverflow(Overflow.AUTO);
setWidth100();
setHeight100();
}
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 329bbab..24a3425 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
@@ -69,6 +69,7 @@ public class Table extends VLayout {
private String headerIcon;
+ private boolean showHeader = true;
private boolean showFooter = true;
/**
@@ -186,28 +187,32 @@ public class Table extends VLayout {
removeMembers(getMembers());
+ if (showHeader) {
- titleLayout = new HLayout();
- titleLayout.setAutoHeight();
- titleLayout.setAlign(VerticalAlignment.BOTTOM);
+ titleLayout = new HLayout();
+ titleLayout.setAutoHeight();
+ titleLayout.setAlign(VerticalAlignment.BOTTOM);
- if (headerIcon != null) {
- Img img = new Img(headerIcon,24, 24);
- img.setPadding(4);
- titleLayout.addMember(img);
- }
+ if (headerIcon != null) {
+ Img img = new Img(headerIcon, 24, 24);
+ img.setPadding(4);
+ titleLayout.addMember(img);
+ }
- titleLayout.addMember(title);
+ titleLayout.addMember(title);
- if (titleComponent != null) {
- titleLayout.addMember(new LayoutSpacer());
- titleLayout.addMember(titleComponent);
+ if (titleComponent != null) {
+ titleLayout.addMember(new LayoutSpacer());
+ titleLayout.addMember(titleComponent);
+ }
+
+ addMember(titleLayout);
}
- addMember(titleLayout);
addMember(listGrid);
if (showFooter) {
+ footer.removeMembers(footer.getMembers());
for (final TableActionInfo tableAction : tableActions) {
IButton button = new IButton(tableAction.title);
@@ -272,6 +277,18 @@ public class Table extends VLayout {
}
}
+ protected void setListGrid(ListGrid listGrid) {
+ this.listGrid = listGrid;
+ }
+
+ public boolean isShowHeader() {
+ return showHeader;
+ }
+
+ public void setShowHeader(boolean showHeader) {
+ this.showHeader = showHeader;
+ }
+
public boolean isShowFooter() {
return showFooter;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
index a166177..9e183fb 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java
@@ -45,6 +45,15 @@ public class TagCloudView extends VLayout {
private String selectedTag;
+ private boolean simple = false;
+
+ public TagCloudView() {
+ }
+
+ public TagCloudView(boolean simple) {
+ this.simple = simple;
+ }
+
@Override
protected void onDraw() {
super.onDraw();
@@ -72,7 +81,9 @@ public class TagCloudView extends VLayout {
this.tags = tags;
- addMember(new HeaderLabel("Tag Cloud"));
+ if (!simple) {
+ addMember(new HeaderLabel("Tag Cloud"));
+ }
long max = 0;
long total = 0;
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 31dd771..6dbf695 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
@@ -195,7 +195,7 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
getSessionSubject(),
EnumSet.copyOf(statuses),
pc),
- "ResoruceService.getQueuedPlatformsAndServers");
+ "ResourceService.getQueuedPlatformsAndServers");
}
public void importResources(Integer[] resourceIds) {
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index 40274c1..d565834 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -31,7 +31,6 @@ a, a:link, a:visited, a:hover {
color: #4A5D75 !important;
font-weight: bold !important;
text-decoration: none !important;
-
}
a:hover {
@@ -121,6 +120,7 @@ a:hover {
font-weight: bold;
text-decoration: none;
color: #363636;
+ height: 28px;
}
.SectionHeader {
@@ -302,8 +302,8 @@ a:hover {
}
.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected,
.menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled {
- border: none;
- font-weight: bold;
+ border: none !important;
+ font-weight: bold !important;
}
@@ -344,4 +344,4 @@ a:hover {
background-color: lightblue;
padding: 5px;
border: 1px solid darkblue;
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/alert/Flag_blue_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/alert/Flag_blue_24.png
new file mode 100644
index 0000000..3082360
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/alert/Flag_blue_24.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png
index 69a4d9f..78f04e5 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_24.png
index 660e4b8..6872eb6 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_24.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_16.png
new file mode 100644
index 0000000..202dfe1
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_16.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_24.png
new file mode 100644
index 0000000..dd365db
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_unknown_24.png
differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png
index 132e4ce..6a5286f 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_24.png
index 83da6ad..3a56b8d 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_24.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png
index d09143b..9240927 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png
index 24b1d98..bdc8532 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png
index bbebc5c..0ef05e9 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
index 7df5599..6babc43 100644
Binary files
a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png and
b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png differ
commit 29d24bb6fe1df362c33d8bc7d9c890f8c3cdd489
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:33:00 2010 -0400
Dashboard, measurement schedule and event data access to gwt
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DashboardGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DashboardGWTServiceImpl.java
new file mode 100644
index 0000000..1d28f7d
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DashboardGWTServiceImpl.java
@@ -0,0 +1,59 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.server.gwt;
+
+import java.util.List;
+
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTService;
+import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
+import org.rhq.enterprise.server.dashboard.DashboardManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Greg Hinkle
+ */
+public class DashboardGWTServiceImpl extends AbstractGWTServiceImpl implements
DashboardGWTService {
+
+ private DashboardManagerLocal dashboardManager =
LookupUtil.getDashboardManagerLocal();
+
+
+ public List<Dashboard> findDashboardsForSubject() {
+ return
SerialUtility.prepare(dashboardManager.findDashboardsForSubject(getSessionSubject()),
+ "DashboardManager.findDashboardsForSubject");
+ }
+
+ public List<Dashboard> findSharedDashboards() {
+ return
SerialUtility.prepare(dashboardManager.findSharedDashboards(getSessionSubject()),
+ "DashboardManager.findSharedDashboards");
+ }
+
+ public Dashboard storeDashboard(Dashboard dashboard) {
+ return
SerialUtility.prepare(dashboardManager.storeDashboard(getSessionSubject(),dashboard),
+ "DashboardManager.storeDashboard");
+ }
+
+ public void removeDashboard(int dashboardId) {
+ dashboardManager.removeDashboard(getSessionSubject(), dashboardId);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/EventGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/EventGWTServiceImpl.java
new file mode 100644
index 0000000..cdfd2cb
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/EventGWTServiceImpl.java
@@ -0,0 +1,65 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.server.gwt;
+
+import org.rhq.core.domain.criteria.EventCriteria;
+import org.rhq.core.domain.event.Event;
+import org.rhq.core.domain.event.EventSeverity;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.gwt.EventGWTService;
+import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
+import org.rhq.enterprise.server.event.EventManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Greg Hinkle
+ */
+public class EventGWTServiceImpl extends AbstractGWTServiceImpl implements
EventGWTService {
+
+ private EventManagerLocal eventManager = LookupUtil.getEventManager();
+
+
+ public EventSeverity[] getSeverityBuckets(int resourceId, long begin, long end, int
numBuckets) {
+ return SerialUtility.prepare(
+ eventManager.getSeverityBuckets(getSessionSubject(), resourceId, begin,
end, numBuckets),
+ "EventService.getSeverityBuckets");
+ }
+
+ public EventSeverity[] getSeverityBucketsForAutoGroup(int parentResourceId, int
resourceTypeId, long begin, long end, int numBuckets) {
+ return SerialUtility.prepare(
+ eventManager.getSeverityBucketsForAutoGroup(getSessionSubject(),
parentResourceId, resourceTypeId, begin, end, numBuckets),
+ "EventService.getSeverityBucketsForAutoGroup");
+ }
+
+ public EventSeverity[] getSeverityBucketsForCompGroup(int resourceGroupId, long
begin, long end, int numBuckets) {
+ return SerialUtility.prepare(
+ eventManager.getSeverityBucketsForCompGroup(getSessionSubject(),
resourceGroupId, begin, end, numBuckets),
+ "EventService.getSeverityBucketsForCompGroup");
+ }
+
+ public PageList<Event> findEventsByCriteria(EventCriteria criteria) {
+ return SerialUtility.prepare(
+ eventManager.findEventsByCriteria(getSessionSubject(), criteria),
+ "EventService.findEventsByCriteria");
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
index d57f5ac..d2c9cae 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java
@@ -19,9 +19,13 @@
package org.rhq.enterprise.gui.coregui.server.gwt;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
import org.rhq.core.domain.util.PageControl;
@@ -30,6 +34,8 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTService;
import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
import java.util.List;
@@ -43,6 +49,10 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
private MeasurementDataManagerLocal dataManager =
LookupUtil.getMeasurementDataManager();
private CallTimeDataManagerLocal callTimeDataManager =
LookupUtil.getCallTimeDataManager();
+ private MeasurementScheduleManagerLocal scheduleManager =
LookupUtil.getMeasurementScheduleManager();
+ private MeasurementDefinitionManagerLocal definitionManager =
LookupUtil.getMeasurementDefinitionManager();
+
+
public List<MeasurementDataTrait> findCurrentTraitsForResource(int resourceId,
DisplayType displayType) {
return SerialUtility.prepare(
dataManager.findCurrentTraitsForResource(getSessionSubject(), resourceId,
displayType),
@@ -69,4 +79,17 @@ public class MeasurementDataGWTServiceImpl extends
AbstractGWTServiceImpl implem
callTimeDataManager.findCallTimeDataForResource(getSessionSubject(),
scheduleId, start, end, pageControl),
"MeasurementDataService.findCallTimeDataForResource");
}
+
+
+ public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria) {
+ return SerialUtility.prepare(
+
definitionManager.findMeasurementDefinitionsByCriteria(getSessionSubject(), criteria),
+
"MeasurementDataService.findMeasurementDefinintionsByCriteria");
+ }
+
+ public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria) {
+ return SerialUtility.prepare(
+ scheduleManager.findSchedulesByCriteria(getSessionSubject(), criteria),
+ "MeasurementDataService.findMeasurementSchedulesByCriteria");
+ }
}
commit 46a8b0db212a254fa1a014f8dd16ada0aea63acc
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:32:11 2010 -0400
Portlet API refactoring
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index 2e5dcd5..7d208f1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -24,17 +24,19 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
+import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.FavoriteResourcesPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MashupPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet;
/**
* @author Greg Hinkle
@@ -59,19 +61,23 @@ public class PortletFactory {
registeredPortlets.put(GraphPortlet.KEY, GraphPortlet.Factory.INSTANCE);
registeredPortlets.put(TagCloudPortlet.KEY, TagCloudPortlet.Factory.INSTANCE);
+
+ registeredPortlets.put(FavoriteResourcesPortlet.KEY,
FavoriteResourcesPortlet.Factory.INSTANCE);
+
+ registeredPortlets.put(MashupPortlet.KEY, MashupPortlet.Factory.INSTANCE);
+ registeredPortlets.put(MessagePortlet.KEY, MessagePortlet.Factory.INSTANCE);
}
- public static Canvas buildPortlet(StoredPortlet storedPortlet) {
+ public static Portlet buildPortlet(PortletWindow portletWindow, DashboardPortlet
storedPortlet) {
PortletViewFactory viewFactory =
registeredPortlets.get(storedPortlet.getPortletKey());
Canvas canvas = null;
- PortletView view = viewFactory.getInstance();
- view.configure(storedPortlet);
- canvas = (Canvas) view;
+ Portlet view = viewFactory.getInstance();
+ view.configure(portletWindow, storedPortlet);
- return canvas;
+ return view;
}
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 8425ad5..65c237a 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
@@ -21,20 +21,26 @@ package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+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.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
/**
* @author Greg Hinkle
*/
-public class AutodiscoveryPortlet extends ResourceAutodiscoveryView implements
PortletView {
+public class AutodiscoveryPortlet extends ResourceAutodiscoveryView implements Portlet {
public static final String KEY = "Discovery Queue";
- public void configure(StoredPortlet storedPortlet) {
+ public AutodiscoveryPortlet() {
+ super(true);
+ }
+
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
// TODO: Implement this method.
}
@@ -43,13 +49,14 @@ public class AutodiscoveryPortlet extends ResourceAutodiscoveryView
implements P
"for monitoring and management or to ingnore them from further
action.");
}
- public Canvas getSettingsCanvas() {
+ public DynamicForm getCustomSettingsForm() {
return null; // TODO: Implement this method.
}
- public static final class Factory implements PortletViewFactory {
+ public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+
+ public final Portlet getInstance() {
return GWT.create(AutodiscoveryPortlet.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
index c956e88..eb14394 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java
@@ -28,14 +28,15 @@ import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
+import com.smartgwt.client.widgets.form.DynamicForm;
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.VLayout;
import org.rhq.core.domain.criteria.ResourceTypeCriteria;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.measurement.MeasurementConverterClient;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
@@ -46,10 +47,9 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+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.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
@@ -57,25 +57,30 @@ import
org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
/**
* @author Greg Hinkle
*/
-public class PlatformPortletView extends VLayout implements PortletView {
+public class PlatformPortletView extends ListGrid implements Portlet {
private MeasurementDataGWTServiceAsync measurementService =
GWTServiceLookup.getMeasurementDataService();
private ResourceTypeGWTServiceAsync typeService =
GWTServiceLookup.getResourceTypeGWTService();
- private PlatformListGrid listGrid;
-
private HashMap<Integer, ResourceType> types = new HashMap<Integer,
ResourceType>();
private HashMap<Integer, PlatformMetricDefinitions>
platformMetricDefinitionsHashMap = new HashMap<Integer,
PlatformMetricDefinitions>();
public static final String KEY = "Platforms Summary";
public PlatformPortletView() {
+ setShowRecordComponents(true);
+ setShowRecordComponentsByCell(true);
+
+ setDataSource(new PlatformMetricDataSource(this));
+ setInitialCriteria(new Criteria("category",
ResourceCategory.PLATFORM.name()));
prefetch();
+
}
+
private void prefetch() {
ResourceTypeCriteria typeCriteria = new ResourceTypeCriteria();
@@ -99,14 +104,9 @@ public class PlatformPortletView extends VLayout implements
PortletView {
private void buildUI() {
- addMember(new HeaderLabel("Platforms"));
-
- listGrid = new PlatformListGrid();
- listGrid.setDataSource(new PlatformMetricDataSource(this));
- listGrid.setInitialCriteria(new Criteria("category",
ResourceCategory.PLATFORM.name()));
- listGrid.setAutoFetchData(true);
- listGrid.setUseAllDataSourceFields(true);
- listGrid.setAutoFitData(Autofit.HORIZONTAL);
+ setAutoFetchData(true);
+ setUseAllDataSourceFields(true);
+ setAutoFitData(Autofit.HORIZONTAL);
ListGridField nameField = new ListGridField("name", "Name",
250);
nameField.setCellFormatter(new CellFormatter() {
@@ -114,17 +114,16 @@ public class PlatformPortletView extends VLayout implements
PortletView {
return "<a href=\"#Resource/" +
listGridRecord.getAttribute("id") + "\">" + o +
"</a>";
}
});
- listGrid.setFields(nameField);
+ setFields(nameField);
- addMember(listGrid);
- listGrid.getField("icon").setWidth(25);
+ getField("icon").setWidth(25);
- listGrid.hideField("id");
- listGrid.hideField("description");
- listGrid.hideField("pluginName");
- listGrid.hideField("category");
- listGrid.hideField("currentAvailability");
+ hideField("id");
+ hideField("description");
+ hideField("pluginName");
+ hideField("category");
+ hideField("currentAvailability");
}
@@ -157,8 +156,8 @@ public class PlatformPortletView extends VLayout implements
PortletView {
record.setAttribute("memory", percent);
*/
- listGrid.setSortField(1);
- listGrid.refreshFields();
+ setSortField(1);
+ refreshFields();
markForRedraw();
}
});
@@ -198,7 +197,7 @@ public class PlatformPortletView extends VLayout implements
PortletView {
return null;
}
- public void configure(StoredPortlet storedPortlet) {
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
// TODO: Implement this method.
}
@@ -206,89 +205,81 @@ public class PlatformPortletView extends VLayout implements
PortletView {
return new HTMLFlow("This portlet displays information about platforms in
inventory.");
}
- public Canvas getSettingsCanvas() {
+ public DynamicForm getCustomSettingsForm() {
return null; // TODO: Implement this method.
}
- private static class PlatformListGrid extends ListGrid {
-
- private PlatformListGrid() {
- setShowRecordComponents(true);
- setShowRecordComponentsByCell(true);
- }
+ @Override
+ protected Canvas createRecordComponent(ListGridRecord listGridRecord, Integer colNum)
{
- @Override
- protected Canvas createRecordComponent(ListGridRecord listGridRecord, Integer
colNum) {
+ String fieldName = this.getFieldName(colNum);
- String fieldName = this.getFieldName(colNum);
+ try {
+ if (fieldName.equals("cpu")) {
+ if (listGridRecord.getAttribute(CPUMetric.Idle.property) != null) {
+ HLayout bar = new HLayout();
+ bar.setHeight(18);
+ bar.setWidth100();
- try {
- if (fieldName.equals("cpu")) {
- if (listGridRecord.getAttribute(CPUMetric.Idle.property) != null) {
- HLayout bar = new HLayout();
- bar.setHeight(18);
- bar.setWidth100();
+ double value =
listGridRecord.getAttributeAsDouble(CPUMetric.Idle.property);
+ value = 1 - value;
- double value =
listGridRecord.getAttributeAsDouble(CPUMetric.Idle.property);
- value = 1 - value;
+ HTMLFlow text = new HTMLFlow(MeasurementConverterClient.format(value,
MeasurementUnits.PERCENTAGE, true));
+ text.setAutoWidth();
+ bar.addMember(text);
- HTMLFlow text = new
HTMLFlow(MeasurementConverterClient.format(value, MeasurementUnits.PERCENTAGE, true));
- text.setAutoWidth();
- bar.addMember(text);
+ Img first = new Img("availBar/up.png");
+ first.setHeight(18);
+ first.setWidth((value * 100) + "%");
+ bar.addMember(first);
- Img first = new Img("availBar/up.png");
- first.setHeight(18);
- first.setWidth((value * 100) + "%");
- bar.addMember(first);
+ Img second = new Img("availBar/unknown.png");
+ second.setHeight(18);
+ second.setWidth((100 - (value * 100)) + "%");
+ bar.addMember(second);
- Img second = new Img("availBar/unknown.png");
- second.setHeight(18);
- second.setWidth((100 - (value * 100)) + "%");
- bar.addMember(second);
-
-
- return bar;
- }
+ return bar;
+ }
- } else if (fieldName.equals("memory")) {
- if (listGridRecord.getAttribute(MemoryMetric.Total.property) != null)
{
- HLayout bar = new HLayout();
- bar.setHeight(18);
- bar.setWidth100();
- double total =
listGridRecord.getAttributeAsDouble(MemoryMetric.Total.property);
- double value =
listGridRecord.getAttributeAsDouble(MemoryMetric.Used.property);
- double percent = value / total;
+ } else if (fieldName.equals("memory")) {
+ if (listGridRecord.getAttribute(MemoryMetric.Total.property) != null) {
+ HLayout bar = new HLayout();
+ bar.setHeight(18);
+ bar.setWidth100();
- HTMLFlow text = new
HTMLFlow(MeasurementConverterClient.format(percent, MeasurementUnits.PERCENTAGE, true));
- text.setAutoWidth();
- bar.addMember(text);
+ double total =
listGridRecord.getAttributeAsDouble(MemoryMetric.Total.property);
+ double value =
listGridRecord.getAttributeAsDouble(MemoryMetric.Used.property);
+ double percent = value / total;
- Img first = new Img("availBar/up.png");
- first.setHeight(18);
- first.setWidth((percent * 100) + "%");
- bar.addMember(first);
+ HTMLFlow text = new
HTMLFlow(MeasurementConverterClient.format(percent, MeasurementUnits.PERCENTAGE, true));
+ text.setAutoWidth();
+ bar.addMember(text);
- Img second = new Img("availBar/unknown.png");
- second.setHeight(18);
- second.setWidth((100 - (percent * 100)) + "%");
- bar.addMember(second);
+ Img first = new Img("availBar/up.png");
+ first.setHeight(18);
+ first.setWidth((percent * 100) + "%");
+ bar.addMember(first);
+ Img second = new Img("availBar/unknown.png");
+ second.setHeight(18);
+ second.setWidth((100 - (percent * 100)) + "%");
+ bar.addMember(second);
- return bar;
- }
+ return bar;
}
- return null;
- } catch (Exception e) {
- // expected until first data loaded
- return null;
}
+ return null;
+ } catch (Exception e) {
+ // expected until first data loaded
+ return null;
}
+
}
@@ -357,7 +348,7 @@ public class PlatformPortletView extends VLayout implements
PortletView {
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(PlatformPortletView.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
index b3a302c..6cb001b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
@@ -21,20 +21,27 @@ package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.enterprise.gui.coregui.client.alert.AlertsView;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+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.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
/**
* @author Greg Hinkle
*/
-public class RecentAlertsPortlet extends AlertsView implements PortletView {
+public class RecentAlertsPortlet extends AlertsView implements Portlet {
public static final String KEY = "Recent Alerts";
- public void configure(StoredPortlet storedPortlet) {
+ public RecentAlertsPortlet() {
+ setShowHeader(false);
+ setShowFooter(false);
+ }
+
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
// TODO: Implement this method.
}
@@ -42,14 +49,14 @@ public class RecentAlertsPortlet extends AlertsView implements
PortletView {
return new HTMLFlow("Displays recent alerts fired on resources visible to
the current user login.");
}
- public Canvas getSettingsCanvas() {
+ public DynamicForm getCustomSettingsForm() {
return null; // TODO: Implement this method.
}
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(RecentAlertsPortlet.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java
index c3a825a..08b611c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java
@@ -26,22 +26,28 @@ package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tree.TreeGrid;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+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.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
-public class RecentlyAddedView extends VLayout implements PortletView {
+public class RecentlyAddedView extends VLayout implements Portlet {
public static final String KEY = "Recently Added Portlet";
+ private boolean simple = true;
+
+ public RecentlyAddedView() {
+ }
@Override
protected void onInit() {
@@ -66,13 +72,15 @@ public class RecentlyAddedView extends VLayout implements PortletView
{
treeGrid.setFields(resourceNameField, timestampField);
- addMember(new HeaderLabel("Recently Added Resources"));
+ if (!simple) {
+ addMember(new HeaderLabel("Recently Added Resources"));
+ }
addMember(treeGrid);
}
- public void configure(StoredPortlet storedPortlet) {
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
}
@@ -80,14 +88,14 @@ public class RecentlyAddedView extends VLayout implements PortletView
{
return new HTMLFlow("This portlet displays resources that have recently been
imported into the inventory.");
}
- public Canvas getSettingsCanvas() {
+ public DynamicForm getCustomSettingsForm() {
return null;
}
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(RecentlyAddedView.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryView.java
index f3c8354..2a1a341 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryView.java
@@ -32,23 +32,23 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.HeaderItem;
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.dashboard.DashboardPortlet;
import org.rhq.core.domain.resource.InventorySummary;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+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.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceBossGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView;
-public class InventorySummaryView extends VLayout implements PortletView {
+public class InventorySummaryView extends VLayout implements Portlet {
private ResourceBossGWTServiceAsync resourceBossService =
GWTServiceLookup.getResourceBossService();
@@ -65,9 +65,9 @@ public class InventorySummaryView extends VLayout implements PortletView
{
form = new DynamicForm();
List<FormItem> formItems = new ArrayList<FormItem>();
- HeaderItem headerItem = new HeaderItem("header");
- headerItem.setValue("Inventory Summary");
- formItems.add(headerItem);
+// HeaderItem headerItem = new HeaderItem("header");
+// headerItem.setValue("Inventory Summary");
+// formItems.add(headerItem);
StaticTextItem platformTotal =
createSummaryRow("platformTotal", "Platform Total",
summary.getPlatformCount());
@@ -118,7 +118,7 @@ public class InventorySummaryView extends VLayout implements
PortletView {
return item;
}
- public void configure(StoredPortlet storedPortlet) {
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
// TODO: Implement this method.
}
@@ -126,13 +126,13 @@ public class InventorySummaryView extends VLayout implements
PortletView {
return null; // TODO: Implement this method.
}
- public Canvas getSettingsCanvas() {
+ public DynamicForm getCustomSettingsForm() {
return null; // TODO: Implement this method.
}
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(InventorySummaryView.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
index 7f21a81..8521be4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
@@ -24,42 +24,38 @@ package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.HTMLFlow;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+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.store.StoredPortlet;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
/**
* @author Greg Hinkle
*/
-public class TagCloudPortlet extends VLayout implements PortletView {
+public class TagCloudPortlet extends TagCloudView implements Portlet {
public static final String KEY = "TagCloud";
- @Override
- protected void onInit() {
- super.onInit();
- addMember(new TagCloudView());
+ public TagCloudPortlet() {
+ super(true);
}
- public void configure(StoredPortlet storedPortlet) {
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
// TODO: Implement this method.
}
public Canvas getHelpCanvas() {
- return null; // TODO: Implement this method.
- }
-
- public Canvas getSettingsCanvas() {
- return null; // TODO: Implement this method.
+ return new HTMLFlow("The <b>Tag Cloud</b> portlet displays the
relative tag counts in the system visible " +
+ "to the current user.");
}
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(TagCloudPortlet.class);
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
new file mode 100644
index 0000000..429e6d7
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
@@ -0,0 +1,79 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util;
+
+import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.types.ContentsType;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.HTMLPane;
+
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.ConfigurablePortlet;
+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.PortletWindow;
+
+/**
+ * @author Greg Hinkle
+ */
+public class MessagePortlet extends HTMLPane implements ConfigurablePortlet {
+
+ public static final String KEY = "Message";
+
+ public MessagePortlet() {
+ setContentsType(ContentsType.PAGE);
+ }
+
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+ String contents =
storedPortlet.getConfiguration().getSimpleValue("message",null);
+ if (contents != null) {
+ setContents(contents);
+ } else {
+ setContents("<i>Message not yet configured, click the settings
button to setup this portlet.");
+ }
+ }
+
+ public Canvas getHelpCanvas() {
+ return new HTMLFlow("This portlet can display an HTML message on the
dashboard.");
+ }
+
+ public ConfigurationDefinition getConfigurationDefinition() {
+ ConfigurationDefinition definition = new
ConfigurationDefinition("MessagePortlet Configuration", "The configuration
settings for the message portlet.");
+
+ definition.put(new PropertyDefinitionSimple("message",
"Message", true, PropertySimpleType.LONG_STRING));
+
+ return definition;
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ public final Portlet getInstance() {
+ return GWT.create(MessagePortlet.class);
+ }
+ }
+}
\ No newline at end of file
commit 5fa7f5c59365fe16ef81421ae25480260f25fdcb
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:31:34 2010 -0400
new mashup portlet to include external content
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
new file mode 100644
index 0000000..e4d4bef
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
@@ -0,0 +1,87 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util;
+
+import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.types.ContentsType;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.HTMLPane;
+
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.ConfigurablePortlet;
+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.PortletWindow;
+
+/**
+ * @author Greg Hinkle
+ */
+public class MashupPortlet extends HTMLPane implements ConfigurablePortlet {
+
+ public static final String KEY = "Mashup";
+
+ public MashupPortlet() {
+ setContentsType(ContentsType.PAGE);
+
+ }
+
+ @Override
+ public void transformHTML(String s) {
+ super.transformHTML(s);
+
+
+ }
+
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+ String url =
storedPortlet.getConfiguration().getSimpleValue("address",null);
+ if (url != null) {
+ setContentsURL(url);
+ } else {
+ setContents("<i>Page address not yet configured, click the
settings button to setup this portlet.");
+ }
+ }
+
+ public Canvas getHelpCanvas() {
+ return new HTMLFlow("This portlet can include a web page via an HTTP request
into an iframe on the dashboard.");
+ }
+
+ public ConfigurationDefinition getConfigurationDefinition() {
+ ConfigurationDefinition definition = new
ConfigurationDefinition("MashupPorlet Configuration", "The configuration
settings for the mashup portlet.");
+
+ definition.put(new PropertyDefinitionSimple("address", "Web
Address", true, PropertySimpleType.STRING));
+
+ return definition;
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ public final Portlet getInstance() {
+ return GWT.create(MashupPortlet.class);
+ }
+ }
+}
commit 22f982b78e76227052e09e818f8cbe6883871b61
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:31:16 2010 -0400
new favorite resources portlet
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
new file mode 100644
index 0000000..99fc8f6
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
@@ -0,0 +1,103 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource;
+
+import java.util.Set;
+
+import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent;
+import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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.PortletWindow;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
+
+/**
+ * @author Greg Hinkle
+ */
+public class FavoriteResourcesPortlet extends ResourceSearchView implements Portlet {
+
+ public static final String KEY = "Favorite Resources";
+
+ public static final String CFG_TABLE_PREFS = "tablePreferences";
+
+ private DashboardPortlet storedPortlet;
+ private PortletWindow portletWindow;
+
+ public FavoriteResourcesPortlet() {
+ setShowHeader(false);
+ setShowFooter(false);
+
+ Set<Integer> favoriteIds =
CoreGUI.getUserPreferences().getFavoriteResources();
+
+ Integer[] favArray = favoriteIds.toArray(new Integer[favoriteIds.size()]);
+
+
+ Criteria criteria = new Criteria();
+ criteria.addCriteria("resourceIds", favArray );
+
+ refresh(criteria);
+
+ getListGrid().addFieldStateChangedHandler(new FieldStateChangedHandler() {
+ public void onFieldStateChanged(FieldStateChangedEvent
fieldStateChangedEvent) {
+ String state = getListGrid().getViewState();
+
+ storedPortlet.getConfiguration().put(new
PropertySimple(CFG_TABLE_PREFS,state));
+ portletWindow.save();
+ }
+ });
+ }
+
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+ this.portletWindow = portletWindow;
+ this.storedPortlet = storedPortlet;
+
+ if (storedPortlet.getConfiguration().getSimple(CFG_TABLE_PREFS) != null) {
+ String state =
storedPortlet.getConfiguration().getSimple(CFG_TABLE_PREFS).getStringValue();
+ getListGrid().setViewState(state);
+ }
+
+
+ }
+
+ public Canvas getHelpCanvas() {
+ return new HTMLFlow("This portlet displays your favorite resources");
+ }
+
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ public final Portlet getInstance() {
+ return GWT.create(FavoriteResourcesPortlet.class);
+ }
+ }
+
+}
commit 9c6dcaae76a6e860e488c72f74f18da83bc0f24c
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:31:05 2010 -0400
Configurable graph portlet
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
index 425cd42..b540699 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
@@ -19,41 +19,137 @@
package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph;
import com.google.gwt.core.client.GWT;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.Label;
+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.SelectItem;
+import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+import
org.rhq.enterprise.gui.coregui.client.components.lookup.ResourceLookupComboBoxItem;
+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;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.ResourceScheduledMetricDatasource;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.SmallGraphView;
/**
* @author Greg Hinkle
*/
-public class GraphPortlet extends SmallGraphView implements PortletView {
+public class GraphPortlet extends SmallGraphView implements CustomSettingsPortlet {
public static final String KEY = "Resource Graph";
- public GraphPortlet() {
+ PortletWindow portletWindow;
+ DashboardPortlet storedPortlet;
+ public GraphPortlet() {
+ setOverflow(Overflow.HIDDEN);
}
- public void configure(StoredPortlet storedPortlet) {
-
setResourceId(Integer.parseInt(storedPortlet.getProperties().get("resourceId")));
-
setDefinitionId(Integer.parseInt(storedPortlet.getProperties().get("definitionId")));
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+ this.portletWindow = portletWindow;
+ this.storedPortlet = storedPortlet;
+ if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
+
setResourceId(storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue());
+
setDefinitionId(storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue());
+ }
}
public Canvas getHelpCanvas() {
- return null; // TODO: Implement this method.
+ return new HTMLFlow("<h3>Graph Portlet</h3>This Portlet supports
the graphing of a resource metric.");
+ }
+
+ public ConfigurationDefinition getConfigurationDefinition() {
+ ConfigurationDefinition def = new ConfigurationDefinition("Graph
Config", "Configuration of the graph portlet");
+ def.put(new PropertyDefinitionSimple("resourceId", "The resource
to graph", true, PropertySimpleType.INTEGER));
+ def.put(new PropertyDefinitionSimple("definitionId", "The metric
definition id to graph", true, PropertySimpleType.INTEGER));
+
+ return def;
}
- public Canvas getSettingsCanvas() {
- return null; // TODO: Implement this method.
+
+
+ @Override
+ protected void onDraw() {
+ removeMembers(getMembers());
+ if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
+ super.onDraw();
+ } else {
+ addMember(new Label("This graph is unconfigured, click the settings
button to configure."));
+ }
+ }
+
+ public DynamicForm getCustomSettingsForm() {
+ final DynamicForm form = new DynamicForm();
+
+
+ final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new
ResourceLookupComboBoxItem("resourceId", "Resource");
+ resourceLookupComboBoxItem.setWidth(300);
+
+ final SelectItem metric = new SelectItem("definitionId",
"Metric") {
+ @Override
+ protected Criteria getPickListFilterCriteria() {
+ Criteria criteria = new Criteria();
+
+ if (resourceLookupComboBoxItem.getValue() != null) {
+ int resourceId = (Integer) resourceLookupComboBoxItem.getValue();
+ criteria.addCriteria("resourceId", resourceId);
+ }
+ return criteria;
+ }
+ };
+
+ metric.setWidth(300);
+ metric.setValueField("id");
+ metric.setDisplayField("displayName");
+ metric.setOptionDataSource(new ResourceScheduledMetricDatasource());
+
+
+ resourceLookupComboBoxItem.addChangedHandler(new
com.smartgwt.client.widgets.form.fields.events.ChangedHandler() {
+ public void onChanged(ChangedEvent
+ event) {
+
+ if (form.getValue("resourceId") instanceof Integer) {
+ metric.fetchData();
+ form.clearValue("defininitionId");
+ }
+ }
+ });
+
+ if (storedPortlet.getConfiguration().getSimple("resourceId") != null)
{
+ form.setValue("resourceId",
storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue());
+ form.setValue("definitionId",
storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue());
+ }
+
+ form.setFields(resourceLookupComboBoxItem, metric);
+
+ form.addSubmitValuesHandler(new SubmitValuesHandler() {
+ public void onSubmitValues(SubmitValuesEvent submitValuesEvent) {
+ storedPortlet.getConfiguration().put(new
PropertySimple("resourceId", form.getValue("resourceId")));
+ storedPortlet.getConfiguration().put(new
PropertySimple("definitionId", form.getValue("definitionId")));
+
+ }
+ });
+
+ return form;
}
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
- public final PortletView getInstance() {
+ public final Portlet getInstance() {
return GWT.create(GraphPortlet.class);
}
}
commit feeeb2d38f8a0e00455f61782f8c5bfe542c6688
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:30:49 2010 -0400
New Dashboard persistence implementation utilities
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardManager.java
new file mode 100644
index 0000000..bf53761
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardManager.java
@@ -0,0 +1,58 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.store;
+
+import java.util.HashSet;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+/**
+ * @author Greg Hinkle
+ */
+public class DashboardManager {
+
+
+ private static DashboardGWTServiceAsync dashboardService =
GWTServiceLookup.getDashboardService();
+
+
+ public static void storeDashboard(final Dashboard dashboard) {
+
+ dashboardService.storeDashboard(dashboard, new AsyncCallback<Dashboard>()
{
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to store dashboard to
server " + dashboard.getName() ,caught);
+ }
+
+ public void onSuccess(Dashboard result) {
+ CoreGUI.getMessageCenter().notify(new Message("Saved dashboard
" + result.getName(), Message.Severity.Info));
+ }
+ });
+
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardStore.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardStore.java
deleted file mode 100644
index 1067359..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/DashboardStore.java
+++ /dev/null
@@ -1,58 +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.dashboard.store;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.util.preferences.UserPreferences;
-
-/**
- * @author Greg Hinkle
- */
-public class DashboardStore {
-
- public static final String STORE_KEY = ".dashboards";
-
- private UserPreferences preferences;
-
-
- private HashSet<StoredDashboard> storedDashboards = new
HashSet<StoredDashboard>();
-
-
- public DashboardStore() {
-
- preferences = CoreGUI.getUserPreferences();
- load();
-
- }
-
-
- public void load() {
-// Set<Integer> dashboardIds =
preferences.getPreferenceAsIntegerSet(STORE_KEY);
-
-
- }
-
-
- public Set<StoredDashboard> getStoredDashboards() {
- return storedDashboards;
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredDashboard.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredDashboard.java
deleted file mode 100644
index f6a9999..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredDashboard.java
+++ /dev/null
@@ -1,77 +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.dashboard.store;
-
-import java.util.ArrayList;
-
-/**
- * @author Greg Hinkle
- */
-public class StoredDashboard {
-
- public static final String STORE_KEY = ".dashboard.";
- private String id;
-
- private String name;
-
- private int columns;
-
- private String[] columnWidths;
-
- private ArrayList<ArrayList<StoredPortlet>> portlets = new
ArrayList<ArrayList<StoredPortlet>>();
-
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public int getColumns() {
- return columns;
- }
-
-
- public ArrayList<ArrayList<StoredPortlet>> getPortlets() {
- return portlets;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setColumns(int columns) {
- this.columns = columns;
- }
-
-
- public String[] getColumnWidths() {
- return columnWidths;
- }
-
- public void setColumnWidths(String... columnWidths) {
- this.columnWidths = columnWidths;
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredPortlet.java
deleted file mode 100644
index e684f42..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/store/StoredPortlet.java
+++ /dev/null
@@ -1,109 +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.dashboard.store;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Greg Hinkle
- */
-public class StoredPortlet {
-
- public static final String STORE_KEY = ".dashboardPortlet.";
- private String id;
-
-
- private String portletKey;
- private String name;
-
- private int column;
- private int index;
-
- private int height = 300;
-
- private Map<String,String> properties = new HashMap<String, String>();
-
-
- public StoredPortlet() {
- }
-
- public StoredPortlet(String name, String portletKey, int height) {
- this.name = name;
- this.portletKey = portletKey;
- this.height = height;
- }
-
- public String getId() {
- return id;
- }
-
- public String getPortletKey() {
- return portletKey;
- }
-
- public String getName() {
- return name;
- }
-
- public int getColumn() {
- return column;
- }
-
- public int getIndex() {
- return index;
- }
-
- public int getHeight() {
- return height;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setPortletKey(String portletKey) {
- this.portletKey = portletKey;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setColumn(int column) {
- this.column = column;
- }
-
- public void setIndex(int index) {
- this.index = index;
- }
-
- public void setHeight(int height) {
- this.height = height;
- }
-
- public void setProperty(String name, String value) {
- properties.put(name, value);
- }
-
-}
commit 3598a98701f39ff3d0772c1327375b039dba4216
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:30:17 2010 -0400
New Dashboard persistence implementation
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/ConfigurablePortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/ConfigurablePortlet.java
new file mode 100644
index 0000000..e96f720
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/ConfigurablePortlet.java
@@ -0,0 +1,34 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard;
+
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+
+/**
+ * @author Greg Hinkle
+ */
+public interface ConfigurablePortlet extends Portlet {
+
+ ConfigurationDefinition getConfigurationDefinition();
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/CustomSettingsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/CustomSettingsPortlet.java
new file mode 100644
index 0000000..db5b211
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/CustomSettingsPortlet.java
@@ -0,0 +1,34 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard;
+
+import com.smartgwt.client.widgets.form.DynamicForm;
+
+/**
+ * @author Greg Hinkle
+ */
+public interface CustomSettingsPortlet extends Portlet {
+
+ DynamicForm getCustomSettingsForm();
+
+}
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 65099f7..6563552 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
@@ -18,52 +18,68 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
-import java.util.ArrayList;
+import java.util.HashSet;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.AnimationCallback;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.CanvasItem;
+import com.smartgwt.client.widgets.form.fields.ColorPickerItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
+import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.menu.IMenuButton;
import com.smartgwt.client.widgets.menu.Menu;
-import com.smartgwt.client.widgets.menu.MenuButton;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.ItemClickEvent;
import com.smartgwt.client.widgets.menu.events.ItemClickHandler;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredDashboard;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
*/
public class DashboardView extends VLayout {
- StoredDashboard storedDashboard;
+ private DashboardsView dashboardsView;
+ private Dashboard storedDashboard;
boolean editMode = false;
PortalLayout portalLayout;
- DynamicForm form;
+ DynamicForm editForm;
IMenuButton addPortlet;
+ HashSet<PortletWindow> portlets = new HashSet<PortletWindow>();
- public DashboardView(StoredDashboard storedDashboard) {
+
+ public DashboardView(DashboardsView dashboardsView, Dashboard storedDashboard) {
+ this.dashboardsView = dashboardsView;
this.storedDashboard = storedDashboard;
setOverflow(Overflow.AUTO);
setPadding(5);
}
+ @Override
+ protected void onInit() {
+ super.onInit();
+ buildEditForm();
+ }
+
public void redraw() {
for (Canvas c : getChildren()) {
- c.destroy();
+ c.removeFromParent();
}
buildPortlets();
@@ -79,8 +95,9 @@ public class DashboardView extends VLayout {
setWidth100();
setHeight100();
+
setBackgroundColor(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND,
"white"));
- portalLayout = new PortalLayout(storedDashboard.getColumns());
+ portalLayout = new PortalLayout(this, storedDashboard.getColumns());
portalLayout.setWidth100();
portalLayout.setHeight100();
@@ -88,13 +105,31 @@ public class DashboardView extends VLayout {
loadPortlets();
- form = new DynamicForm();
- form.setAutoWidth();
- form.setNumCols(7);
+ addMember(editForm);
+ editForm.hide();
+ addMember(portalLayout);
+
+ }
+
+
+ private DynamicForm buildEditForm() {
+ editForm = new DynamicForm();
+ editForm.setAutoWidth();
+ editForm.setNumCols(9);
+
+ TextItem nameItem = new TextItem("name","Dashboard Name");
+ nameItem.setValue(storedDashboard.getName());
+ nameItem.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ storedDashboard.setName((String) changedEvent.getValue());
+ save();
+ dashboardsView.updateNames();
+ }
+ });
final StaticTextItem numColItem = new StaticTextItem();
numColItem.setTitle("Columns");
- numColItem.setValue(portalLayout.getMembers().length);
+ numColItem.setValue(storedDashboard.getColumns());
ButtonItem addColumn = new ButtonItem("addColumn", "Add
Column");
// addColumn.setIcon("silk/application_side_expand.png");
@@ -106,8 +141,9 @@ public class DashboardView extends VLayout {
addColumn.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
event) {
portalLayout.addMember(new PortalColumn());
- numColItem.setValue(portalLayout.getMembers().length);
-
+ numColItem.setValue(storedDashboard.getColumns() + 1);
+ storedDashboard.setColumns(storedDashboard.getColumns() + 1);
+ save();
}
});
@@ -127,22 +163,14 @@ public class DashboardView extends VLayout {
Canvas lastMember = canvases[numMembers - 1];
portalLayout.removeMember(lastMember);
numColItem.setValue(numMembers - 1);
+ storedDashboard.setColumns(storedDashboard.getColumns() - 1);
+ save();
}
-
+ save();
}
});
- final ButtonItem editButton = new ButtonItem("editable", editMode ?
"View Mode" : "Edit Mode");
- editButton.setAutoFit(true);
- editButton.setStartRow(false);
- editButton.setEndRow(false);
- editButton.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
clickEvent) {
- editMode = !editMode;
- redraw();
- }
- });
Menu addPorletMenu = new Menu();
@@ -150,10 +178,8 @@ public class DashboardView extends VLayout {
addPorletMenu.addItem(new MenuItem(portletName));
}
-
addPortlet = new IMenuButton("Add Portlet", addPorletMenu);
-
// addPortlet = new ButtonItem("addPortlet", "Add Portlet");
addPortlet.setIcon("[skin]/images/actions/add.png");
addPortlet.setAutoFit(true);
@@ -171,81 +197,75 @@ public class DashboardView extends VLayout {
addCanvas.setStartRow(false);
addCanvas.setEndRow(false);
+ ColorPickerItem picker = new ColorPickerItem();
+
+ picker.setTitle("Background");
+ picker.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ Object v = changedEvent.getValue();
+ System.out.println("color chagned to " + v);
+ setBackgroundColor(String.valueOf(v));
+ storedDashboard.getConfiguration().put(new
PropertySimple(Dashboard.CFG_BACKGROUND,String.valueOf(v)));
+ save();
+ }
+ });
+
picker.setValue(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND,"white"));
- if (editMode) {
- form.setItems(numColItem, addCanvas, addColumn, removeColumn, editButton);
- } else {
- form.setItems(editButton);
- }
- addMember(form);
- addMember(portalLayout);
+ editForm.setItems(nameItem, numColItem, addCanvas, picker, addColumn,
removeColumn);
+ return editForm;
}
+
private void loadPortlets() {
int col = 0;
- for (ArrayList<StoredPortlet> column : storedDashboard.getPortlets()) {
+ for (int i = 0; i < storedDashboard.getColumns(); i++) {
- for (StoredPortlet storedPortlet : column) {
- Canvas portalCanvas = PortletFactory.buildPortlet(storedPortlet);
-
- final Portlet portlet = new Portlet(editMode);
- portlet.addItem(portalCanvas);
+ for (DashboardPortlet storedPortlet : storedDashboard.getPortlets(i)) {
+ final PortletWindow portlet = new PortletWindow(this, storedPortlet);
+ portlets.add(portlet);
portlet.setTitle(storedPortlet.getName());
portlet.setHeight(storedPortlet.getHeight());
portlet.setVisible(true);
-// newPortlet.setHelpClickHandler(handler);
-// newPortlet.setSettingsClickHandler(handler);
-
portalLayout.addPortlet(portlet, col);
}
col++;
}
-
-
}
private void addPortlet(String portletName) {
- final Portlet newPortlet = new Portlet(true);
+ DashboardPortlet storedPortlet = new DashboardPortlet(portletName, portletName,
250);
- StoredPortlet storedPortlet = new StoredPortlet(portletName, portletName, 250);
- Canvas canvas = PortletFactory.buildPortlet(storedPortlet);
+ final PortletWindow newPortlet = new PortletWindow(this, storedPortlet);
+ portlets.add(newPortlet);
- newPortlet.setTitle(portletName);
+ storedDashboard.addPortlet(storedPortlet, 0, 0);
- ClickHandler handler = new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- PortletSettingsWindow settingsWindow = new
PortletSettingsWindow("Recently Added Resources");
- settingsWindow.show();
- }
- };
+ newPortlet.setTitle(portletName);
- newPortlet.addItem(canvas);
newPortlet.setHeight(350);
newPortlet.setVisible(false);
- newPortlet.setHelpClickHandler(handler);
- newPortlet.setSettingsClickHandler(handler);
- PortalColumn column = portalLayout.addPortlet(newPortlet);
+ PortalColumn column = portalLayout.addPortlet(newPortlet, 0);
// also insert a blank spacer element, which will trigger the built-in
// animateMembers layout animation
final LayoutSpacer placeHolder = new LayoutSpacer();
- placeHolder.setRect(newPortlet.getRect());
- column.addMember(placeHolder, 0); // add to top
+// placeHolder.setRect(newPortlet.getRect());
+ column.addMember(placeHolder); // add to top
// create an outline around the clicked button
final Canvas outline = new Canvas();
- outline.setLeft(form.getAbsoluteLeft() + addPortlet.getLeft());
- outline.setTop(form.getAbsoluteTop());
+ outline.setLeft(editForm.getAbsoluteLeft() + addPortlet.getLeft());
+ outline.setTop(editForm.getAbsoluteTop());
outline.setWidth(addPortlet.getWidth());
outline.setHeight(addPortlet.getHeight());
outline.setBorder("2px solid 8289A6");
@@ -262,5 +282,61 @@ public class DashboardView extends VLayout {
newPortlet.show();
}
}, 750);
+ save();
+ }
+
+ public void save() {
+ GWTServiceLookup.getDashboardService().storeDashboard(storedDashboard, new
AsyncCallback<Dashboard>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to save dashboard to
server", caught);
+ }
+
+ public void onSuccess(Dashboard result) {
+ CoreGUI.getMessageCenter().notify(new Message("Saved dashboard
" + result.getName() + " to server", Message.Severity.Info));
+ storedDashboard = result;
+
+ updateConfigs(result);
+ }
+ });
+ }
+
+ private void updateConfigs(Dashboard result) {
+ for (PortletWindow portletWindow : portlets) {
+ for (DashboardPortlet portlet : result.getPortlets()) {
+ if (portletWindow.getDashboardPortlet().getId() == portlet.getId()) {
+
portletWindow.getDashboardPortlet().setConfiguration(portlet.getConfiguration());
+ }
+ }
+ }
+ }
+
+ public void delete() {
+
GWTServiceLookup.getDashboardService().removeDashboard(this.storedDashboard.getId(), new
AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Successfully deleted
dashboard " + storedDashboard.getName(), Message.Severity.Info));
+ }
+ });
+ }
+
+ public void resize() {
+ portalLayout.resize();
+ }
+
+ public Dashboard getDashboard() {
+ return storedDashboard;
+ }
+
+ public void setEditMode(boolean editMode) {
+ this.editMode = editMode;
+ if (editMode) {
+ this.editForm.show();
+ } else {
+ this.editForm.hide();
+ }
+ markForRedraw();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 1f3695b..37b0880 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -1,51 +1,83 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2009 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.
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
*
* 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.
+ * GNU General Public License and the GNU Lesser 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.
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
-import java.util.ArrayList;
+import java.util.List;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.util.BooleanCallback;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.IButton;
+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.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
-
-import org.rhq.core.domain.resource.InventorySummary;
+import com.smartgwt.client.widgets.tab.events.CloseClickHandler;
+import com.smartgwt.client.widgets.tab.events.TabCloseClickEvent;
+import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
+import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.dashboard.Dashboard;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.DashboardStore;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredDashboard;
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MashupPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet;
+import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
/**
* @author Greg Hinkle
*/
-public class DashboardsView extends VLayout {
+public class DashboardsView extends VLayout implements BookmarkableView {
private TabSet tabSet;
- private DashboardStore dashboardStore;
+ private IButton editButton;
+
+ private boolean editMode = false;
+
+ private List<Dashboard> dashboards;
+
+ private DashboardView selectedDashboardView;
+ private Dashboard selectedDashboard;
+
+ private DashboardGWTServiceAsync dashboardService =
GWTServiceLookup.getDashboardService();
+
+ private String selectedTab;
public DashboardsView() {
setOverflow(Overflow.AUTO);
@@ -59,80 +91,216 @@ public class DashboardsView extends VLayout {
protected void onInit() {
super.onInit();
+ dashboardService.findDashboardsForSubject(new
AsyncCallback<List<Dashboard>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load user
dashboards", caught);
+ }
+
+ public void onSuccess(List<Dashboard> result) {
+ if (result.isEmpty()) {
+ result.add(getDefaultDashboard());
+ }
+ updateDashboards(result);
+ }
+ });
+ }
+
+ private void updateDashboards(List<Dashboard> dashboards) {
+ removeMembers(getMembers());
+ this.dashboards = dashboards;
+
+
tabSet = new TabSet();
+
tabSet.setWidth100();
tabSet.setHeight100();
- dashboardStore = new DashboardStore();
+ tabSet.setCanCloseTabs(true);
+
- dashboardStore.getStoredDashboards().add(getDefaultDashboard());
+ editButton = new IButton(editMode ? "View Mode" : "Edit
Mode");
+ editButton.setAutoFit(true);
+ editButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ editMode = !editMode;
+ editButton.setTitle(editMode ? "View Mode" : "Edit
Mode");
+ selectedDashboardView.setEditMode(editMode);
+ }
+ });
- for (StoredDashboard dashboard : dashboardStore.getStoredDashboards()) {
- DashboardView dashboardView = new DashboardView(dashboard);
+ final IButton newDashboardButton = new IButton("New Dashboard");
+ newDashboardButton.setAutoFit(true);
+ newDashboardButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ addNewDashboard();
+ }
+ });
+
+ HLayout buttons = new HLayout(5);
+ buttons.addMember(editButton);
+ buttons.addMember(newDashboardButton);
+
+ tabSet.setTabBarControls(buttons);
+
+
+ tabSet.addTabSelectedHandler(new TabSelectedHandler() {
+ public void onTabSelected(TabSelectedEvent tabSelectedEvent) {
+ History.newItem("Dashboard/" +
tabSelectedEvent.getTab().getTitle(), false);
+ selectedDashboardView = (DashboardView)
tabSelectedEvent.getTab().getPane();
+ selectedDashboard = selectedDashboardView.getDashboard();
+ selectedDashboardView.setEditMode(editMode);
+ }
+ });
+
+ for (Dashboard dashboard : dashboards) {
+ DashboardView dashboardView = new DashboardView(this, dashboard);
Tab tab = new Tab(dashboard.getName());
tab.setPane(dashboardView);
+ tab.setCanClose(true);
+
tabSet.addTab(tab);
+ if (dashboard.getName().equals(selectedTab)) {
+ tabSet.selectTab(tab);
+ }
}
+ tabSet.addCloseClickHandler(new CloseClickHandler() {
+ public void onCloseClick(final TabCloseClickEvent tabCloseClickEvent) {
+ final DashboardView dashboardView = (DashboardView)
tabCloseClickEvent.getTab().getPane();
+ SC.ask("Are you sure you want to delete [" +
tabCloseClickEvent.getTab().getTitle() + "]?", new BooleanCallback() {
+ public void execute(Boolean aBoolean) {
+ if (aBoolean) {
+ dashboardView.delete();
+ } else {
+ tabCloseClickEvent.cancel();
+ }
+ }
+ });
+ }
+ });
+
addMember(tabSet);
+
}
- protected StoredDashboard getDefaultDashboard() {
+ protected Dashboard getDefaultDashboard() {
- StoredDashboard dashboard = new StoredDashboard();
+ Dashboard dashboard = new Dashboard();
dashboard.setName("Default Dashboard");
dashboard.setColumns(2);
- dashboard.setColumnWidths("30%","70%");
+ dashboard.setColumnWidths("30%", "70%");
+ dashboard.getConfiguration().put(new
PropertySimple(Dashboard.CFG_BACKGROUND,"#F1F2F3"));
- ArrayList<StoredPortlet> col1 = new ArrayList<StoredPortlet>();
- ArrayList<StoredPortlet> col2 = new ArrayList<StoredPortlet>();
+ DashboardPortlet summary = new DashboardPortlet("Inventory Summary",
InventorySummaryView.KEY, 230);
+ dashboard.addPortlet(summary, 0, 0);
+ DashboardPortlet tagCloud = new DashboardPortlet("Tag Cloud",
TagCloudPortlet.KEY, 200);
+ dashboard.addPortlet(tagCloud, 0, 1);
+ // Experimental
+// StoredPortlet platformSummary = new StoredPortlet("Platform Summary",
PlatformPortletView.KEY, 300);
+// col2.add(platformSummary);
- StoredPortlet summary = new StoredPortlet("Inventory Summary",
InventorySummaryView.KEY, 250);
- col1.add(summary);
+ DashboardPortlet welcome = new DashboardPortlet("Welcome To RHQ",
MessagePortlet.KEY, 180);
+ welcome.getConfiguration().put(new
PropertySimple("message","<h1>Welcome to RHQ</h1>\n" +
+ "<p>The RHQ project 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>"));
+ dashboard.addPortlet(welcome, 1, 0);
+
+ DashboardPortlet news = new DashboardPortlet("RHQ News",
MashupPortlet.KEY, 320);
+ news.getConfiguration().put(new PropertySimple("address",
"http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
+ dashboard.addPortlet(news, 1, 1);
+//
+ DashboardPortlet discoveryQueue = new DashboardPortlet("Discovery
Queue", AutodiscoveryPortlet.KEY, 250);
+ dashboard.addPortlet(discoveryQueue, 1, 2);
- StoredPortlet tagCloud = new StoredPortlet("Tag Cloud",
TagCloudPortlet.KEY, 250);
- col1.add(tagCloud);
- StoredPortlet graph = new StoredPortlet("ghinkle (MAC OS X) CPU",
GraphPortlet.KEY, 250);
- graph.setProperty("resourceId","10001");
- graph.setProperty("definitionId","10100");
- col1.add(graph);
+ DashboardPortlet recentAlerts = new DashboardPortlet("Recent Alerts",
RecentAlertsPortlet.KEY, 250);
+ dashboard.addPortlet(recentAlerts, 1, 3);
- StoredPortlet graphTwo = new StoredPortlet("JBoss AS Txn / Min",
GraphPortlet.KEY, 250);
- graphTwo.setProperty("resourceId","10003");
- graphTwo.setProperty("definitionId","10916");
- col1.add(graphTwo);
+ DashboardPortlet recentlyAdded = new DashboardPortlet("Recently Added
Resources", RecentlyAddedView.KEY, 250);
+ dashboard.addPortlet(recentlyAdded, 1, 4);
+ return dashboard;
+ }
- // Experimental
-// StoredPortlet platformSummary = new StoredPortlet("Platform Summary",
PlatformPortletView.KEY, 300);
-// col2.add(platformSummary);
-//
- StoredPortlet discoveryQueue = new StoredPortlet("Discovery Queue",
AutodiscoveryPortlet.KEY, 250);
- col2.add(discoveryQueue);
- StoredPortlet recentAlerts = new StoredPortlet("Recent Alerts",
RecentAlertsPortlet.KEY, 250);
- col2.add(recentAlerts);
+ public void addNewDashboard() {
- StoredPortlet recentlyAdded = new StoredPortlet("Recently Added
Resources", RecentlyAddedView.KEY, 250);
- col2.add(recentlyAdded);
+ Dashboard dashboard = new Dashboard();
+ dashboard.setName("Dashboard");
+ int i = 1;
+ while (true) {
+ boolean exists = false;
+ for (Dashboard db : dashboards) {
+ if (("Dashboard " + i).equals(db.getName()))
+ exists = true;
+ }
+ if (!exists) {
+ break;
+ }
+ }
+ dashboard.setName("Dashboard " + i);
- dashboard.getPortlets().add(col1);
- dashboard.getPortlets().add(col2);
+ dashboard.setColumns(2);
+ dashboard.setColumnWidths("30%", "70%");
+ dashboardService.storeDashboard(dashboard, new AsyncCallback<Dashboard>()
{
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to add new
dashboard", caught);
+ }
+ public void onSuccess(Dashboard result) {
+ DashboardView dashboardView = new DashboardView(DashboardsView.this,
result);
- return dashboard;
+ Tab tab = new Tab(result.getName());
+ tab.setPane(dashboardView);
+ tab.setCanClose(true);
+
+ tabSet.addTab(tab);
+
+ tabSet.selectTab(tab);
+ editMode = true;
+ editButton.setTitle(editMode ? "View Mode" : "Edit
Mode");
+ dashboardView.setEditMode(editMode);
+
+
+ }
+ });
+ }
+
+ public void updateNames() {
+ for (Tab t : tabSet.getTabs()) {
+ DashboardView view = (DashboardView) t.getPane();
+ t.setTitle(view.getDashboard().getName());
+ }
+ }
+
+
+
+ public void renderView(ViewPath viewPath) {
+ if (!viewPath.isEnd()) {
+ selectedTab = viewPath.getCurrent().getPath();
+ if (tabSet != null) {
+ tabSet.selectTab(selectedTab);
+ }
+ }
+ }
+ public Dashboard getDashboard() {
+ return selectedDashboard;
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/OldDashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/OldDashboardView.java
deleted file mode 100644
index 2fc4826..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/OldDashboardView.java
+++ /dev/null
@@ -1,265 +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.dashboard;
-
-import com.google.gwt.user.client.Random;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.AnimationCallback;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.layout.LayoutSpacer;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.SmallGraphView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
-
-/**
- * @author Greg Hinkle
- */
-public class OldDashboardView extends VLayout {
-
-
- boolean editMode = false;
-
- PortalLayout portalLayout;
- DynamicForm form;
- ButtonItem addPortlet;
-
- public OldDashboardView() {
- setOverflow(Overflow.AUTO);
- setPadding(5);
- }
-
- public void redraw() {
- for (Canvas c : getChildren()) {
- c.destroy();
- }
-
- buildPortlets();
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
- buildPortlets();
- }
-
- public void buildPortlets() {
- setWidth100();
- setHeight100();
-
-
- portalLayout = new PortalLayout(2);
- portalLayout.setWidth100();
- portalLayout.setHeight100();
-
-
- Portlet summaryPortlet = new Portlet(editMode);
- summaryPortlet.setTitle("Inventory Summary");
- summaryPortlet.addItem(new InventorySummaryView());
- summaryPortlet.setHeight(300);
- portalLayout.addPortlet(summaryPortlet);
-
-
- Portlet platformsPortlet = new Portlet(editMode);
- platformsPortlet.setTitle("Platform Portlet");
- platformsPortlet.addItem(new PlatformPortletView());
- platformsPortlet.setHeight(300);
- portalLayout.addPortlet(platformsPortlet);
-
-
- Portlet adPortlet = new Portlet(editMode);
- adPortlet.setTitle("Auto Discovery Queue");
- adPortlet.addItem(new ResourceAutodiscoveryView(true));
- adPortlet.setHeight(250);
- portalLayout.addPortlet(adPortlet);
-
-
- // create portlets...
- for (int i = 1; i <= 2; i++) {
- Portlet portlet = new Portlet(editMode);
- portlet.setTitle("Portlet");
-
- // Label label = new Label();
- // label.setAlign(Alignment.CENTER);
- // label.setLayoutAlign(VerticalAlignment.CENTER);
- // label.setContents("Portlet contents");
- // label.setBackgroundColor(colors[Random.nextInt(colors.length - 1)]);
-
- portlet.addItem(new SmallGraphView());
- portlet.setHeight(400);
- portalLayout.addPortlet(portlet);
- }
-
- final VLayout vLayout = new VLayout(15);
-
- form = new DynamicForm();
- form.setAutoWidth();
- form.setNumCols(7);
-
- final StaticTextItem numColItem = new StaticTextItem();
- numColItem.setTitle("Columns");
- numColItem.setValue(portalLayout.getMembers().length);
-
- ButtonItem addColumn = new ButtonItem("addColumn", "Add
Column");
-// addColumn.setIcon("silk/application_side_expand.png");
- addColumn.setAutoFit(true);
- addColumn.setStartRow(false);
- addColumn.setEndRow(false);
-
-
- addColumn.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
event) {
- portalLayout.addMember(new PortalColumn());
- numColItem.setValue(portalLayout.getMembers().length);
-
- }
- });
-
- ButtonItem removeColumn = new ButtonItem("removeColumn", "Remove
Column");
-// removeColumn.setIcon("silk/application_side_contract.png");
- removeColumn.setAutoFit(true);
- removeColumn.setStartRow(false);
- removeColumn.setEndRow(false);
-
-
- removeColumn.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
event) {
-
- Canvas[] canvases = portalLayout.getMembers();
- int numMembers = canvases.length;
- if (numMembers > 0) {
- Canvas lastMember = canvases[numMembers - 1];
- portalLayout.removeMember(lastMember);
- numColItem.setValue(numMembers - 1);
- }
-
- }
- });
-
-
- final ButtonItem editButton = new ButtonItem("editable", editMode ?
"View Mode" : "Edit Mode");
- editButton.setAutoFit(true);
- editButton.setStartRow(false);
- editButton.setEndRow(false);
- editButton.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
clickEvent) {
- editMode = !editMode;
- redraw();
- }
- });
-
- addPortlet = new ButtonItem("addPortlet", "Add Portlet");
- addPortlet.setIcon("[skin]/images/actions/add.png");
- addPortlet.setAutoFit(true);
-
- addPortlet.setStartRow(false);
- addPortlet.setEndRow(false);
- addPortlet.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
- public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
event) {
-
- addPortlet();
-
- }
- });
-
-
- if (editMode) {
- form.setItems(numColItem, addPortlet, addColumn, removeColumn, editButton);
- } else {
- form.setItems(editButton);
- }
- addMember(form);
- addMember(portalLayout);
-
- }
-
-
- private void addPortlet() {
- final Portlet newPortlet = new Portlet(true);
- newPortlet.setTitle("Portlet ");
-
-// Label label = new Label();
-// label.setAlign(Alignment.CENTER);
-// label.setLayoutAlign(VerticalAlignment.CENTER);
-// label.setContents("Portlet contents");
-// label.setBackgroundColor(colors[Random.nextInt(colors.length - 1)]);
-// newPortlet.addItem(label);
-
- int nextInt = Random.nextInt() % 3;
-
-// if (nextInt == 0) {
-// ResourceSearchView item = new ResourceSearchView();
-// newPortlet.addItem(item);
-//
-// } else if (nextInt == 1) {
-// newPortlet.addItem(new RolesView());
-// } else {
-// newPortlet.addItem(new SummaryCountsView());
-// }
-
- ClickHandler handler = new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- PortletSettingsWindow settingsWindow = new
PortletSettingsWindow("Recently Added Resources");
- settingsWindow.show();
- }
- };
-
- newPortlet.addItem(new RecentlyAddedView());
- newPortlet.setHeight(350);
- newPortlet.setVisible(false);
- newPortlet.setHelpClickHandler(handler);
- newPortlet.setSettingsClickHandler(handler);
- PortalColumn column = portalLayout.addPortlet(newPortlet);
-
- // also insert a blank spacer element, which will trigger the built-in
- // animateMembers layout animation
- final LayoutSpacer placeHolder = new LayoutSpacer();
- placeHolder.setRect(newPortlet.getRect());
- column.addMember(placeHolder, 0); // add to top
-
- // create an outline around the clicked button
- final Canvas outline = new Canvas();
- outline.setLeft(form.getAbsoluteLeft() + addPortlet.getLeft());
- outline.setTop(form.getAbsoluteTop());
- outline.setWidth(addPortlet.getWidth());
- outline.setHeight(addPortlet.getHeight());
- outline.setBorder("2px solid 8289A6");
- outline.draw();
- outline.bringToFront();
-
- outline.animateRect(newPortlet.getPageLeft(), newPortlet.getPageTop(),
- newPortlet.getVisibleWidth(), newPortlet.getViewportHeight(),
- new AnimationCallback() {
- public void execute(boolean earlyFinish) {
- // callback at end of animation - destroy placeholder and
outline; show the new portlet
- placeHolder.destroy();
- outline.destroy();
- newPortlet.show();
- }
- }, 750);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
index b1b7b38..0a5a1e6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
@@ -1,41 +1,97 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2009 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.
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
*
* 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.
+ * GNU General Public License and the GNU Lesser 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.
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
+import com.smartgwt.client.util.EventHandler;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.events.DropEvent;
+import com.smartgwt.client.widgets.events.DropHandler;
import com.smartgwt.client.widgets.layout.HLayout;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+
/**
* @author Greg Hinkle
*/
public class PortalLayout extends HLayout {
- public PortalLayout(int numColumns) {
+
+ private DashboardView dashboardView;
+
+ public PortalLayout(DashboardView dashboardView, int numColumns) {
+
+ this.dashboardView = dashboardView;
+
setMembersMargin(6);
for (int i = 0; i < numColumns; i++) {
- PortalColumn column = new PortalColumn();
+ final PortalColumn column = new PortalColumn();
if (i == 0) {
column.setWidth("30%");
}
addMember(column);
+
+
+
+
+ final int columnNumber = i;
+ column.addDropHandler(new DropHandler() {
+ public void onDrop(DropEvent dropEvent) {
+
+ int dropPosition = column.getDropPosition();
+ int dropColumn = columnNumber;
+
+
+ Canvas target = EventHandler.getDragTarget();
+ ((PortletWindow)
target).getDashboardPortlet().setIndex(dropPosition);
+ ((PortletWindow)
target).getDashboardPortlet().setColumn(dropColumn);
+
+ int colNum = 0;
+ for (Canvas pcc : getMembers()) {
+
+ PortalColumn pc = (PortalColumn) pcc;
+
+
+ int i = 0;
+ for (Canvas c : pc.getMembers()) {
+ if (colNum == dropColumn && i == dropPosition) {
+ i++;
+ }
+
+ if (c instanceof PortletWindow) {
+ DashboardPortlet dp = ((PortletWindow)
c).getDashboardPortlet();
+ dp.setIndex(i++);
+ }
+ }
+
+ colNum++;
+ }
+ save();
+ System.out.println("Rearranged column indexes");
+ }
+ });
}
}
- public PortalColumn addPortlet(Portlet portlet) {
+ public PortalColumn addPortlet(PortletWindow portlet) {
// find the column with the fewest portlets
int fewestPortlets = Integer.MAX_VALUE;
PortalColumn fewestPortletsColumn = null;
@@ -51,7 +107,7 @@ public class PortalLayout extends HLayout {
}
- public PortalColumn addPortlet(Portlet portlet, int column) {
+ public PortalColumn addPortlet(PortletWindow portlet, int column) {
PortalColumn fewestPortletsColumn = (PortalColumn) getMember(column);
fewestPortletsColumn.addMember(portlet);
@@ -59,4 +115,22 @@ public class PortalLayout extends HLayout {
return fewestPortletsColumn;
}
+ public void save() {
+ this.dashboardView.save();
+ }
+
+ public void resize() {
+ for (Canvas c : getMembers()) {
+ PortalColumn column = (PortalColumn) c;
+
+ for (Canvas p : column.getMembers()) {
+ if (p instanceof PortletWindow) {
+ PortletWindow portlet = (PortletWindow) p;
+
+ p.setWidth(column.getWidth());
+
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/Portlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/Portlet.java
index 4fe028c..78cf4d8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/Portlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/Portlet.java
@@ -18,87 +18,23 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard;
-import com.smartgwt.client.types.DragAppearance;
-import com.smartgwt.client.types.HeaderControls;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.HeaderControl;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.DynamicForm;
+
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
/**
* @author Greg Hinkle
*/
-public class Portlet extends Window {
-
- private static final ClickHandler NO_OP_HANDLER = new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- }
- };
-
- private ClickHandler settingsHandlerDelegate = NO_OP_HANDLER;
-
- private ClickHandler helpHandlerDelegate = NO_OP_HANDLER;
-
- private ClickHandler settingsHandler = new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- settingsHandlerDelegate.onClick(clickEvent);
- }
- };
-
- private ClickHandler helpHandler = new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- helpHandlerDelegate.onClick(clickEvent);
- }
- };
-
- public Portlet(boolean showFrame) {
-
- if (!showFrame) {
- setShowHeader(false);
- setShowEdges(false);
- } else {
- // customize the appearance and order of the controls in the window header
- setHeaderControls(
- HeaderControls.MINIMIZE_BUTTON,
- HeaderControls.HEADER_LABEL,
- new HeaderControl(HeaderControl.SETTINGS, settingsHandler),
- new HeaderControl(HeaderControl.HELP, helpHandler),
- HeaderControls.CLOSE_BUTTON
- );
-
- // show either a shadow, or translucency, when dragging a portlet
- // (could do both at the same time, but these are not visually compatible
effects)
- // setShowDragShadow(true);
- setDragOpacity(30);
-
- // enable predefined component animation
- setAnimateMinimize(true);
-
- // Window is draggable with "outline" appearance by default.
- // "target" is the solid appearance.
- setDragAppearance(DragAppearance.TARGET);
- setCanDrop(true);
-
- setCanDragResize(true);
- setResizeFrom("B");
+public interface Portlet {
- }
+ void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet);
- setShowShadow(false);
+ Canvas getHelpCanvas();
- // these settings enable the portlet to autosize its height only to fit its
contents
- // (since width is determined from the containing layout, not the portlet
contents)
-// setVPolicy(LayoutPolicy.NONE);
- setOverflow(Overflow.VISIBLE);
+// ConfigurationDefinition getConfigurationDefinition();
- }
- public void setSettingsClickHandler(ClickHandler handler) {
- settingsHandlerDelegate = handler;
- }
- public void setHelpClickHandler(ClickHandler handler) {
- helpHandlerDelegate = handler;
- }
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletHelpWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletHelpWindow.java
new file mode 100644
index 0000000..6013893
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletHelpWindow.java
@@ -0,0 +1,100 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.dashboard;
+
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.LayoutPolicy;
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+
+/**
+ * This is a window for displaying portlet settings. The window contains a form which in
turn will contain the
+ * widgets for a portlet's settings. Those widgets will have to be passed to the
window since the window is intended
+ * to support all portlets. The layout and sizing strategy for this window is to be as
large as the widgets contained
+ * within it. And the form will stretch and resize as the window is resized. This
flexible layout strategy is used
+ * since there are different settings (with different widgets) for different portlets
which will in turn result in
+ * different sizes for the parent window.
+ *
+ * @author John Sanda
+ */
+public class PortletHelpWindow extends Window {
+
+ private DashboardPortlet storedPortlet;
+ private Portlet view;
+
+ public PortletHelpWindow(DashboardPortlet storedPortlet, Portlet view) {
+ this.storedPortlet = storedPortlet;
+ this.view = view;
+
+
+
+ setTitle(storedPortlet.getName() + " Help");
+ setOverflow(Overflow.VISIBLE);
+// setAutoSize(true);
+
+ setHeight(400);
+ setWidth(400);
+ setAutoCenter(true);
+ setCanDragResize(true);
+ setCanDragReposition(true);
+ setDismissOnEscape(true);
+ setDismissOnOutsideClick(true);
+ }
+
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ Canvas c = view.getHelpCanvas();
+
+ VLayout layout = new VLayout();
+ layout.setWidth100();
+ layout.setHeight100();
+ layout.setPadding(15);
+ layout.setLayoutMargin(20);
+ layout.setVPolicy(LayoutPolicy.FILL);
+
+ if (c != null) {
+ layout.addMember(c);
+ } else {
+ layout.addMember(new Label("No help available for this portlet"));
+ }
+
+
+ addItem(layout);
+
+ }
+
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java
index b0c37cd..b68ab67 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java
@@ -23,13 +23,24 @@
package org.rhq.enterprise.gui.coregui.client.dashboard;
+import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.LayoutPolicy;
import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import
org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+
/**
* This is a window for displaying portlet settings. The window contains a form which in
turn will contain the
* widgets for a portlet's settings. Those widgets will have to be passed to the
window since the window is intended
@@ -42,15 +53,24 @@ import com.smartgwt.client.widgets.layout.VLayout;
*/
public class PortletSettingsWindow extends Window {
- private String portletTitle;
+ private PortletWindow parentWindow;
+ private DashboardPortlet storedPortlet;
+ private Portlet view;
- public PortletSettingsWindow(String portletTitle) {
- this.portletTitle = portletTitle;
- setTitle("RHQ Dashboard Settings: " + portletTitle);
+ public PortletSettingsWindow(PortletWindow parentWindow, DashboardPortlet
storedPortlet, Portlet view) {
+ this.parentWindow = parentWindow;
+ this.storedPortlet = storedPortlet;
+ this.view = view;
+ setTitle(storedPortlet.getName() + " Settings");
setOverflow(Overflow.VISIBLE);
+ setMinWidth(400);
+ setMinHeight(400);
setAutoSize(true);
+ setAutoCenter(true);
setCanDragResize(true);
setCanDragReposition(true);
+
+
}
@Override
@@ -64,24 +84,82 @@ public class PortletSettingsWindow extends Window {
layout.setLayoutMargin(20);
layout.setVPolicy(LayoutPolicy.FILL);
- final DynamicForm form = new DynamicForm();
- form.setGroupTitle("Display Settings");
- form.setIsGroup(true);
- form.setNumCols(2);
- form.setWidth100();
- form.setHeight100();
- form.setCellPadding(5);
- TextItem username = new TextItem();
- username.setTitle("Username");
+ if (view instanceof CustomSettingsPortlet) {
+ final DynamicForm form = ((CustomSettingsPortlet)
view).getCustomSettingsForm();
+ layout.addMember(form);
+
+ IButton cancel = new IButton("Cancel");
+ cancel.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ PortletSettingsWindow.this.destroy();
+ }
+ });
+ IButton save = new IButton("Save");
+ save.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ if (form.validate()) {
+ form.submit();
+ PortletSettingsWindow.this.destroy();
+ view.configure(parentWindow, storedPortlet);
+ ((Canvas) view).redraw();
+ parentWindow.save();
+ }
+ }
+ });
+
+ HLayout buttons = new HLayout(10);
+ buttons.setLayoutAlign(Alignment.CENTER);
+ buttons.addMember(cancel);
+ buttons.addMember(save);
+ layout.addMember(buttons);
+
+ } else if (view instanceof ConfigurablePortlet) {
+
+ ConfigurationDefinition definition = ((ConfigurablePortlet)
view).getConfigurationDefinition();
+ Configuration configuration = storedPortlet.getConfiguration();
- TextItem password = new TextItem();
- password.setTitle("Password");
+ final ConfigurationEditor editor = new ConfigurationEditor(definition,
configuration);
+ editor.setWidth(400);
+ editor.setHeight(400);
+ layout.addMember(editor);
+
+
+ IButton cancel = new IButton("Cancel");
+ cancel.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ PortletSettingsWindow.this.destroy();
+ }
+ });
+ IButton save = new IButton("Save");
+ save.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ if (editor.validate()) {
+ Configuration configuration = editor.getConfiguration();
+ storedPortlet.setConfiguration(configuration);
+ PortletSettingsWindow.this.destroy();
+ view.configure(parentWindow, storedPortlet);
+// ((Canvas) view).markForRedraw();
+ parentWindow.markForRedraw();
+ parentWindow.save();
+ }
+ }
+ });
+
+ HLayout buttons = new HLayout(10);
+ buttons.setLayoutAlign(Alignment.CENTER);
+ buttons.addMember(cancel);
+ buttons.addMember(save);
+ layout.addMember(buttons);
+
+
+ } else {
+ layout.addMember(new Label("No settings available for this
portlet"));
+ }
- form.setFields(username, password);
- layout.addMember(form);
addItem(layout);
}
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletView.java
deleted file mode 100644
index 342c9ce..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletView.java
+++ /dev/null
@@ -1,36 +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.dashboard;
-
-import com.smartgwt.client.widgets.Canvas;
-
-import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
-
-/**
- * @author Greg Hinkle
- */
-public interface PortletView {
-
- void configure(StoredPortlet storedPortlet);
-
- Canvas getHelpCanvas();
-
- Canvas getSettingsCanvas();
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java
index 34cfaf3..b58e070 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java
@@ -23,6 +23,6 @@ package org.rhq.enterprise.gui.coregui.client.dashboard;
*/
public interface PortletViewFactory {
- PortletView getInstance();
+ Portlet getInstance();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
new file mode 100644
index 0000000..f381773
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java
@@ -0,0 +1,182 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard;
+
+import com.smartgwt.client.types.DragAppearance;
+import com.smartgwt.client.types.HeaderControls;
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HeaderControl;
+import com.smartgwt.client.widgets.Window;
+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.events.DragResizeStopEvent;
+import com.smartgwt.client.widgets.events.DragResizeStopHandler;
+
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+
+/**
+ * @author Greg Hinkle
+ */
+public class PortletWindow extends Window {
+
+ private DashboardView dashboardView;
+ private DashboardPortlet dashboardPortlet;
+
+ private Portlet view;
+
+ private static final ClickHandler NO_OP_HANDLER = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ }
+ };
+
+ private ClickHandler settingsHandlerDelegate = NO_OP_HANDLER;
+
+ private ClickHandler helpHandlerDelegate = NO_OP_HANDLER;
+
+ private ClickHandler settingsHandler = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ settingsHandlerDelegate.onClick(clickEvent);
+ }
+ };
+
+ private ClickHandler helpHandler = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ helpHandlerDelegate.onClick(clickEvent);
+ }
+ };
+
+ public PortletWindow(DashboardView dashboardView, DashboardPortlet dashboardPortlet)
{
+
+ this.dashboardView = dashboardView;
+ this.dashboardPortlet = dashboardPortlet;
+ setEdgeSize(2);
+
+
+// if (!showFrame) {
+// setShowHeader(false);
+// setShowEdges(false);
+
+ // customize the appearance and order of the controls in the window header
+ setHeaderControls(
+ HeaderControls.MINIMIZE_BUTTON,
+ HeaderControls.HEADER_LABEL,
+ new HeaderControl(HeaderControl.SETTINGS, settingsHandler),
+ new HeaderControl(HeaderControl.HELP, helpHandler),
+ HeaderControls.CLOSE_BUTTON
+ );
+
+ // show either a shadow, or translucency, when dragging a portlet
+ // (could do both at the same time, but these are not visually compatible
effects)
+ // setShowDragShadow(true);
+ setDragOpacity(30);
+
+ // enable predefined component animation
+ setAnimateMinimize(true);
+
+ // Window is draggable with "outline" appearance by default.
+ // "target" is the solid appearance.
+ setDragAppearance(DragAppearance.TARGET);
+ setCanDrop(true);
+
+ setCanDragResize(true);
+// setResizeFrom("B");
+
+
+ setShowShadow(false);
+
+ // these settings enable the portlet to autosize its height only to fit its
contents
+ // (since width is determined from the containing layout, not the portlet
contents)
+// setVPolicy(LayoutPolicy.NONE);
+ setOverflow(Overflow.VISIBLE);
+
+
+ addDragResizeStopHandler(new DragResizeStopHandler() {
+ public void onDragResizeStop(DragResizeStopEvent dragResizeStopEvent) {
+
+
+ PortletWindow.this.dashboardPortlet.setHeight(((Canvas)
dragResizeStopEvent.getSource()).getHeight());
+
+ PortletWindow.this.dashboardView.resize();
+ save();
+
+ }
+ });
+
+ addCloseClickHandler(new CloseClickHandler() {
+ public void onCloseClick(CloseClientEvent closeClientEvent) {
+
PortletWindow.this.dashboardPortlet.getDashboard().removePortlet(PortletWindow.this.dashboardPortlet);
+ save();
+ destroy();
+ }
+ });
+
+ setSettingsClickHandler(settingsHandler);
+ setHelpClickHandler(helpHandler);
+
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ view = PortletFactory.buildPortlet(this, dashboardPortlet);
+
+ Canvas canvas = (Canvas) view;
+ addItem(canvas);
+
+ settingsHandlerDelegate = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ new PortletSettingsWindow(PortletWindow.this, dashboardPortlet,
view).show();
+ }
+ };
+
+ helpHandlerDelegate = new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ new PortletHelpWindow(dashboardPortlet, view).show();
+ }
+ };
+ }
+
+ public void setSettingsClickHandler(ClickHandler handler) {
+ settingsHandlerDelegate = handler;
+ }
+
+ public void setHelpClickHandler(ClickHandler handler) {
+ helpHandlerDelegate = handler;
+ }
+
+ public DashboardPortlet getDashboardPortlet() {
+ return dashboardPortlet;
+ }
+
+ public void setDashboardPortlet(DashboardPortlet dashboardPortlet) {
+ this.dashboardPortlet = dashboardPortlet;
+ }
+
+ public void save() {
+ this.dashboardView.save();
+ }
+}
commit 6296f6138990c843b4e4872c5ac0bd4cbace0966
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:28:42 2010 -0400
Fix search bar links for gwt
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 ecdd88f..c6e5a9d 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
@@ -27,13 +27,13 @@ package org.rhq.enterprise.gui.coregui.client;
*/
public class LinkManager {
- private static boolean GWT = false;
+ private static boolean GWT = true;
public static String getResourceLink(int resourceId) {
if (GWT) {
- return "Resource/" + resourceId;
+ return "#Resource/" + resourceId;
} else {
return "/rhq/resource/summary/overview.xhtml?id=" + resourceId;
}
@@ -43,7 +43,7 @@ public class LinkManager {
public static String getResourceGroupLink(int resouceGroupId) {
if (GWT) {
- return "ResourceGroup/" + resouceGroupId;
+ return "#ResourceGroup/" + resouceGroupId;
} else {
return "/rhq/group/inventory/view.xhtml?groupId=" +
resouceGroupId;
}
@@ -133,20 +133,36 @@ public class LinkManager {
public static String getAdminUsersLink() {
- return "/admin/user/UserAdmin.do?mode=list";
+ if (GWT) {
+ return "#Administration/Security/Manage%20Users";
+ } else {
+ return "/admin/user/UserAdmin.do?mode=list";
+ }
}
public static String getAdminRolesLink() {
+ if (GWT) {
+ return "#Administration/Security/Manage%20Roles";
+ } else {
return "/admin/role/RoleAdmin.do?mode=list";
+ }
}
public static String getAdminSysConfigLink() {
+ if (GWT) {
+ return "#Administration/Configuration/System%20Settings";
+ } else {
return "/admin/config/Config.do?mode=edit";
+ }
}
public static String getAdminPluginsLink() {
- return "/rhq/admin/plugin/plugin-list.xhtml";
+ if (GWT) {
+ return "#Administration/Configuration/Plugins";
+ } else {
+ return "/rhq/admin/plugin/plugin-list.xhtml";
+ }
}
@@ -195,7 +211,11 @@ public class LinkManager {
public static String getAdminLicenseLink() {
- return "/admin/license/LicenseAdmin.do?mode=view";
+ if (GWT) {
+ return "#Administration/Configuration/License";
+ } else {
+ return "/admin/license/LicenseAdmin.do?mode=view";
+ }
}
@@ -220,4 +240,4 @@ public class LinkManager {
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
index 40c6154..c14d2d7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java
@@ -133,7 +133,7 @@ public class SearchBarPane extends HLayout {
if (!link.contains("#")) {
com.google.gwt.user.client.Window.Location.assign(link);
} else {
- History.newItem(link);
+ History.newItem(link.substring(1));
}
} catch (Exception e) {
}
commit 386205307c0fea3eedb2e757bc87986656372b81
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:28:17 2010 -0400
Small resource view improvements
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 b1b1ece..7a1ebba 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
@@ -100,6 +100,19 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
"parentId")));
}
+ if (request.getCriteria().getValues().get("id") != null) {
+
criteria.addFilterId(request.getCriteria().getAttributeAsInt("id"));
+ }
+
+ if (request.getCriteria().getValues().get("resourceIds") != null) {
+ int[] ids =
request.getCriteria().getAttributeAsIntArray("resourceIds");
+ Integer[] oids = new Integer[ids.length];
+ for (int i = 0; i < ids.length; i++) {
+ oids[i] = ids[i++];
+ }
+ criteria.addFilterIds(oids);
+ }
+
if (request.getCriteria().getValues().get("name") != null) {
criteria.addFilterName((String)
request.getCriteria().getValues().get("name"));
}
@@ -216,4 +229,4 @@ public class ResourceDatasource extends RPCDataSource<Resource>
{
return record;
}
-}
\ No newline at end of file
+}
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 c08c42f..57c8acb 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
@@ -43,6 +43,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
* @author Greg Hinkle
*/
public class ResourceSearchView extends Table {
+
private static final String DEFAULT_TITLE = "Resources";
private ArrayList<ResourceSelectListener> selectListeners = new
ArrayList<ResourceSelectListener>();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index cdf3025..27fa9af 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -47,6 +47,7 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectLi
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView;
@@ -173,7 +174,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
- eventsTab.updateSubTab("History", new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
+ eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
@@ -248,7 +249,7 @@ public class ResourceDetailView extends VLayout implements
BookmarkableView, Res
}
if (type.getEventDefinitions() == null || type.getEventDefinitions().isEmpty() ||
!permissions.isMeasure()) {
- topTabSet.disableTab(eventsTab);
+ topTabSet.enableTab(eventsTab);
} else {
topTabSet.enableTab(eventsTab);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
index f3dee98..49e3974 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java
@@ -45,6 +45,7 @@ import com.smartgwt.client.types.AnimationEffect;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.HTMLPane;
+import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.WidgetCanvas;
import com.smartgwt.client.widgets.Window;
@@ -122,6 +123,7 @@ public class SmallGraphView extends VLayout {
public void setResourceId(int resourceId) {
this.resourceId = resourceId;
+ this.definition = null;
}
public int getDefinitionId() {
@@ -130,15 +132,14 @@ public class SmallGraphView extends VLayout {
public void setDefinitionId(int definitionId) {
this.definitionId = definitionId;
+ this.definition = null;
}
@Override
protected void onDraw() {
super.onDraw();
- for (Canvas c : getChildren()) {
- c.destroy();
- }
+ removeMembers(getMembers());
if (this.definition == null) {
@@ -214,6 +215,36 @@ public class SmallGraphView extends VLayout {
private void drawGraph() {
+ HLayout titleLayout = new HLayout();
+
+ if (definition != null) {
+ titleLayout.setAutoHeight();
+
+ titleLayout.setWidth100();
+
+ HTMLFlow title = new HTMLFlow("<b>" +
definition.getDisplayName() + "</b> " + definition.getDescription());
+ title.setWidth("*");
+ title.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ displayAsDialog();
+ }
+ });
+ titleLayout.addMember(title);
+
+ Img liveGraph = new
Img("subsystems/monitor/Monitor_16.png",16,16);
+ liveGraph.setTooltip("Click for a live graph of current values");
+
+ liveGraph.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ LiveGraphView.displayAsDialog(resourceId, definition);
+ }
+ });
+ titleLayout.addMember(liveGraph);
+
+ addMember(titleLayout);
+ }
+
+
PlotModel model = new PlotModel();
PlotOptions plotOptions = new PlotOptions();
plotOptions.setDefaultLineSeriesOptions(new
LineSeriesOptions().setLineWidth(1).setShow(true));
@@ -221,6 +252,7 @@ public class SmallGraphView extends VLayout {
plotOptions.setDefaultShadowSize(0);
+
// You need make the grid hoverable <<<<<<<<<
plotOptions.setGridOptions(new
GridOptions().setHoverable(true).setMouseActiveRadius(10).setAutoHighlight(true));
@@ -234,7 +266,7 @@ public class SmallGraphView extends VLayout {
// create the plot
SimplePlot plot = new SimplePlot(model, plotOptions);
- plot.setSize(String.valueOf(getInnerContentWidth()),
String.valueOf(getInnerContentHeight() - 20));
+ plot.setSize(String.valueOf(getInnerContentWidth()),
String.valueOf(getInnerContentHeight() - titleLayout.getHeight() - 50));
// "80%","80%");
@@ -276,38 +308,18 @@ public class SmallGraphView extends VLayout {
hoverLabel.setBorder("1px solid orange");
hoverLabel.hide();
- hoverLabel.draw();
+ if (hoverLabel.isDrawn())
+ hoverLabel.redraw();
+ else
+ hoverLabel.draw();
// put it on a panel
- if (definition != null) {
-
- HLayout titleLayout = new HLayout();
- titleLayout.setWidth100();
-
- HTMLFlow title = new HTMLFlow("<b>" +
definition.getDisplayName() + "</b> " + definition.getDescription());
- title.setWidth("*");
- title.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- displayAsDialog();
- }
- });
- titleLayout.addMember(title);
- HTMLPane liveGraphLink = new HTMLPane();
- liveGraphLink.setWidth(100);
- liveGraphLink.setContents("Live Graph");
- liveGraphLink.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- LiveGraphView.displayAsDialog(resourceId, definition);
- }
- });
- titleLayout.addMember(liveGraphLink);
+ addMember(new WidgetCanvas(plot));
- addMember(titleLayout);
- }
+ plot.setSize(String.valueOf(getInnerContentWidth()),
String.valueOf(getInnerContentHeight() - titleLayout.getHeight() - 50));
- addMember(new WidgetCanvas(plot));
}
private String getHover(PlotItem item) {
@@ -336,7 +348,10 @@ public class SmallGraphView extends VLayout {
long max = System.currentTimeMillis();
long min = max - (1000L * 60 * 60 * 8);
- plotOptions.setXAxisOptions(new
AxisOptions().setTicks(8).setMinimum(min).setMaximum(max).setTickFormatter(new
TickFormatter() {
+
+ int xTicks = getWidth() / 140;
+
+ plotOptions.setXAxisOptions(new
AxisOptions().setTicks(xTicks).setMinimum(min).setMaximum(max).setTickFormatter(new
TickFormatter() {
public String formatTickValue(double tickValue, Axis axis) {
com.google.gwt.i18n.client.DateTimeFormat dateFormat =
DateTimeFormat.getShortDateTimeFormat();
return dateFormat.format(new Date((long) tickValue));
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 7402610..cd52111 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
@@ -72,28 +72,35 @@ public class ResourceAutodiscoveryView extends VLayout {
protected void onInit() {
super.onInit();
+ if (!simple) {
- HLayout titleLayout = new HLayout(150);
+ HLayout titleLayout = new HLayout(150);
- HTMLFlow title = new HTMLFlow();
- title.setWidth100();
- title.setHeight(35);
- title.setContents("Auto Discovery Queue");
- title.setPadding(4);
- title.setStyleName("HeaderLabel");
- titleLayout.addMember(title);
+ HTMLFlow title = new HTMLFlow();
+ title.setWidth100();
+ title.setHeight(35);
+ title.setContents("Auto Discovery Queue");
+ title.setPadding(4);
+ title.setStyleName("HeaderLabel");
+ titleLayout.addMember(title);
- DynamicForm form = new DynamicForm();
- final SelectItem statusSelectItem = new SelectItem("statuses",
"Displayed Statuses");
- statusSelectItem.setValueMap("New", "Ignored", "New and
Ignored");
- statusSelectItem.setValue("New");
- form.setItems(statusSelectItem);
- if (!simple)
+ DynamicForm form = new DynamicForm();
+ final SelectItem statusSelectItem = new SelectItem("statuses",
"Displayed Statuses");
+ statusSelectItem.setValueMap("New", "Ignored", "New
and Ignored");
+ statusSelectItem.setValue("New");
+ form.setItems(statusSelectItem);
titleLayout.addMember(form);
- addMember(titleLayout);
+ statusSelectItem.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ treeGrid.fetchData(new Criteria("statuses", (String)
statusSelectItem.getValue()));
+ }
+ });
+
+ addMember(titleLayout);
+ }
treeGrid = new TreeGrid();
@@ -210,11 +217,6 @@ public class ResourceAutodiscoveryView extends VLayout {
}
);
- statusSelectItem.addChangedHandler(new ChangedHandler() {
- public void onChanged(ChangedEvent changedEvent) {
- treeGrid.fetchData(new Criteria("statuses", (String)
statusSelectItem.getValue()));
- }
- });
}
private Integer[] getSelectedIds() {
commit 1cf17185ccce9b5aa49c9d537cebf132737fd52e
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:27:39 2010 -0400
GWT Event view
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
new file mode 100644
index 0000000..f8656e3
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java
@@ -0,0 +1,134 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event;
+
+import java.util.Date;
+
+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.fields.DataSourceImageField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.types.FieldType;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.EventCriteria;
+import org.rhq.core.domain.event.Event;
+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.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class EventDatasource extends RPCDataSource<Event> {
+
+
+ public EventDatasource() {
+ super();
+
+// DataSourceField id = new DataSourceIntegerField("id",
"Id");
+// id.setPrimaryKey(true);
+// addField(id);
+
+ DataSourceTextField detail = new DataSourceTextField("detail",
"Detail");
+ addField(detail);
+
+// DataSourceTextField detailExcerpt = new
DataSourceTextField("detailExcerpt", "Detail Excerpt");
+// addField(detailExcerpt);
+
+ DataSourceTextField severity = new DataSourceTextField("severity",
"Servity");
+ addField(severity);
+
+// DataSourceTextField source = new DataSourceTextField("source",
"Source");
+// addField(source);
+
+ DataSourceTextField sourceLocation = new
DataSourceTextField("sourceLocation", "Source Location");
+ addField(sourceLocation);
+
+// DataSourceTextField type = new DataSourceTextField("type",
"Type");
+// addField(type);
+
+ DataSourceTextField timestamp = new DataSourceTextField("timestamp",
"Timestamp");
+ timestamp.setType(FieldType.DATETIME);
+ addField(timestamp);
+
+
+ }
+
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+
+ EventCriteria criteria = new EventCriteria();
+ criteria.addSortSeverity(PageOrdering.DESC);
+
+ criteria.setPageControl(getPageControl(request));
+ criteria.fetchSource(true);
+
+ if (request.getCriteria().getValues().get("resourceId") != null) {
+
criteria.addFilterResourceId(request.getCriteria().getAttributeAsInt("resourceId"));
+ }
+
+ GWTServiceLookup.getEventService().findEventsByCriteria(criteria,
+ new AsyncCallback<PageList<Event>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load event
data", caught);
+ }
+
+ public void onSuccess(PageList<Event> result) {
+ response.setData(buildRecords(result));
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+ });
+
+ }
+
+ @Override
+ public Event copyValues(ListGridRecord from) {
+ return null; // TODO: Implement this method.
+ }
+
+ @Override
+ public ListGridRecord copyValues(Event from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute("id", from.getId());
+ record.setAttribute("detail", from.getDetail());
+ record.setAttribute("detailExcerpt", from.getDetailExcerpt());
+ record.setAttribute("severity", from.getSeverity().name());
+ record.setAttribute("source", from.getSource());
+ record.setAttribute("sourceLocation", from.getSourceLocation());
+ record.setAttribute("type", from.getType());
+ record.setAttribute("timestamp", new Date(from.getTimestamp()));
+
+ return record;
+ }
+
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
new file mode 100644
index 0000000..72ecded
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java
@@ -0,0 +1,65 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+
+/**
+ * @author Greg Hinkle
+ */
+public class EventHistoryView extends Table {
+
+
+ public EventHistoryView(Criteria criteria) {
+ super("Event History", criteria);
+
+ setDataSource(new EventDatasource());
+
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+// getListGrid().getField("id").setWidth(60);
+ getListGrid().getField("severity").setWidth(120);
+ getListGrid().getField("severity").setCellFormatter(new CellFormatter()
{
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1)
{
+ return Canvas.imgHTML("subsystems/event/" + o, 16, 16) + o;
+ }
+ });
+
+ getListGrid().getField("sourceLocation").setWidth(200);
+ getListGrid().getField("timestamp").setWidth(160);
+ }
+
+ public static EventHistoryView createResourceHistoryView(int resourceId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria("resourceId",resourceId);
+ return new EventHistoryView(criteria);
+ }
+}
commit 14a2af634752dd6a190f35f0c35fdce33ff6c4cb
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 11:27:22 2010 -0400
New resource metric schedule datasource
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceScheduledMetricDatasource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceScheduledMetricDatasource.java
new file mode 100644
index 0000000..f412d7b
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceScheduledMetricDatasource.java
@@ -0,0 +1,153 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
+
+import java.util.Collection;
+
+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.Record;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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.util.RPCDataSource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ResourceScheduledMetricDatasource extends
RPCDataSource<MeasurementDefinition> {
+
+
+ public ResourceScheduledMetricDatasource() {
+
+ DataSourceIntegerField id = new DataSourceIntegerField("id");
+ id.setPrimaryKey(true);
+ addField(id);
+
+ DataSourceTextField name = new DataSourceTextField("name");
+ addField(name);
+
+ DataSourceTextField displayName = new
DataSourceTextField("displayName");
+ addField(displayName);
+
+ DataSourceTextField description = new
DataSourceTextField("description");
+ addField(description);
+
+ DataSourceTextField units = new DataSourceTextField("units");
+ addField(units);
+
+ DataSourceTextField numericType = new
DataSourceTextField("numericType");
+ addField(numericType);
+
+ DataSourceTextField category = new DataSourceTextField("category");
+ addField(category);
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response) {
+
+
+
+
+ if (request.getCriteria().getValues().containsKey("id")) {
+ MeasurementDefinitionCriteria criteria = new
MeasurementDefinitionCriteria();
+
+
criteria.addFilterId(request.getCriteria().getAttributeAsInt("id"));
+
GWTServiceLookup.getMeasurementDataService().findMeasurementDefinitionsByCriteria(criteria,
+ new AsyncCallback<PageList<MeasurementDefinition>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load
metric definitions",caught);
+ }
+
+ public void onSuccess(PageList<MeasurementDefinition>
result) {
+ response.setData(buildRecords(result));
+ processResponse(request.getRequestId(), response);
+ }
+ });
+
+
+ } else if (request.getCriteria().getValues().containsKey("resourceId"))
{
+ MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria();
+ criteria.fetchDefinition(true);
+
+
criteria.addFilterResourceId(request.getCriteria().getAttributeAsInt("resourceId"));
+
+
+
GWTServiceLookup.getMeasurementDataService().findMeasurementSchedulesByCriteria(criteria,
new AsyncCallback<PageList<MeasurementSchedule>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load metric
schedules", caught);
+ }
+
+ public void onSuccess(PageList<MeasurementSchedule> result) {
+ response.setData(buildRecords(result));
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ } else {
+ processResponse(request.getRequestId(), response);
+ }
+ }
+
+ private ListGridRecord[] buildRecords(PageList<MeasurementSchedule> list) {
+ PageList<MeasurementDefinition> definitions = new
PageList<MeasurementDefinition>();
+
+ for (MeasurementSchedule schedule : list) {
+ if (schedule.isEnabled() && schedule.getDefinition().getDataType() ==
DataType.MEASUREMENT) {
+ definitions.add(schedule.getDefinition());
+ }
+ }
+
+ return buildRecords(definitions);
+ }
+
+
+ @Override
+ public MeasurementDefinition copyValues(ListGridRecord from) {
+ return null; // TODO: Implement this method.
+ }
+
+ @Override
+ public ListGridRecord copyValues(MeasurementDefinition from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute("id", from.getId());
+ record.setAttribute("name", from.getName());
+ record.setAttribute("displayName", from.getDisplayName());
+ record.setAttribute("description", from.getDescription());
+ record.setAttribute("units", from.getUnits().name());
+ record.setAttribute("numericType", from.getNumericType().name());
+ record.setAttribute("category", from.getCategory().name());
+ return record;
+ }
+}
commit 6e5134a378188ac58aed7c8c5fe1d735f5e0fd7a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:46:57 2010 -0400
start of group pages
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
new file mode 100644
index 0000000..4e9f17a
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -0,0 +1,312 @@
+/*
+ * 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.groups.detail;
+
+import java.util.EnumSet;
+import java.util.Set;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.Side;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tab.Tab;
+
+import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.resource.composite.ResourcePermission;
+import org.rhq.core.domain.resource.group.GroupCategory;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.alert.definitions.AlertDefinitionsView;
+import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
+import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
+import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler;
+import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTitleBar;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+
+/**
+ * Right panel of the resource view.
+ *
+ * @author Greg Hinkle
+ */
+public class ResourceGroupDetailView extends VLayout implements BookmarkableView,
TwoLevelTabSelectedHandler {
+
+ private ResourceGroup group;
+ private ResourcePermission permissions;
+
+ private ResourceType groupType;
+
+ private TwoLevelTab summaryTab;
+ private TwoLevelTab monitoringTab;
+ private TwoLevelTab inventoryTab;
+ private TwoLevelTab operationsTab;
+ private TwoLevelTab alertsTab;
+ private TwoLevelTab configurationTab;
+ private TwoLevelTab eventsTab;
+ private TwoLevelTab contentTab;
+
+ private TwoLevelTabSet topTabSet;
+
+ private ResourceGroupTitleBar titleBar;
+
+ private ViewId tabView;
+ private ViewId subtabView;
+
+
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ setWidth100();
+ setHeight100();
+
+
+ // The Tabs section
+
+ topTabSet = new TwoLevelTabSet();
+ topTabSet.setTabBarPosition(Side.TOP);
+ topTabSet.setWidth100();
+ topTabSet.setHeight100();
+ topTabSet.setEdgeMarginSize(0);
+ topTabSet.setEdgeSize(0);
+
+ summaryTab = new TwoLevelTab("Summary",
"/images/icons/Service_up_16.png");
+ summaryTab.registerSubTabs("Overview", "Timeline");
+
+ monitoringTab = new TwoLevelTab("Monitoring",
"/images/icons/Monitor_grey_16.png");
+ monitoringTab.registerSubTabs("Graphs", "Tables",
"Traits", "Availability", "Schedules", "Call
Time");
+
+ inventoryTab = new TwoLevelTab("Inventory",
"/images/icons/Inventory_grey_16.png");
+ inventoryTab.registerSubTabs("Children", "Connection
Settings");
+
+ operationsTab = new TwoLevelTab("Operations",
"/images/icons/Operation_grey_16.png");
+ operationsTab.registerSubTabs("History", "Scheduled");
+
+ alertsTab = new TwoLevelTab("Alerts",
"/images/icons/Alert_grey_16.png");
+ alertsTab.registerSubTabs("History", "Definitions");
+
+ configurationTab = new TwoLevelTab("Configuration",
"/images/icons/Configure_grey_16.png");
+ configurationTab.registerSubTabs("Current", "History");
+
+ eventsTab = new TwoLevelTab("Events",
"/images/icons/Events_grey_16.png");
+ eventsTab.registerSubTabs("History");
+
+ contentTab = new TwoLevelTab("Content",
"/images/icons/Content_grey_16.png");
+ contentTab.registerSubTabs("Deployed", "New",
"Subscriptions", "History");
+
+ topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab,
alertsTab, configurationTab, eventsTab, contentTab);
+
+
+ topTabSet.addTwoLevelTabSelectedHandler(this);
+
+ titleBar = new ResourceGroupTitleBar();
+ addMember(titleBar);
+
+ addMember(topTabSet);
+
+// CoreGUI.addBreadCrumb(getPlace());
+ }
+
+ public void onResourceSelected(ResourceGroup group) {
+
+ this.group = group;
+
+ titleBar.setGroup(group);
+
+ int selectedTab = topTabSet.getSelectedTabNumber();
+
+ // TODO all of the tabs
+
+// FullHTMLPane timelinePane = new
FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" +
resource.getId());
+// summaryTab.updateSubTab("Overview", new
ResourceOverviewView(resource));
+// summaryTab.updateSubTab("Timeline", timelinePane);
+
+
+// monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); //
new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId()));
+// monitoringTab.updateSubTab("Tables", new
FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId()));
+// monitoringTab.updateSubTab("Traits", new
FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" +
resource.getId()));
+// monitoringTab.updateSubTab("Availability", new
FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" +
resource.getId()));
+// monitoringTab.updateSubTab("Schedules", new
FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" +
resource.getId()));
+// monitoringTab.updateSubTab("Call Time", new CallTimeView(resource));
+//
+//
+// inventoryTab.updateSubTab("Children",
ResourceSearchView.getChildrenOf(resource.getId()));
+// inventoryTab.updateSubTab("Connection Settings", new
PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(),
resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
+//
+// operationsTab.updateSubTab("History",
OperationHistoryView.getResourceHistoryView(resource));
+//
+// configurationTab.updateSubTab("Current", new
ResourceConfigurationEditView(resource));
+// configurationTab.updateSubTab("History",
ConfigurationHistoryView.getHistoryOf(resource.getId()));
+//
+// alertsTab.updateSubTab("History", new
ResourceAlertHistoryView(resource.getId()));
+// alertsTab.updateSubTab("Definitions",
AlertDefinitionsView.getResourceView(resource));
+//
+// eventsTab.updateSubTab("History",
EventHistoryView.createResourceHistoryView(resource.getId())); //new
FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
+//
+// contentTab.updateSubTab("Deployed", new
FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId()));
+// contentTab.updateSubTab("New", new
FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" +
resource.getId()));
+// contentTab.updateSubTab("Subscriptions", new
FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" +
resource.getId()));
+// contentTab.updateSubTab("History", new
FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" +
resource.getId()));
+
+
+// topTabSet.setSelectedTab(selectedTab);
+
+ updateTabStatus();
+
+ topTabSet.markForRedraw();
+ }
+
+
+ private void updateTabStatus() {
+ // Go and get the type with all needed metadata
+ // and then get the permissions for this resource
+
+ if (group.getGroupCategory() == GroupCategory.COMPATIBLE) {
+ ResourceType groupType = group.getResourceType();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(groupType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.content,
+ ResourceTypeRepository.MetadataType.operations,
+ ResourceTypeRepository.MetadataType.events,
+
ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+
+ ResourceGroupDetailView.this.groupType = type;
+
+ GWTServiceLookup.getAuthorizationService().
+
getImplicitGroupPermissions(ResourceGroupDetailView.this.group.getId(),
+ new AsyncCallback<Set<Permission>>()
{
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError("Failed to load group permissions",
caught);
+ }
+
+ public void onSuccess(Set<Permission>
result) {
+ ResourceGroupDetailView.this.permissions
= new ResourcePermission(result);
+ completeTabUpdate();
+ }
+ });
+ }
+ });
+ }
+ }
+
+
+ private void completeTabUpdate() {
+
+ if (!permissions.isMeasure()) {
+ topTabSet.disableTab(monitoringTab);
+ } else {
+ topTabSet.enableTab(monitoringTab);
+ }
+
+ if (groupType.getOperationDefinitions() == null ||
groupType.getOperationDefinitions().isEmpty() || !permissions.isControl()) {
+ topTabSet.disableTab(operationsTab);
+ } else {
+ topTabSet.enableTab(operationsTab);
+ }
+
+
+ if (!permissions.isAlert()) {
+ topTabSet.disableTab(alertsTab);
+ } else {
+ topTabSet.enableTab(alertsTab);
+ }
+
+ if (groupType.getResourceConfigurationDefinition() == null ||
!permissions.isConfigure()) {
+ topTabSet.disableTab(configurationTab);
+ } else {
+ topTabSet.enableTab(configurationTab);
+ }
+
+ if (groupType.getEventDefinitions() == null ||
groupType.getEventDefinitions().isEmpty() || !permissions.isMeasure()) {
+ topTabSet.enableTab(eventsTab);
+ } else {
+ topTabSet.enableTab(eventsTab);
+ }
+
+ if (groupType.getPackageTypes() == null || groupType.getPackageTypes().isEmpty()
|| !permissions.isContent()) {
+ topTabSet.disableTab(contentTab);
+ } else {
+ topTabSet.enableTab(contentTab);
+ }
+
+
+ }
+
+
+ public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
+ String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
+// System.out.println("TAB: " + currentView.getPath() + tabPath);
+
+ if (group != null) {
+ String path = "ResourceGroup/" + group.getId() + tabPath;
+ History.newItem(path, false);
+ }
+ }
+
+
+ public void renderView(ViewPath viewPath) {
+ // TODO: Implement this method.
+
+ if (viewPath.isEnd()) {
+ // default
+
+ } else {
+
+ tabView = viewPath.getCurrent();
+ subtabView = viewPath.getNext();
+
+ for (Tab t : topTabSet.getTabs()) {
+ TwoLevelTab tab = (TwoLevelTab) t;
+
+ if (tab.getTitle().equals(tabView.getPath())) {
+ topTabSet.selectTab(tabView.getPath());
+
+ tab.getLayout().selectTab(subtabView.getPath());
+
+
+ }
+
+ }
+
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
new file mode 100644
index 0000000..e8ae5aa
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
@@ -0,0 +1,195 @@
+/*
+ * 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.groups.detail;
+
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+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 org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.group.GroupCategory;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.tagging.Tag;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView;
+import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+
+/**
+ * @author Greg Hinkle
+ * @author Ian Springer
+ */
+public class ResourceGroupTitleBar extends HLayout {
+ private static final String FAV_ICON = "Favorite_24_Selected.png";
+ private static final String NOT_FAV_ICON = "Favorite_24.png";
+
+ private ResourceGroup group;
+
+ private Img badge;
+ private Img favoriteButton;
+ private HTMLFlow title;
+ private Img availabilityImage;
+ private boolean favorite;
+
+ public ResourceGroupTitleBar() {
+ super();
+ setWidth100();
+ setHeight(30);
+ setPadding(5);
+ setMembersMargin(5);
+ }
+
+ public void update() {
+ for (Canvas child : getChildren()) {
+ child.destroy();
+ }
+
+ this.title = new HTMLFlow();
+ this.title.setWidth("*");
+
+ this.availabilityImage = new Img("resources/availability_grey_24.png",
24, 24);
+
+ this.favoriteButton = new Img(NOT_FAV_ICON, 24, 24);
+
+ this.favoriteButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ Set<Integer> favorites = toggleFavoriteLocally();
+ CoreGUI.getUserPreferences().setFavoriteResources(favorites, new
UpdateFavoritesCallback());
+ }
+ });
+
+ badge = new Img("types/Service_up_24.png", 24, 24);
+
+ TagEditorView tagEditorView = new TagEditorView(group.getTags(), false, new
TagsChangedCallback() {
+ public void tagsChanged(final HashSet<Tag> tags) {
+ GWTServiceLookup.getTagService().updateResourceGroupTags(group.getId(),
tags, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to update
resource group tags", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("Resource
group tags updated", Message.Severity.Info));
+ // update what is essentially our local cache
+ group.setTags(tags);
+ }
+ });
+ }
+ });
+
+ loadTags(tagEditorView);
+
+
+ addMember(badge);
+ addMember(title);
+ addMember(tagEditorView);
+ addMember(availabilityImage);
+ addMember(favoriteButton);
+ }
+
+ private void loadTags(final TagEditorView tagEditorView) {
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addFilterId(group.getId());
+ criteria.fetchTags(true);
+ GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria,
new AsyncCallback<PageList<ResourceGroup>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Could not load resource
tags",caught);
+ }
+
+ public void onSuccess(PageList<ResourceGroup> result) {
+ LinkedHashSet<Tag> tags = new LinkedHashSet<Tag>();
+ tags.addAll(result.get(0).getTags());
+ tagEditorView.setTags(tags);
+ }
+ });
+ }
+
+
+
+ public void setGroup(ResourceGroup group) {
+ this.group = group;
+ update();
+
+ this.title.setContents("<span class=\"SectionHeader\">"
+ group.getName() + "</span> <span
class=\"subtitle\">" + group.getGroupCategory().name() +
"</span>");
+
+ Set<Integer> favorites =
CoreGUI.getUserPreferences().getFavoriteResourceGroups();
+ this.favorite = favorites.contains(group.getId());
+ updateFavoriteButton();
+
+ this.availabilityImage.setSrc("resources/availability_" +
+ (true ? "green" : "red") + //todo
+ "_24.png");
+
+
+
+ String category = this.group.getGroupCategory() == GroupCategory.COMPATIBLE ?
"Cluster" : "Group";
+
+
+ String avail = "up"; // todo
+// (resource.getCurrentAvailability() != null &&
resource.getCurrentAvailability().getAvailabilityType() != null)
+// ?
(resource.getCurrentAvailability().getAvailabilityType().name().toLowerCase()) :
"down";
+ badge.setSrc("types/" + category + "_" + avail +
"_24.png");
+
+ markForRedraw();
+ }
+
+ private void updateFavoriteButton() {
+ this.favoriteButton.setSrc(favorite ? FAV_ICON : NOT_FAV_ICON);
+ this.favoriteButton.setTooltip("Click to " + (favorite ?
"remove" : "add") + " this group as a favorite.");
+ }
+
+ private Set<Integer> toggleFavoriteLocally() {
+ this.favorite = !this.favorite;
+ Set<Integer> favorites =
CoreGUI.getUserPreferences().getFavoriteResourceGroups();
+ if (this.favorite) {
+ favorites.add(group.getId());
+ } else {
+ favorites.remove(group.getId());
+ }
+ return favorites;
+ }
+
+ public class UpdateFavoritesCallback implements AsyncCallback<Subject> {
+ public void onSuccess(Subject subject) {
+ CoreGUI.getMessageCenter().notify(new Message((favorite ? "Added "
: "Removed ") + " Group "
+ + ResourceGroupTitleBar.this.group.getName() + " as a
favorite.", Message.Severity.Info));
+ updateFavoriteButton();
+ }
+
+ public void onFailure(Throwable throwable) {
+ CoreGUI.getMessageCenter().notify(new Message("Failed to " +
(favorite ? "add " : "remove ") + " Group "
+ + ResourceGroupTitleBar.this.group.getName() + " as a
favorite.", Message.Severity.Error));
+ // Revert back to our original favorite status, since the server update
failed.
+ toggleFavoriteLocally();
+ }
+ }
+}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
new file mode 100644
index 0000000..37c492c
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java
@@ -0,0 +1,146 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail;
+
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.layout.HLayout;
+
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.ViewId;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ResourceGroupTopView extends HLayout implements BookmarkableView {
+
+ private Canvas contentCanvas;
+
+ private Resource currentResource;
+ //private Resource resourcePlatform;
+
+// private ResourceTreeView treeView;
+ private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+
+ public ResourceGroupTopView() {
+
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ setWidth100();
+ setHeight100();
+
+
+// treeView = new ResourceTreeView();
+// addMember(treeView);
+
+ contentCanvas = new Canvas();
+ addMember(contentCanvas);
+
+
+ // created above
+// detailView = new ResourceDetailView();
+
+// treeView.addResourceSelectListener(detailView);
+
+
+ setContent(detailView);
+
+ }
+/*
+ public void setSelectedResource(final int resourceId, final ViewPath view) {
+ Resource resource = this.treeView.getResource(resourceId);
+ if (resource != null) {
+ setSelectedResource(resource, view);
+ } else {
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(resourceId);
+ criteria.fetchTags(true);
+ //criteria.fetchParentResource(true);
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getMessageCenter().notify(new Message("Resource with id
[" + resourceId +
+ "] does not exist or is not accessible.",
Message.Severity.Warning));
+
+ CoreGUI.goTo(InventoryView.VIEW_PATH);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ if (result.isEmpty()) {
+ //noinspection ThrowableInstanceNeverThrown
+ onFailure(new Exception("Resource with id [" +
resourceId + "] does not exist."));
+ } else {
+ Resource resource = result.get(0);
+ setSelectedResource(resource, view);
+ }
+ }
+ });
+ }
+ }
+
+ private void setSelectedResource(Resource resource, ViewPath viewPath) {
+ this.currentResource = resource;
+ this.treeView.setSelectedResource(resource, viewPath.getCurrent());
+ this.detailView.onResourceSelected(resource);
+ }*/
+
+ public void setContent(Canvas newContent) {
+ if (contentCanvas.getChildren().length > 0)
+ contentCanvas.getChildren()[0].destroy();
+ contentCanvas.addChild(newContent);
+ contentCanvas.markForRedraw();
+ }
+
+
+ public void renderView(ViewPath viewPath) {
+ if (viewPath.isEnd()) {
+ // default detail view
+ viewPath.getViewPath().add(new ViewId("Summary"));
+ viewPath.getViewPath().add(new ViewId("Overview"));
+ }
+
+ Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
+
+ if (currentResource == null || currentResource.getId() != resourceId) {
+
+// setSelectedResource(resourceId, viewPath);
+
+// this.treeView.renderView(viewPath);
+
+ viewPath.next();
+
+ this.detailView.renderView(viewPath);
+
+ }
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeDatasource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeDatasource.java
new file mode 100644
index 0000000..51b48eb
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeDatasource.java
@@ -0,0 +1,329 @@
+/*
+ * 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.groups.detail;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+
+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.DataSource;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceImageField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.types.DSDataFormat;
+import com.smartgwt.client.types.DSProtocol;
+import com.smartgwt.client.widgets.tree.TreeNode;
+
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceSubCategory;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+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;
+
+/**
+ * This doesn't extend RPCDataSource because it is tree oriented and
+ * behaves different from normal list data sources in some places.
+ *
+ * @author Greg Hinkle
+ */
+public class ResourceGroupTreeDatasource extends DataSource {
+
+ private boolean initialized = false;
+ int rootId;
+ List<Resource> initialData;
+
+ private ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+ public ResourceGroupTreeDatasource(List<Resource> initialData) {
+ setClientOnly(false);
+ setDataProtocol(DSProtocol.CLIENTCUSTOM);
+ setDataFormat(DSDataFormat.CUSTOM);
+
+ this.initialData = initialData;
+
+ this.rootId = rootId;
+
+ DataSourceField idDataField = new DataSourceTextField("id",
"ID");
+ idDataField.setPrimaryKey(true);
+
+ DataSourceTextField nameDataField = new DataSourceTextField("name",
"Name");
+ nameDataField.setCanEdit(false);
+
+ DataSourceTextField descriptionDataField = new
DataSourceTextField("description", "Description");
+ descriptionDataField.setCanEdit(false);
+
+ DataSourceImageField availabilityDataField = new
DataSourceImageField("currentAvailability", "Availability");
+ descriptionDataField.setCanEdit(false);
+
+ DataSourceTextField parentIdField = new DataSourceTextField("parentId",
"Parent ID");
+ parentIdField.setForeignKey("id");
+ // parentIdField.setRootValue(rootId);
+
+ // DataSourceTextField parentKeyField = new
DataSourceTextField("parentKey", "Parent KEY");
+ // parentKeyField.setForeignKey("id");
+ // parentKeyField.setRootValue(rootId);
+
+ // nameDataField.setType(FieldType.);
+
+ setDropExtraFields(false);
+
+ setFields(idDataField, nameDataField, descriptionDataField,
availabilityDataField);
+ }
+
+ @Override
+ protected Object transformRequest(DSRequest request) {
+ String requestId = request.getRequestId();
+ DSResponse response = new DSResponse();
+ response.setAttribute("clientContext",
request.getAttributeAsObject("clientContext"));
+ // Asume success
+ response.setStatus(0);
+ switch (request.getOperationType()) {
+ case ADD:
+ //executeAdd(request, response);
+ break;
+ case FETCH:
+ executeFetch(requestId, request, response);
+ break;
+ case REMOVE:
+ //executeRemove(lstRec);
+ break;
+ case UPDATE:
+ //executeAdd(lstRec, false);
+ break;
+
+ default:
+ break;
+ }
+
+ return request.getData();
+ }
+
+
+ public void executeFetch(final String requestId, final DSRequest request, final
DSResponse response) {
+ final long start = System.currentTimeMillis();
+
+ String p = request.getCriteria().getAttribute("parentId");
+ // System.out.println("All attributes: " +
Arrays.toString(request.getCriteria().getAttributes()));
+
+ ResourceCriteria criteria = new ResourceCriteria();
+
+ if (p == null) {
+ System.out.println("DataSourceTree: Loading initial data");
+
+ // criteria.addFilterId(rootId);
+
+ processIncomingData(initialData, response, requestId);
+ return;
+
+ } else {
+ System.out.println("DataSourceTree: Loading " + p);
+
+ criteria.addFilterParentResourceId(Integer.parseInt(p));
+ }
+
+ // The server is already eager fetch resource type
+ // * criteria.fetchResourceType(true);
+
+ resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to load resource data
for tree", caught);
+ response.setStatus(RPCResponse.STATUS_FAILURE);
+ processResponse(requestId, response);
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ processIncomingData(result, response, requestId);
+ }
+ });
+ }
+
+ private void processIncomingData(List<Resource> result, final DSResponse
response, final String requestId) {
+
+ ResourceTypeRepository.Cache.getInstance().loadResourceTypes(result,
+ EnumSet.of(ResourceTypeRepository.MetadataType.operations,
ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory),
+ new ResourceTypeRepository.ResourceTypeLoadedCallback() {
+ public void onResourceTypeLoaded(List<Resource> result) {
+ response.setData(build(result));
+ processResponse(requestId, response);
+
+ }
+ });
+ }
+
+ /**
+ * Construct a set of TreeNodes from a list of resources
+ *
+ * @param resources
+ * @return
+ */
+ public static TreeNode[] build(List<Resource> resources) {
+ ResourceTreeNode[] records = new ResourceTreeNode[resources.size()];
+ for (int x = 0; x < resources.size(); x++) {
+ Resource res = resources.get(x);
+ ResourceTreeNode record = new ResourceTreeNode(res);
+ records[x] = record;
+ }
+
+ return introduceTypeFolders(records);
+ }
+
+ private static TreeNode[] introduceTypeFolders(ResourceTreeNode[] nodes) {
+ ArrayList<TreeNode> built = new ArrayList<TreeNode>();
+ HashMap<ResourceSubCategory, CategoryTreeNode> categories = new
HashMap<ResourceSubCategory, CategoryTreeNode>();
+ HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType,
TypeTreeNode>();
+
+
+ for (ResourceTreeNode node : nodes) {
+ built.add(node);
+
+ if (!types.containsKey(node.getResourceType())
+ && node.getResourceType().getCategory() !=
ResourceCategory.PLATFORM) {
+
+ String parentResourceId =
String.valueOf(node.getResource().getParentResource().getId());
+
+ CategoryTreeNode categoryNode = null;
+
+ if (node.getResourceType().getSubCategory() != null) {
+ ResourceSubCategory category =
node.getResourceType().getSubCategory();
+ if (category.getName() != null) {
+ categoryNode = categories.get(category);
+
+ if (categoryNode == null) {
+ categoryNode = new CategoryTreeNode(parentResourceId,
category);
+
+ categories.put(category, categoryNode);
+ built.add(categoryNode);
+ }
+ }
+ }
+
+ String parentId = null;
+ if (categoryNode != null) {
+ parentId = categoryNode.getAttribute("id");
+ } else {
+ parentId = parentResourceId;
+ }
+
+ TypeTreeNode typeNode = new TypeTreeNode(parentId, parentResourceId,
node.getResourceType().getName());
+ built.add(typeNode);
+ types.put(node.getResourceType(), typeNode);
+ }
+ }
+
+ return built.toArray(new TreeNode[built.size()]);
+
+ }
+
+ private static boolean sameTypes(ResourceTreeNode[] nodes) {
+ ResourceType first = nodes[0].getResourceType();
+ for (ResourceTreeNode node : nodes) {
+ if (!first.equals(node)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static class CategoryTreeNode extends TreeNode {
+ public CategoryTreeNode(String parentId, ResourceSubCategory category) {
+ setID(parentId + "__" + category.getName());
+ setParentID(parentId);
+ setName(category.getDisplayName());
+
+ setAttribute("id", parentId + "__" +
category.getName());
+ setAttribute("parentId", parentId);
+ setAttribute("name", category.getDisplayName());
+ }
+ }
+
+
+ public static class TypeTreeNode extends TreeNode {
+
+ private TypeTreeNode(String parentId, String parentResourceId, String type) {
+ setID(parentId + "_" + type);
+ setParentID(parentId);
+
+ setAttribute("id", parentResourceId + "_" + type);
+ setAttribute("parentId", parentId);
+ // setAttribute("parentKey", parentId);
+ setAttribute("name", type);
+ }
+
+ }
+
+ public static class ResourceTreeNode extends TreeNode {
+
+ private Resource resource;
+
+ private ResourceTreeNode(Resource resource) {
+ this.resource = resource;
+
+ String id = String.valueOf(resource.getId());
+ String parentId = resource.getParentResource() == null ? null
+ : (resource.getParentResource().getId() + "_" +
resource.getResourceType().getName());
+
+ // System.out.println(id + " / " + parentId);
+
+ setID(id);
+ setParentID(parentId);
+
+ setAttribute("id", id);
+ setAttribute("parentId", parentId);
+
+ // setAttribute("parentKey",
resource.getParentResource() == null ? 0 : (resource.getParentResource().getId() +
resource.getResourceType().getName()));
+
+ setAttribute("name", resource.getName());
+ setAttribute("description", resource.getDescription());
+ setAttribute(
+ "currentAvailability",
+ resource.getCurrentAvailability().getAvailabilityType() ==
AvailabilityType.UP ? "/images/icons/availability_green_16.png"
+ : "/images/icons/availability_red_16.png");
+
+ setIsFolder((resource.getResourceType().getChildResourceTypes() != null
&& !resource.getResourceType()
+ .getChildResourceTypes().isEmpty()));
+ }
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ public void setResource(Resource resource) {
+ this.resource = resource;
+ }
+
+ public ResourceType getResourceType() {
+ return resource.getResourceType();
+ }
+
+ public String getParentId() {
+ return getAttribute("parentId");
+ }
+ }
+}
\ No newline at end of file
commit 3070ccda29b5fb7cb46a6974940d3c8bba01bf5d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:46:24 2010 -0400
Exposed group favorites
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 edaa01f..62c88dd 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
@@ -62,6 +62,17 @@ public class UserPreferences {
store(callback);
}
+ public Set<Integer> getFavoriteResourceGroups() {
+ return getPreferenceAsIntegerSet(UserPreferenceNames.GROUP_HEALTH_GROUPS);
+ }
+
+ public void setFavoriteResourceGroups(Set<Integer> resourceGroupIds,
AsyncCallback<Subject> callback) {
+ setPreference(UserPreferenceNames.GROUP_HEALTH_GROUPS, resourceGroupIds);
+ store(callback);
+ }
+
+
+
protected String getPreference(String name) {
return userConfiguration.getSimpleValue(name, null);
commit 5aad7544a4d5b37d54b27373ab045d19cf854332
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:45:44 2010 -0400
An inplace single-resource selector
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/lookup/ResourceLookupComboBoxItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/lookup/ResourceLookupComboBoxItem.java
new file mode 100644
index 0000000..0717df5
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/lookup/ResourceLookupComboBoxItem.java
@@ -0,0 +1,63 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.components.lookup;
+
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.TextMatchStyle;
+import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
+import com.smartgwt.client.widgets.grid.ListGridField;
+
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
+
+/**
+ * @author Greg Hinkle
+ */
+public class ResourceLookupComboBoxItem extends ComboBoxItem {
+
+ public ResourceLookupComboBoxItem(String name, String title) {
+ super(name, title);
+ setWidth(300);
+ setHint("resource search");
+ setShowHintInField(false);
+
+ setOptionDataSource(new ResourceDatasource());
+
+ ListGridField nameField = new ListGridField("name", "Name",
250);
+ ListGridField descriptionField = new ListGridField("description",
"Description");
+ ListGridField typeNameField = new ListGridField("typeName",
"Type", 130);
+ ListGridField pluginNameField = new ListGridField("pluginName",
"Plugin", 100);
+ ListGridField categoryField = new ListGridField("category",
"Category", 60);
+ ListGridField availabilityField = new
ListGridField("currentAvailability", "Availability", 55);
+ availabilityField.setAlign(Alignment.CENTER);
+
+ setPickListFields(nameField, descriptionField, typeNameField, pluginNameField,
categoryField, availabilityField);
+
+ setValueField("id");
+ setDisplayField("name");
+ setPickListWidth(800);
+ setTextMatchStyle(TextMatchStyle.SUBSTRING);
+ setCompleteOnTab(true);
+
+
+ }
+}
commit 392dc509343611da3b2493118629e842f698cc26
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:45:22 2010 -0400
expose validation state for config editor
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 89fbba7..74d9bf7 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
@@ -60,6 +60,7 @@ import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.ValuesManager;
import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
@@ -132,6 +133,8 @@ public class ConfigurationEditor extends VLayout {
private Configuration configuration;
private Configuration originalConfiguration;
+ private ValuesManager valuesManager = new ValuesManager();
+
private boolean changed = false;
private Label loadingLabel = new Label("<b>Loading...</b>");
@@ -190,6 +193,10 @@ public class ConfigurationEditor extends VLayout {
addMember(new Label(message));
}
+ public boolean validate() {
+ return this.valuesManager.validate();
+ }
+
@Override
protected void onDraw() {
super.onDraw();
@@ -457,6 +464,7 @@ public class ConfigurationEditor extends VLayout {
private DynamicForm buildPropertiesForm(ArrayList<PropertyDefinition>
definitions, AbstractPropertyMap propertyMap) {
DynamicForm form = new DynamicForm();
+ form.setValuesManager(valuesManager);
form.setValidateOnChange(true);
form.addItemChangedHandler(new ItemChangedHandler() {
@@ -501,7 +509,8 @@ public class ConfigurationEditor extends VLayout {
StaticTextItem nameItem = new StaticTextItem();
nameItem.setStartRow(true);
- nameItem.setValue("<b>" + propertyDefinition.getDisplayName() +
"</b>");
+ String title = "<b>" + (propertyDefinition.getDisplayName() !=
null ? propertyDefinition.getDisplayName() : propertyDefinition.getName()) +
"</b>";
+ nameItem.setValue(title);
nameItem.setShowTitle(false);
nameItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
commit ea5b210af7fcc646f0c63182b553c0991b230013
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:44:33 2010 -0400
Dashboard, measurement schedule and event data access to gwt
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index b60e8cc..eb4504b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -38,7 +38,7 @@
<!-- limit builds to your preferred browser -->
<!-- Safari -->
- <!--<set-property name="user.agent"
value="safari"/>-->
+ <set-property name="user.agent" value="safari"/>
<!-- Firefox 3 -->
<!-- <set-property name="user.agent"
value="gecko1_8"/>-->
@@ -66,5 +66,7 @@
<servlet path="/RemoteInstallGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/>
<servlet path="/RepoGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl"/>
<servlet path="/ContentGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
+ <servlet path="/DashboardGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/>
+ <servlet path="/EventGWTService"
class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/>
</module>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
new file mode 100644
index 0000000..da86756
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
@@ -0,0 +1,47 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.gwt;
+
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.dashboard.Dashboard;
+
+/**
+ * @author Greg Hinkle
+ */
+public interface DashboardGWTService extends RemoteService {
+
+
+ List<Dashboard> findDashboardsForSubject();
+
+ List<Dashboard> findSharedDashboards();
+
+ Dashboard storeDashboard(Dashboard dashboard);
+
+ void removeDashboard(int dashboardId);
+
+
+}
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
new file mode 100644
index 0000000..04b967b
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
@@ -0,0 +1,59 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.gwt;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import org.rhq.core.domain.criteria.EventCriteria;
+import org.rhq.core.domain.event.Event;
+import org.rhq.core.domain.event.EventSeverity;
+import org.rhq.core.domain.util.PageList;
+
+/**
+ * @author Greg Hinkle
+ */
+public interface EventGWTService extends RemoteService {
+
+
+ EventSeverity[] getSeverityBuckets(
+ int resourceId,
+ long begin,
+ long end,
+ int numBuckets);
+
+ EventSeverity[] getSeverityBucketsForAutoGroup(
+ int parentResourceId,
+ int resourceTypeId,
+ long begin,
+ long end,
+ int numBuckets);
+
+ EventSeverity[] getSeverityBucketsForCompGroup(
+
+ int resourceGroupId,
+ long begin,
+ long end,
+ int numBuckets);
+
+ PageList<Event> findEventsByCriteria(EventCriteria criteria);
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index d48dd7a..af1a631 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -108,6 +108,16 @@ public class GWTServiceLookup {
return secure(SearchGWTServiceAsync.Util.getInstance());
}
+ public static DashboardGWTServiceAsync getDashboardService() {
+ return secure(DashboardGWTServiceAsync.Util.getInstance());
+ }
+
+ public static EventGWTServiceAsync getEventService() {
+ return secure(EventGWTServiceAsync.Util.getInstance());
+ }
+
+
+
private static <T> T secure(Object sdt) {
if (!(sdt instanceof ServiceDefTarget))
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index 5a9ae94..48776a3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -19,9 +19,13 @@
package org.rhq.enterprise.gui.coregui.client.gwt;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
+import org.rhq.core.domain.criteria.MeasurementScheduleCriteria;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
import org.rhq.core.domain.util.PageControl;
@@ -49,4 +53,10 @@ public interface MeasurementDataGWTService extends RemoteService {
PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId,
long start, long end, PageControl pageControl);
+
+
+ public PageList<MeasurementDefinition>
findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
+
+ public PageList<MeasurementSchedule>
findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index 97b5a3e..acc4198 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -92,6 +92,14 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
ContentGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
DashboardGWTService</servlet-name>
+
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
EventGWTService</servlet-name>
+
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -182,4 +190,12 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
SearchGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SearchGWTService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
DashboardGWTService</servlet-name>
+
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DashboardGWTService</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI
EventGWTService</servlet-name>
+
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/EventGWTService</url-pattern>
+ </servlet-mapping>
</web-app>
commit c7555e033462802c402dad30bbb90ca506fa6ba9
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:42:16 2010 -0400
Dashboard access
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerBean.java
new file mode 100644
index 0000000..db4c6b6
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerBean.java
@@ -0,0 +1,100 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.server.dashboard;
+
+import java.util.List;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+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.dashboard.Dashboard;
+import org.rhq.enterprise.server.RHQConstants;
+import org.rhq.enterprise.server.auth.SubjectManagerBean;
+import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
+import org.rhq.enterprise.server.authz.PermissionException;
+
+/**
+ *
+ * @author Greg Hinkle
+ */
+@Stateless
+public class DashboardManagerBean implements DashboardManagerLocal,
DashboardManagerRemote{
+
+ @SuppressWarnings("unused")
+ private final Log log = LogFactory.getLog(SubjectManagerBean.class);
+
+ @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
+ private EntityManager entityManager;
+
+ @EJB
+ private AuthorizationManagerLocal authorizationManager;
+
+
+ public List<Dashboard> findDashboardsForSubject(Subject subject) {
+ Query query = entityManager.createQuery("SELECT d FROM Dashboard d WHERE
d.owner.id = :subjectId");
+
+ query.setParameter("subjectId", subject.getId());
+
+ return query.getResultList();
+
+ }
+
+ public List<Dashboard> findSharedDashboards(Subject subject) {
+ Query query = entityManager.createQuery("SELECT d FROM Dashboard d WHERE
d.shared = true");
+
+ return query.getResultList();
+ }
+
+ public Dashboard storeDashboard(Subject subject, Dashboard dashboard) {
+ Dashboard d = null;
+ if ((d = entityManager.find(Dashboard.class, dashboard.getId())) == null) {
+ dashboard.setOwner(subject);
+ entityManager.persist(dashboard);
+ return dashboard;
+ } else {
+ if (!authorizationManager.hasGlobalPermission(subject,
Permission.MANAGE_SETTINGS) && d.getOwner().getId() != subject.getId()) {
+ throw new PermissionException("You may only alter dashboards you
own.");
+ }
+ return entityManager.merge(dashboard);
+ }
+ }
+
+ public void removeDashboard(Subject subject, int dashboardId) {
+
+ Dashboard toDelete = entityManager.find(Dashboard.class,dashboardId);
+
+ if (!authorizationManager.hasGlobalPermission(subject,
Permission.MANAGE_SETTINGS) && toDelete.getOwner().getId() != subject.getId()) {
+ throw new PermissionException("You may only delete dashboards you
own.");
+ }
+
+ entityManager.remove(toDelete);
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerLocal.java
new file mode 100644
index 0000000..c915e5b
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerLocal.java
@@ -0,0 +1,33 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.server.dashboard;
+
+import javax.ejb.Local;
+
+/**
+ * @author Greg Hinkle
+ */
+@Local
+public interface DashboardManagerLocal extends DashboardManagerRemote {
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerRemote.java
new file mode 100644
index 0000000..c51a9a5
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/dashboard/DashboardManagerRemote.java
@@ -0,0 +1,50 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.server.dashboard;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.ejb.Remote;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.dashboard.Dashboard;
+
+/**
+ * @author Greg Hinkle
+ */
+@Remote
+public interface DashboardManagerRemote {
+
+
+ public List<Dashboard> findDashboardsForSubject(Subject subject);
+
+ public List<Dashboard> findSharedDashboards(Subject subject);
+
+ public Dashboard storeDashboard(Subject subject, Dashboard dashboard);
+
+ public void removeDashboard(Subject subject, int dashboardId);
+
+
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 9367bdc..f75b7e2 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -101,6 +101,8 @@ import org.rhq.enterprise.server.core.CoreServerMBean;
import org.rhq.enterprise.server.core.EmailManagerBean;
import org.rhq.enterprise.server.core.EmailManagerLocal;
import org.rhq.enterprise.server.core.plugin.PluginDeploymentScannerMBean;
+import org.rhq.enterprise.server.dashboard.DashboardManagerBean;
+import org.rhq.enterprise.server.dashboard.DashboardManagerLocal;
import org.rhq.enterprise.server.discovery.DiscoveryBossBean;
import org.rhq.enterprise.server.discovery.DiscoveryBossLocal;
import org.rhq.enterprise.server.entitlement.EntitlementManagerBean;
@@ -572,6 +574,9 @@ public final class LookupUtil {
return lookupLocal(TagManagerBean.class);
}
+ public static DashboardManagerLocal getDashboardManagerLocal() {
+ return lookupLocal(DashboardManagerBean.class);
+ }
public static CoreServerMBean getCoreServer() {
@@ -595,6 +600,7 @@ public final class LookupUtil {
return service;
}
+
//--------------------------------------------
// The TEST services
//--------------------------------------------
commit 5d48df59d9eac105562bfff4757f4c0f8e8faa9d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Fri Jun 18 10:41:45 2010 -0400
Core dashboard storage, schema install and domain classes
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 92ae1d2..2013b3d 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.87</db.schema.version>
+ <db.schema.version>2.88</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
b/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
index 11655fb..f4993e5 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
@@ -39,7 +39,7 @@ To run the default target, you must set one of the following properties
to true:
<property name="dbsetup.scripts.dir"
value="${basedir}/src/main/scripts/dbsetup" />
<property name="dbsetup.output.dir"
value="${basedir}/target/dbsetup" /> <!-- away from classes so it
doesn't go into the jar -->
<!-- define the setup creation processing order. note, removals are done in the
reverse order -->
- <property name="dbsetup.subsystems"
value="config,cluster,inventory,auth,authz,search,operation,event,alert,sysconfig,scheduler,amps,measurement,content,resource-request,jms,obsolete"/>
+ <property name="dbsetup.subsystems"
value="config,cluster,inventory,auth,authz,search,dashboard,operation,event,alert,sysconfig,scheduler,amps,measurement,content,resource-request,jms,obsolete"/>
<property name="dbsetup.combined.schema"
value="${dbsetup.output.dir}/all-schema.xml" />
<property name="dbsetup.combined.data"
value="${dbsetup.output.dir}/all-data.xml" />
<property name="dbsetup.tstamp.file"
value="${dbsetup.output.dir}/dbsetup-combine.tstamp" />
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/dashboard-schema.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/dashboard-schema.xml
new file mode 100644
index 0000000..48c95a5
--- /dev/null
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/dashboard-schema.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<dbsetup name="amps-schema.xml"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-dbsetup-schema">
+
+
+ <table name="RHQ_DASHBOARD">
+ <column name="ID" default="sequence-only"
initial="10001" primarykey="true" required="true"
type="INTEGER"/>
+ <column name="NAME" type="VARCHAR2" size="200"
required="true"/>
+ <column name="SUBJECT_ID" type="INTEGER"
required="true"/>
+ <column name="SHARED" type="BOOLEAN"
required="true"/>
+ <column name="CONFIGURATION_ID" type="INTEGER"
required="false" references="RHQ_CONFIG"/>
+ </table>
+
+
+ <table name="RHQ_DASHBOARD_PORTLET">
+ <column name="ID" default="sequence-only"
initial="10001" primarykey="true" required="true"
type="INTEGER"/>
+ <column name="NAME" type="VARCHAR2" size="200"
required="true"/>
+ <column name="PORTLET_KEY" type="VARCHAR2"
size="200" required="true"/>
+ <column name="COL" type="INTEGER"
required="true"/>
+ <column name="COL_INDEX" type="INTEGER"
required="true"/>
+ <column name="HEIGHT" type="INTEGER"
required="true"/>
+ <column name="CONFIGURATION_ID" type="INTEGER"
required="false" references="RHQ_CONFIG"/>
+ <column name="DASHBOARD_ID" type="INTEGER"
required="false" references="RHQ_DASHBOARD"/>
+ </table>
+
+</dbsetup>
\ No newline at end of file
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 4ba557b..b650283 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2984,7 +2984,77 @@
</statement>
</schema-directSQL>
</schemaSpec>
-
+
+ <schemaSpec version="2.88">
+
+ <!-- the customizable dashboard storage system -->
+
+ <schema-createSequence name="RHQ_DASHBOARD_ID_SEQ"
initial="10001"/>
+ <schema-directSQL>
+ <statement desc="Creating table RHQ_DASHBOARD">
+ CREATE TABLE RHQ_DASHBOARD ( ID INTEGER PRIMARY KEY )
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="ID" nullable="FALSE"/>
+ <schema-addColumn table="RHQ_DASHBOARD"
column="NAME" columnType="VARCHAR2" precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="NAME" nullable="FALSE"/>
+ <schema-addColumn table="RHQ_DASHBOARD"
column="SUBJECT_ID" columnType="INTEGER"/>
+ <schema-addColumn table="RHQ_DASHBOARD"
column="SHARED" columnType="BOOLEAN"/>
+ <schema-alterColumn table="RHQ_DASHBOARD"
column="SHARED" nullable="FALSE"/>
+ <schema-addColumn table="RHQ_DASHBOARD"
column="CONFIGURATION_ID" columnType="INTEGER"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD
+ ADD CONSTRAINT RHQ_DASH_CFG_ID_FK
+ FOREIGN KEY ( CONFIGURATION_ID )
+ REFERENCES RHQ_CONFIG ( ID )
+ </statement>
+ </schema-directSQL>
+
+
+ <schema-createSequence name="RHQ_DASHBOARD_PORTLET_ID_SEQ"
initial="10001"/>
+ <schema-directSQL>
+ <statement desc="Creating table
RHQ_DASHBOARD_PORTLET">
+ CREATE TABLE RHQ_DASHBOARD_PORTLET ( ID INTEGER PRIMARY KEY )
+ </statement>
+ </schema-directSQL>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="ID" nullable="FALSE"/>
+
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="NAME" columnType="VARCHAR2" precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="NAME" nullable="FALSE"/>
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="PORTLET_KEY" columnType="VARCHAR2"
+ precision="200"/>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="PORTLET_KEY" nullable="FALSE"/>
+
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL" columnType="INTEGER"/>
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="COL_INDEX" columnType="INTEGER"/>
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="HEIGHT" columnType="INTEGER"/>
+
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="CONFIGURATION_ID" columnType="INTEGER"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD_PORTLET
+ ADD CONSTRAINT RHQ_DASH_PT_CFG_ID_FK
+ FOREIGN KEY ( CONFIGURATION_ID )
+ REFERENCES RHQ_CONFIG ( ID )
+ </statement>
+ </schema-directSQL>
+
+
+ <schema-addColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" columnType="INTEGER"/>
+ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET"
column="DASHBOARD_ID" nullable="FALSE"/>
+ <schema-directSQL>
+ <statement>
+ ALTER TABLE RHQ_DASHBOARD_PORTLET
+ ADD CONSTRAINT RHQ_DASH_PT_DASH_ID_FK
+ FOREIGN KEY ( DASHBOARD_ID )
+ REFERENCES RHQ_DASHBOARD ( ID )
+ </statement>
+ </schema-directSQL>
+
+ </schemaSpec>
+
+
</dbupgrade>
</target>
</project>
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
new file mode 100644
index 0000000..6e99c4b
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
@@ -0,0 +1,215 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.dashboard;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.hibernate.annotations.Cascade;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+
+/**
+ * @author Greg Hinkle
+ */
+@Entity
+@SequenceGenerator(name = "RHQ_DASHBOARD_ID_SEQ", sequenceName =
"RHQ_DASHBOARD_ID_SEQ")
+@Table(name = "RHQ_DASHBOARD")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement
+public class Dashboard implements Serializable {
+
+ @Column(name = "ID", nullable = false)
+ @GeneratedValue(strategy = GenerationType.AUTO, generator =
"RHQ_DASHBOARD_ID_SEQ")
+ @Id
+ private int id;
+
+ @Column(name = "NAME", nullable = false)
+ private String name;
+
+
+ @Column(name = "SHARED", nullable = false)
+ private boolean shared = false;
+
+
+ @JoinColumn(name = "CONFIGURATION_ID", referencedColumnName =
"ID")
+ @OneToOne(cascade = { CascadeType.ALL })
+ private Configuration configuration = new Configuration();
+
+
+
+ @JoinColumn(name = "SUBJECT_ID", nullable = false)
+ @ManyToOne(fetch = FetchType.LAZY)
+ private Subject owner;
+
+
+ @OneToMany(mappedBy = "dashboard", fetch = FetchType.EAGER)
+ @Cascade( { org.hibernate.annotations.CascadeType.PERSIST,
org.hibernate.annotations.CascadeType.MERGE,
org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
+ private Set<DashboardPortlet> portlets = new
HashSet<DashboardPortlet>();
+
+
+
+
+ public static final String CFG_COLUMNS = "columns";
+ public static final String CFG_WIDTHS = "widths";
+ public static final String CFG_BACKGROUND = "background";
+ public static final String CFG_REFRESH_RATE = "refresh";
+
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isShared() {
+ return shared;
+ }
+
+ public void setShared(boolean shared) {
+ this.shared = shared;
+ }
+
+ public Subject getOwner() {
+ return owner;
+ }
+
+ public void setOwner(Subject owner) {
+ this.owner = owner;
+ }
+
+ public int getColumns() {
+ return configuration.getSimple(CFG_COLUMNS).getIntegerValue();
+ }
+
+ public void setColumns(int columns) {
+ configuration.put(new PropertySimple(CFG_COLUMNS, columns));
+ }
+
+ public String[] getColumnWidths() {
+ return
configuration.getSimple(CFG_WIDTHS).getStringValue().split(",");
+ }
+
+ public void setColumnWidths(String... columnWidths) {
+ configuration.put(new PropertySimple(CFG_WIDTHS, columnWidths));
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ public Set<DashboardPortlet> getPortlets() {
+ return portlets;
+ }
+
+ public List<DashboardPortlet> getPortlets(int column) {
+
+ List<DashboardPortlet> columnPortlets = new
ArrayList<DashboardPortlet>();
+ for (DashboardPortlet p : this.portlets) {
+ if (p.getColumn() == column) {
+ columnPortlets.add(p);
+ }
+ }
+
+ Collections.sort(columnPortlets, new Comparator<DashboardPortlet>() {
+ public int compare(DashboardPortlet o1, DashboardPortlet o2) {
+ return (o1.getIndex() < o2.getIndex() ? -1 : (o1.getIndex() ==
o2.getIndex() ? 0 : 1));
+ }
+ });
+
+ return columnPortlets;
+ }
+
+
+
+ public boolean removePortlet(DashboardPortlet storedPortlet) {
+ return portlets.remove(storedPortlet);
+ }
+
+ public void addPortlet(DashboardPortlet storedPortlet, int column, int index) {
+ storedPortlet.setColumn(column);
+ storedPortlet.setIndex(index);
+ storedPortlet.setDashboard(this);
+ portlets.add(storedPortlet);
+ }
+
+ public Dashboard deepCoopy(boolean keepIds) {
+
+ Dashboard newDashboard = new Dashboard();
+ if (keepIds) {
+ newDashboard.id = this.id;
+ }
+ newDashboard.name = this.name;
+ newDashboard.owner = this.owner;
+ newDashboard.shared = this.shared;
+ newDashboard.configuration = this.configuration.deepCopy(keepIds);
+
+ for (DashboardPortlet portlet : portlets) {
+ DashboardPortlet newPortlet = portlet.deepCopy(keepIds);
+ newPortlet.setDashboard(this);
+ newDashboard.addPortlet(newPortlet, newPortlet.getColumn(),
newPortlet.getIndex());
+ }
+ return newDashboard;
+ }
+
+}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
new file mode 100644
index 0000000..38b455a
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
@@ -0,0 +1,170 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.core.domain.dashboard;
+
+import java.io.Serializable;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.rhq.core.domain.configuration.Configuration;
+
+/**
+ * @author Greg Hinkle
+ */
+@Entity
+@SequenceGenerator(name = "RHQ_DASHBOARD_PORTLET_ID_SEQ", sequenceName =
"RHQ_DASHBOARD_PORTLET_ID_SEQ")
+@Table(name = "RHQ_DASHBOARD_PORTLET")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement
+public class DashboardPortlet implements Serializable {
+
+
+ @Column(name = "ID", nullable = false)
+ @GeneratedValue(strategy = GenerationType.AUTO, generator =
"RHQ_DASHBOARD_PORTLET_ID_SEQ")
+ @Id
+ private int id;
+
+ @Column(name = "PORTLET_KEY")
+ private String portletKey;
+
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "COL")
+ private int column;
+
+ @Column(name = "COL_INDEX")
+ private int index;
+
+ @Column(name = "HEIGHT")
+ private int height = 300;
+
+ @JoinColumn(name = "CONFIGURATION_ID", referencedColumnName =
"ID")
+ @OneToOne(cascade = { CascadeType.ALL })
+ private Configuration configuration = new Configuration();
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "DASHBOARD_ID", nullable = false)
+ private Dashboard dashboard;
+
+
+ public DashboardPortlet() {
+ }
+
+ public DashboardPortlet(String name, String portletKey, int height) {
+ this.name = name;
+ this.portletKey = portletKey;
+ this.height = height;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getPortletKey() {
+ return portletKey;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getColumn() {
+ return column;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public void setPortletKey(String portletKey) {
+ this.portletKey = portletKey;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setColumn(int column) {
+ this.column = column;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public Dashboard getDashboard() {
+ return dashboard;
+ }
+
+ public void setDashboard(Dashboard dashboard) {
+ this.dashboard = dashboard;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ public DashboardPortlet deepCopy(boolean keepIds) {
+ DashboardPortlet newPortlet = new DashboardPortlet();
+ if (keepIds) {
+ newPortlet.id = this.id;
+ }
+ newPortlet.name = this.name;
+ newPortlet.portletKey = this.portletKey;
+ newPortlet.column = this.column;
+ newPortlet.index = this.index;
+ newPortlet.height = this.height;
+ newPortlet.configuration = this.configuration != null ?
this.configuration.deepCopy(keepIds) : null;
+ return newPortlet;
+ }
+}
commit 80edbde0361b9652e9b5bc659d57552b8f75a1a9
Merge: 19a417e... 65a5fcf...
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Wed Jun 16 11:27:40 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 19a417e69b8900879b720cda795dade68dc5bc81
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Wed Jun 16 11:26:31 2010 -0400
change project version from 3.0.0-SNAPSHOT to 4.0.0-SNAPSHOT
diff --git a/etc/apt/pom.xml b/etc/apt/pom.xml
index a6f6552..0fe6a92 100644
--- a/etc/apt/pom.xml
+++ b/etc/apt/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/perspectives/sample-perspective/app/pom.xml
b/etc/samples/perspectives/sample-perspective/app/pom.xml
index eb531fc..67382f9 100644
--- a/etc/samples/perspectives/sample-perspective/app/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
@@ -28,7 +28,7 @@
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-base-perspective-war</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -43,7 +43,7 @@
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-base-perspective-war</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
<type>war</type>
</dependency>
@@ -53,7 +53,7 @@
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-base-perspective-jar</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- Deps with provided scope are not transitive, so we need to specify
@@ -92,3 +92,4 @@
</build>
</project>
+
diff --git a/etc/samples/perspectives/sample-perspective/perspective/pom.xml
b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
index 206c6e6..1ffe65f 100644
--- a/etc/samples/perspectives/sample-perspective/perspective/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
@@ -22,7 +22,7 @@
<description>A Sample Perspective showing extension points and
filters</description>
<properties>
- <rhq.version>3.0.0-SNAPSHOT</rhq.version>
+ <rhq.version>${project.parent.version}</rhq.version>
</properties>
<dependencies>
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index 72bca97..6eed8b4 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-cli-tests</artifactId>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index eda9133..0833b2a 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index bc7965b..7f7127c 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 2cf950b..d69311c 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index ee81a94..c6a6dab 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index d177f9e..ae391f8 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index a51f92b..f52e92d 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 92ae1d2..4f27a44 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index e0ced84..700912d 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 0911918..21ebfa6 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d47d4c8..b3a20e2 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e1ce7ef..d9c8d4c 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 2e58102..bc886fe 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 7739177..dfcdfde 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index eeb7e81..2e5c467 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7aad64c..b895d04 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index bc41dc5..405eaed 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index d9f1c1c..03f3932 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 8942239..342369a 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 8b9da9c..93931da 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml
b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 611eb9d..c917be9 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml
b/modules/enterprise/gui/base-perspective-war/pom.xml
index 798a8ca..d3c0764 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index df05645..57a30b9 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index ca1b68d..f075eb1 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/installer-war/pom.xml
b/modules/enterprise/gui/installer-war/pom.xml
index dcb1f88..40ba05f 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 0c529ba..072ac8f 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index 783942c..24bb252 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index aa880be..095ada1 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3b0dbb8..89f283c 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index 33966bd..ee90d58 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-cli</artifactId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index 605267f..01ed78b 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-client-api</artifactId>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 910b617..3879afd 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-parent</artifactId>
diff --git a/modules/enterprise/remoting/webservices/pom.xml
b/modules/enterprise/remoting/webservices/pom.xml
index 2ea73ee..393d2e9 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-remoting-webservices</artifactId>
diff --git a/modules/enterprise/server/container-lib/pom.xml
b/modules/enterprise/server/container-lib/pom.xml
index 2c98817..9a2a929 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 6ae155a..d51c61d 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -1,13 +1,11 @@
-<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">
+<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-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index bf15866..00f7835 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 840adfb..e08f58d 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/license-gen/jar/pom.xml
b/modules/enterprise/server/license-gen/jar/pom.xml
index ca17646..93e7d8a 100644
--- a/modules/enterprise/server/license-gen/jar/pom.xml
+++ b/modules/enterprise/server/license-gen/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/license-gen/maven-plugin/pom.xml
b/modules/enterprise/server/license-gen/maven-plugin/pom.xml
index bf1c453..47d159a 100644
--- a/modules/enterprise/server/license-gen/maven-plugin/pom.xml
+++ b/modules/enterprise/server/license-gen/maven-plugin/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index ad4a632..b8556e0 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 9f1a05c..ac2e280 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index 7d884ca..c3f248c 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index c9df693..0b7664a 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 924973d..e6019b8 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 70c948e..f13e951 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
index 45d61df..ca703ae 100644
--- a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
+++ b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
@@ -2,16 +2,17 @@
<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-scriptlang</artifactId>
- <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Script lang Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-sms/pom.xml
b/modules/enterprise/server/plugins/alert-sms/pom.xml
index 901a11d..57175db 100644
--- a/modules/enterprise/server/plugins/alert-sms/pom.xml
+++ b/modules/enterprise/server/plugins/alert-sms/pom.xml
@@ -2,16 +2,17 @@
<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-sms</artifactId>
- <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SMS-Sender Alert Plugin</name>
@@ -197,4 +198,4 @@
</profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index f8a5704..c1689b3 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index cb7123b..09f2ddc 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 73f405e..45280cd 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 4a15ba1..abb2e5d 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 0033d1b..621f3e5 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 61965f2..da8e8e7 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 7451668..8d1e368 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 0ac61d3..f5fbeb1 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml
b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 5a78451..b7f3be7 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
index 19af416..d548a5e 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
index 2039f89..9a45ada 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
index 87b03cb..aef65bf 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 2b16f4a..07be817 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml
b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index e4ab9b2..c1187d1 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index a6cba32..9ada86c 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9c7cc74..ab4f217 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index ebdd3da..243eed4 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 3c03600..fe8638e 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 06c8981..24dd98a 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml
b/modules/enterprise/server/sars/agent-sar/pom.xml
index aa278b8..e933c81 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 0cc2084..786cead 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 14738d0..5990106 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/helpers/pluginAnnotations/pom.xml
b/modules/helpers/pluginAnnotations/pom.xml
index f9dde4c..e637aad 100644
--- a/modules/helpers/pluginAnnotations/pom.xml
+++ b/modules/helpers/pluginAnnotations/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin annotations</name>
<description>Annotations to help generate plugin
descriptors</description>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<scm>
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/help...
diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml
index 4a31a97..940e46d 100644
--- a/modules/helpers/pluginGen/pom.xml
+++ b/modules/helpers/pluginGen/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin generator</name>
<description>Helper to generate plugin skeletons</description>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<scm>
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/help...
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index a0721a9..154fc0f 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 5d327ee..99ece1c 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/jopr/pom.xml b/modules/jopr/pom.xml
index d96100b..530a044 100644
--- a/modules/jopr/pom.xml
+++ b/modules/jopr/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
@@ -37,7 +37,7 @@
<properties>
<rhq.groupId>org.rhq</rhq.groupId>
- <rhq.version>3.0.0-SNAPSHOT</rhq.version>
+ <rhq.version>${project.parent.version}</rhq.version>
<rhq.product.name>RHQ</rhq.product.name>
<rhq.earName>rhq.ear</rhq.earName>
<!-- the below path is relative to {rhq-trunk} -->
diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
index 143984d..c198d6c 100644
--- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
+++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index c37598e..0370302 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index cc160c9..d7e6d8a 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index b4f9208..fb850c5 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 963223b..72d9cc4 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 4f185f4..cb324cc 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
@@ -242,4 +242,4 @@
</profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index d920440..1082bb3 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d5aaad5..9371766 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 30889f7..c72f79a 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index b79645d..0b85a57 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f7cf265..d783ffc 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hardware/pom.xml b/modules/plugins/hardware/pom.xml
index 9050b7e..29d6d11 100644
--- a/modules/plugins/hardware/pom.xml
+++ b/modules/plugins/hardware/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index acb08ef..a7bac31 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 7dd0fde..ef32374 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index de89333..68eae1a 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 853c020..ad90e83 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iptables/pom.xml b/modules/plugins/iptables/pom.xml
index d2b6ff6..ce6d7b8 100644
--- a/modules/plugins/iptables/pom.xml
+++ b/modules/plugins/iptables/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 02e34cd..def88d2 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
@@ -19,11 +19,6 @@
<name>RHQ IRC Server Plugin</name>
<description>Remote monitoring of IRC repos</description>
- <properties>
- <scm.module.path>TODO</scm.module.path>
- <rhq.version>3.0.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see
above too -->
- </properties>
-
<build>
<plugins>
<plugin>
@@ -172,7 +167,6 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
-
<dependency>
<groupId>pircbot</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a0ade77..2766efd 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b9ed2b3..31d5fbc 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index b3846fa..b09a9aa 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 443e524..e9dca27 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jdbctrace/pom.xml b/modules/plugins/jdbctrace/pom.xml
index b21740c..c7ab30c 100644
--- a/modules/plugins/jdbctrace/pom.xml
+++ b/modules/plugins/jdbctrace/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jira/pom.xml b/modules/plugins/jira/pom.xml
index ac4ec8d..8e0a879 100644
--- a/modules/plugins/jira/pom.xml
+++ b/modules/plugins/jira/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ac9885a..83e3030 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index bc182b3..a1a61cf 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/lsof/pom.xml b/modules/plugins/lsof/pom.xml
index c579da0..0667659 100644
--- a/modules/plugins/lsof/pom.xml
+++ b/modules/plugins/lsof/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d0c9053..5152236 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 06ae2ae..67d24a0 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/onewire/pom.xml b/modules/plugins/onewire/pom.xml
index bd59655..8b2fa39 100644
--- a/modules/plugins/onewire/pom.xml
+++ b/modules/plugins/onewire/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 1acdb0f..be37d2b 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 39c75da..136770c 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 97b83b0..5597a30 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 85d6105..4859ad7 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 283ab6a..2130abe 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 5a4466c..beab355 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/raw-config-test/pom.xml
b/modules/plugins/raw-config-test/pom.xml
index c3750ed..7489eff 100644
--- a/modules/plugins/raw-config-test/pom.xml
+++ b/modules/plugins/raw-config-test/pom.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
+
<groupId>org.rhq.plugins</groupId>
<artifactId>raw-config-test</artifactId>
<name>raw-config-test</name>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index a190dcd..3aa3bb6 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 8f4e675..d0ef9fe 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 0d41574..a338a98 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 7719b14..05cb816 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 3ca3e1d..ed7473b 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/services/pom.xml b/modules/plugins/services/pom.xml
index 525335c..0f84fe1 100644
--- a/modules/plugins/services/pom.xml
+++ b/modules/plugins/services/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 2d9d715..89178cc 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3579496..a68e444 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 41df1b8..0353f4f 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 205d5b0..4c93bb3 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index e299efa..9adaca6 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index b3d5e87..4f1c4c3 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index e62f28b..c2550aa 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,10 +4,9 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
-
<groupId>org.rhq</groupId>
<artifactId>rhq-virt-plugin</artifactId>
<packaging>jar</packaging>
diff --git a/modules/pom.xml b/modules/pom.xml
index bc96ae3..e363555 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 2235687..5f96131 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
diff --git a/pom.xml b/pom.xml
index ae5b534..5980dc2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 65a5fcf6342439fcf127529c7b2f1bba5f05f4a6
Merge: 687cb82... 4c33a12...
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Wed Jun 16 16:07:14 2010 +0200
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit 687cb82196f410a5b512c5f7c69da6e85c5bb3cb
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Wed Jun 16 16:04:13 2010 +0200
BZ 601880 - JBossAS5 Plugin - ApplicationServerOperationsDelegate uses old plugin
configuration after plugin configuration was updated.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java
index e4a0ec9..e21153e 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java
@@ -190,7 +190,7 @@ public class ApplicationServerComponent implements ResourceComponent,
ProfileSer
public void start(ResourceContext resourceContext) {
this.resourceContext = resourceContext;
-
+ this.operationDelegate = new ApplicationServerOperationsDelegate(this);
// Connect to the JBAS instance's Profile Service and JMX MBeanServer.
connectToProfileService();
initializeEmsConnection();
@@ -486,10 +486,7 @@ public class ApplicationServerComponent implements ResourceComponent,
ProfileSer
public OperationResult invokeOperation(String name, Configuration parameters) throws
InterruptedException,
Exception {
- if (this.operationDelegate == null) {
- this.operationDelegate = new ApplicationServerOperationsDelegate(this,
this.resourceContext
- .getSystemInformation());
- }
+
ApplicationServerSupportedOperations operation =
Enum.valueOf(ApplicationServerSupportedOperations.class, name
.toUpperCase());
return this.operationDelegate.invoke(operation, parameters);
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
index 643c9cc..5f7ae4f 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java
@@ -37,7 +37,6 @@ import org.mc4j.ems.connection.bean.parameter.EmsParameter;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.core.pluginapi.util.ProcessExecutionUtility;
import org.rhq.core.system.ProcessExecution;
@@ -94,25 +93,13 @@ public class ApplicationServerOperationsDelegate {
*/
private ApplicationServerComponent serverComponent;
- private Configuration pluginConfig;
-
- private ResourceContext resourceContext;
-
private File configPath;
- /**
- * Passed in from the resource context for making process calls.
- */
- private SystemInfo systemInfo;
-
// Constructors --------------------------------------------
public ApplicationServerOperationsDelegate(
- ApplicationServerComponent serverComponent, SystemInfo systemInfo) {
+ ApplicationServerComponent serverComponent) {
this.serverComponent = serverComponent;
- this.resourceContext = serverComponent.getResourceContext();
- this.pluginConfig = this.resourceContext.getPluginConfiguration();
- this.systemInfo = systemInfo;
}
// Public --------------------------------------------
@@ -172,7 +159,7 @@ public class ApplicationServerOperationsDelegate {
result.setErrorMessage("The server is already started.");
return result;
}
-
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
File startScriptFile = getStartScriptPath();
validateScriptFile(
startScriptFile,
@@ -233,7 +220,8 @@ public class ApplicationServerOperationsDelegate {
if (log.isDebugEnabled()) {
log.debug("About to execute the following process: [" + processExecution +
"]");
}
- ProcessExecutionResults results = this.systemInfo
+ SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation();
+ ProcessExecutionResults results = systemInfo
.executeProcess(processExecution);
logExecutionResults(results);
@@ -258,6 +246,7 @@ public class ApplicationServerOperationsDelegate {
}
private String getConfigurationSet() {
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
configPath = resolvePathRelativeToHomeDir(getRequiredPropertyValue(
pluginConfig,
ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR));
@@ -311,6 +300,7 @@ public class ApplicationServerOperationsDelegate {
return result;
}
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
ApplicationServerShutdownMethod shutdownMethod = Enum
.valueOf(
ApplicationServerShutdownMethod.class,
@@ -343,6 +333,7 @@ public class ApplicationServerOperationsDelegate {
validateScriptFile(
shutdownScriptFile,
ApplicationServerPluginConfigurationProperties.SHUTDOWN_SCRIPT_CONFIG_PROP);
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
String prefix = pluginConfig
.getSimple(
ApplicationServerPluginConfigurationProperties.SCRIPT_PREFIX_CONFIG_PROP)
@@ -386,7 +377,8 @@ public class ApplicationServerOperationsDelegate {
log.debug("About to execute the following process: ["
+ processExecution + "]");
}
- ProcessExecutionResults results = this.systemInfo
+ SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation();
+ ProcessExecutionResults results = systemInfo
.executeProcess(processExecution);
logExecutionResults(results);
@@ -413,6 +405,7 @@ public class ApplicationServerOperationsDelegate {
* @return success message if no errors are encountered
*/
private String shutdownViaJmx() {
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
String mbeanName = pluginConfig
.getSimple(
ApplicationServerPluginConfigurationProperties.SHUTDOWN_MBEAN_CONFIG_PROP)
@@ -604,13 +597,15 @@ public class ApplicationServerOperationsDelegate {
*/
@Nullable
public File getJavaHomePath() {
- String javaHomePath =
this.pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.JAVA_HOME,
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
+ String javaHomePath =
pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.JAVA_HOME,
null);
File javaHome = (javaHomePath != null) ? new File(javaHomePath) : null;
return javaHome;
}
void validateJavaHomePathProperty() {
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
String javaHome = pluginConfig.getSimple(
ApplicationServerPluginConfigurationProperties.JAVA_HOME)
.getStringValue();
commit f6fa0f6e0847b28c67be82f8cf4159f32fd2937d
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Wed Jun 16 09:53:16 2010 -0400
Remove unused updates tab from BundleVersionView
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
index 0680b40..663f06c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java
@@ -79,7 +79,7 @@ public class BundleVersionView extends VLayout implements
BookmarkableView {
tabs.addTab(createFilesTab());
- tabs.addTab(createUpdateHistoryTab());
+// tabs.addTab(createUpdateHistoryTab());
addMember(new BackButton("Back to Bundle: " +
version.getBundle().getName(),"Bundles/Bundle/" +
version.getBundle().getId()));
commit 4c33a122281757a65c2398e4570adba753224cbb
Merge: dc7af8a... 9c9a05b...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Jun 16 11:35:48 2010 +0200
Merge branch 'translations'
commit 9c9a05b1cb658d480638fcea86df90e892a11bfc
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Thu Jun 3 11:17:47 2010 +0200
Move non-en properties outside the java class and into .properties files
diff --git
a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java
b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java
index be8ddc5..83e5d73 100644
---
a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java
+++
b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java
@@ -51,290 +51,182 @@ public interface InstallerI18NResourceKeys {
@I18NMessages( { @I18NMessage(locale = "en", value =
"${product.help.doc.root}") })
String HELP_DOC_ROOT = "helpDocRoot";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Create
Database/User"),
- @I18NMessage(locale = "de", value = "Datenbank mit -benutzer
anlegen") })
+ @I18NMessage(locale = "en", value = "Create Database/User")
String CREATE_DATABASE_USER_TITLE = "createDatabaseUserTitle";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Enter your database
administrator's information here and press the button to create a database and
user."),
- @I18NMessage(locale = "de", value = "Geben Sie die
Administratoreninformation hier ein, und clicken Sie den Button, um eine Datenbank mit
Benutzer anzulegen.") })
+ @I18NMessage(locale = "en", value = "Enter your database
administrator's information here and press the button to create a database and
user.")
String CREATE_DATABASE_USER_HELP = "createDatabaseUserHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "DB Connection
URL"),
- @I18NMessage(locale = "de", value = "URL der
Datenbankverbindung") })
+ @I18NMessage(locale = "en", value = "DB Connection URL")
String ADMIN_CONNECTION_URL = "adminConnectionUrl";
- @I18NMessages( { @I18NMessage(locale = "en", value = "DB Admin
Username"),
- @I18NMessage(locale = "de", value = "Benutzername des
Datenbankadministrators") })
+ @I18NMessage(locale = "en", value = "DB Admin Username")
String ADMIN_USERNAME = "adminUsername";
- @I18NMessages( { @I18NMessage(locale = "en", value = "DB Admin
Password"),
- @I18NMessage(locale = "de", value = "Passwort des
Datenbankadministrators") })
+ @I18NMessage(locale = "en", value = "DB Admin Password")
String ADMIN_PASSWORD = "adminPassword";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Usage of the selected
database is for demo purposes only. It should not be used in production installations. No
support is available for installations that use H2 or MS SQL Server for their
database."),
- @I18NMessage(locale = "de", value = "Unterstützung für diese
Datenbank ist experimentell und ist nur für Demo-und Testzwecke geeignet.") })
+ @I18NMessage(locale = "en", value = "Usage of the selected database is
for demo purposes only. It should not be used in production installations. No support is
available for installations that use H2 or MS SQL Server for their database.")
String EXPERIMENTAL_DB = "experimentalDb";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Create a
database/user if needed"),
- @I18NMessage(locale = "de", value = "DB mit -benutzer anlegen,
falls nötig") })
+ @I18NMessage(locale = "en", value = "Create a database/user if
needed")
String CREATE_DATABASE_NOTE = "createDatabaseNote";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Create
Database"),
- @I18NMessage(locale = "de", value = "Datenbank anlegen") })
+ @I18NMessage(locale = "en", value = "Create Database")
String CREATE_DATABASE_BUTTON = "createDatabaseButton";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Confirm database
settings"),
- @I18NMessage(locale = "de", value = "Überprüfen Sie, dass die
Einstellungen für die Datenbank gültig sind") })
+ @I18NMessage(locale = "en", value = "Confirm database settings")
String TEST_DATABASE_NOTE = "testDatabaseNote";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Test
Connection"),
- @I18NMessage(locale = "de", value = "Verbindung testen") })
+ @I18NMessage(locale = "en", value = "Test Connection")
String TEST_DATABASE_BUTTON = "testDatabaseButton";
- @I18NMessages( { @I18NMessage(locale = "en", value = "A database
schema already exists. What do you want to do?"),
- @I18NMessage(locale = "de", value = "Das gewünschte
Datenbankschema existiert schon. Was wollen Sie machen?") })
+ @I18NMessage(locale = "en", value = "A database schema already exists.
What do you want to do?")
String EXISTING_SCHEMA_QUESTION = "existingSchemaQuestion";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Overwrite (lose
existing data)"),
- @I18NMessage(locale = "de", value = "Ãœberschreiben (vorhandene
Daten gehen verloren)") })
+ @I18NMessage(locale = "en", value = "Overwrite (lose existing
data)")
String EXISTING_SCHEMA_OPTION_OVERWRITE = "existingSchemaAnswerOverwrite";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Keep (maintain
existing data)"),
- @I18NMessage(locale = "de", value = "Behalten (existierende Daten
werden aktualisiert)") })
+ @I18NMessage(locale = "en", value = "Keep (maintain existing
data)")
String EXISTING_SCHEMA_OPTION_KEEP = "existingSchemaAnswerUpgrade";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Skip (leave
database as-is)"),
- @I18NMessage(locale = "de", value = "Umgehen (Datenbank bleibt wie
sie ist)") })
+ @I18NMessage(locale = "en", value = "Skip (leave database
as-is)")
String EXISTING_SCHEMA_OPTION_SKIP = "existingSchemaAnswerSkip";
- @I18NMessages( { @I18NMessage(locale = "en", value = "The {0} property
value was an invalid number [{1}]"),
- @I18NMessage(locale = "de", value = "[{1}] ist ein ungültiger
Zahlenwert für die Eigenschaft {0}"),
- @I18NMessage(locale = "fr", value = "La valeur du paramètre {0}
n'est pas un nombre valide [{1}]") })
+ @I18NMessage(locale = "en", value = "The {0} property value was an
invalid number [{1}]")
String INVALID_NUMBER = "invalidNumber";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "The {0} boolean property
value must be either 'true' or 'false' but was [{1}]"),
- @I18NMessage(locale = "de", value = "Die boolesche Eigenschaft {0}
muss entweder 'true' oder 'false' sein, war aber [{1}]"),
- @I18NMessage(locale = "fr", value = "La valeur booléenne du
paramètre {0} devait être 'true' ou 'false', mais était [{1}]") })
+ @I18NMessage(locale = "en", value = "The {0} boolean property value
must be either 'true' or 'false' but was [{1}]")
String INVALID_BOOLEAN = "invalidBoolean";
- @I18NMessages( { @I18NMessage(locale = "en", value = "The {0} property
value must be set."),
- @I18NMessage(locale = "de", value = "Die Eigenschaft {0} muss
gesetzt werden.") })
+ @I18NMessage(locale = "en", value = "The {0} property value must be
set.")
String INVALID_STRING = "invalidString";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Failed to save properties and
fully deploy - ${product.shortName} Server will not function properly\\n\\\nCause:
{0}"),
- @I18NMessage(locale = "de", value = "Konnte die Einstellungen
nicht speichern und den Server vollständig starten.\\n\\\n"
- + "Der ${product.shortName} Server wird nicht korrekt
funktionieren.\\n\\\nGrund: {0}"),
- @I18NMessage(locale = "fr", value = "Impossible de sauvegarder les
paramètres et de déployer entièrement - RHQ Server ne fonctionnera pas
correctement\\n\\\nCause: {0}") })
+ @I18NMessage(locale = "en", value = "Failed to save properties and
fully deploy - ${product.shortName} Server will not function properly\\n\\\nCause:
{0}")
String SAVE_FAILURE = "saveFailure";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Error"),
- @I18NMessage(locale = "de", value = "Fehler"),
- @I18NMessage(locale = "fr", value = "Erreur")})
+ @I18NMessage(locale = "en", value = "Error")
String ERROR_LABEL = "errorLabel";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Could not save
the settings for some reason."),
- @I18NMessage(locale = "de", value = "Kann die Einstellungen nicht
sichern"),
- @I18NMessage(locale = "fr", value = "Impossible de sauvegarder les
paramètres pour une raison inconnue")})
+ @I18NMessage(locale = "en", value = "Could not save the settings for
some reason.")
String SAVE_ERROR = "saveError";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Could not connect to the
database with the given database settings. \\n\\\n"
- + "Please check the database settings and make sure your database is
running."),
- @I18NMessage(locale = "de", value = "Eine Verbindung zur Datenbank
ist mit den gebenen Einstellungen für die Datenbank nicht möglich. \\n\\\n"
- + "Bitte überprüfen Sie die Einstellungen und stellen Sie sicher, dass
die Datenbak aktiv ist"),
- @I18NMessage(locale = "fr", value = "Impossible de se connecter Ã
la base de données avec les paramètres donnés. \\n\\\n"
- + "Veuillez vérifier les paramètres et que la base de données est
opérationnelle.") })
+ @I18NMessage(locale = "en", value = "Could not connect to the database
with the given database settings. \\n\\\n"
+ + "Please check the database settings and make sure your database is
running.")
String INVALID_DATABASE_SETTINGS = "invalidDatabaseSettings";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "These are the configuration
settings for this ${product.shortName} Server installation. \\n\\\n"
+ @I18NMessage(locale = "en", value = "These are the configuration
settings for this ${product.shortName} Server installation. \\n\\\n"
+ "You may customize some, all or none as required. Click on the
setting name for setting-specific help. Changes to settings marked as \"Restart
Required\" \\n\\\n"
- + "will not take effect until after restarting the server. In this case
restart the server immediately after successful installation."),
- @I18NMessage(locale = "de", value = "Diese Seite zeigt Ihnen die
Konfigurationseinstellungen \\n\\\n"
- + "für die Installation des ${product.shortName} Servers. Sie können
keinen, einige oder alle\\n\\\n"
- + "dieser Werte nach Ihren Anforderungen ändern. Sie können auf den
Namen einer Einstellung klicken, um direkt weitere Informationen zu
erhalten.\\n\\\n"
- + "Bitte beachten sie, dass \\n\\\n"
- + "einige dieser Änderungen erst nach einem Neustart des Servers aktiv
werden. \\n\\\n"
- + "Wenn Sie diese Einstellungen ändern, müssen Sie den Server sofort neu
starten, damit \\n\\\n"
- + "sie aufgegriffen werden."),
- @I18NMessage(locale = "fr", value = "Cette page vous montre les
valeurs actuelles de la configuration \\n\\\n"
- + "pour cette installation de RHQ Server. Vous pouvez en changez
certains, tous, ou aucun \\n\\\n"
- + "d'entre elles pour vos besoin personnels. Veuillez noter que
certains de \\n\\\n"
- + "ces changements ne prendront place qu'après un redémarrage du
\\n\\\n"
- + "serveur. Si vous changez l'une de ces valeurs, vous devrez
\\n\\\n"
- + "immediatement arrêter et redémarrer le serveur pour appliquer les
changements.")})
+ + "will not take effect until after restarting the server. In this case
restart the server immediately after successful installation.")
String SET_PROPERTIES_INSTRUCTIONS = "setPropertiesInstructions";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Click this checkbox to see
both standard and advanced configuration settings."),
- @I18NMessage(locale = "de", value = "Markieren Sie diese Checkbox,
um die standardmäßigen und weiterführende Einstellungen anzuzeigen.") })
+ @I18NMessage(locale = "en", value = "Click this checkbox to see both
standard and advanced configuration settings.")
String ADVANCED_SETTINGS_INSTRUCTIONS = "advancedSettingsInstructions";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Press the 'Production
Installation' button for a normal installation.\\n\\\n"
+ @I18NMessage(locale = "en", value = "Press the 'Production
Installation' button for a normal installation.\\n\\\n"
+ "Press the 'Embedded Installation' button to quickly create a
complete environment with the help of the embedded database and embedded agent. "
- + "The embedded installation is for demonstration and evaluation
purposes ONLY!"),
- @I18NMessage(locale = "de", value = "Drücken Sie die
'Produktion Installation'-Taste für eine normale Installation
durchzuführen.\\n\\\n"
- + "Drücken Sie die 'Embedded Installation'-Taste, um schnell
eine vollständige Umgebung mit Hilfe der eingebetteten Datenbank und Embedded Agenten zu
erstellen. "
- + "Die Embedded-Installation ist nur für Demonstrations- und
Evaluierungszwecke geeignet!") })
+ + "The embedded installation is for demonstration and evaluation
purposes ONLY!")
String INSTALL_BUTTONS_TEXT = "installButtonsText";
- @I18NMessages( { @I18NMessage(locale = "en", value = "-- or --"),
@I18NMessage(locale = "de", value = "-- oder --") })
+ @I18NMessage(locale = "en", value = "-- or --")
String OR_TEXT = "orText";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Embedded
Installation"),
- @I18NMessage(locale = "de", value = "Embedded Installation")
})
+ @I18NMessage(locale = "en", value = "Embedded Installation")
String SAVE_EMBEDDED_MODE = "saveEmbeddedMode";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Database Settings define the
database configured for this installation. All are required. Use the \"Test
Connection\" button to validate the settings."),
- @I18NMessage(locale = "de", value = "Die Datenbankeinstellungen
definieren die Datenbank für diese Installation. Alle Einstellungen werden
benötigt.\\n\\\n"
- + "Klicken Sie auf den \"Verbindung testen\" Button, um die
Einstellungen zu validieren.") })
+ @I18NMessage(locale = "en", value = "Database Settings define the
database configured for this installation. All are required. Use the \"Test
Connection\" button to validate the settings.")
String DATABASE_SETTINGS_INSTRUCTIONS = "databaseSettingsInstructions";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Installation Settings define
the required server endpoint for this installation."),
- @I18NMessage(locale = "de", value = "Diese Einstellungen
definieren den notwendigen Server-Endpunkt für diese Installation.") })
+ @I18NMessage(locale = "en", value = "Installation Settings define the
required server endpoint for this installation.")
String INSTALL_SETTINGS_INSTRUCTIONS = "installSettingsInstructions";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "If performing an upgrade or
re-installation then select from the list of registered servers: "),
- @I18NMessage(locale = "de", value = "Wählen Sie aus der Liste der
registrierten Server, wenn Sie ein Upgrade oder eine Neuinstallation durchführen.")
})
+ @I18NMessage(locale = "en", value = "If performing an upgrade or
re-installation then select from the list of registered servers: ")
String INSTALL_SETTINGS_NOTE_1 = "installSettingsNote1";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "If installing a new server
enter the server endpoint settings below:"),
- @I18NMessage(locale = "de", value = "Geben Sie den Serverendpunkt
unten ein, wenn Sie eine Neuinstallation durchführen:") })
+ @I18NMessage(locale = "en", value = "If installing a new server enter
the server endpoint settings below:")
String INSTALL_SETTINGS_NOTE_2 = "installSettingsNote2";
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Server Settings configure the
server for this installation. All server settings are required."),
- @I18NMessage(locale = "de", value = "Diese Servereinstellungen
konfigurieren den Server für diese Installation. Alle Einstellungen werden
benötigt.") })
+ @I18NMessage(locale = "en", value = "Server Settings configure the
server for this installation. All server settings are required.")
String SERVER_SETTINGS_INSTRUCTIONS = "serverSettingsInstructions";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Install
Server!"),
- @I18NMessage(locale = "de", value = "Server installieren!"),
- @I18NMessage(locale = "fr", value = "Installez
${product.shortName} Server!")})
+ @I18NMessage(locale = "en", value = "Install Server!")
String SAVE = "save";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Yes"),
@I18NMessage(locale = "de", value = "Ja"), @I18NMessage(locale =
"fr", value = "Oui") })
+ @I18NMessage(locale = "en", value = "Yes")
String YES_STRING = "yesString";
- @I18NMessages( { @I18NMessage(locale = "en", value = "No"),
@I18NMessage(locale = "de", value = "Nein"), @I18NMessage(locale =
"fr", value = "Non") })
+ @I18NMessage(locale = "en", value = "No")
String NO_STRING = "noString";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Property
Name"),
- @I18NMessage(locale = "de", value = "Eigenschaft") ,
- @I18NMessage(locale = "fr", value = "Propriété") })
+ @I18NMessage(locale = "en", value = "Property Name")
String PROPERTY_NAME = "propertyName";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Value"),
@I18NMessage(locale = "de", value = "Wert"), @I18NMessage(locale =
"fr", value = "Valeur") })
+ @I18NMessage(locale = "en", value = "Value")
String VALUE = "value";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Requires
Restart?"),
- @I18NMessage(locale = "de", value = "Neustart
erforderlich?"),
- @I18NMessage(locale = "fr", value = "Redémarrage
nécessaire?")})
+ @I18NMessage(locale = "en", value = "Requires Restart?")
String REQUIRES_RESTART = "requiresRestart";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Welcome to
${product.shortName}!"),
- @I18NMessage(locale = "de", value = "Willkommen bei
${product.shortName}!"),
- @I18NMessage(locale = "fr", value = "Bienvenue sur
${product.shortName}!")})
+ @I18NMessage(locale = "en", value = "Welcome to
${product.shortName}!")
String WELCOME_TITLE = "welcomeTitle";
- @I18NMessages( {
@I18NMessage(locale = "en", value = "You have reached the
${product.shortName} Installer. Use this page \\n\\\n"
+ "to install and configure the ${product.shortName} Server.
\\n\\\n"
- + "Once complete you will be able to log on and use
${product.shortName}."),
- @I18NMessage(locale = "de", value = "Willkommen beim
Installationsprogramm von ${product.shortName}. Mit diesem können Sie \\n\\\n"
- + "${product.shortName} installieren und konfigurieren. \\n\\\n"
- + "Nachdem dies geschehen ist, können Sie sich einloggen und mit
${product.shortName} arbeiten"),
- @I18NMessage(locale = "fr", value = "Voici le programme
d'installation de ${product.shortName}. Vous allez utiliser cette page \\n\\\n"
- + "pour compléter l'installation et configurer ${product.shortName}
Server. \\n\\\n"
- + "Une fois complétée, vous pourrez vous identifier et commencer Ã
utiliser ${product.shortName}") })
+ + "Once complete you will be able to log on and use
${product.shortName}.")
String WELCOME_MESSAGE = "welcomeMessage";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Starting up,
please wait..."),
- @I18NMessage(locale = "de", value = "Bitte warten Sie bis der
Server gestartet ist"),
- @I18NMessage(locale = "fr", value = "Démarrage, veuillez
patienter...")})
+ @I18NMessage(locale = "en", value = "Starting up, please
wait...")
String STARTING = "starting";
- @I18NMessages( { @I18NMessage(locale = "en", value =
"${product.shortName} will be installed!"),
- @I18NMessage(locale = "de", value = "${product.shortName} wird
installiert"),
- @I18NMessage(locale = "fr", value = "${product.shortName} sera
installé")})
+ @I18NMessage(locale = "en", value = "${product.shortName} will be
installed!")
String ALREADY_INSTALLED = "alreadyInstalled";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Done! Click here
to get started!"),
- @I18NMessage(locale = "de", value = "Fertig! Klicken Sie hier, um
fortzufahren!"),
- @I18NMessage(locale = "fr", value = "Terminé! Cliquez ici pour
commencer!")})
+ @I18NMessage(locale = "en", value = "Done! Click here to get
started!")
String ALREADY_INSTALLED_STARTED_LINK = "alreadyInstalledStartedLink";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Click here to
continue the installation"),
- @I18NMessage(locale = "de", value = "Klicken Sie hier, um mit der
Installation fortzufahren"),
- @I18NMessage(locale = "fr", value = "Cliquez ici pour continuer
l'installation")})
+ @I18NMessage(locale = "en", value = "Click here to continue the
installation")
String START_INSTALLING_LINK = "startInstallingLink";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Back to
configuration page"),
- @I18NMessage(locale = "de", value = "Zurück zur Seite mit den
Einstellungen") ,
- @I18NMessage(locale = "fr", value = "Retour à la page de
configuration")})
+ @I18NMessage(locale = "en", value = "Back to configuration
page")
String BACK_TO_SETTINGS_LINK = "backToSettingsLink";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Show Advanced
Settings"),
- @I18NMessage(locale = "de", value = "Erweiterte Einstellungen
anzeigen"),
- @I18NMessage(locale = "fr", value = "Montrer les options
avancées")})
+ @I18NMessage(locale = "en", value = "Show Advanced Settings")
String SHOW_ADVANCED_SETTINGS = "showAdvancedSettings";
// Below are the localized names of all the properties that can be configured
// The _HELP I18NMessage strings refer to links under
HELP_DOC_RHQ_SERVER_PROP_PARENT_PAGE
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database
Type"),
- @I18NMessage(locale = "de", value = "Datenbanktyp"),
- @I18NMessage(locale = "fr", value = "Type de Base de
Données") })
+ @I18NMessage(locale = "en", value = "Database Type")
String PROP_DATABASE_TYPE = "propertyDatabaseType";
@I18NMessage("-DatabaseType")
String PROP_DATABASE_TYPE_HELP = "propertyDatabaseTypeHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database
Connection URL"),
- @I18NMessage(locale = "de", value = "URL der
Datenbankverbindung"),
- @I18NMessage(locale = "fr", value = "URL de connexion à la base de
données") })
+ @I18NMessage(locale = "en", value = "Database Connection URL")
String PROP_DATABASE_CONNECTION_URL = "propertyDatabaseConnectionUrl";
@I18NMessage("-DatabaseConnectionURL")
String PROP_DATABASE_CONNECTION_URL_HELP =
"propertyDatabaseConnectionUrlHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database JDBC
Driver Class"),
- @I18NMessage(locale = "de", value = "Klassnname des
JDBC-Datenbanktreibers"),
- @I18NMessage(locale = "fr", value = "Classe du driver JDBC de la
base de données") })
+ @I18NMessage(locale = "en", value = "Database JDBC Driver
Class")
String PROP_DATABASE_DRIVER_CLASS = "propertyDatabaseDriverClass";
@I18NMessage("-DatabaseJDBCDriverClass")
String PROP_DATABASE_DRIVER_CLASS_HELP =
"propertyDatabaseDriverClassHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database XA
DataSource Class"),
- @I18NMessage(locale = "de", value = "Klassnname des
XA-Datenbanktreibers") })
+ @I18NMessage(locale = "en", value = "Database XA DataSource
Class")
String PROP_DATABASE_XA_DS_CLASS = "propertyDatabaseXADataSourceClass";
@I18NMessage("-DatabaseXADataSourceClass")
String PROP_DATABASE_XA_DS_CLASS_HELP =
"propertyDatabaseXADataSourceClassHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database User
Name"),
- @I18NMessage(locale = "de", value = "Name des
Datenbankbenutzers"),
- @I18NMessage(locale = "fr", value = "Nom d'utilisateur de la
base de données") })
+ @I18NMessage(locale = "en", value = "Database User Name")
String PROP_DATABASE_USERNAME = "propertyDatabaseUserName";
@I18NMessage("-DatabaseUserName")
String PROP_DATABASE_USERNAME_HELP = "propertyDatabaseUserNameHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Database
Password"),
- @I18NMessage(locale = "de", value = "Password des
Datenbankbenutzers"),
- @I18NMessage(locale = "fr", value = "Mot de passe de la base de
données") })
+ @I18NMessage(locale = "en", value = "Database Password")
String PROP_DATABASE_PASSWORD = "propertyDatabasePassword";
@I18NMessage("-DatabasePassword")
String PROP_DATABASE_PASSWORD_HELP = "propertyDatabasePasswordHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Server Bind
Address"),
- @I18NMessage(locale = "de", value = "IP-Adresse an die der Sever
sich binden soll"),
- @I18NMessage(locale = "fr", value = "Adresse IP Ã laquelle le
serveur doit se lier") })
+ @I18NMessage(locale = "en", value = "Server Bind Address")
String PROP_SERVER_BIND_ADDRESS = "propertyBindAddress";
@I18NMessage("-ServerBindAddress")
String PROP_SERVER_BIND_ADDRESS_HELP = "propertyBindAddressHelp";
@@ -344,8 +236,7 @@ public interface InstallerI18NResourceKeys {
@I18NMessage("-HTTPPort")
String PROP_HTTP_PORT_HELP = "propertyHttpPortHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Secure HTTPS
Port"),
- @I18NMessage(locale = "de", value = "HTTPS Port"),
@I18NMessage(locale = "fr", value = "Port HTTPS Sécurisé") })
+ @I18NMessage(locale = "en", value = "Secure HTTPS Port")
String PROP_HTTPS_PORT = "propertyHttpsPort";
@I18NMessage("-SecureHTTPSPort")
String PROP_HTTPS_PORT_HELP = "propertyHttpsPortHelp";
@@ -600,16 +491,12 @@ public interface InstallerI18NResourceKeys {
@I18NMessage("-OutgoingServerAuthenticationModeEnabled")
String PROP_SECURITY_CLIENT_SERVER_AUTH_MODE_ENABLED_HELP =
"propertySecurityClientServerAuthModeEnabledHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Embedded Agent
Enabled"),
- @I18NMessage(locale = "de", value = "Eingebetteten Agent
verwenden"),
- @I18NMessage(locale = "fr", value = "Activer l'Agent
embarqué")})
+ @I18NMessage(locale = "en", value = "Embedded Agent Enabled")
String PROP_EMBEDDED_RHQ_AGENT_ENABLED =
"propertyEmbeddedRHQAgentEnabled";
@I18NMessage("-EmbeddedRHQAgentEnabled")
String PROP_EMBEDDED_RHQ_AGENT_ENABLED_HELP =
"propertyEmbeddedRHQAgentEnabledHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Embedded Agent
Name"),
- @I18NMessage(locale = "de", value = "Name des eingebetteten
Agent"),
- @I18NMessage(locale = "fr", value = "Nom du Agent
embarqué")})
+ @I18NMessage(locale = "en", value = "Embedded Agent Name")
String PROP_EMBEDDED_RHQ_AGENT_NAME = "propertyEmbeddedRHQAgentName";
@I18NMessage("-EmbeddedRHQAgentName")
String PROP_EMBEDDED_RHQ_AGENT_NAME_HELP =
"propertyEmbeddedRHQAgentNameHelp";
@@ -624,8 +511,7 @@ public interface InstallerI18NResourceKeys {
@I18NMessage("-EmbeddedRHQAgentResetConfiguration")
String PROP_EMBEDDED_RHQ_AGENT_RESET_CONFIGURATION_HELP =
"propertyEmbeddedRHQAgentResetConfigurationHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Email SMTP
Hostname"),
- @I18NMessage(locale = "de", value = "Hostname des SMTP
Servers") })
+ @I18NMessage(locale = "en", value = "Email SMTP Hostname")
String PROP_EMAIL_SMTP_HOST = "propertyEmailSmtpHost";
@I18NMessage("-EmailSMTPHostname")
String PROP_EMAIL_SMTP_HOST_HELP = "propertyEmailSmtpHostHelp";
@@ -635,9 +521,7 @@ public interface InstallerI18NResourceKeys {
@I18NMessage("-EmailSMTPPort")
String PROP_EMAIL_SMTP_PORT_HELP = "propertyEmailSmtpPortHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Email From
Address"),
- @I18NMessage(locale = "de", value = "E-Mail
Absenderadresse"),
- @I18NMessage(locale = "fr", value = "E-Mail de
l'expéditeur") })
+ @I18NMessage(locale = "en", value = "Email From Address")
String PROP_EMAIL_FROM_ADDRESS = "propertyEmailFromAddress";
@I18NMessage("-EmailFromAddress")
String PROP_EMAIL_FROM_ADDRESS_HELP = "propertyEmailFromAddressHelp";
@@ -759,45 +643,32 @@ public interface InstallerI18NResourceKeys {
// Help Documentation - links to the wiki
- @I18NMessages( {
- @I18NMessage(locale = "en", value = "Please review the
documentation linked below to learn more about ${product.shortName}:"),
- @I18NMessage(locale = "de", value = "Die unten aufgeführten Links
enthalten weitere Informationen zu ${product.shortName}:"),
- @I18NMessage(locale = "fr", value = "Veuillez consulter la
documentation ci-dessous pour en apprendre plus sur ${product.shortName}:")})
+ @I18NMessage(locale = "en", value = "Please review the documentation
linked below to learn more about ${product.shortName}:")
String INTRODUCE_HELP_DOCS = "introduceHelpDocs";
@I18NMessage("${product.help.installation}")
String HELP_DOC_RHQ_SERVER_INSTALL_GUIDE = "helpDocRHQServerInstallGuide";
- @I18NMessages( { @I18NMessage(locale = "en", value =
"${product.shortName} Server Installation Guide"),
- @I18NMessage(locale = "de", value = "${product.shortName} Server
Installationsanleitung"),
- @I18NMessage(locale = "fr", value = "Guide d'installation de
${product.shortName} Server")})
+ @I18NMessage(locale = "en", value = "${product.shortName} Server
Installation Guide")
String HELP_DOC_RHQ_SERVER_INSTALL_GUIDE_LABEL =
"helpDocRHQServerInstallGuideLabel";
@I18NMessage("GUI+Console+Users+Guide")
String HELP_DOC_RHQ_GUI_CONSOLE_USERS_GUIDE =
"helpDocRHQGuiConsoleUsersGuide";
- @I18NMessages( { @I18NMessage(locale = "en", value =
"${product.shortName} GUI Console Users Guide"),
- @I18NMessage(locale = "de", value = "Benutzerhandbuch
${product.shortName} GUI"),
- @I18NMessage(locale = "fr", value = "Guide d'utilisation de la
${product.shortName} GUI Console")})
+ @I18NMessage(locale = "en", value = "${product.shortName} GUI Console
Users Guide")
String HELP_DOC_RHQ_GUI_CONSOLE_USERS_GUIDE_LABEL =
"helpDocRHQGuiConsoleUsersGuideLabel";
@I18NMessage("${product.help.guide.server}")
String HELP_DOC_RHQ_SERVER_USERS_GUIDE = "helpDocRHQServerUsersGuide";
- @I18NMessages( { @I18NMessage(locale = "en", value =
"${product.shortName} Server Users Guide"),
- @I18NMessage(locale = "de", value = "Benutzerhandbuch
${product.shortName} Server"),
- @I18NMessage(locale = "fr", value = "Guide d'utilisation de
${product.shortName} Server")})
+ @I18NMessage(locale = "en", value = "${product.shortName} Server Users
Guide")
String HELP_DOC_RHQ_SERVER_USERS_GUIDE_LABEL =
"helpDocRHQServerUsersGuideLabel";
@I18NMessage("${product.help.guide.agent}")
String HELP_DOC_RHQ_AGENT_USERS_GUIDE = "helpDocRHQAgentUsersGuide";
- @I18NMessages( { @I18NMessage(locale = "en", value =
"${product.shortName} Agent Users Guide"),
- @I18NMessage(locale = "de", value = "Benutzerhandbuch
${product.shortName} Agent"),
- @I18NMessage(locale = "fr", value = "Guide d'utilisation de
${product.shortName} Agent")})
+ @I18NMessage(locale = "en", value = "${product.shortName} Agent Users
Guide")
String HELP_DOC_RHQ_AGENT_USERS_GUIDE_LABEL =
"helpDocRHQAgentUsersGuideLabel";
@I18NMessage("${product.help.FAQ}")
String HELP_DOC_FAQ = "helpDocFaq";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Frequently Asked
Questions"),
- @I18NMessage(locale = "de", value = "Häufig gestellte
Fragen"),
- @I18NMessage(locale = "fr", value = "Foire Aux Questions")
})
+ @I18NMessage(locale = "en", value = "Frequently Asked
Questions")
String HELP_DOC_FAQ_LABEL = "helpDocFaqLabel";
// the page that contains all the config props help text
@@ -805,31 +676,25 @@ public interface InstallerI18NResourceKeys {
@I18NMessage("${product.help.config.props}")
String HELP_DOC_RHQ_SERVER_PROP_PARENT_PAGE =
"helpDocRHQServerPropParentPage";
- @I18NMessages( { @I18NMessage(locale = "en", value = "New
Server"),
- @I18NMessage(locale = "de", value = "Neuer Server") })
+ @I18NMessage(locale = "en", value = "New Server")
String NEW_SERVER_SELECT_ITEM = "newServerSelectItem";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Registered
Servers:"),
- @I18NMessage(locale = "de", value = "Registrierte Server:")
})
+ @I18NMessage(locale = "en", value = "Registered Servers:")
String REGISTERED_SERVERS_LABEL = "registeredServersLabel";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Server
Name"),
- @I18NMessage(locale = "de", value = "Servername") })
+ @I18NMessage(locale = "en", value = "Server Name")
String PROP_HIGH_AVAILABILITY_NAME = "propertyHighAvailabilityName";
@I18NMessage("-ServerName")
String PROP_HIGH_AVAILABILITY_NAME_HELP =
"propertyHighAvailabilityNameHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Maintenance Mode
At Start"),
- @I18NMessage(locale = "de", value = "Maintenance Mode At
Start") })
+ @I18NMessage(locale = "en", value = "Maintenance Mode At Start")
String PROP_MM_AT_START = "propertyMaintenanceModeAtStart";
@I18NMessage("-MaintenanceModeAtStart")
String PROP_MM_AT_START_HELP = "propertyMaintenanceModeAtStartHelp";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Server Public
Address"),
- @I18NMessage(locale = "de", value = "HA-Endpunkt-Adresse des
Servers") })
+ @I18NMessage(locale = "en", value = "Server Public Address")
String PROP_HIGH_AVAILABILITY_ENDPOINT_ADDRESS =
"propertyHighAvailabilityEndpointAddress";
- @I18NMessages( { @I18NMessage(locale = "en", value = "Server Affinity
Group Name"),
- @I18NMessage(locale = "de", value = "Name der zugehörigen
Servergruppe") })
+ @I18NMessage(locale = "en", value = "Server Affinity Group
Name")
String PROP_HIGH_AVAILABILITY_AFFINITY_GROUP =
"propertyHighAvailabilityAffinityGroup";
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_de.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_de.properties
new file mode 100644
index 0000000..5fdf56c
--- /dev/null
+++
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_de.properties
@@ -0,0 +1,82 @@
+createDatabaseUserTitle=Datenbank mit -benutzer anlegen
+createDatabaseUserHelp=Geben Sie die Administratoreninformation hier ein, und clicken Sie
den Button, um eine Datenbank mit Benutzer anzulegen.
+adminConnectionUrl=URL der Datenbankverbindung
+adminUsername=Benutzername des Datenbankadministrators
+adminPassword=Passwort des Datenbankadministrators
+experimentalDb=Unterstützung für diese Datenbank ist experimentell und ist nur für
Demo-und Testzwecke geeignet.
+createDatabaseNote=DB mit -benutzer anlegen, falls nötig
+createDatabaseButton=Datenbank anlegen
+testDatabaseNote=Überprüfen Sie, dass die Einstellungen für die Datenbank gültig sind
+testDatabaseButton=Verbindung testen
+existingSchemaQuestion=Das gewünschte Datenbankschema existiert schon. Was wollen Sie
machen?
+existingSchemaAnswerOverwrite=Ãœberschreiben (vorhandene Daten gehen verloren)
+existingSchemaAnswerUpgrade=Behalten (existierende Daten werden aktualisiert)
+existingSchemaAnswerSkip=Umgehen (Datenbank bleibt wie sie ist)
+invalidNumber=[{1}] ist ein ungültiger Zahlenwert für die Eigenschaft {0}
+invalidBoolean=Die boolesche Eigenschaft {0} muss entweder 'true' oder
'false' sein, war aber [{1}]
+invalidString=Die Eigenschaft {0} muss gesetzt werden.
+saveFailure=Konnte die Einstellungen nicht speichern und den Server vollständig
starten.\n\
+Der ${product.shortName} Server wird nicht korrekt funktionieren.\n\
+Grund: {0}
+errorLabel=Fehler
+saveError=Kann die Einstellungen nicht sichern
+invalidDatabaseSettings=Eine Verbindung zur Datenbank ist mit den gebenen Einstellungen
für die Datenbank nicht möglich. \n\
+Bitte überprüfen Sie die Einstellungen und stellen Sie sicher, dass die Datenbak aktiv
ist
+setPropertiesInstructions=Diese Seite zeigt Ihnen die Konfigurationseinstellungen \n\
+für die Installation des ${product.shortName} Servers. Sie können keinen, einige oder
alle\n\
+dieser Werte nach Ihren Anforderungen ändern. Sie können auf den Namen einer Einstellung
klicken, um direkt weitere Informationen zu erhalten.\n\
+Bitte beachten sie, dass \n\
+einige dieser Änderungen erst nach einem Neustart des Servers aktiv werden. \n\
+Wenn Sie diese Einstellungen ändern, müssen Sie den Server sofort neu starten, damit \n\
+sie aufgegriffen werden.
+advancedSettingsInstructions=Markieren Sie diese Checkbox, um die standardmäßigen und
weiterführende Einstellungen anzuzeigen.
+installButtonsText=Drücken Sie die 'Produktion Installation'-Taste für eine
normale Installation durchzuführen.\n\
+Drücken Sie die 'Embedded Installation'-Taste, um schnell eine vollständige
Umgebung mit Hilfe der eingebetteten Datenbank und Embedded Agenten zu erstellen. Die
Embedded-Installation ist nur für Demonstrations- und Evaluierungszwecke geeignet!
+orText=-- oder --
+saveEmbeddedMode=Embedded Installation
+databaseSettingsInstructions=Die Datenbankeinstellungen definieren die Datenbank für
diese Installation. Alle Einstellungen werden benötigt.\n\
+Klicken Sie auf den "Verbindung testen" Button, um die Einstellungen zu
validieren.
+installSettingsInstructions=Diese Einstellungen definieren den notwendigen
Server-Endpunkt für diese Installation.
+installSettingsNote1=Wählen Sie aus der Liste der registrierten Server, wenn Sie ein
Upgrade oder eine Neuinstallation durchführen.
+installSettingsNote2=Geben Sie den Serverendpunkt unten ein, wenn Sie eine
Neuinstallation durchführen:
+serverSettingsInstructions=Diese Servereinstellungen konfigurieren den Server für diese
Installation. Alle Einstellungen werden benötigt.
+save=Server installieren!
+yesString=Ja
+noString=Nein
+propertyName=Eigenschaft
+value=Wert
+requiresRestart=Neustart erforderlich?
+welcomeTitle=Willkommen bei ${product.shortName}!
+welcomeMessage=Willkommen beim Installationsprogramm von ${product.shortName}. Mit diesem
können Sie \n\
+${product.shortName} installieren und konfigurieren. \n\
+Nachdem dies geschehen ist, können Sie sich einloggen und mit ${product.shortName}
arbeiten
+starting=Bitte warten Sie bis der Server gestartet ist
+alreadyInstalled=${product.shortName} wird installiert
+alreadyInstalledStartedLink=Fertig! Klicken Sie hier, um fortzufahren!
+startInstallingLink=Klicken Sie hier, um mit der Installation fortzufahren
+backToSettingsLink=Zurück zur Seite mit den Einstellungen
+showAdvancedSettings=Erweiterte Einstellungen anzeigen
+propertyDatabaseType=Datenbanktyp
+propertyDatabaseConnectionUrl=URL der Datenbankverbindung
+propertyDatabaseDriverClass=Klassnname des JDBC-Datenbanktreibers
+propertyDatabaseXADataSourceClass=Klassnname des XA-Datenbanktreibers
+propertyDatabaseUserName=Name des Datenbankbenutzers
+propertyDatabasePassword=Password des Datenbankbenutzers
+propertyBindAddress=IP-Adresse an die der Sever sich binden soll
+propertyHttpsPort=HTTPS Port
+propertyEmbeddedRHQAgentEnabled=Eingebetteten Agent verwenden
+propertyEmbeddedRHQAgentName=Name des eingebetteten Agent
+propertyEmailSmtpHost=Hostname des SMTP Servers
+propertyEmailFromAddress=E-Mail Absenderadresse
+introduceHelpDocs=Die unten aufgeführten Links enthalten weitere Informationen zu
${product.shortName}:
+helpDocRHQServerInstallGuideLabel=${product.shortName} Server Installationsanleitung
+helpDocRHQGuiConsoleUsersGuideLabel=Benutzerhandbuch ${product.shortName} GUI
+helpDocRHQServerUsersGuideLabel=Benutzerhandbuch ${product.shortName} Server
+helpDocRHQAgentUsersGuideLabel=Benutzerhandbuch ${product.shortName} Agent
+helpDocFaqLabel=Häufig gestellte Fragen
+newServerSelectItem=Neuer Server
+registeredServersLabel=Registrierte Server:
+propertyHighAvailabilityName=Servername
+propertyMaintenanceModeAtStart=Maintenance Mode At Start
+propertyHighAvailabilityEndpointAddress=HA-Endpunkt-Adresse des Servers
+propertyHighAvailabilityAffinityGroup=Name der zugehörigen Servergruppe
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_fr.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_fr.properties
new file mode 100644
index 0000000..d2a51b4
--- /dev/null
+++
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_fr.properties
@@ -0,0 +1,47 @@
+invalidNumber=La valeur du paramètre {0} n'est pas un nombre valide [{1}]
+invalidBoolean=La valeur booléenne du paramètre {0} devait être 'true' ou
'false', mais était [{1}]
+saveFailure=Impossible de sauvegarder les paramètres et de déployer entièrement - RHQ
Server ne fonctionnera pas correctement\n\
+Cause: {0}
+errorLabel=Erreur
+saveError=Impossible de sauvegarder les paramètres pour une raison inconnue
+invalidDatabaseSettings=Impossible de se connecter à la base de données avec les
paramètres donnés. \n\
+Veuillez vérifier les paramètres et que la base de données est opérationnelle.
+setPropertiesInstructions=Cette page vous montre les valeurs actuelles de la
configuration \n\
+pour cette installation de RHQ Server. Vous pouvez en changez certains, tous, ou aucun
\n\
+d'entre elles pour vos besoin personnels. Veuillez noter que certains de \n\
+ces changements ne prendront place qu'après un redémarrage du \n\
+serveur. Si vous changez l'une de ces valeurs, vous devrez \n\
+immediatement arrêter et redémarrer le serveur pour appliquer les changements.
+save=Installez ${product.shortName} Server!
+yesString=Oui
+noString=Non
+propertyName=Propriété
+value=Valeur
+requiresRestart=Redémarrage nécessaire?
+welcomeTitle=Bienvenue sur ${product.shortName}!
+welcomeMessage=Voici le programme d'installation de ${product.shortName}. Vous allez
utiliser cette page \n\
+pour compléter l'installation et configurer ${product.shortName} Server. \n\
+Une fois complétée, vous pourrez vous identifier et commencer à utiliser
${product.shortName}
+starting=Démarrage, veuillez patienter...
+alreadyInstalled=${product.shortName} sera installé
+alreadyInstalledStartedLink=Terminé! Cliquez ici pour commencer!
+startInstallingLink=Cliquez ici pour continuer l'installation
+backToSettingsLink=Retour à la page de configuration
+showAdvancedSettings=Montrer les options avancées
+propertyDatabaseType=Type de Base de Données
+propertyDatabaseConnectionUrl=URL de connexion à la base de données
+propertyDatabaseDriverClass=Classe du driver JDBC de la base de données
+propertyDatabaseUserName=Nom d'utilisateur de la base de données
+propertyDatabasePassword=Mot de passe de la base de données
+propertyBindAddress=Adresse IP Ã laquelle le serveur doit se lier
+propertyHttpsPort=Port HTTPS Sécurisé
+propertyEmbeddedRHQAgentEnabled=Activer l'Agent embarqué
+propertyEmbeddedRHQAgentName=Nom du Agent embarqué
+propertyEmailFromAddress=E-Mail de l'expéditeur
+introduceHelpDocs=Veuillez consulter la documentation ci-dessous pour en apprendre plus
sur ${product.shortName}:
+helpDocRHQServerInstallGuideLabel=Guide d'installation de ${product.shortName}
Server
+helpDocRHQGuiConsoleUsersGuideLabel=Guide d'utilisation de la ${product.shortName}
GUI Console
+helpDocRHQServerUsersGuideLabel=Guide d'utilisation de ${product.shortName} Server
+helpDocRHQAgentUsersGuideLabel=Guide d'utilisation de ${product.shortName} Agent
+helpDocFaqLabel=Foire Aux Questions
+orText=-- ou --
commit 6e87060f43f7858e89e7a505e3d6e72047ab3eac
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Thu Jun 3 11:17:12 2010 +0200
Remove properties that should come from default.
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
index 5c15b50..f98e373 100644
---
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
+++
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
@@ -1,9 +1,3 @@
-product.shortName=RHQ
-product.name=RHQ
-product.fullName=RHQ
-product.url=${product.url}
-product.sales.email=sales(a)rhq-project.org
-product.support.email=info(a)rhq-project.org
helpDocRoot=http://support.rhq-project.org/display/RHQ/
createDatabaseUserTitle=Criar Base de Dados/Usu\u00E1rio
createDatabaseUserHelp=Entre com as informa\u00E7\u00F5es do administrador do banco de
dados e clique no bot\u00E3o para criar o baco de dados e o usu\u00E1rio.
@@ -33,7 +27,7 @@ orText=-- ou --
saveEmbeddedMode=Instala\u00E7\u00E3o habilitada
databaseSettingsInstructions=As propriedades do banco de dados definem o banco de dados
configurado para esta instala\u00E7\u00E3o. Todos os campos s\u00E3o necess\u00E1rios. Use
o bot\u00E3o "Testar Conex\u00E3o" para validar as propriedades.
installSettingsInstructions=As propriedades de acesso definem localiza\u00E7\u00E3o
(endpoint) do servidor.
-installSettingsNote1=No caso de uma atualiza\u00E7\u00E3o ou reinstala\u00E7\u00E3o
selecione a partir da lista de servidores registrados\:
+installSettingsNote1=No caso de uma atualiza\u00E7\u00E3o ou reinstala\u00E7\u00E3o
selecione a partir da lista de servidores registrados\:
installSettingsNote2=No caso de uma nova instala\u00E7\u00E3o informe as propriedades
abaixo\:
serverSettingsInstructions=Todos os campos abaixo s\u00E3o necess\u00E1rios.
save=Instalar Servidor\!
@@ -52,7 +46,7 @@ backToSettingsLink=Retornar \u00E0 p\u00E1gina de
configura\u00E7\u00E3o
showAdvancedSettings=Mostrar configura\u00E7\u00F5es avan\u00E7adas
propertyDatabaseType=Tipo de Banco de Dados
propertyDatabaseTypeHelp=-TipoBancoDeDados
-propertyDatabaseConnectionUrl=URL de conex\u00E3o do Banco de Dados
+propertyDatabaseConnectionUrl=URL de conex\u00E3o do Banco de Dados
propertyDatabaseUserName=Usu\u00E1rio do Banco de Dados
propertyDatabasePassword=Senha do Banco de Dados
propertyEmbeddedRHQAgentEnabled=Agente embutido habilitado
commit a2ca57138f6065f65241eb7b721666c3d1e7e850
Author: Heiko W. Rupp <hwr(a)pilhuhn.de>
Date: Sun May 30 10:12:29 2010 +0200
Use this translation for all of pt language for now
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
new file mode 100644
index 0000000..5c15b50
--- /dev/null
+++
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
@@ -0,0 +1,75 @@
+product.shortName=RHQ
+product.name=RHQ
+product.fullName=RHQ
+product.url=${product.url}
+product.sales.email=sales(a)rhq-project.org
+product.support.email=info(a)rhq-project.org
+helpDocRoot=http://support.rhq-project.org/display/RHQ/
+createDatabaseUserTitle=Criar Base de Dados/Usu\u00E1rio
+createDatabaseUserHelp=Entre com as informa\u00E7\u00F5es do administrador do banco de
dados e clique no bot\u00E3o para criar o baco de dados e o usu\u00E1rio.
+adminConnectionUrl=URL de conex\u00E3o com BD
+adminUsername=Usu\u00E1rio administrador do BD
+adminPassword=Senha de administrador do BD
+experimentalDb=O banco de dados selecionado \u00E9 utilizado apenas para
demonstra\u00E7\u00E3o. Ele n\u00E3o deve ser utilizado em ambiente de produ\u00E7\u00E3o.
N\u00E3o h\u00E1 suporte dispon\u00EDvel para insta\u00E7\u00E3oes que utilizam H2 ou MS
SQL Server como banco de dados.
+createDatabaseNote=Cria um banco de dados e usu\u00E1rio se necess\u00E1rio
+createDatabaseButton=Criar Banco de Dados
+testDatabaseNote=Confirmar configura\u00E7\u00F5es do banco de dados
+testDatabaseButton=Testar Conex\u00E3o
+existingSchemaQuestion=O esquema do banco de dados j\u00E1 existe. O que deseja fazer?
+existingSchemaAnswerOverwrite=Substituir (os dados existentes ser\u00E3o perdidos)
+existingSchemaAnswerUpgrade=Manter (os dados existentes ser\u00E3o mantidos)
+existingSchemaAnswerSkip=Prosseguir (deixar o banco de dados como est\u00E1)
+invalidNumber=O valor da propriedade {0} \u00E9 um n\u00FAmero inv\u00E1lido\: [{1}]
+invalidBoolean=O valor da propriedade booleana {0} deve ser 'true' ou
'false' mas foi atribu\u00EDdo como [{1}]
+invalidString=O valor da propriedade {0} deve ser informado.
+saveFailure=Falha ao gravar as propriedades e implantar - O Servidor RHQ n\u00E3o
funcionar\u00E1 apropriadamente\nCausa\: {0}
+errorLabel=Erro
+saveError=Por algum motivo n\u00E3o foi poss\u00EDvel gravar as configura\u00E7\u00F5es.
+invalidDatabaseSettings=N\u00E3o foi poss\u00EDvel conectar ao banco banco de dados com
as propriedades informadas. \nFavor verificar as configura\u00E7\u00F5es do banco de dados
e certifircar-se de que est\u00E1 em execu\u00E7\u00E3o.
+setPropertiesInstructions=Estas s\u00E3o as configura\u00E7\u00F5es para a
instala\u00E7\u00E3o do Servidor RHQ. \nVoc\u00EA pode customizar alguma, todas ou nenhuma
conforme necess\u00E1rio. Clique no nome da propriedade para visualizar a ajuda
espec\u00EDfica. Altera\u00E7\u00F5es nas configura\u00E7\u00F5es marcadas como
"Restart Necess\u00E1rio" \nn\u00E3o ter\u00E3o efeito at\u00E9 que o servidor
seja reiniciado. Nesse caso reinicie o servidor imediatamente ap\u00F3s a
instala\u00E7\u00E3o ter sido conclu\u00EDda com sucesso.
+advancedSettingsInstructions=Marque esta caixa de sele\u00E7\u00E3o para visualizar as
configura\u00E7\u00F5es avan\u00E7adas.
+installButtonsText=Pressione o bot\u00E3o 'Instala\u00E7\u00E3o de
Produ\u00E7\u00E3o' para uma instala\u00E7\u00E3o normal.\nPressione o bot\u00E3o
'Instala\u00E7ao Embutida' para criar rapidamente um ambiente completo com a ajuda
do banco de dados e do agente embutidos. A instala\u00E7\u00E3o embutida possui apenas o
prop\u00F3sito de demonstra\u00E7\u00E3o e avalia\u00E7\u00E3o\!
+orText=-- ou --
+saveEmbeddedMode=Instala\u00E7\u00E3o habilitada
+databaseSettingsInstructions=As propriedades do banco de dados definem o banco de dados
configurado para esta instala\u00E7\u00E3o. Todos os campos s\u00E3o necess\u00E1rios. Use
o bot\u00E3o "Testar Conex\u00E3o" para validar as propriedades.
+installSettingsInstructions=As propriedades de acesso definem localiza\u00E7\u00E3o
(endpoint) do servidor.
+installSettingsNote1=No caso de uma atualiza\u00E7\u00E3o ou reinstala\u00E7\u00E3o
selecione a partir da lista de servidores registrados\:
+installSettingsNote2=No caso de uma nova instala\u00E7\u00E3o informe as propriedades
abaixo\:
+serverSettingsInstructions=Todos os campos abaixo s\u00E3o necess\u00E1rios.
+save=Instalar Servidor\!
+yesString=Sim
+noString=N\u00E3o
+propertyName=Nome da Propriedade
+value=Valor
+requiresRestart=Restart necess\u00E1rio?
+welcomeTitle=Bem vindo ao RHQ\!
+welcomeMessage=Bem vindo \u00E0 instala\u00E7\u00E3o do RHQ. Utilize esta p\u00E1gina
\npara instalar e configurar o Servidor RHQ. \nAp\u00F3s completar a instala\u00E7\u00E3o
voc\u00EA poder\u00E1 se autenticar e usar o RHQ.
+starting=Iniciando, por favor aguarde...
+alreadyInstalled=RHQ ser\u00E1 instalado\!
+alreadyInstalledStartedLink=Pronto\! Clique aqui para come\u00E7ar\!
+startInstallingLink=Clique aqui para continuar a instala\u00E7\u00E3o.
+backToSettingsLink=Retornar \u00E0 p\u00E1gina de configura\u00E7\u00E3o
+showAdvancedSettings=Mostrar configura\u00E7\u00F5es avan\u00E7adas
+propertyDatabaseType=Tipo de Banco de Dados
+propertyDatabaseTypeHelp=-TipoBancoDeDados
+propertyDatabaseConnectionUrl=URL de conex\u00E3o do Banco de Dados
+propertyDatabaseUserName=Usu\u00E1rio do Banco de Dados
+propertyDatabasePassword=Senha do Banco de Dados
+propertyEmbeddedRHQAgentEnabled=Agente embutido habilitado
+propertyEmbeddedRHQAgentName=Nome do Agente embutido
+propertyEmbeddedRHQAgentDisableNativeSystem=Desabilitar sistema nativo no Agente
embutido
+propertyEmbeddedRHQAgentResetConfiguration=Reconfigurar Agente embutido
+propertyOperationTimeout=Timeout padr\u00E3o para invocar uma opera\u00E7\u00E3o
+introduceHelpDocs=Favor consultar a documenta\u00E7\u00E3o atrav\u00E9s dos links abaixo
para saber mais a respeito do RHQ\:
+helpDocRHQServerInstallGuideLabel=RHQ Server - Guia de Instala\u00E7\u00E3o
+helpDocRHQGuiConsoleUsersGuideLabel=RHQ GUI Console - Guia do Usu\u00E1rio
+helpDocRHQServerUsersGuideLabel=RHQ Server - Guia do Usu\u00E1rio
+helpDocRHQAgentUsersGuideLabel=RHQ Agent - Guia do Usu\u00E1rio
+helpDocFaqLabel=Perguntas Frequentes (FAQ)
+helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/RHQ/Configuring+the+Server#ConfiguringtheServer
+newServerSelectItem=Novo Servidor
+registeredServersLabel=Servidores Registrados
+propertyHighAvailabilityName=Nome do Servidor
+propertyMaintenanceModeAtStart=Modo de manuten\u00E7\u00E3o na Inicializa\u00E7\u00E3o
+propertyHighAvailabilityEndpointAddress=Endere\u00E7o p\u00FAblico do Servidor
+propertyHighAvailabilityAffinityGroup=Nome do Grupo de Afinidade do Servidor
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
deleted file mode 100644
index 5c15b50..0000000
---
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
+++ /dev/null
@@ -1,75 +0,0 @@
-product.shortName=RHQ
-product.name=RHQ
-product.fullName=RHQ
-product.url=${product.url}
-product.sales.email=sales(a)rhq-project.org
-product.support.email=info(a)rhq-project.org
-helpDocRoot=http://support.rhq-project.org/display/RHQ/
-createDatabaseUserTitle=Criar Base de Dados/Usu\u00E1rio
-createDatabaseUserHelp=Entre com as informa\u00E7\u00F5es do administrador do banco de
dados e clique no bot\u00E3o para criar o baco de dados e o usu\u00E1rio.
-adminConnectionUrl=URL de conex\u00E3o com BD
-adminUsername=Usu\u00E1rio administrador do BD
-adminPassword=Senha de administrador do BD
-experimentalDb=O banco de dados selecionado \u00E9 utilizado apenas para
demonstra\u00E7\u00E3o. Ele n\u00E3o deve ser utilizado em ambiente de produ\u00E7\u00E3o.
N\u00E3o h\u00E1 suporte dispon\u00EDvel para insta\u00E7\u00E3oes que utilizam H2 ou MS
SQL Server como banco de dados.
-createDatabaseNote=Cria um banco de dados e usu\u00E1rio se necess\u00E1rio
-createDatabaseButton=Criar Banco de Dados
-testDatabaseNote=Confirmar configura\u00E7\u00F5es do banco de dados
-testDatabaseButton=Testar Conex\u00E3o
-existingSchemaQuestion=O esquema do banco de dados j\u00E1 existe. O que deseja fazer?
-existingSchemaAnswerOverwrite=Substituir (os dados existentes ser\u00E3o perdidos)
-existingSchemaAnswerUpgrade=Manter (os dados existentes ser\u00E3o mantidos)
-existingSchemaAnswerSkip=Prosseguir (deixar o banco de dados como est\u00E1)
-invalidNumber=O valor da propriedade {0} \u00E9 um n\u00FAmero inv\u00E1lido\: [{1}]
-invalidBoolean=O valor da propriedade booleana {0} deve ser 'true' ou
'false' mas foi atribu\u00EDdo como [{1}]
-invalidString=O valor da propriedade {0} deve ser informado.
-saveFailure=Falha ao gravar as propriedades e implantar - O Servidor RHQ n\u00E3o
funcionar\u00E1 apropriadamente\nCausa\: {0}
-errorLabel=Erro
-saveError=Por algum motivo n\u00E3o foi poss\u00EDvel gravar as configura\u00E7\u00F5es.
-invalidDatabaseSettings=N\u00E3o foi poss\u00EDvel conectar ao banco banco de dados com
as propriedades informadas. \nFavor verificar as configura\u00E7\u00F5es do banco de dados
e certifircar-se de que est\u00E1 em execu\u00E7\u00E3o.
-setPropertiesInstructions=Estas s\u00E3o as configura\u00E7\u00F5es para a
instala\u00E7\u00E3o do Servidor RHQ. \nVoc\u00EA pode customizar alguma, todas ou nenhuma
conforme necess\u00E1rio. Clique no nome da propriedade para visualizar a ajuda
espec\u00EDfica. Altera\u00E7\u00F5es nas configura\u00E7\u00F5es marcadas como
"Restart Necess\u00E1rio" \nn\u00E3o ter\u00E3o efeito at\u00E9 que o servidor
seja reiniciado. Nesse caso reinicie o servidor imediatamente ap\u00F3s a
instala\u00E7\u00E3o ter sido conclu\u00EDda com sucesso.
-advancedSettingsInstructions=Marque esta caixa de sele\u00E7\u00E3o para visualizar as
configura\u00E7\u00F5es avan\u00E7adas.
-installButtonsText=Pressione o bot\u00E3o 'Instala\u00E7\u00E3o de
Produ\u00E7\u00E3o' para uma instala\u00E7\u00E3o normal.\nPressione o bot\u00E3o
'Instala\u00E7ao Embutida' para criar rapidamente um ambiente completo com a ajuda
do banco de dados e do agente embutidos. A instala\u00E7\u00E3o embutida possui apenas o
prop\u00F3sito de demonstra\u00E7\u00E3o e avalia\u00E7\u00E3o\!
-orText=-- ou --
-saveEmbeddedMode=Instala\u00E7\u00E3o habilitada
-databaseSettingsInstructions=As propriedades do banco de dados definem o banco de dados
configurado para esta instala\u00E7\u00E3o. Todos os campos s\u00E3o necess\u00E1rios. Use
o bot\u00E3o "Testar Conex\u00E3o" para validar as propriedades.
-installSettingsInstructions=As propriedades de acesso definem localiza\u00E7\u00E3o
(endpoint) do servidor.
-installSettingsNote1=No caso de uma atualiza\u00E7\u00E3o ou reinstala\u00E7\u00E3o
selecione a partir da lista de servidores registrados\:
-installSettingsNote2=No caso de uma nova instala\u00E7\u00E3o informe as propriedades
abaixo\:
-serverSettingsInstructions=Todos os campos abaixo s\u00E3o necess\u00E1rios.
-save=Instalar Servidor\!
-yesString=Sim
-noString=N\u00E3o
-propertyName=Nome da Propriedade
-value=Valor
-requiresRestart=Restart necess\u00E1rio?
-welcomeTitle=Bem vindo ao RHQ\!
-welcomeMessage=Bem vindo \u00E0 instala\u00E7\u00E3o do RHQ. Utilize esta p\u00E1gina
\npara instalar e configurar o Servidor RHQ. \nAp\u00F3s completar a instala\u00E7\u00E3o
voc\u00EA poder\u00E1 se autenticar e usar o RHQ.
-starting=Iniciando, por favor aguarde...
-alreadyInstalled=RHQ ser\u00E1 instalado\!
-alreadyInstalledStartedLink=Pronto\! Clique aqui para come\u00E7ar\!
-startInstallingLink=Clique aqui para continuar a instala\u00E7\u00E3o.
-backToSettingsLink=Retornar \u00E0 p\u00E1gina de configura\u00E7\u00E3o
-showAdvancedSettings=Mostrar configura\u00E7\u00F5es avan\u00E7adas
-propertyDatabaseType=Tipo de Banco de Dados
-propertyDatabaseTypeHelp=-TipoBancoDeDados
-propertyDatabaseConnectionUrl=URL de conex\u00E3o do Banco de Dados
-propertyDatabaseUserName=Usu\u00E1rio do Banco de Dados
-propertyDatabasePassword=Senha do Banco de Dados
-propertyEmbeddedRHQAgentEnabled=Agente embutido habilitado
-propertyEmbeddedRHQAgentName=Nome do Agente embutido
-propertyEmbeddedRHQAgentDisableNativeSystem=Desabilitar sistema nativo no Agente
embutido
-propertyEmbeddedRHQAgentResetConfiguration=Reconfigurar Agente embutido
-propertyOperationTimeout=Timeout padr\u00E3o para invocar uma opera\u00E7\u00E3o
-introduceHelpDocs=Favor consultar a documenta\u00E7\u00E3o atrav\u00E9s dos links abaixo
para saber mais a respeito do RHQ\:
-helpDocRHQServerInstallGuideLabel=RHQ Server - Guia de Instala\u00E7\u00E3o
-helpDocRHQGuiConsoleUsersGuideLabel=RHQ GUI Console - Guia do Usu\u00E1rio
-helpDocRHQServerUsersGuideLabel=RHQ Server - Guia do Usu\u00E1rio
-helpDocRHQAgentUsersGuideLabel=RHQ Agent - Guia do Usu\u00E1rio
-helpDocFaqLabel=Perguntas Frequentes (FAQ)
-helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/RHQ/Configuring+the+Server#ConfiguringtheServer
-newServerSelectItem=Novo Servidor
-registeredServersLabel=Servidores Registrados
-propertyHighAvailabilityName=Nome do Servidor
-propertyMaintenanceModeAtStart=Modo de manuten\u00E7\u00E3o na Inicializa\u00E7\u00E3o
-propertyHighAvailabilityEndpointAddress=Endere\u00E7o p\u00FAblico do Servidor
-propertyHighAvailabilityAffinityGroup=Nome do Grupo de Afinidade do Servidor
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
b/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
index 6872fe3..9ad7a36 100644
--- a/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
+++ b/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
@@ -57,7 +57,7 @@
<default-locale>en</default-locale>
<supported-locale>de</supported-locale>
<supported-locale>fr</supported-locale>
- <supported-locale>pt_br</supported-locale>
+ <supported-locale>pt</supported-locale>
</locale-config>
</application>
commit 0f044686fe65af9b1f381c2535ba19d4210f74ce
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 26 22:12:10 2010 +0200
Portuguese (Brazilian) installer messages by Rafael Torres - many thanks!
diff --git
a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
new file mode 100644
index 0000000..5c15b50
--- /dev/null
+++
b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt_br.properties
@@ -0,0 +1,75 @@
+product.shortName=RHQ
+product.name=RHQ
+product.fullName=RHQ
+product.url=${product.url}
+product.sales.email=sales(a)rhq-project.org
+product.support.email=info(a)rhq-project.org
+helpDocRoot=http://support.rhq-project.org/display/RHQ/
+createDatabaseUserTitle=Criar Base de Dados/Usu\u00E1rio
+createDatabaseUserHelp=Entre com as informa\u00E7\u00F5es do administrador do banco de
dados e clique no bot\u00E3o para criar o baco de dados e o usu\u00E1rio.
+adminConnectionUrl=URL de conex\u00E3o com BD
+adminUsername=Usu\u00E1rio administrador do BD
+adminPassword=Senha de administrador do BD
+experimentalDb=O banco de dados selecionado \u00E9 utilizado apenas para
demonstra\u00E7\u00E3o. Ele n\u00E3o deve ser utilizado em ambiente de produ\u00E7\u00E3o.
N\u00E3o h\u00E1 suporte dispon\u00EDvel para insta\u00E7\u00E3oes que utilizam H2 ou MS
SQL Server como banco de dados.
+createDatabaseNote=Cria um banco de dados e usu\u00E1rio se necess\u00E1rio
+createDatabaseButton=Criar Banco de Dados
+testDatabaseNote=Confirmar configura\u00E7\u00F5es do banco de dados
+testDatabaseButton=Testar Conex\u00E3o
+existingSchemaQuestion=O esquema do banco de dados j\u00E1 existe. O que deseja fazer?
+existingSchemaAnswerOverwrite=Substituir (os dados existentes ser\u00E3o perdidos)
+existingSchemaAnswerUpgrade=Manter (os dados existentes ser\u00E3o mantidos)
+existingSchemaAnswerSkip=Prosseguir (deixar o banco de dados como est\u00E1)
+invalidNumber=O valor da propriedade {0} \u00E9 um n\u00FAmero inv\u00E1lido\: [{1}]
+invalidBoolean=O valor da propriedade booleana {0} deve ser 'true' ou
'false' mas foi atribu\u00EDdo como [{1}]
+invalidString=O valor da propriedade {0} deve ser informado.
+saveFailure=Falha ao gravar as propriedades e implantar - O Servidor RHQ n\u00E3o
funcionar\u00E1 apropriadamente\nCausa\: {0}
+errorLabel=Erro
+saveError=Por algum motivo n\u00E3o foi poss\u00EDvel gravar as configura\u00E7\u00F5es.
+invalidDatabaseSettings=N\u00E3o foi poss\u00EDvel conectar ao banco banco de dados com
as propriedades informadas. \nFavor verificar as configura\u00E7\u00F5es do banco de dados
e certifircar-se de que est\u00E1 em execu\u00E7\u00E3o.
+setPropertiesInstructions=Estas s\u00E3o as configura\u00E7\u00F5es para a
instala\u00E7\u00E3o do Servidor RHQ. \nVoc\u00EA pode customizar alguma, todas ou nenhuma
conforme necess\u00E1rio. Clique no nome da propriedade para visualizar a ajuda
espec\u00EDfica. Altera\u00E7\u00F5es nas configura\u00E7\u00F5es marcadas como
"Restart Necess\u00E1rio" \nn\u00E3o ter\u00E3o efeito at\u00E9 que o servidor
seja reiniciado. Nesse caso reinicie o servidor imediatamente ap\u00F3s a
instala\u00E7\u00E3o ter sido conclu\u00EDda com sucesso.
+advancedSettingsInstructions=Marque esta caixa de sele\u00E7\u00E3o para visualizar as
configura\u00E7\u00F5es avan\u00E7adas.
+installButtonsText=Pressione o bot\u00E3o 'Instala\u00E7\u00E3o de
Produ\u00E7\u00E3o' para uma instala\u00E7\u00E3o normal.\nPressione o bot\u00E3o
'Instala\u00E7ao Embutida' para criar rapidamente um ambiente completo com a ajuda
do banco de dados e do agente embutidos. A instala\u00E7\u00E3o embutida possui apenas o
prop\u00F3sito de demonstra\u00E7\u00E3o e avalia\u00E7\u00E3o\!
+orText=-- ou --
+saveEmbeddedMode=Instala\u00E7\u00E3o habilitada
+databaseSettingsInstructions=As propriedades do banco de dados definem o banco de dados
configurado para esta instala\u00E7\u00E3o. Todos os campos s\u00E3o necess\u00E1rios. Use
o bot\u00E3o "Testar Conex\u00E3o" para validar as propriedades.
+installSettingsInstructions=As propriedades de acesso definem localiza\u00E7\u00E3o
(endpoint) do servidor.
+installSettingsNote1=No caso de uma atualiza\u00E7\u00E3o ou reinstala\u00E7\u00E3o
selecione a partir da lista de servidores registrados\:
+installSettingsNote2=No caso de uma nova instala\u00E7\u00E3o informe as propriedades
abaixo\:
+serverSettingsInstructions=Todos os campos abaixo s\u00E3o necess\u00E1rios.
+save=Instalar Servidor\!
+yesString=Sim
+noString=N\u00E3o
+propertyName=Nome da Propriedade
+value=Valor
+requiresRestart=Restart necess\u00E1rio?
+welcomeTitle=Bem vindo ao RHQ\!
+welcomeMessage=Bem vindo \u00E0 instala\u00E7\u00E3o do RHQ. Utilize esta p\u00E1gina
\npara instalar e configurar o Servidor RHQ. \nAp\u00F3s completar a instala\u00E7\u00E3o
voc\u00EA poder\u00E1 se autenticar e usar o RHQ.
+starting=Iniciando, por favor aguarde...
+alreadyInstalled=RHQ ser\u00E1 instalado\!
+alreadyInstalledStartedLink=Pronto\! Clique aqui para come\u00E7ar\!
+startInstallingLink=Clique aqui para continuar a instala\u00E7\u00E3o.
+backToSettingsLink=Retornar \u00E0 p\u00E1gina de configura\u00E7\u00E3o
+showAdvancedSettings=Mostrar configura\u00E7\u00F5es avan\u00E7adas
+propertyDatabaseType=Tipo de Banco de Dados
+propertyDatabaseTypeHelp=-TipoBancoDeDados
+propertyDatabaseConnectionUrl=URL de conex\u00E3o do Banco de Dados
+propertyDatabaseUserName=Usu\u00E1rio do Banco de Dados
+propertyDatabasePassword=Senha do Banco de Dados
+propertyEmbeddedRHQAgentEnabled=Agente embutido habilitado
+propertyEmbeddedRHQAgentName=Nome do Agente embutido
+propertyEmbeddedRHQAgentDisableNativeSystem=Desabilitar sistema nativo no Agente
embutido
+propertyEmbeddedRHQAgentResetConfiguration=Reconfigurar Agente embutido
+propertyOperationTimeout=Timeout padr\u00E3o para invocar uma opera\u00E7\u00E3o
+introduceHelpDocs=Favor consultar a documenta\u00E7\u00E3o atrav\u00E9s dos links abaixo
para saber mais a respeito do RHQ\:
+helpDocRHQServerInstallGuideLabel=RHQ Server - Guia de Instala\u00E7\u00E3o
+helpDocRHQGuiConsoleUsersGuideLabel=RHQ GUI Console - Guia do Usu\u00E1rio
+helpDocRHQServerUsersGuideLabel=RHQ Server - Guia do Usu\u00E1rio
+helpDocRHQAgentUsersGuideLabel=RHQ Agent - Guia do Usu\u00E1rio
+helpDocFaqLabel=Perguntas Frequentes (FAQ)
+helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/RHQ/Configuring+the+Server#ConfiguringtheServer
+newServerSelectItem=Novo Servidor
+registeredServersLabel=Servidores Registrados
+propertyHighAvailabilityName=Nome do Servidor
+propertyMaintenanceModeAtStart=Modo de manuten\u00E7\u00E3o na Inicializa\u00E7\u00E3o
+propertyHighAvailabilityEndpointAddress=Endere\u00E7o p\u00FAblico do Servidor
+propertyHighAvailabilityAffinityGroup=Nome do Grupo de Afinidade do Servidor
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
b/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
index fc785ed..6872fe3 100644
--- a/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
+++ b/modules/enterprise/gui/installer-war/src/main/webapp/WEB-INF/faces-config.xml
@@ -57,6 +57,7 @@
<default-locale>en</default-locale>
<supported-locale>de</supported-locale>
<supported-locale>fr</supported-locale>
+ <supported-locale>pt_br</supported-locale>
</locale-config>
</application>
commit 91f0e1a6aa3d18bb0d6375b9d7280c4bfb5cbd3f
Merge: 2ff1981... dc7af8a...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Jun 15 16:05:24 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit dc7af8a3f3dfe58d50eea9a434e49c416899941d
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Tue Jun 15 14:57:28 2010 -0400
update root pom to reflect that the minimum Java version for RHQ has been upgraded
from 5 to 6
diff --git a/pom.xml b/pom.xml
index 7006a03..ae5b534 100644
--- a/pom.xml
+++ b/pom.xml
@@ -693,8 +693,8 @@
<maxmem>512M</maxmem>
<!-- compiler options -->
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
<optimize>false</optimize>
</configuration>
</plugin>
@@ -805,7 +805,7 @@
<version>2.0.10</version>
</requireMavenVersion>
<requireJavaVersion>
- <version>[1.5,1.8)</version> <!-- 1.5.x, 1.6.x, 1.7.x
-->
+ <version>[1.6,1.8)</version> <!-- 1.6.x, 1.7.x -->
</requireJavaVersion>
</rules>
</configuration>
@@ -981,13 +981,13 @@
</properties>
</profile>
- <!-- Set the java5.home prop to a Java5 JRE dir to enforce that only Java5 APIs
are used. -->
+ <!-- Set the java6.home prop to a Java6 JRE dir to enforce that only Java6 APIs
are used. -->
<profile>
<id>check-java-api</id>
<activation>
<property>
- <name>java5.home</name>
+ <name>java6.home</name>
</property>
</activation>
@@ -1001,7 +1001,7 @@
<inherited>false</inherited>
<configuration>
<tasks>
- <echo>java5.home=${java5.home}</echo>
+ <echo>java6.home=${java6.home}</echo>
</tasks>
</configuration>
<goals>
@@ -1015,7 +1015,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
-
<bootclasspath>${java5.home}/lib/rt.jar${path.separator}${java5.home}/lib/jsse.jar${path.separator}${java5.home}/lib/jce.jar</bootclasspath>
+
<bootclasspath>${java6.home}/lib/rt.jar${path.separator}${java6.home}/lib/jsse.jar${path.separator}${java6.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
commit 9a7e6db3f4db56667c16a8a80b928326682e9908
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Jun 15 09:57:26 2010 -0400
introduce JDK6 API usage
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
index fa81429..c8111fc 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
@@ -245,8 +245,6 @@ public class Deployer {
public DeploymentDiskUsage estimateDiskUsage() throws Exception {
final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage();
- /*
- OH TO BE ABLE TO USE A MODERN JDK - THIS NEEDS JDK6
File partition = this.deploymentData.getDestinationDir();
long usableSpace = partition.getUsableSpace();
while (usableSpace == 0L && partition != null) {
@@ -257,8 +255,6 @@ public class Deployer {
}
diskUsage.setMaxDiskUsable(usableSpace);
- */
- diskUsage.setMaxDiskUsable(Long.MAX_VALUE);
Set<File> zipFiles = this.deploymentData.getZipFiles();
for (File zipFile : zipFiles) {
diff --git
a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java
b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java
index ff1a31e..10bc624 100644
---
a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java
+++
b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java
@@ -23,7 +23,6 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -38,7 +37,6 @@ import org.rhq.core.domain.bundle.BundleResourceDeployment;
import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory;
import org.rhq.core.domain.content.PackageVersion;
import org.rhq.core.pluginapi.bundle.BundleManagerProvider;
-import org.rhq.core.system.OperatingSystemType;
import org.rhq.core.system.ProcessExecution;
import org.rhq.core.system.ProcessExecutionResults;
import org.rhq.core.system.SystemInfo;
@@ -262,33 +260,12 @@ public class ProcessingRecipeContext extends RecipeContext {
}
private void ensureExecutable(File scriptFile) {
- boolean success;
-
- try {
- Method m = File.class.getMethod("setExecutable", Boolean.TYPE,
Boolean.TYPE);
- Boolean r = (Boolean) m.invoke(scriptFile, Boolean.TRUE, Boolean.TRUE);
- success = r.booleanValue();
- } catch (Exception e) {
- // Oh, if only we'd just stop dilly-dallying and move to JDK6 already
- if (this.systemInfo.getOperatingSystemType() != OperatingSystemType.WINDOWS)
{
- ProcessExecution pe = new ProcessExecution("chmod");
- pe.setArguments(new String[] { "u+x",
scriptFile.getAbsolutePath() });
- pe.setWaitForCompletion(30000L);
- pe.setCheckExecutableExists(false);
- pe.setWorkingDirectory(scriptFile.getParent());
- ProcessExecutionResults chmodResults =
this.systemInfo.executeProcess(pe);
- success = (chmodResults.getExitCode() != null &&
chmodResults.getExitCode().intValue() == 0);
- } else {
- success = true; // assume we can execute it on windows
- }
- }
-
+ boolean success = scriptFile.setExecutable(true, true);
if (!success) {
String msg = "Cannot ensure that script [" + scriptFile + "]
is executable";
audit("ensureExecutable",
BundleResourceDeploymentHistory.Status.FAILURE, msg);
throw new RuntimeException(msg);
}
-
return;
}
commit cfa1b8d643d1899bca8e07b56213482a62df8b2b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jun 14 11:14:42 2010 -0400
just a comment added to talk about bind address vs. public address
diff --git a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
index b087a76..f36b459 100644
--- a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
+++ b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
@@ -883,6 +883,18 @@ commands named "config", "setconfig" and
"setup" and the command line options
adapters that are available. If you want the agent to use
a specific IP or address, then you must define the
bind-address here.
+
+ Notice about bind-address and bind-port:
+ If you use transport param "serverBindAddress", that will
+ actually be the address the agent will use to bind its
+ socket and the rhq.communications.connector.bind-address
+ will be the public address the RHQ Server will use to
+ talk to the agent.
+ If you use transport param "serverBindPort", that will
+ actually be the port the agent will use for its server
+ socket and the rhq.communications.connector.bind-port
+ will be the public port the RHQ Server will use to
+ talk to the agent.
-->
<entry key="rhq.communications.connector.rhqtype"
value="agent" />
<entry key="rhq.communications.connector.transport"
value="socket" />
commit 0f34ac2c5509187eb3d991ff4e21c47b60f539da
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 10 16:01:46 2010 -0400
BZ 602762 - do not set any hashcode if rpm returned there filler value indicating it
wasn't set (this filler value is a string of all-zeros)
diff --git
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
index 872faac..7755073 100644
---
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
+++
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
@@ -171,10 +171,12 @@ public class RpmPackageDiscoveryDelegate {
packageDetails.setClassification(category);
packageDetails.setDisplayName(name);
packageDetails.setFileName(fileName);
- if (md5.length() <= 32) {
- packageDetails.setMD5(md5);
- } else {
- packageDetails.setSHA256(md5); // md5's can only be 32 chars,
anything more and we assume its a SHA256
+ if (!md5.startsWith("00000000000000000000000000000000")) {
+ if (md5.length() <= 32) {
+ packageDetails.setMD5(md5);
+ } else {
+ packageDetails.setSHA256(md5); // md5's can only be 32 chars,
anything more and we assume its a SHA256
+ }
}
packageDetails.setFileSize(fileSize);
packageDetails.setLicenseName(license);
commit 4cc744f43e8e2442851162d5c61392a54b63d190
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 10 13:26:58 2010 -0400
BZ 602329 auto installer now knows to expect encrypted db password
diff --git
a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
index 6f6235a..a7d1392 100644
---
a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
+++
b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
@@ -18,11 +18,6 @@
*/
package org.rhq.enterprise.installer;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.sql.Connection;
@@ -546,6 +541,23 @@ public class ConfigurationBean {
public StartPageResults save() {
LOG.info("Installer raw values: " + configuration);
+ // if auto-install is enabled, the db password will be encrypted - decrypt it
internally and we'll re-encrypt later
+ if (isAutoinstallEnabled()) {
+ try {
+ PropertyItemWithValue prop =
getConfigurationPropertyFromAll(ServerProperties.PROP_DATABASE_PASSWORD);
+ String pass = prop.getValue();
+ pass = decodePassword(pass);
+ prop.setValue(pass);
+ // log the unencrypted pw, but only at the trace level so it isn't
put in the log file
+ // unless someone explicitly enables the trace level so they can see the
pass that is to be used for debugging
+ LOG.trace(">" + pass);
+ } catch (Exception e) {
+ LOG.fatal("Could not decrypt the password for some reason -
auto-installation failed", e);
+ lastError = I18Nmsg.getMsg(InstallerI18NResourceKeys.SAVE_ERROR,
ThrowableUtil.getAllMessages(e));
+ return StartPageResults.ERROR;
+ }
+ }
+
// its possible the JDBC URL was changed, clear the factory cache in case the DB
version is different now
DatabaseTypeFactory.clearDatabaseTypeCache();
@@ -733,7 +745,7 @@ public class ConfigurationBean {
// encode database password and set updated properties
String pass =
configurationAsProperties.getProperty(ServerProperties.PROP_DATABASE_PASSWORD);
pass = encryptPassword(pass);
-
configurationAsProperties.setProperty(ServerProperties.PROP_DATABASE_PASSWORD,pass);
+
configurationAsProperties.setProperty(ServerProperties.PROP_DATABASE_PASSWORD, pass);
serverInfo.setServerProperties(configurationAsProperties);
@@ -765,13 +777,30 @@ public class ConfigurationBean {
try {
SecureIdentityLoginModule lm = new SecureIdentityLoginModule();
- Class clazz = SecureIdentityLoginModule.class;
- Method m = clazz.getDeclaredMethod("encode",String.class);
+ Class<?> clazz = SecureIdentityLoginModule.class;
+ Method m = clazz.getDeclaredMethod("encode", String.class);
m.setAccessible(true);
- String res = (String) m.invoke(lm,password);
+ String res = (String) m.invoke(lm, password);
return res;
} catch (Exception e) {
- throw new Exception("Encoding db password failed: " , e);
+ throw new Exception("Encoding db password failed: ", e);
+ }
+ }
+
+ private String decodePassword(String encrypedPassword) throws Exception {
+
+ // We need to do some mumbo jumbo, as the interesting method is private
+ // in SecureIdentityLoginModule
+
+ try {
+ SecureIdentityLoginModule lm = new SecureIdentityLoginModule();
+ Class<?> clazz = SecureIdentityLoginModule.class;
+ Method m = clazz.getDeclaredMethod("decode", String.class);
+ m.setAccessible(true);
+ char[] res = (char[]) m.invoke(lm, encrypedPassword);
+ return new String(res);
+ } catch (Exception e) {
+ throw new Exception("Decoding db password failed: ", e);
}
}
commit 3eeda5cf1a1a779ac337411bf68af016ceb7ef46
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 10 13:26:25 2010 -0400
BZ 602486 - remove JDK6 usage temporarily - reinstate this once JDK6 is allowed
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
index c8111fc..fa81429 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java
@@ -245,6 +245,8 @@ public class Deployer {
public DeploymentDiskUsage estimateDiskUsage() throws Exception {
final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage();
+ /*
+ OH TO BE ABLE TO USE A MODERN JDK - THIS NEEDS JDK6
File partition = this.deploymentData.getDestinationDir();
long usableSpace = partition.getUsableSpace();
while (usableSpace == 0L && partition != null) {
@@ -255,6 +257,8 @@ public class Deployer {
}
diskUsage.setMaxDiskUsable(usableSpace);
+ */
+ diskUsage.setMaxDiskUsable(Long.MAX_VALUE);
Set<File> zipFiles = this.deploymentData.getZipFiles();
for (File zipFile : zipFiles) {
commit 83d0bd01759ddc48af69697273f08bbf361bb7a4
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 10 13:25:18 2010 -0400
BZ 602762 - platform plugin needs to set SHA256/MD5 properly
diff --git
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
index 74cc8b7..872faac 100644
---
a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
+++
b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/content/RpmPackageDiscoveryDelegate.java
@@ -171,7 +171,11 @@ public class RpmPackageDiscoveryDelegate {
packageDetails.setClassification(category);
packageDetails.setDisplayName(name);
packageDetails.setFileName(fileName);
- packageDetails.setMD5(md5);
+ if (md5.length() <= 32) {
+ packageDetails.setMD5(md5);
+ } else {
+ packageDetails.setSHA256(md5); // md5's can only be 32 chars,
anything more and we assume its a SHA256
+ }
packageDetails.setFileSize(fileSize);
packageDetails.setLicenseName(license);
packageDetails.setLongDescription(description.toString());
commit 5e018834577cf1717405c106619db97abf6c9e3d
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Mon Jun 14 16:01:24 2010 -0400
update Maven release plugin to v2.0
diff --git a/pom.xml b/pom.xml
index 1bc6dd6..7006a03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -515,7 +515,7 @@
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-9</version>
+ <version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
@@ -537,7 +537,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
- <argLine>-Xms16m -Xmx256m</argLine>
+ <argLine>-Xms16M -Xmx256M</argLine>
</configuration>
</plugin>
<plugin>
commit 596db721bb2bbd073721ee911426941edd342d9d
Merge: c3e2373... 296dfea...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 15:07:01 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit c3e23733c30347dc98a298a5c67c7378e207f06b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 15:05:30 2010 -0400
remove duplicate classes. these look to have been copied into new package
structure and then never removed.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/FileContentDelegate.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/FileContentDelegate.java
deleted file mode 100644
index 095f7de..0000000
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/FileContentDelegate.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Jopr Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.plugins.jbossas5;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.content.PackageDetails;
-import org.rhq.core.domain.content.PackageDetailsKey;
-import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
-import org.rhq.core.pluginapi.util.FileUtils;
-import org.rhq.core.util.ZipUtil;
-import org.rhq.core.util.file.FileUtil;
-
-/**
-* Delegate class used for manipulating artifacts in a JON plugin.
-*
-* @author Greg Hinkle
-* @author Jason Dobies
-*/
-public class FileContentDelegate {
- // Attributes --------------------------------------------
-
- private final Log log = LogFactory.getLog(FileContentDelegate.class);
-
- protected File directory;
-
- private final String fileEnding;
- private final String packageTypeName;
-
- // Constructors --------------------------------------------
-
- public FileContentDelegate(File directory, String fileEnding, String packageTypeName)
{
- this.directory = directory;
- this.fileEnding = fileEnding;
- this.packageTypeName = packageTypeName;
- }
-
- // Public --------------------------------------------
-
- public String getFileEnding() {
- return fileEnding;
- }
-
- public String getPackageTypeName() {
- return packageTypeName;
- }
-
- public File getDirectory() {
- return directory;
- }
-
- /**
- * Creates a new package described by the specified details. The destination of the
content in the provided input
- * stream will be determined by the package name.
- *
- * @param details describes the package being created
- * @param content content to be written for the package. NOTE this Stream will be
closed by this method.
- * @param unzip if <code>true</code>, the content stream will be
treated like a ZIP file and be unzipped as
- * it is written, using the package name as the base directory; if
<code>false</code> the
- * @param createBackup If <code>true</code>, the original file will be
backed up to file.bak
- */
- public void createContent(PackageDetails details, InputStream content, boolean unzip,
boolean createBackup) {
- File contentFile = getPath(details);
- try {
- if (createBackup) {
- moveToBackup(contentFile, ".bak");
- }
- if (unzip) {
- ZipUtil.unzipFile(content, contentFile);
- } else {
- FileUtil.writeFile(content, contentFile);
- }
- details.setFileName(contentFile.getPath());
- } catch (IOException e) {
- throw new RuntimeException("Error creating artifact from details: "
+ contentFile, e);
- }
- }
-
- /**
- * Try to move the passed contentFile to a backup named contentFile + suffix
- * @param contentFile File object pointing to the original file
- * @param suffix the suffix to tack on
- */
- private void moveToBackup(File contentFile, String suffix) {
-
- File backupFile = new File(contentFile.getAbsolutePath() + suffix);
- if (backupFile.exists()) {
- // remove
- if (!backupFile.delete())
- log.warn("Removing of old backup file " + backupFile + "
failed ");
- }
- if (!contentFile.renameTo(backupFile)) {
- log.warn("Moving " + contentFile + " to backup " +
backupFile + " failed");
- }
- }
-
- public File getPath(PackageDetails details) {
- /* JBNADM-2022 - It still needs to be determined if it is the responsibility of
the plugin container or the
- * plugin to be concerned with path information in the package
name. For now, it's the plugin's
- * responsibility. We strip out the path information to keep
control of where the JARs are
- * deployed to. Note: when we add support for more package types,
we'll need to refactor this
- * out on a package type basis.
- *
- * jdobies, Sep 20, 2007
- */
- PackageDetailsKey key = details.getKey();
- String fileName = key.getName();
- int lastPathStart = fileName.lastIndexOf(File.separatorChar);
- if (lastPathStart > -1) {
- fileName = fileName.substring(lastPathStart + 1);
- }
-
- if (!fileName.endsWith(fileEnding)) {
- fileName = fileName + fileEnding;
- }
- return new File(this.directory, fileName);
- }
-
- /**
- * Returns a stream from which the content of the specified package can be read.
- *
- * @param details package being loaded
- *
- * @return buffered input stream containing the contents of the package; will not be
<code>null</code>, an
- * exception is thrown if the content cannot be loaded
- */
- public InputStream getContent(PackageDetails details) {
- File contentFile = getPath(details);
- try {
- return new BufferedInputStream(new FileInputStream(contentFile));
- } catch (FileNotFoundException e) {
- throw new RuntimeException("Package content not found for package "
+ contentFile, e);
- }
- }
-
- /**
- * Deletes the underlying file for the specified package.
- *
- * @param details package to delete
- */
- public void deleteContent(PackageDetails details) {
- File contentFile = getPath(details);
- if (!contentFile.exists())
- return;
-
- try {
- FileUtils.purge(contentFile, true);
- } catch (IOException e) {
- throw new RuntimeException("Failed to delete underlying file [" +
contentFile + "] for " + details + ".", e);
- }
- }
-
- public Set<ResourcePackageDetails> discoverDeployedPackages() {
- /*
- * This is a stub implementation, you need to implement a
- * discovery for artifacts of your particular content type
- */
- return null;
- }
-}
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JarContentDelegate.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JarContentDelegate.java
deleted file mode 100644
index 47bad08..0000000
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JarContentDelegate.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Jopr Management Platform
- * Copyright (C) 2005-2008 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.plugins.jbossas5;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.content.PackageDetailsKey;
-import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
-import org.rhq.core.util.MessageDigestGenerator;
-
-/**
- * Discovers Jar files as artifacts including loading their manifest version into the
artifact config.
- *
- * @author Greg Hinkle
- */
-public class JarContentDelegate extends FileContentDelegate {
- public static final String MIME_TYPE_JAR = "application/java-archive";
-
- public JarContentDelegate(File directory, String typeName) {
- super(directory, ".jar", typeName);
- }
-
- /*
- * public InputStream getContent(ArtifactDetails artifactDetails) { File
contentFile = new File(this.directory,
- * artifactDetails.getArtifactKey()); try { return new
BufferedInputStream(new
- * FileInputStream(contentFile)); } catch (FileNotFoundException e) {
throw new
- * RuntimeException("Artifact content not found for artifact " +
artifactDetails, e); } }
- *
- */
- /*
- * public void deleteContent(ArtifactDetails artifactDetails) { File contentFile =
new File(this.directory,
- * artifactDetails.getArtifactKey());
- *
- * if (!contentFile.exists()) return;
- *
- * // If the artifact is a directory, its contents need to be deleted first if
(contentFile.isDirectory()) {
- * TomcatFileUtils.deleteDirectoryContents(contentFile.listFiles()); }
- *
- * boolean deleteResult = contentFile.delete();
- *
- * if (deleteResult==false) { throw new RuntimeException("Artifact
content not succesfully deleted: " +
- * artifactDetails); }
- *
- * }
- */
-
- @Override
- public Set<ResourcePackageDetails> discoverDeployedPackages() {
- Set<ResourcePackageDetails> packages = new
HashSet<ResourcePackageDetails>();
-
- File[] files = this.directory.listFiles(new FileFilter() {
- public boolean accept(File pathname) {
- return pathname.getName().endsWith(getFileEnding()) &&
pathname.isFile();
- }
- });
-
- for (File file : files) {
- String manifestVersion = null;
- JarFile jf = null;
- try {
- Configuration config = new Configuration();
- jf = new JarFile(file);
-
- Manifest manifest = jf.getManifest();
-
- if (manifest != null) {
- Attributes attributes = manifest.getMainAttributes();
-
- manifestVersion =
attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
-
- config.put(new PropertySimple("version",
manifestVersion));
- config.put(new PropertySimple("title",
attributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE)));
- config.put(new PropertySimple("url",
attributes.getValue(Attributes.Name.IMPLEMENTATION_URL)));
- config
- .put(new PropertySimple("vendor",
attributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR)));
-
- config.put(new PropertySimple("classpath",
attributes.getValue(Attributes.Name.CLASS_PATH)));
- config.put(new PropertySimple("sealed",
attributes.getValue(Attributes.Name.SEALED)));
- }
-
- String sha256 = null;
- try {
- sha256 = new
MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(file);
- } catch (Exception e) {
- // leave as null
- }
- String version = getVersion(manifestVersion, sha256);
- ResourcePackageDetails details = new ResourcePackageDetails(new
PackageDetailsKey(file.getName(),
- version, getPackageTypeName(), "noarch"));
-
- packages.add(details);
- details.setFileCreatedDate(file.lastModified()); // Why don't we have
a last modified time?
- details.setFileName(file.getName());
- details.setFileSize(file.length());
- details.setClassification(MIME_TYPE_JAR);
- details.setSHA256(sha256);
-
- details.setExtraProperties(config);
- } catch (IOException e) {
- // If we can't open it, don't worry about it, we just won't
know the version
- } finally {
- try {
- if (jf != null)
- jf.close();
- } catch (Exception e) {
- // Nothing we can do here ...
- }
- }
- }
-
- return packages;
- }
-
- private String getVersion(String manifestVersion, String sha256) {
- // Version string in order of preference
- // manifestVersion + sha256, sha256, manifestVersion, "0"
- String version = "0";
-
- if ((null != manifestVersion) && (null != sha256)) {
- // this protects against the occasional differing binaries with poor manifest
maintenance
- version = manifestVersion + " [sha256=" + sha256 + "]";
- } else if (null != sha256) {
- version = "[sha256=" + sha256 + "]";
- } else if (null != manifestVersion) {
- version = manifestVersion;
- }
-
- return version;
- }
-
-}
commit 944a01de0f47d9ee4adb1b333f5c23dbbe41e2af
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 15:04:49 2010 -0400
Change default package version in the GUI to be "0" as opposed to
"1.0".
This is in line with the latest package versioning scheme which uses "0"
for discovered packages that can't be assigned any other version string.
"0" is easier to distinguish as a default, "1.0" lactually looks
like it
may be a real, discovered, version.
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java
index c364459..645ebe7 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java
@@ -79,7 +79,7 @@ public class CreateNewPackageChildResourceUIBean {
// private static final String OUTCOME_SUCCESS = "success";
private static final String OUTCOME_CANCEL = "cancel";
- private static final String DEFAULT_VERSION = "1.0";
+ private static final String DEFAULT_VERSION = "0";
// Attributes --------------------------------------------
commit 04c3fa3ca1e86249291131192b40f70037b9abb0
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 15:02:18 2010 -0400
Just added a digest generation test
diff --git a/modules/core/util/src/test/java/org/rhq/core/util/MD5GeneratorTest.java
b/modules/core/util/src/test/java/org/rhq/core/util/MD5GeneratorTest.java
index c4b5a3b..d1511de 100644
--- a/modules/core/util/src/test/java/org/rhq/core/util/MD5GeneratorTest.java
+++ b/modules/core/util/src/test/java/org/rhq/core/util/MD5GeneratorTest.java
@@ -38,11 +38,14 @@ public class MD5GeneratorTest {
String md5 = MessageDigestGenerator.getDigestString("calculate MD5 of this
String!\n");
assert md5.equals("ac98d9c00ea0d821cd757b0f3c628c99") : "Invalid
MD5 was " + md5;
+ md5 = new MessageDigestGenerator(MessageDigestGenerator.MD5)
+ .calcDigestString("calculate MD5 of this String!\n");
+ assert md5.equals("ac98d9c00ea0d821cd757b0f3c628c99") : "Invalid
MD5 was " + md5;
+
String sha256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
.calcDigestString("calculate SHA256 of this String!");
assert
sha256.equals("10ee77d3c1ccf45c15c360ecc4f8847136d64b594b0eedc4dd2e67bde4ec8100")
: "Invalid SHA256 was "
+ sha256;
-
}
public void testEmpty() {
commit 360c016fddd9a1a983eea9db7c15dbe33a471aa9
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 15:00:43 2010 -0400
Remove from the AS/AS5/Tomcat plugins the approach of a file-based cache
mapping filename-to-version for packages. This is one, unnecessary and
two, doesn't work as you can't guarantee version based on filename at plugin
granularity. This should solve [BZ 602538] but goes further to clean up all
three plugins using the bad approach.
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/StandaloneManagedDeploymentComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/StandaloneManagedDeploymentComponent.java
index 1a2655f..9336c25 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/StandaloneManagedDeploymentComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/StandaloneManagedDeploymentComponent.java
@@ -54,10 +54,8 @@ import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.content.ContentFacet;
import org.rhq.core.pluginapi.content.ContentServices;
-import org.rhq.core.pluginapi.content.version.PackageVersions;
import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.util.MessageDigestGenerator;
@@ -92,8 +90,6 @@ public class StandaloneManagedDeploymentComponent extends
AbstractManagedDeploym
private final Log log = LogFactory.getLog(this.getClass());
- private PackageVersions versions;
-
// ------------ MeasurementFacet Implementation ------------
@Override
@@ -138,20 +134,9 @@ public class StandaloneManagedDeploymentComponent extends
AbstractManagedDeploym
+ getResourceDescription() + " does not exist.");
String fileName = this.deploymentFile.getName();
- PackageVersions packageVersions = loadPackageVersions();
- String version = packageVersions.getVersion(fileName);
-
JarContentFileInfo fileInfo = new JarContentFileInfo(this.deploymentFile);
String sha256 = getSHA256(fileInfo);
-
- // First discovery of this EAR/WAR
- if (version == null) {
- // try to use version from manifest. if not there use the sha256. if that
fails default to "0".
- version = getVersion(fileInfo, sha256);
- versions.putVersion(fileName, version);
- versions.saveToDisk();
- }
-
+ String version = getVersion(fileInfo, sha256);
// Package name is the deployment's file name (e.g. foo.ear).
PackageDetailsKey key = new PackageDetailsKey(fileName, version, PKG_TYPE_FILE,
ARCHITECTURE);
ResourcePackageDetails packageDetails = new ResourcePackageDetails(key);
@@ -324,7 +309,6 @@ public class StandaloneManagedDeploymentComponent extends
AbstractManagedDeploym
// Deploy was successful!
deleteBackupOfOriginalFile(backupOfOriginalFile);
- persistApplicationVersion(packageDetails, this.deploymentFile);
DeployPackagesResponse response = new
DeployPackagesResponse(ContentResponseResult.SUCCESS);
DeployIndividualPackageResponse packageResponse = new
DeployIndividualPackageResponse(packageDetails.getKey(),
@@ -390,14 +374,6 @@ public class StandaloneManagedDeploymentComponent extends
AbstractManagedDeploym
return response;
}
- private void persistApplicationVersion(ResourcePackageDetails packageDetails, File
appFile) {
- String packageName = appFile.getName();
- log.debug("Persisting application version '" +
packageDetails.getVersion() + "' for package '" + packageName
- + "'");
- PackageVersions versions = loadPackageVersions();
- versions.putVersion(packageName, packageDetails.getVersion());
- }
-
private void deleteBackupOfOriginalFile(File backupOfOriginalFile) {
log.debug("Deleting backup of original file '" +
backupOfOriginalFile + "'...");
try {
@@ -437,25 +413,4 @@ public class StandaloneManagedDeploymentComponent extends
AbstractManagedDeploym
}
return tempFile;
}
-
- /**
- * Returns an instantiated and loaded versions store access point.
- *
- * @return will not be <code>null</code>
- */
- private PackageVersions loadPackageVersions() {
- if (this.versions == null) {
- ResourceType resourceType = getResourceContext().getResourceType();
- String pluginName = resourceType.getPlugin();
- File dataDirectoryFile = getResourceContext().getDataDirectory();
- dataDirectoryFile.mkdirs();
- String dataDirectory = dataDirectoryFile.getAbsolutePath();
- log.trace("Creating application versions store with plugin name ["
+ pluginName + "] and data directory ["
- + dataDirectory + "]");
- this.versions = new PackageVersions(pluginName, dataDirectory);
- this.versions.loadFromDisk();
- }
-
- return this.versions;
- }
}
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/ApplicationComponent.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/ApplicationComponent.java
index e923682..0bde101 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/ApplicationComponent.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/ApplicationComponent.java
@@ -46,10 +46,8 @@ import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.content.ContentFacet;
import org.rhq.core.pluginapi.content.ContentServices;
-import org.rhq.core.pluginapi.content.version.PackageVersions;
import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
@@ -91,11 +89,6 @@ public class ApplicationComponent extends
MBeanResourceComponent<JBossASServerCo
private final Log log = LogFactory.getLog(this.getClass());
- /**
- * Entry point to the persisted store of EAR/WAR package versions.
- */
- private PackageVersions versions;
-
// ContentFacet Implementation --------------------------------------------
public InputStream retrievePackageBits(ResourcePackageDetails packageDetails) {
@@ -135,20 +128,9 @@ public class ApplicationComponent extends
MBeanResourceComponent<JBossASServerCo
// Package name and file name of the application are the same
String fileName = new File(fullFileName).getName();
- PackageVersions versions = loadApplicationVersions();
- String version = versions.getVersion(fileName);
-
JarContentFileInfo fileInfo = new JarContentFileInfo(file);
String sha256 = getSHA256(fileInfo);
-
- // First discovery of this EAR/WAR
- if (version == null) {
- // try to use version from manifest. if not there use the sha256. if that
fails default to "0".
- version = getVersion(fileInfo, sha256);
- versions.putVersion(fileName, version);
- versions.saveToDisk();
- }
-
+ String version = getVersion(fileInfo, sha256);
PackageDetailsKey key = new PackageDetailsKey(fileName, version,
PKG_TYPE_FILE, ARCHITECTURE);
ResourcePackageDetails details = new ResourcePackageDetails(key);
details.setFileName(fileName);
@@ -276,7 +258,6 @@ public class ApplicationComponent extends
MBeanResourceComponent<JBossASServerCo
// Deploy was successful!
deleteBackupOfOriginalFile(backupOfOriginalFile);
- persistApplicationVersion(packageDetails, appFile);
DeployPackagesResponse response = new
DeployPackagesResponse(ContentResponseResult.SUCCESS);
DeployIndividualPackageResponse packageResponse = new
DeployIndividualPackageResponse(packageDetails.getKey(),
@@ -436,36 +417,6 @@ public class ApplicationComponent extends
MBeanResourceComponent<JBossASServerCo
}
- // Private --------------------------------------------
-
- /**
- * Returns an instantiated and loaded versions store access point.
- *
- * @return will not be <code>null</code>
- */
- private PackageVersions loadApplicationVersions() {
- if (versions == null) {
- ResourceType resourceType = getResourceContext().getResourceType();
- String pluginName = resourceType.getPlugin();
-
- File dataDirectoryFile = getResourceContext().getDataDirectory();
-
- if (!dataDirectoryFile.exists()) {
- dataDirectoryFile.mkdir();
- }
-
- String dataDirectory = dataDirectoryFile.getAbsolutePath();
-
- log.debug("Creating application versions store with plugin name ["
+ pluginName + "] and data directory ["
- + dataDirectory + "]");
-
- versions = new PackageVersions(pluginName, dataDirectory);
- versions.loadFromDisk();
- }
-
- return versions;
- }
-
/**
* Creates the necessary transfer objects to report a failed application deployment
(update).
*
@@ -486,12 +437,6 @@ public class ApplicationComponent extends
MBeanResourceComponent<JBossASServerCo
return response;
}
- private void persistApplicationVersion(ResourcePackageDetails packageDetails, File
appFile) {
- String packageName = appFile.getName();
- PackageVersions versions = loadApplicationVersions();
- versions.putVersion(packageName, packageDetails.getVersion());
- }
-
private void deleteBackupOfOriginalFile(File backupOfOriginalFile) {
try {
FileUtils.purge(backupOfOriginalFile, true);
diff --git
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatWarComponent.java
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatWarComponent.java
index b3f0b98..9ecc0d7 100644
---
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatWarComponent.java
+++
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatWarComponent.java
@@ -60,11 +60,9 @@ import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
import org.rhq.core.domain.measurement.calltime.CallTimeData;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.pluginapi.content.ContentFacet;
import org.rhq.core.pluginapi.content.ContentServices;
-import org.rhq.core.pluginapi.content.version.PackageVersions;
import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.operation.OperationResult;
@@ -135,8 +133,6 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
* Architecture string used in describing discovered packages.
*/
private static final String ARCHITECTURE = "noarch";
- private PackageVersions versions;
-
private EmsBean webModuleMBean;
private ResponseTimeLogParser logParser;
@@ -531,7 +527,6 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
// Deploy was successful!
deleteBackupOfOriginalFile(backupFile);
- persistApplicationVersion(packageDetails, appFile);
DeployPackagesResponse response = new
DeployPackagesResponse(ContentResponseResult.SUCCESS);
DeployIndividualPackageResponse packageResponse = new
DeployIndividualPackageResponse(packageDetails.getKey(),
@@ -626,18 +621,9 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
if (file.exists()) {
// Package name and file name of the application are the same
String fileName = new File(fullFileName).getName();
-
- PackageVersions versions = loadApplicationVersions();
- String version = versions.getVersion(fileName);
String sha256 = getSHA256(file);
-
- // First discovery of this WAR
- if (null == version) {
- JarContentFileInfo info = new JarContentFileInfo(file);
- version = getVersion(info, sha256);
- versions.putVersion(fileName, version);
- versions.saveToDisk();
- }
+ JarContentFileInfo info = new JarContentFileInfo(file);
+ String version = getVersion(info, sha256);
PackageDetailsKey key = new PackageDetailsKey(fileName, version,
PKG_TYPE_FILE, ARCHITECTURE);
ResourcePackageDetails details = new ResourcePackageDetails(key);
@@ -646,6 +632,7 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
if (!file.isDirectory())
details.setFileSize(file.length());
details.setFileCreatedDate(null); // TODO: get created date via SIGAR
+ details.setInstallationTimestamp(System.currentTimeMillis()); // TODO:
anything better than discovery time
details.setSHA256(sha256);
packages.add(details);
@@ -735,12 +722,6 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
return response;
}
- private void persistApplicationVersion(ResourcePackageDetails packageDetails, File
appFile) {
- String packageName = appFile.getName();
- PackageVersions versions = loadApplicationVersions();
- versions.putVersion(packageName, packageDetails.getVersion());
- }
-
private void deleteBackupOfOriginalFile(File backupOfOriginalFile) {
try {
FileUtils.purge(backupOfOriginalFile, true);
@@ -754,29 +735,6 @@ public class TomcatWarComponent extends
MBeanResourceComponent<TomcatVHostCompon
return getResourceContext().getParentResourceComponent();
}
- private PackageVersions loadApplicationVersions() {
- if (versions == null) {
- ResourceType resourceType = getResourceContext().getResourceType();
- String pluginName = resourceType.getPlugin();
-
- File dataDirectoryFile = getResourceContext().getDataDirectory();
-
- if (!dataDirectoryFile.exists()) {
- dataDirectoryFile.mkdir();
- }
-
- String dataDirectory = dataDirectoryFile.getAbsolutePath();
-
- log.debug("Creating application versions store with plugin name ["
+ pluginName + "] and data directory ["
- + dataDirectory + "]");
-
- versions = new PackageVersions(pluginName, dataDirectory);
- versions.loadFromDisk();
- }
-
- return versions;
- }
-
public void deleteResource() throws Exception {
Configuration pluginConfiguration =
getResourceContext().getPluginConfiguration();
String fileName =
pluginConfiguration.getSimple(PROPERTY_FILENAME).getStringValue();
commit 257ac0e19eb057b7040428270cdf8690785aca12
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 14 14:53:25 2010 -0400
Declare Tomcat User Database a singleton resource type
Declare WebApp Cache a singleton resource type
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
index 010de71..b0d9364 100644
--- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
@@ -570,7 +570,8 @@
name="Tomcat Cache"
discovery="TomcatCacheDiscoveryComponent"
class="TomcatCacheComponent"
- description="A Tomcat Application (WAR) Cache">
+ description="A Tomcat Application (WAR) Cache"
+ singleton="true">
<plugin-configuration>
<c:group name="General">
@@ -953,7 +954,8 @@
name="Tomcat User Database"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="TomcatUserDatabaseComponent"
- description="Tomcat User Database">
+ description="Tomcat User Database"
+ singleton="true">
<plugin-configuration>
<c:group name="General">
commit 296dfea6fd9e43000e81e8742fd6fba344ef5bc1
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Mon Jun 14 11:49:34 2010 -0400
further work on release.sh
(cherry picked from commit 26c8541cb9e429b8da6b58088502f2acc60c0280)
(cherry picked from commit aa3721e17493e727a126564c12ba0924153eef61)
diff --git a/release.sh b/release.sh
index dabd332..186fe1b 100755
--- a/release.sh
+++ b/release.sh
@@ -4,9 +4,10 @@
PROJECT_NAME="rhq"
PROJECT_DISPLAY_NAME="RHQ"
-PROJECT_SVN_URL="http://svn.rhq-project.org/repos/rhq"
+PROJECT_GIT_URL="ssh://git.fedorahosted.org/git/rhq/rhq.git"
+PROJECT_GIT_WEB_URL="http://git.fedorahosted.org/git/?p=rhq/rhq.git"
TAG_PREFIX="RHQ"
-MINIMUM_MAVEN_VERSION="2.0.10"
+MINIMUM_MAVEN_VERSION="2.1.0"
# Functions
@@ -21,24 +22,29 @@ abort()
}
usage()
-{
- EXE=`basename $0`
- abort "Usage: $EXE RELEASE_VERSION DEVELOPMENT_VERSION" "Example:
$EXE 3.0.0.Beta1 3.0.0-SNAPSHOT"
+{
+ abort "$@" "Usage: $EXE community|enterprise RELEASE_VERSION
DEVELOPMENT_VERSION" "Example: $EXE 3.0.0.GA 3.0.0-SNAPSHOT"
}
# Process command line args.
-if [ "$#" -ne 2 ]; then
+EXE=`basename $0`
+if [ "$#" -ne 3 ]; then
usage
fi
-RELEASE_VERSION="$1"
+RELEASE_TYPE="$1"
+if [ "$RELEASE_TYPE" != "community" ] && [
"$RELEASE_TYPE" != "enterprise" ]; then
+ usage "Invalid release type: $RELEASE_TYPE"
+fi
+RELEASE_VERSION="$2"
TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
-DEVELOPMENT_VERSION="$2"
+DEVELOPMENT_VERSION="$3"
BRANCH="master"
RELEASE_BRANCH="release-$RELEASE_VERSION"
+
# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
if [ -z "$JAVA_HOME" ]; then
@@ -111,33 +117,13 @@ if ! which mvn >/dev/null 2>&1; then
fi
-# Make sure GIT_HOME points to a valid git install.
-
-#if [ -z "$GIT_HOME" ]; then
-# abort "GIT_HOME environment variable is not set." >&2
-#fi
-
-#if [ ! -d "$GIT_HOME" ]; then
-# abort "GIT_HOME ($GIT_HOME) does not exist or is not a directory."
-#fi
-
-#echo "Prepending $GIT_HOME/bin to PATH..."
-#PATH="$GIT_HOME/bin:$PATH"
+# Make sure git is in the PATH.
if ! which git >/dev/null 2>&1; then
- #abort "git not found in PATH ($PATH) - GIT_HOME must point to a git install
dir."
abort "git not found in PATH ($PATH)."
fi
-#echo "Prepending $GIT_HOME/lib to LD_LIBRARY_PATH..."
-#LD_LIBRARY_PATH="$GIT_HOME/lib:$LD_LIBRARY_PATH"
-#export LD_LIBRARY_PATH
-
-
-# Set additional required env vars.
-
-LANG=en_US.iso88591
-export LANG
+# TODO: Check for a minimum git version?
# Set various local variables.
@@ -152,49 +138,46 @@ cd "$WORK_DIR"
MAVEN_LOCAL_REPO_DIR="$WORK_DIR/m2-repository"
MAVEN_SETTINGS_FILE="$WORK_DIR/m2-settings.xml"
-MAVEN_ARGS="--settings "$MAVEN_SETTINGS_FILE" --debug --errors
-Penterprise,dist,release"
+MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --errors
-Penterprise,dist,release"
if [ "$RELEASE_TYPE" = "enterprise" ]; then
- MAVEN_OPTS="$MAVEN_OPTS -Dexclude-webdav"
+ MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav"
+fi
+if [ -z "$RHQ_RELEASE_QUIET" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS --debug"
fi
if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="12"
fi
-# Print out summary of environment.
+# Print out a summary of the environment.
echo
-echo "========================= Environment Variables
=============================="
+echo "========================== Environment Variables
=============================="
echo "JAVA_HOME=$JAVA_HOME"
+echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
-#echo "GIT_HOME=$GIT_HOME"
echo "PATH=$PATH"
-echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
-echo "LANG=$LANG"
-echo "============================ Local Variables
================================="
+echo "============================= Local Variables
================================="
echo "WORK_DIR=$WORK_DIR"
echo "PROJECT_NAME=$PROJECT_NAME"
echo "RELEASE_TYPE=$RELEASE_TYPE"
echo "RELEASE_VERSION=$RELEASE_VERSION"
echo "DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION"
echo "RELEASE_BRANCH=$RELEASE_BRANCH"
-echo "RELEASE_BRANCH_SVN_URL=$RELEASE_BRANCH_SVN_URL"
-echo "RELEASE_BRANCH_CHECKOUT_DIR=$RELEASE_BRANCH_CHECKOUT_DIR"
echo "RELEASE_TAG=$RELEASE_TAG"
-echo "RELEASE_TAG_SVN_URL=$RELEASE_TAG_SVN_URL"
-echo "RELEASE_TAG_CHECKOUT_DIR=$RELEASE_TAG_CHECKOUT_DIR"
echo "MAVEN_LOCAL_REPO_DIR=$MAVEN_LOCAL_REPO_DIR"
echo
"MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS"
echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE"
echo "MAVEN_ARGS=$MAVEN_ARGS"
-echo "============================ Program Versions
================================"
-java -version
-echo
+echo "============================= Program Versions
================================"
git --version
echo
+java -version
+echo
mvn --version | head -1
-echo
"=============================================================================="
+echo
"==============================================================================="
echo
@@ -244,7 +227,9 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}"
</settings>
EOF
+
# Clone and/or checkout the source from git.
+
CLONE_DIR="$WORK_DIR/rhq"
if [ -d "$CLONE_DIR" ]; then
cd "$CLONE_DIR"
@@ -270,13 +255,15 @@ if [ ! -d "$CLONE_DIR" ]; then
fi
-# Create a branch for the release, so we don't have to mess with master.
-echo "Creating branch $RELEASE_BRANCH and checking it out..."
+# Create a branch for the release, so we don't have to make any changes to master.
+
+echo "Creating release branch $RELEASE_BRANCH and checking it out..."
git push origin master:$RELEASE_BRANCH
git checkout $RELEASE_BRANCH
-# Run a test build before tagging.
+# Run a test build before tagging. This will also publish the snapshot artifacts to the
local repo to "bootstrap" the repo.
+
echo "Building project to ensure tests pass and to bootstrap local Maven repo (this
will take about 15-30 minutes)..."
# TODO: Add -Djava5.home=$JAVA5_HOME/jre to the below mvn command line once the Java6 API
usages have been removed from the Deployer class.
# TODO: Add -Ddbreset to the below mvn command line - this was removed temporarily to
speed up development and testing of this release script.
@@ -291,11 +278,13 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build.
+
echo "Cleaning up snapshot jars produced by test build..."
mvn clean $MAVEN_ARGS
# Do a dry run of tagging the release.
+
echo "Doing a dry run of tagging the release..."
mvn release:prepare $MAVEN_ARGS --batch-mode -DreleaseVersion=$RELEASE_VERSION
-DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG
"-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true" -DdryRun=true
EXIT_CODE=$?
@@ -308,8 +297,8 @@ echo "Tagging dry run succeeded!"
# If the dry run succeeded, tag it for real.
+
echo "Tagging the release..."
-cd "$RELEASE_BRANCH_CHECKOUT_DIR"
mvn release:prepare $MAVEN_ARGS --batch-mode -DreleaseVersion=$RELEASE_VERSION
-DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG
"-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true" -DdryRun=false
EXIT_CODE=$?
mvn release:clean $MAVEN_ARGS
@@ -321,6 +310,7 @@ echo "Tagging succeeded!"
# Checkout the tag and build it.
+
echo "Checking out release tag $RELEASE_TAG..."
git checkout "$RELEASE_TAG"
echo "Building release from tag (this will take about 5-10 minutes)..."
@@ -332,9 +322,10 @@ echo
echo "Release build succeeded!"
-echo "=========================== Release Info
==============================="
+echo
+echo "=============================== Release Info
=================================="
echo "Version: $RELEASE_VERSION"
-echo "Branch URL: $RELEASE_BRANCH_SVN_URL"
-echo "Tag URL:
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=shortlog;h=refs/heads/$R...
-echo
"========================================================================"
+echo "Branch URL:
$PROJECT_GIT_WEB_URL;a=shortlog;h=refs/heads/$RELEASE_BRANCH"
+echo "Tag URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/tags/$RELEASE_TAG"
+echo
"==============================================================================="
commit 971ae47ad979efbca1b589d68a8c2d57f5540bd0
Author: Ian P. Springer <ips(a)jetengine.(none)>
Date: Thu Jun 10 22:36:33 2010 -0400
1) update release.sh to work with git
2) set project.build.sourceEncoding prop to "ISO-8859-1" in root pom
3) update container build to always include rtfilter connectors
(cherry picked from commit b5fabbd90abab2c9dbf7d716d85e36e39fdb0d42)
diff --git a/modules/enterprise/server/container/pom.xml
b/modules/enterprise/server/container/pom.xml
index 6b296df..6ae155a 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -1,4 +1,6 @@
-<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">
+<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>
@@ -165,7 +167,6 @@
<property name="dev.profile.active"
value="${dev.profile.active}" />
<property name="developer" value="${developer}"
/>
<property name="rhq.earName"
value="${rhq.earName}" />
- <property name="package-connectors"
value="${package-connectors}" />
<!-- dependency versions -->
<property name="rhq.version"
value="${project.version}" />
@@ -353,13 +354,6 @@
</build>
</profile>
- <profile>
- <id>dist</id>
- <properties>
- <package-connectors>true</package-connectors>
- </properties>
- </profile>
-
</profiles>
</project>
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 cf11ad2..4e7a944 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
@@ -400,8 +400,8 @@
</target>
- <target name="package-connectors" if="package-connectors">
- <echo>Deploying the rt-filter conectors ...</echo>
+ <target name="package-connectors">
+ <echo>Deploying the response-time servlet filter connectors ...</echo>
<delete
file="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/connectors/connector-rtfilter.zip"
/>
<zip
destfile="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/connectors/connector-rtfilter.zip">
<zipfileset
dir="${basedir}/../../agent/src/etc/product_connectors">
diff --git a/pom.xml b/pom.xml
index 286bf41..1bc6dd6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,9 @@
<properties>
+ <!-- explictly specify a default encoding to avoid relying on the LANG env var
being set correctly -->
+ <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
+
<rhq.groupId>org.rhq</rhq.groupId>
<rhq.product.name>RHQ</rhq.product.name>
<rhq.earName>rhq.ear</rhq.earName>
diff --git a/release.sh b/release.sh
index 6be2ff8..dabd332 100755
--- a/release.sh
+++ b/release.sh
@@ -23,24 +23,21 @@ abort()
usage()
{
EXE=`basename $0`
- abort "Usage: $EXE community|enterprise RELEASE_VERSION
DEVELOPMENT_VERSION" "Example: $EXE community 1.3.1 1.3.2-SNAPSHOT"
+ abort "Usage: $EXE RELEASE_VERSION DEVELOPMENT_VERSION" "Example:
$EXE 3.0.0.Beta1 3.0.0-SNAPSHOT"
}
# Process command line args.
-if [ "$#" -ne 3 ]; then
+if [ "$#" -ne 2 ]; then
usage
fi
-RELEASE_TYPE="$1"
-if [ "$RELEASE_TYPE" != "community" ] && [
"$RELEASE_TYPE" != "enterprise" ]; then
- usage
-fi
-RELEASE_VERSION="$2"
+RELEASE_VERSION="$1"
TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
-DEVELOPMENT_VERSION="$3"
-
+DEVELOPMENT_VERSION="$2"
+BRANCH="master"
+RELEASE_BRANCH="release-$RELEASE_VERSION"
# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
@@ -114,26 +111,27 @@ if ! which mvn >/dev/null 2>&1; then
fi
-# Make sure SUBVERSION_HOME points to a valid Subversion install.
+# Make sure GIT_HOME points to a valid git install.
-if [ -z "$SUBVERSION_HOME" ]; then
- abort "SUBVERSION_HOME environment variable is not set." >&2
-fi
+#if [ -z "$GIT_HOME" ]; then
+# abort "GIT_HOME environment variable is not set." >&2
+#fi
-if [ ! -d "$SUBVERSION_HOME" ]; then
- abort "SUBVERSION_HOME ($SUBVERSION_HOME) does not exist or is not a
directory."
-fi
+#if [ ! -d "$GIT_HOME" ]; then
+# abort "GIT_HOME ($GIT_HOME) does not exist or is not a directory."
+#fi
-echo "Prepending $SUBVERSION_HOME/bin to PATH..."
-PATH="$SUBVERSION_HOME/bin:$PATH"
+#echo "Prepending $GIT_HOME/bin to PATH..."
+#PATH="$GIT_HOME/bin:$PATH"
-if ! which svn >/dev/null 2>&1; then
- abort "svn not found in PATH ($PATH) - SUBVERSION_HOME must point to an SVN
install dir."
+if ! which git >/dev/null 2>&1; then
+ #abort "git not found in PATH ($PATH) - GIT_HOME must point to a git install
dir."
+ abort "git not found in PATH ($PATH)."
fi
-echo "Prepending $SUBVERSION_HOME/lib to LD_LIBRARY_PATH..."
-LD_LIBRARY_PATH="$SUBVERSION_HOME/lib:$LD_LIBRARY_PATH"
-export LD_LIBRARY_PATH
+#echo "Prepending $GIT_HOME/lib to LD_LIBRARY_PATH..."
+#LD_LIBRARY_PATH="$GIT_HOME/lib:$LD_LIBRARY_PATH"
+#export LD_LIBRARY_PATH
# Set additional required env vars.
@@ -143,29 +141,23 @@ export LANG
# Set various local variables.
-
-if [ -z "$BASE_DIR" ]; then
- BASE_DIR="$HOME"
-fi
-WORK_DIR="$BASE_DIR/${PROJECT_NAME}-${RELEASE_TYPE}-${RELEASE_VERSION}"
-
-RELEASE_BRANCH_CHECKOUT_DIR="$WORK_DIR/branch"
-RELEASE_TAG_CHECKOUT_DIR="$WORK_DIR/tag"
-if [ -n "$RELEASE_BRANCH" ]; then
- RELEASE_BRANCH_SVN_URL="$PROJECT_SVN_URL/branches/$RELEASE_BRANCH"
-else
- RELEASE_BRANCH_SVN_URL="$PROJECT_SVN_URL/trunk"
+if [ -n "$HUDSON_URL" ] && [ -n "$WORKSPACE" ]; then
+ echo "We appear to be running in a Hudson job."
+ WORK_DIR="$WORKSPACE"
+elif [ -z "$WORK_DIR" ]; then
+ WORK_DIR="$HOME/release"
fi
-RELEASE_TAG_SVN_URL="$PROJECT_SVN_URL/tags/$RELEASE_TAG"
+cd "$WORK_DIR"
+
-MAVEN_LOCAL_REPO_DIR="$BASE_DIR/release-m2-repo"
-MAVEN_SETTINGS_FILE="$WORK_DIR/settings.xml"
-MAVEN_OPTS="--settings "$MAVEN_SETTINGS_FILE" --debug --errors
-Penterprise -Pdist -Prelease"
+MAVEN_LOCAL_REPO_DIR="$WORK_DIR/m2-repository"
+MAVEN_SETTINGS_FILE="$WORK_DIR/m2-settings.xml"
+MAVEN_ARGS="--settings "$MAVEN_SETTINGS_FILE" --debug --errors
-Penterprise,dist,release"
if [ "$RELEASE_TYPE" = "enterprise" ]; then
- MAVEN_OPTS="$MAVEN_OPTS -Pojdbc-driver -Dpackage-connectors
-Dexclude-webdav"
+ MAVEN_OPTS="$MAVEN_OPTS -Dexclude-webdav"
fi
if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
- MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="24"
+ MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="12"
fi
@@ -175,7 +167,8 @@ echo
echo "========================= Environment Variables
=============================="
echo "JAVA_HOME=$JAVA_HOME"
echo "M2_HOME=$M2_HOME"
-echo "SUBVERSION_HOME=$SUBVERSION_HOME"
+echo "MAVEN_OPTS=$MAVEN_OPTS"
+#echo "GIT_HOME=$GIT_HOME"
echo "PATH=$PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "LANG=$LANG"
@@ -194,22 +187,22 @@ echo "RELEASE_TAG_CHECKOUT_DIR=$RELEASE_TAG_CHECKOUT_DIR"
echo "MAVEN_LOCAL_REPO_DIR=$MAVEN_LOCAL_REPO_DIR"
echo
"MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS"
echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE"
-echo "MAVEN_OPTS=$MAVEN_OPTS"
+echo "MAVEN_ARGS=$MAVEN_ARGS"
echo "============================ Program Versions
================================"
-mvn --version
+java -version
echo
-svn --version | head -2
+git --version
+echo
+mvn --version | head -1
echo
"=============================================================================="
echo
-# Clean the Maven local repo.
-
+# Clean the Maven local repo if it hasn't been purged recently.
if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
- if [ -n "$OUTPUT" ]; then
-
- echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than
24 hours - purging it for a clean-clean build..."
+ if [ -n "$OUTPUT" ]; then
+ echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than
$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean
build..."
rm -rf "$MAVEN_LOCAL_REPO_DIR"
fi
fi
@@ -217,12 +210,12 @@ mkdir -p "$MAVEN_LOCAL_REPO_DIR"
# Create the Maven settings file.
-SETTINGS=${WORK_DIR}/settings.xml
-cat <<EOF >${SETTINGS}
+cat <<EOF >"${MAVEN_SETTINGS_FILE}"
<settings>
<localRepository>$MAVEN_LOCAL_REPO_DIR</localRepository>
<profiles>
+
<profile>
<id>release</id>
<properties>
@@ -247,58 +240,80 @@ cat <<EOF >${SETTINGS}
</properties>
</profile>
- <profile>
- <id>ojdbc-driver</id>
- <repositories>
- <repository>
- <id>internal</id>
- <name>Internal Repository</name>
- <url>http://jon01.qa.atl2.redhat.com:8042/m2-repo/</url>
- </repository>
- </repositories>
- </profile>
</profiles>
</settings>
EOF
+# Clone and/or checkout the source from git.
+CLONE_DIR="$WORK_DIR/rhq"
+if [ -d "$CLONE_DIR" ]; then
+ cd "$CLONE_DIR"
+ git status >/dev/null 2>&1
+ # Note, git 1.6 and earlier returns an exit code of 1, rather than 0, if there are any
uncommitted changes,
+ # and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to
determine if $CLONE_DIR
+ # is a git working copy.
+ if [ $? -le 1 ]; then
+ echo "Checking out a clean copy of the master branch..."
+ git checkout "$BRANCH"
+ git reset --hard
+ git clean -dxf
+ else
+ cd "$WORK_DIR"
+ rm -rf "$CLONE_DIR"
+ fi
+fi
+if [ ! -d "$CLONE_DIR" ]; then
+ echo "Cloning the RHQ git repo (this will take about 10-15 minutes)..."
+ git clone
ssh://git.fedorahosted.org/git/rhq/rhq.git
+ cd "$CLONE_DIR"
+ git checkout "$BRANCH"
+fi
-# Run a test build before tagging.
-if [ -f "$RELEASE_BRANCH_CHECKOUT_DIR" ]; then
- echo "Purging contents of RELEASE_BRANCH_CHECKOUT_DIR
($RELEASE_BRANCH_CHECKOUT_DIR)..."
- rm -rf "$RELEASE_BRANCH_CHECKOUT_DIR"
-fi
-mkdir -p "$RELEASE_BRANCH_CHECKOUT_DIR"
+# Create a branch for the release, so we don't have to mess with master.
+echo "Creating branch $RELEASE_BRANCH and checking it out..."
+git push origin master:$RELEASE_BRANCH
+git checkout $RELEASE_BRANCH
-echo "Checking out branch source from $RELEASE_BRANCH_SVN_URL to
$RELEASE_BRANCH_CHECKOUT_DIR (this will take about 5-10 minutes)..."
-# We only need pom.xml and modules/**. Save some time by not checking out etc/**.
-svn co -N $RELEASE_BRANCH_SVN_URL "$RELEASE_BRANCH_CHECKOUT_DIR"
-cd "$RELEASE_BRANCH_CHECKOUT_DIR"
-svn co $RELEASE_BRANCH_SVN_URL/modules
-echo "Building project to ensure tests pass and to boostrap local Maven repo (this
will take about 10-15 minutes)..."
-# This will build everything except the CLI, enforcing Java 5 APIs.
-mvn install $MAVEN_OPTS -Ddbsetup -Djava5.home=$JAVA5_HOME/jre
-if [ "$?" -ne 0 ]; then
- abort "Build failed. Please see above Maven output for details, fix any issues,
then try again."
-fi
-# Now build the CLI, enforcing Java 6 APIs.
-cd modules/enterprise/remoting/cli
-mvn install $MAVEN_OPTS
+# Run a test build before tagging.
+echo "Building project to ensure tests pass and to bootstrap local Maven repo (this
will take about 15-30 minutes)..."
+# TODO: Add -Djava5.home=$JAVA5_HOME/jre to the below mvn command line once the Java6 API
usages have been removed from the Deployer class.
+# TODO: Add -Ddbreset to the below mvn command line - this was removed temporarily to
speed up development and testing of this release script.
+# TODO: Remove the -Dmaven.test.skip=true - this was added temporarily to speed up
development and testing of this release script.
+# NOTE: No need to do a mvn clean, since we just did either a clone or clean checkout
above.
+mvn install $MAVEN_ARGS -Dmaven.test.skip=true
if [ "$?" -ne 0 ]; then
- abort "Build failed. Please see above Maven output for details, fix any issues,
then try again."
+ abort "Test build failed. Please see above Maven output for details, fix any
issues, then try again."
fi
-
echo
echo "Test build succeeded!"
-# Tag the release.
+# Clean up the snapshot jars produced by the test build.
+echo "Cleaning up snapshot jars produced by test build..."
+mvn clean $MAVEN_ARGS
+
+
+# Do a dry run of tagging the release.
+echo "Doing a dry run of tagging the release..."
+mvn release:prepare $MAVEN_ARGS --batch-mode -DreleaseVersion=$RELEASE_VERSION
-DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG
"-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true" -DdryRun=true
+EXIT_CODE=$?
+mvn release:clean $MAVEN_ARGS
+if [ "$EXIT_CODE" -ne 0 ]; then
+ abort "Tagging dry run failed. Please see above Maven output for details, fix any
issues, then try again."
+fi
+echo
+echo "Tagging dry run succeeded!"
+
+# If the dry run succeeded, tag it for real.
echo "Tagging the release..."
cd "$RELEASE_BRANCH_CHECKOUT_DIR"
-mvn release:prepare $MAVEN_OPTS -DreleaseVersion=$RELEASE_VERSION
-DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG
"-DpreparationGoals=clean verify $MAVEN_OPTS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true" -DdryRun=true
-if [ "$?" -ne 0 ]; then
+mvn release:prepare $MAVEN_ARGS --batch-mode -DreleaseVersion=$RELEASE_VERSION
-DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG
"-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true
-Ddbsetup-do-not-check-schema=true" -DdryRun=false
+EXIT_CODE=$?
+mvn release:clean $MAVEN_ARGS
+if [ "$EXIT_CODE" -ne 0 ]; then
abort "Tagging failed. Please see above Maven output for details, fix any issues,
then try again."
fi
echo
@@ -306,28 +321,20 @@ echo "Tagging succeeded!"
# Checkout the tag and build it.
-
-if [ -f "$RELEASE_TAG_CHECKOUT_DIR" ]; then
- echo "Purging contents of RELEASE_TAG_CHECKOUT_DIR
($RELEASE_TAG_CHECKOUT_DIR)..."
- rm -rf "$RELEASE_TAG_CHECKOUT_DIR"
-fi
-mkdir -p "$RELEASE_TAG_CHECKOUT_DIR"
-
-echo "Checking out tag source from $RELEASE_TAG_SVN_URL to $RELEASE_TAG_CHECKOUT_DIR
(this will take about 5-10 minutes)..."
-svn co -N $RELEASE_TAG_SVN_URL "$RELEASE_TAG_CHECKOUT_DIR"
-cd "$RELEASE_TAG_CHECKOUT_DIR"
-svn co $RELEASE_TAG_SVN_URL/modules
-
-echo "Building release from tag (this will take about 10-15 minutes)..."
-mvn install $MAVEN_OPTS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true
+echo "Checking out release tag $RELEASE_TAG..."
+git checkout "$RELEASE_TAG"
+echo "Building release from tag (this will take about 5-10 minutes)..."
+mvn install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true
if [ "$?" -ne 0 ]; then
- abort "Build failed. Please see above Maven output for details, fix any issues,
then try again."
+ abort "Release build failed. Please see above Maven output for details, fix any
issues, then try again."
fi
echo
echo "Release build succeeded!"
+
echo "=========================== Release Info
==============================="
echo "Version: $RELEASE_VERSION"
-echo "Branch SVN URL: $RELEASE_BRANCH_SVN_URL"
-echo "Tag SVN URL: $RELEASE_TAG_SVN_URL"
+echo "Branch URL: $RELEASE_BRANCH_SVN_URL"
+echo "Tag URL:
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=shortlog;h=refs/heads/$R...
echo
"========================================================================"
+
commit c809e6802fb6572387b5a8099bce6795ee49a0d8
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Jun 4 17:25:36 2010 +0200
The best disambiguation yet. The types with duplicate names accross the whole type
hierarchy are always shown with the plugin info, disambiguated plugin info is pushed down
as much as possible so that it appears as close to the resource (or at the resource,
ideally).
Also, the plugin info is correctly left intact when it was used to disambiguate at
least a part of some partition at some level.
A couple of minor optimizations.
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 302fdac..10b3830 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
@@ -2094,6 +2094,6 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
public <T> ResourceNamesDisambiguationResult<T>
disambiguate(List<T> results, IntExtractor<? super T> extractor,
DisambiguationUpdateStrategy updateStrategy) {
- return Disambiguator.disambiguate(results, updateStrategy, extractor,
entityManager);
+ return Disambiguator.disambiguate(results, updateStrategy, extractor,
entityManager, typeManager.getDuplicateTypeNames());
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
index 11ea47d..8a340d5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
@@ -23,7 +23,10 @@
package org.rhq.enterprise.server.resource.disambiguation;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.EnumSet;
+import java.util.List;
import
org.rhq.enterprise.server.resource.disambiguation.MutableDisambiguationReport.Resource;
@@ -39,7 +42,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
*/
EXACT {
public <T> void update(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report) {
- updateResources(policy, report);
+ updateResources(policy, report, true, true);
int nofParents = policy.size() - 1;
if (nofParents < 0)
nofParents = 0;
@@ -52,6 +55,10 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
}
}
}
+
+ public <T> boolean partitionFurther(ReportPartitions<T> partitions)
{
+ return true;
+ }
},
/**
@@ -60,7 +67,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
*/
KEEP_AT_LEAST_ONE_PARENT {
public <T> void update(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report) {
- updateResources(policy, report);
+ updateResources(policy, report, true, true);
int nofParents = policy.size() - 1;
if (nofParents < 1)
nofParents = 1;
@@ -74,6 +81,10 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
public EnumSet<ResourceResolution>
resourceLevelRepartitionableResolutions() {
return EnumSet.allOf(ResourceResolution.class);
}
+
+ public <T> boolean partitionFurther(ReportPartitions<T> partitions)
{
+ return true;
+ }
},
/**
@@ -82,7 +93,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
*/
KEEP_PARENTS_TO_TOPMOST_SERVERS {
public <T> void update(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report) {
- updateResources(policy, report);
+ updateResources(policy, report, true, true);
//only remove the platform, if the policy doesn't dictate its
presence...
if (policy.size() > 1 && report.parents.size() > policy.size()
- 1) {
report.parents.remove(report.parents.size() - 1);
@@ -93,6 +104,10 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
public EnumSet<ResourceResolution>
resourceLevelRepartitionableResolutions() {
return EnumSet.allOf(ResourceResolution.class);
}
+
+ public <T> boolean partitionFurther(ReportPartitions<T> partitions)
{
+ return partitions.getDisambiguationPolicy().size() <
Disambiguator.MAXIMUM_DISAMBIGUATED_TREE_DEPTH - 1;
+ }
},
/**
@@ -100,7 +115,7 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
*/
KEEP_ALL_PARENTS {
public <T> void update(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report) {
- updateResources(policy, report);
+ updateResources(policy, report, true, true);
//do nothing to the parents, keep them as they are...
}
@@ -111,8 +126,16 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
public EnumSet<ResourceResolution> alwaysRepartitionableResolutions() {
return EnumSet.of(ResourceResolution.NAME);
}
+
+ public <T> boolean partitionFurther(ReportPartitions<T> partitions)
{
+ //we always keep all the info about the resources in this strategy
+ //so there's no real need to disambiguate anything.
+ return false;
+ }
};
+ private static final DisambiguationPolicy.Level overridingResolution = new
DisambiguationPolicy.Level(ResourceResolution.TYPE);
+
/**
* This updates the resources in the report according to the resolutions contained in
the policy.
* This method is called as part of the {@link
DisambiguationUpdateStrategy#update(DisambiguationPolicy, MutableDisambiguationReport)}
@@ -123,15 +146,29 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
* @param <T>
* @param policy
* @param report
+ * @param honorAmbiguousTypeNamesList whether to honor the list of ambiguous type
names as listed in the policy when updating the resources.
+ * @param pushDownPluginInfo if true, the plugin information is pushed down as low in
the resource hierarchy as possible. This means that if
+ * some parent needs plugin disambiguation or is of an ambiguous type and the
resource comes from the same plugin, the plugin info is preserved
+ * on the resource rather than on the parent. This is mainly useful for the display
purposes, because it just
+ * looks nicer to have that info at a resource than somewhere in the location
string.
*/
- public static <T> void updateResources(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report) {
- updateResource(policy.get(0), report.resource);
+ public static <T> void updateResources(DisambiguationPolicy policy,
MutableDisambiguationReport<T> report, boolean honorAmbiguousTypeNamesList, boolean
pushDownPluginInfo) {
+ List<String> ambiguousTypeNames = honorAmbiguousTypeNamesList ?
policy.getAmbiguousTypeNames() : Collections.<String>emptyList();
+
+ String resourcePlugin = report.resource.resourceType.plugin;
+ List<String> parentPlugins = new
ArrayList<String>(report.parents.size());
+ updateResource(policy.get(0), report.resource, ambiguousTypeNames);
int disambiguationPolicyIndex = 1;
while (disambiguationPolicyIndex < policy.size() &&
disambiguationPolicyIndex - 1 < report.parents.size()) {
- ResourceResolution parentResolution = policy.get(disambiguationPolicyIndex);
+ DisambiguationPolicy.Level resolutionLevel =
policy.get(disambiguationPolicyIndex);
MutableDisambiguationReport.Resource parent =
report.parents.get(disambiguationPolicyIndex - 1);
- updateResource(parentResolution, parent);
+
+ if (pushDownPluginInfo) {
+ parentPlugins.add(parent.resourceType.plugin);
+ }
+
+ updateResource(resolutionLevel, parent, ambiguousTypeNames);
disambiguationPolicyIndex++;
}
@@ -142,30 +179,27 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
//we need to treat those parents as well. Because they are not needed for
disambiguation, treat them as
//if only the name and type was needed for them.
for (; disambiguationPolicyIndex < report.parents.size();
++disambiguationPolicyIndex) {
- updateResource(ResourceResolution.TYPE,
report.parents.get(disambiguationPolicyIndex));
+ if (pushDownPluginInfo) {
+
parentPlugins.add(report.parents.get(disambiguationPolicyIndex).resourceType.plugin);
+ }
+ updateResource(overridingResolution,
report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames);
}
- //include the plugin information only if it was actually the deciding resolution
of the policy.
- if (policy.get(policy.size() - 1) == ResourceResolution.PLUGIN) {
- String decidingPlugin = policy.size() > 1 ?
report.parents.get(policy.size() - 2).resourceType.plugin :
report.resource.resourceType.plugin;
-
- for (int i = policy.size() - 3; i >= 0; i--) {
- if (decidingPlugin.equals(report.parents.get(i).resourceType.plugin)) {
- updateResource(ResourceResolution.TYPE, report.parents.get(i));
+ if (pushDownPluginInfo) {
+ for (int i = report.parents.size() - 1; i >= 0; --i) {
+ String plugin = report.parents.get(i).resourceType.plugin;
+ if (plugin != null && i > 0 &&
plugin.equals(parentPlugins.get(i - 1))) {
+ report.parents.get(i - 1).resourceType.plugin = plugin;
+ report.parents.get(i).resourceType.plugin = null;
}
}
- if (policy.size() > 1 &&
decidingPlugin.equals(report.resource.resourceType.plugin)) {
- updateResource(ResourceResolution.TYPE, report.resource);
- }
- } else {
- //ok, this report was in the end resolved by some name or type at the
resource level
- //or higher up in the parents. This alone uniquely identifies the resource,
so there's
- //no need to show the (ambigous anyway) plugin info.
- updateResource(ResourceResolution.TYPE, report.resource);
-
- for (MutableDisambiguationReport.Resource parent : report.parents) {
- updateResource(ResourceResolution.TYPE, parent);
+ if (report.parents.size() > 0) {
+ String plugin = report.parents.get(0).resourceType.plugin;
+ if (plugin != null && plugin.equals(resourcePlugin)) {
+ report.resource.resourceType.plugin = resourcePlugin;
+ report.parents.get(0).resourceType.plugin = null;
+ }
}
}
}
@@ -188,10 +222,17 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
}
- private static void updateResource(ResourceResolution resolution, Resource resource)
{
- switch (resolution) {
+ private static void updateResource(DisambiguationPolicy.Level resolutionLevel,
Resource resource, List<String> ambiguousTypeNames) {
+ switch (resolutionLevel.getResourceResolution()) {
case NAME: case TYPE:
- resource.resourceType.plugin = null;
+ if (!ambiguousTypeNames.contains(resource.resourceType.name)) {
+ resource.resourceType.plugin = null;
+ }
+ break;
+ case PLUGIN:
+ if (!(resolutionLevel.isDeciding() ||
ambiguousTypeNames.contains(resource.resourceType.name))) {
+ resource.resourceType.plugin = null;
+ }
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java
index d4ce232..3387983 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java
@@ -24,6 +24,7 @@
package org.rhq.enterprise.server.resource.disambiguation;
import java.util.ArrayList;
+import java.util.List;
/**
* A disambiguation policy determines whether two disambiguation reports are still
ambiguous or not.
@@ -31,31 +32,71 @@ import java.util.ArrayList;
* The policy is basically a list of {@link ResourceResolution} instances each
corresponding to either
* the resource itself of some of its parent in the hierarchy. Each of the {@link
ResourceResolution} instances
* in the list determines how the appropriate part of the report is disambiguated.
- * <p>
- * Only last element in this list actually decides whether the two reports are still
ambiguous. The thinking
- * behind this is that the previous resolutions in the chain are "decided" and
the last one is the one
- * we are currently trying to determine the correct resolution for.
- *
*
* @author Lukas Krejci
*/
-public class DisambiguationPolicy extends ArrayList<ResourceResolution> {
+public class DisambiguationPolicy extends ArrayList<DisambiguationPolicy.Level> {
private static final long serialVersionUID = 1L;
private DisambiguationUpdateStrategy parentsUpdateStrategy;
+ private List<String> ambiguousTypeNames;
+
+ public static class Level {
+ private ResourceResolution resourceResolution;
+ private boolean deciding;
+
+ public Level(ResourceResolution resourceResolution) {
+ this(resourceResolution, false);
+ }
+
+ public Level(ResourceResolution resourceResolution, boolean deciding) {
+ this.resourceResolution = resourceResolution;
+ this.deciding = deciding;
+ }
+
+ public boolean isDeciding() {
+ return deciding;
+ }
+
+ public void setDeciding(boolean deciding) {
+ this.deciding = deciding;
+ }
+
+ public ResourceResolution getResourceResolution() {
+ return resourceResolution;
+ }
+
+ public String toString() {
+ return "Level[" + resourceResolution + (deciding ? ",
deciding]" : ", not deciding]");
+ }
+ }
- public DisambiguationPolicy(DisambiguationUpdateStrategy
parentsDisambiguationStrategy) {
+ public DisambiguationPolicy(DisambiguationUpdateStrategy
parentsDisambiguationStrategy, List<String> ambiguousTypeNames) {
this.parentsUpdateStrategy = parentsDisambiguationStrategy;
+ this.ambiguousTypeNames = ambiguousTypeNames;
}
public DisambiguationPolicy(DisambiguationPolicy other) {
- super(other);
+ for(Level level : other) {
+ this.add(new Level(level.resourceResolution, level.deciding));
+ }
this.parentsUpdateStrategy = other.parentsUpdateStrategy;
+ this.ambiguousTypeNames = other.ambiguousTypeNames;
}
- public static DisambiguationPolicy getUniqueNamePolicy(DisambiguationUpdateStrategy
parentsDisambiguationStrategy) {
- DisambiguationPolicy ret = new
DisambiguationPolicy(parentsDisambiguationStrategy);
- ret.add(ResourceResolution.NAME);
+ /**
+ * Creates a "starting" disambiguation policy that is used to try and
disambiguate
+ * the resources by just their name.
+ *
+ * @see #DisambiguationPolicy(DisambiguationUpdateStrategy, List)
+ * @see #getAmbiguousTypeNames()
+ * @param parentsDisambiguationStrategy
+ * @param ambiguousTypeNames the list of ambiguous type names
+ * @return
+ */
+ public static DisambiguationPolicy getUniqueNamePolicy(DisambiguationUpdateStrategy
parentsDisambiguationStrategy, List<String> ambiguousTypeNames) {
+ DisambiguationPolicy ret = new
DisambiguationPolicy(parentsDisambiguationStrategy, ambiguousTypeNames);
+ ret.add(new Level(ResourceResolution.NAME));
return ret;
}
@@ -69,6 +110,18 @@ public class DisambiguationPolicy extends
ArrayList<ResourceResolution> {
}
/**
+ * @return the list of type names that are defined in multiple plugins. Such type
names
+ * should be disambiguated no matter if it is needed or not.
+ */
+ public List<String> getAmbiguousTypeNames() {
+ return ambiguousTypeNames;
+ }
+
+ public void setAmbiguousTypeNames(List<String> ambiguousTypeNames) {
+ this.ambiguousTypeNames = ambiguousTypeNames;
+ }
+
+ /**
* Tells whether the last resolution in this policy determines the reports
ambiguous.
*
* @param <T>
@@ -83,16 +136,19 @@ public class DisambiguationPolicy extends
ArrayList<ResourceResolution> {
if (ra == null || rb == null)
return false;
- ResourceResolution resolution = get(size() - 1);
+ Level level = getCurrentLevel();
- return resolution.areAmbiguous(ra, rb);
+ if (level != null) {
+ return level.getResourceResolution().areAmbiguous(ra, rb);
+ } else {
+ return false;
+ }
}
/**
- * @return the currently deciding {@link ResourceResolution} (i.e. the last element
in this
- * policy)
+ * @return the last element in this policy
*/
- public ResourceResolution getCurrentResourceResolution() {
+ public Level getCurrentLevel() {
return size() > 0 ? get(size() - 1) : null;
}
@@ -104,19 +160,19 @@ public class DisambiguationPolicy extends
ArrayList<ResourceResolution> {
*/
public DisambiguationPolicy getNext() {
int lastIdx = size() - 1;
- ResourceResolution lastResolution = get(lastIdx);
+ ResourceResolution lastResolution = get(lastIdx).getResourceResolution();
DisambiguationPolicy ret = new DisambiguationPolicy(this);
switch (lastResolution) {
case NAME:
- ret.set(lastIdx, ResourceResolution.TYPE);
+ ret.get(lastIdx).resourceResolution = ResourceResolution.TYPE;
break;
case TYPE:
- ret.set(lastIdx, ResourceResolution.PLUGIN);
+ ret.get(lastIdx).resourceResolution = ResourceResolution.PLUGIN;
break;
case PLUGIN:
- ret.add(ResourceResolution.NAME);
+ ret.add(new Level(ResourceResolution.NAME));
break;
}
@@ -128,10 +184,10 @@ public class DisambiguationPolicy extends
ArrayList<ResourceResolution> {
* if the current policy doesn't require repartitioning of unique reports.
*/
public DisambiguationPolicy getNextRepartitioningPolicy() {
- ResourceResolution currentResolution = get(size() - 1);
+ ResourceResolution currentResolution =
getCurrentLevel().getResourceResolution();
- if
(parentsUpdateStrategy.alwaysRepartitionableResolutions().contains(currentResolution) ||
(size() == 1)
- &&
parentsUpdateStrategy.resourceLevelRepartitionableResolutions().contains(currentResolution))
{
+ if
(parentsUpdateStrategy.alwaysRepartitionableResolutions().contains(currentResolution) ||
(size() == 1
+ &&
parentsUpdateStrategy.resourceLevelRepartitionableResolutions().contains(currentResolution)))
{
DisambiguationPolicy newPolicy = getNext();
@@ -141,7 +197,7 @@ public class DisambiguationPolicy extends
ArrayList<ResourceResolution> {
//therefore, skip the plugin resolution in that case.
if (currentResolution == ResourceResolution.TYPE) {
newPolicy = newPolicy.getNext();
- newPolicy.set(newPolicy.size() - 2, ResourceResolution.TYPE);
+ newPolicy.get(newPolicy.size() - 2).resourceResolution =
ResourceResolution.TYPE;
}
return newPolicy;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java
index 4674c1e..1639644 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java
@@ -62,4 +62,19 @@ public interface DisambiguationUpdateStrategy {
*/
EnumSet<ResourceResolution> alwaysRepartitionableResolutions();
+ /**
+ * The disambiguation procedure calls this method for every not yet fully unique
+ * partitions set when it determines that further disambiguation should be
performed.
+ * <p>
+ * But this is not always necessary, depending on the update strategy
implementation.
+ * <p>
+ * This method is therefore the means for the update strategy to short-circuit the
disambiguation
+ * procedure when it determines that further disambiguation would not make sense for
this strategy.
+ *
+ * @param <T>
+ * @param partitions the partitions object holding a subset of the results being
disambiguated along
+ * with the policy that is used to disambiguate them
+ * @return true if further disambiguation is useful, false otherwise
+ */
+ <T> boolean partitionFurther(ReportPartitions<T> partitions);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
index 7adc22e..2baa4db 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java
@@ -44,6 +44,9 @@ import org.rhq.core.util.IntExtractor;
*/
public class Disambiguator {
+ /**
+ * The maximum depth of the resource tree.
+ */
public static final int MAXIMUM_DISAMBIGUATED_TREE_DEPTH = 7;
private static final String PARENT_INFO_QUERY;
@@ -95,11 +98,12 @@ public class Disambiguator {
* @param disambiguationUpdateStrategy how is the disambiguation info going to be
applied to the results.
* @param resourceIdExtractor an object able to extract resource id from an instance
of type parameter.
* @param entityManager an entityManager to be used to access the database
+ * @param duplicateTypeNames the list of type names that are ambiguous without plugin
spec
* @return the disambiguation result or null on error
*/
public static <T> ResourceNamesDisambiguationResult<T>
disambiguate(List<T> results,
DisambiguationUpdateStrategy disambiguationUpdateStrategy, IntExtractor<?
super T> extractor,
- EntityManager entityManager) {
+ EntityManager entityManager, List<String> duplicateTypeNames) {
if (results.isEmpty()) {
return new ResourceNamesDisambiguationResult<T>(new
ArrayList<DisambiguationReport<T>>());
@@ -143,7 +147,7 @@ public class Disambiguator {
//requires different level of disambiguation, I will then process them
individually.
ReportPartitions<T> partitionedReports = new
ReportPartitions<T>(DisambiguationPolicy
- .getUniqueNamePolicy(disambiguationUpdateStrategy));
+ .getUniqueNamePolicy(disambiguationUpdateStrategy, duplicateTypeNames));
@SuppressWarnings("unchecked")
List<Object[]> parentsResults = (List<Object[]>)
parentsQuery.getResultList();
@@ -206,12 +210,16 @@ public class Disambiguator {
List<ReportPartitions<T>> ambiguousSubPartitions = new
ArrayList<ReportPartitions<T>>();
- if (!partitionedReports.isPartitionsUnique()) {
- ambiguousSubPartitions.add(partitionedReports);
+ if (!disambiguationUpdateStrategy.partitionFurther(partitionedReports)) {
+ updateResourcesInPartitions(disambiguationUpdateStrategy,
partitionedReports.getDisambiguationPolicy(), partitionedReports.getAllPartitions());
} else {
- repartitionUnique(partitionedReports, disambiguationUpdateStrategy,
ambiguousSubPartitions);
+ if (!partitionedReports.isPartitionsUnique()) {
+ ambiguousSubPartitions.add(partitionedReports);
+ } else {
+ repartitionUnique(partitionedReports, disambiguationUpdateStrategy,
ambiguousSubPartitions);
+ }
}
-
+
while (ambiguousSubPartitions.size() > 0) {
Iterator<ReportPartitions<T>> subPartitionIterator =
ambiguousSubPartitions.iterator();
List<ReportPartitions<T>> newAmbiguousPartitions = new
ArrayList<ReportPartitions<T>>();
@@ -219,17 +227,21 @@ public class Disambiguator {
while (subPartitionIterator.hasNext()) {
ReportPartitions<T> subPartition =
subPartitionIterator.next();
- repartitionUnique(subPartition, disambiguationUpdateStrategy,
newAmbiguousPartitions);
-
- for (List<MutableDisambiguationReport<T>>
partitionReports : subPartition.getAmbiguousPartitions()) {
- ReportPartitions<T> replacementSubpartition = new
ReportPartitions<T>(subPartition
- .getDisambiguationPolicy().getNext());
- replacementSubpartition.putAll(partitionReports);
- if (!replacementSubpartition.isPartitionsUnique()) {
- newAmbiguousPartitions.add(replacementSubpartition);
- } else {
- repartitionUnique(replacementSubpartition,
disambiguationUpdateStrategy, newAmbiguousPartitions);
+ if (disambiguationUpdateStrategy.partitionFurther(subPartition)) {
+ repartitionUnique(subPartition, disambiguationUpdateStrategy,
newAmbiguousPartitions);
+
+ for (List<MutableDisambiguationReport<T>>
partitionReports : subPartition.getAmbiguousPartitions()) {
+ ReportPartitions<T> replacementSubpartition = new
ReportPartitions<T>(subPartition
+ .getDisambiguationPolicy().getNext());
+ replacementSubpartition.putAll(partitionReports);
+ if (!replacementSubpartition.isPartitionsUnique()) {
+ newAmbiguousPartitions.add(replacementSubpartition);
+ } else {
+ repartitionUnique(replacementSubpartition,
disambiguationUpdateStrategy, newAmbiguousPartitions);
+ }
}
+ } else {
+ updateResourcesInPartitions(disambiguationUpdateStrategy,
subPartition.getDisambiguationPolicy(), subPartition.getAllPartitions());
}
subPartitionIterator.remove();
}
@@ -266,14 +278,17 @@ public class Disambiguator {
} else {
//ok, there is no other repartitioning policy that we can try.
//Let's update the reports in the unique partitions...
- for (List<MutableDisambiguationReport<T>> partition :
partitions.getUniquePartitions()) {
- for (MutableDisambiguationReport<T> report : partition) {
- updateStrategy.update(partitions.getDisambiguationPolicy(),
report);
- }
- }
-
+ updateResourcesInPartitions(updateStrategy,
partitions.getDisambiguationPolicy(), partitions.getUniquePartitions());
return;
}
}
}
+
+ private static <T> void
updateResourcesInPartitions(DisambiguationUpdateStrategy strategy, DisambiguationPolicy
policy, List<List<MutableDisambiguationReport<T>>> partitions) {
+ for (List<MutableDisambiguationReport<T>> partition : partitions) {
+ for (MutableDisambiguationReport<T> report : partition) {
+ strategy.update(policy, report);
+ }
+ }
+ }
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
index 8fbb9ab..337ef31 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java
@@ -31,6 +31,10 @@ import java.util.List;
* This class partitions the reports inserted into it by chunking them up
* into sublists containing mutually ambiguous reports. The ambiguity is determined using
* a {@link DisambiguationPolicy}.
+ * <p>
+ * The ReportPartition instances can form a tree using the {@link
#getPreviousPartitioning()}
+ * and the parameters provided to the constructors. This is handy to keep track of what
+ * partitions have been disambiguated at what level and how.
*
* @param <T> the type of the original instances the are being disambiguated.
*
@@ -40,8 +44,9 @@ public class ReportPartitions<T> {
private static final long serialVersionUID = 1L;
private DisambiguationPolicy disambiguationPolicy;
- private List<List<MutableDisambiguationReport<T>>> partitions;
-
+ private List<List<MutableDisambiguationReport<T>>>
uniquePartitions;
+ private List<List<MutableDisambiguationReport<T>>>
ambiguousPartitions;
+
/**
* Constructs a new instance with no partitions in it.
*
@@ -49,7 +54,8 @@ public class ReportPartitions<T> {
*/
public ReportPartitions(DisambiguationPolicy disambiguationPolicy) {
this.disambiguationPolicy = disambiguationPolicy;
- partitions = new
ArrayList<List<MutableDisambiguationReport<T>>>();
+ uniquePartitions = new
ArrayList<List<MutableDisambiguationReport<T>>>();
+ ambiguousPartitions = new
ArrayList<List<MutableDisambiguationReport<T>>>();
}
public ReportPartitions(DisambiguationPolicy disambiguationPolicy,
ReportPartitions<T> other) {
@@ -69,77 +75,89 @@ public class ReportPartitions<T> {
}
public List<List<MutableDisambiguationReport<T>>>
getAmbiguousPartitions() {
- List<List<MutableDisambiguationReport<T>>> ret = new
ArrayList<List<MutableDisambiguationReport<T>>>();
-
- for (List<MutableDisambiguationReport<T>> partition : partitions) {
- if (partition.size() > 1) {
- ret.add(partition);
- }
- }
-
- return ret;
+ return Collections.unmodifiableList(ambiguousPartitions);
}
public List<List<MutableDisambiguationReport<T>>>
getUniquePartitions() {
- List<List<MutableDisambiguationReport<T>>> ret = new
ArrayList<List<MutableDisambiguationReport<T>>>();
-
- for (List<MutableDisambiguationReport<T>> partition : partitions) {
- if (partition.size() == 1) {
- ret.add(partition);
- }
- }
-
- return ret;
+ return Collections.unmodifiableList(uniquePartitions);
}
public List<List<MutableDisambiguationReport<T>>>
getAllPartitions() {
- return Collections.unmodifiableList(partitions);
+ List<List<MutableDisambiguationReport<T>>> ret = new
ArrayList<List<MutableDisambiguationReport<T>>>(ambiguousPartitions);
+ ret.addAll(uniquePartitions);
+ return Collections.unmodifiableList(ret);
}
public void put(MutableDisambiguationReport<T> value) {
- boolean found = false;
- for (List<MutableDisambiguationReport<T>> partition : partitions) {
- for (MutableDisambiguationReport<T> partitionPrototype : partition) {
- if (disambiguationPolicy.areAmbiguous(partitionPrototype, value)) {
- found = true;
- break;
- }
- }
- if (found) {
- partition.add(value);
- break;
- }
- }
-
- if (!found) {
- List<MutableDisambiguationReport<T>> newPartition = new
ArrayList<MutableDisambiguationReport<T>>();
- newPartition.add(value);
- partitions.add(newPartition);
- }
+ put(value, true);
}
public void putAll(List<MutableDisambiguationReport<T>> values) {
for (MutableDisambiguationReport<T> v : values) {
- put(v);
+ put(v, false);
}
+ updatePolicy();
}
public void putAll(ReportPartitions<T> other) {
for (List<MutableDisambiguationReport<T>> partition :
other.getAllPartitions()) {
- putAll(partition);
+ for (MutableDisambiguationReport<T> v : partition) {
+ put(v, false);
+ }
}
+ updatePolicy();
}
public boolean isPartitionsUnique() {
- for (List<MutableDisambiguationReport<T>> partition : partitions) {
- if (partition.size() > 1) {
- return false;
+ return ambiguousPartitions.size() == 0;
+ }
+
+ public String toString() {
+ return "ReportPartitions[policy=" + disambiguationPolicy + ",
uniquePartitions=" + uniquePartitions + ", ambiguousPartitions=" +
ambiguousPartitions + "]";
+ }
+
+ private void put(MutableDisambiguationReport<T> value, boolean updatePolicy) {
+ if (insertIntoExisting(value, ambiguousPartitions) >= 0) {
+ return;
+ } else {
+ int idx = insertIntoExisting(value, uniquePartitions);
+ if (idx >= 0) {
+ ambiguousPartitions.add(uniquePartitions.remove(idx));
+ } else {
+ List<MutableDisambiguationReport<T>> newPartition = new
ArrayList<MutableDisambiguationReport<T>>();
+ newPartition.add(value);
+ uniquePartitions.add(newPartition);
}
}
- return true;
+
+ if (updatePolicy) {
+ updatePolicy();
+ }
+ }
+
+ private void updatePolicy() {
+ this.disambiguationPolicy.getCurrentLevel().setDeciding(uniquePartitions.size()
> 0);
}
+
+ private int insertIntoExisting(MutableDisambiguationReport<T> value,
List<List<MutableDisambiguationReport<T>>> partitions) {
+ int idx = -1;
+ boolean found = false;
+ for (List<MutableDisambiguationReport<T>> partition : partitions) {
+ for (MutableDisambiguationReport<T> partitionPrototype : partition) {
+ if (disambiguationPolicy.areAmbiguous(partitionPrototype, value)) {
+ found = true;
+ break;
+ }
+ }
- public String toString() {
- return "ReportPartitions[policy=" + disambiguationPolicy + ",
partitions=" + partitions + "]";
+ idx++;
+
+ if (found) {
+ partition.add(value);
+ break;
+ }
+ }
+
+ return found ? idx : -1;
}
}
\ No newline at end of file
commit 60faf0491dabc3c6ac7b6cf11601bc29b90b2278
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Jun 3 20:28:26 2010 +0200
This is an experimental change to the way the disambiguation works (once more). This
tries to deal with the fact that the plugin info is shown when resource of the same name
and type are only resolved by parent path (and thus showing the plugin info).
This change has a problem though. If an ambiguous partition is partially resolved by a
plugin info at resource level, the rest of partition is disambiguated further up by name
and then loses the plugin info further below (which would be needed to
disambiguate with the previously partially resolved parts).
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
index c11c3dd..11ea47d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java
@@ -103,10 +103,13 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
updateResources(policy, report);
//do nothing to the parents, keep them as they are...
}
-
- @Override
+
public EnumSet<ResourceResolution>
resourceLevelRepartitionableResolutions() {
- return EnumSet.allOf(ResourceResolution.class);
+ return EnumSet.of(ResourceResolution.NAME);
+ }
+
+ public EnumSet<ResourceResolution> alwaysRepartitionableResolutions() {
+ return EnumSet.of(ResourceResolution.NAME);
}
};
@@ -142,17 +145,28 @@ public enum DefaultDisambiguationUpdateStrategies implements
DisambiguationUpdat
updateResource(ResourceResolution.TYPE,
report.parents.get(disambiguationPolicyIndex));
}
- //don't replicate the plugin information on the parents if it was reported
- //on the resource already.
- //this has to be done on all the parents, not just the ones that are immediately
needed
- //for disambiguation. The parents update strategies might leave more parents than
those needed.
- if (policy.get(0) == ResourceResolution.PLUGIN) {
- for (MutableDisambiguationReport.Resource parent : report.parents) {
- if
(report.resource.resourceType.plugin.equals(parent.resourceType.plugin)) {
-
- parent.resourceType.plugin = null;
+ //include the plugin information only if it was actually the deciding resolution
of the policy.
+ if (policy.get(policy.size() - 1) == ResourceResolution.PLUGIN) {
+ String decidingPlugin = policy.size() > 1 ?
report.parents.get(policy.size() - 2).resourceType.plugin :
report.resource.resourceType.plugin;
+
+ for (int i = policy.size() - 3; i >= 0; i--) {
+ if (decidingPlugin.equals(report.parents.get(i).resourceType.plugin)) {
+ updateResource(ResourceResolution.TYPE, report.parents.get(i));
}
}
+
+ if (policy.size() > 1 &&
decidingPlugin.equals(report.resource.resourceType.plugin)) {
+ updateResource(ResourceResolution.TYPE, report.resource);
+ }
+ } else {
+ //ok, this report was in the end resolved by some name or type at the
resource level
+ //or higher up in the parents. This alone uniquely identifies the resource,
so there's
+ //no need to show the (ambigous anyway) plugin info.
+ updateResource(ResourceResolution.TYPE, report.resource);
+
+ for (MutableDisambiguationReport.Resource parent : report.parents) {
+ updateResource(ResourceResolution.TYPE, parent);
+ }
}
}
commit 15afa3047b5e80dd300310fefd56694043c56a50
Merge: c276dd3... b346cc5...
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 7 14:57:04 2010 -0400
Merge branch 'master' of
ssh://git.fedorahosted.org/git/rhq/rhq
commit c276dd30093abedc805ea617601358711d683b84
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 7 14:35:10 2010 -0400
Fix applied to searchgui
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
index 76520b8..e4e7f01 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java
@@ -63,6 +63,12 @@ public class SearchGUI implements EntryPoint {
}
public static void checkLoginStatus() {
+
+ if (CoreGUI.detectIe6()) {
+ CoreGUI.forceIe6Hacks();
+ }
+
+
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/sessionAccess");
try {
b.setCallback(new RequestCallback() {
@@ -115,6 +121,10 @@ public class SearchGUI implements EntryPoint {
} catch (RequestException e) {
SC.say("Unable to determine login status, check server status");
e.printStackTrace();
+ } finally {
+ if (CoreGUI.detectIe6()) {
+ CoreGUI.unforceIe6Hacks();
+ }
}
}
commit 8b3a2aafafed411c0d72cfb11ff621f0809b4e56
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 7 13:37:13 2010 -0400
Fix for IE menubar problem
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 bcc4236..e5c0d93 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
@@ -78,7 +78,7 @@ public class MenuBarView extends VLayout {
this.aboutModalWindow = new AboutModalWindow();
- // TODO GH: This is a nasty hack... it injects the css to override the smartgwt
skin
+ /*// TODO GH: This is a nasty hack... it injects the css to override the smartgwt
skin
String css = ".menuButton, .menuButtonOver, .menuButtonDown,
.menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown,
.menuButtonSelectedOver, .menuButtonSelectedDisabled {\n" +
" border: none;\n" +
" font-size: 9pt; \n" +
@@ -92,7 +92,7 @@ public class MenuBarView extends VLayout {
style.setInnerText(css);
Document.get().getBody().appendChild(style);
-
+*/
commit 6cdf397955b12540715378a1d6f88254f8227b0a
Author: Greg Hinkle <ghinkle(a)redhat.com>
Date: Mon Jun 7 12:42:43 2010 -0400
Fix for IE + GWT problems on loading the app after login
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 97a09e6..b6b2aa7 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
@@ -103,6 +103,11 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
// String sessionIdString =
com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion");
// if (sessionIdString == null) {
+ if (detectIe6()) {
+ forceIe6Hacks();
+ }
+
+
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/sessionAccess");
try {
b.setCallback(new RequestCallback() {
@@ -155,6 +160,10 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
} catch (RequestException e) {
SC.say("Unable to determine login status, check server status");
e.printStackTrace();
+ } finally {
+ if (detectIe6()) {
+ unforceIe6Hacks();
+ }
}
}
@@ -317,4 +326,29 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String> {
}
}
}
+
+
+ /**
+ * Detects IE6.
+ * <p/>
+ * This is a nasty hack; but it's extremely reliable when running with other
+ * js libraries on the same page at the same time as gwt.
+ */
+ public static native boolean detectIe6() /*-{
+ if (typeof $doc.body.style.maxHeight != "undefined")
+ return(false);
+ else
+ return(true);
+}-*/;
+
+ public static native void forceIe6Hacks() /*-{
+ $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest;
+ $wnd.XMLHttpRequest = null;
+}-*/;
+
+ public static native void unforceIe6Hacks() /*-{
+ $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup;
+ $wnd.XMLHttpRequestBackup = null;
+}-*/;
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index a529ef9..64d89ca 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -148,6 +148,10 @@ public class LoginView extends Canvas {
private void login(String user, String password) {
+ if (CoreGUI.detectIe6()) {
+ CoreGUI.forceIe6Hacks();
+ }
+
loginButton.setDisabled(true);
RequestBuilder b = new RequestBuilder(RequestBuilder.GET,
"/j_security_check.do?j_username=" + user +
"&j_password=" + password);
@@ -171,9 +175,13 @@ public class LoginView extends Canvas {
}
});
b.send();
- } catch (RequestException e) {
+ } catch (Exception e) {
loginButton.setDisabled(false);
e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ } finally {
+ if (CoreGUI.detectIe6()) {
+ CoreGUI.unforceIe6Hacks();
+ }
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
index 7acfcbe..08911dd 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
@@ -56,6 +56,14 @@ public class SessionAccessServlet extends HttpServlet {
HttpServletResponse response = (HttpServletResponse) resp;
HttpServletRequest request = (HttpServletRequest) req;
+ response.addHeader("Pragma", "no-cache");
+ response.addHeader("Cache-Control", "no-cache");
+ // Stronger according to blog comment below that references HTTP spec
+ response.addHeader("Cache-Control", "no-store");
+ response.addHeader("Cache-Control", "must-revalidate");
+ // some date in the past
+ response.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00
GMT");
+
//if a session does not already exist this call will create one
HttpSession session = request.getSession();